if (om.getReasoner() != null) { if (om.getReasoner() .getReasonerCapabilities().contains( null, ReasonerVocabulary.supportsP, RDFS.subClassOf ))
if (om.getReasoner() != null) { if (om.getReasoner() .getReasonerCapabilities().contains( null, ReasonerVocabulary.supportsP, RDFS.subClassOf ))
if (getGraph() instanceof InfGraph) { supportsIndAsThing = ((InfGraph) getGraph()).getReasoner() .getReasonerCapabilities() .contains( null, ReasonerVocabulary.supportsP, ReasonerVocabulary.individualAsThingP );
if (getGraph() instanceof InfGraph) { supportsIndAsThing = ((InfGraph) getGraph()).getReasoner() .getReasonerCapabilities() .contains( null, ReasonerVocabulary.supportsP, ReasonerVocabulary.individualAsThingP );
/** * <p>Answer an iterator over the classes in this ontology model that represent * the uppermost nodes of the class hierarchy. Depending on the underlying * reasoner configuration, if any, these will be calculated as the classes * that have Top (i.e. <code>owl:Thing</code> or <code>daml:Thing</code>) * as a direct super-class, or the classes which have no declared super-class.</p> * @return An iterator of the root classes in the local class hierarchy */ @Override public ExtendedIterator<OntClass> listHierarchyRootClasses() { // look for the shortcut of using direct subClass on :Thing if (getReasoner() != null) { Model conf = getReasoner().getReasonerCapabilities(); if (conf != null && conf.contains( null, ReasonerVocabulary.supportsP, ReasonerVocabulary.directSubClassOf ) && getProfile().THING() != null) { // we have have both direct sub-class of and a :Thing class to test against return listStatements( null, ReasonerVocabulary.directSubClassOf, getProfile().THING() ) .mapWith( s -> s.getSubject().as( OntClass.class )); } } // no easy shortcut, so we use brute force return listClasses() .filterDrop( OntResource::isOntLanguageTerm ) .filterKeep( OntClass::isHierarchyRoot ); }
/** * <p>Answer an iterator over the classes in this ontology model that represent * the uppermost nodes of the class hierarchy. Depending on the underlying * reasoner configuration, if any, these will be calculated as the classes * that have Top (i.e. <code>owl:Thing</code> or <code>daml:Thing</code>) * as a direct super-class, or the classes which have no declared super-class.</p> * @return An iterator of the root classes in the local class hierarchy */ @Override public ExtendedIterator<OntClass> listHierarchyRootClasses() { // look for the shortcut of using direct subClass on :Thing if (getReasoner() != null) { Model conf = getReasoner().getReasonerCapabilities(); if (conf != null && conf.contains( null, ReasonerVocabulary.supportsP, ReasonerVocabulary.directSubClassOf ) && getProfile().THING() != null) { // we have have both direct sub-class of and a :Thing class to test against return listStatements( null, ReasonerVocabulary.directSubClassOf, getProfile().THING() ) .mapWith( s -> s.getSubject().as( OntClass.class )); } } // no easy shortcut, so we use brute force return listClasses() .filterDrop( OntResource::isOntLanguageTerm ) .filterKeep( OntClass::isHierarchyRoot ); }
Model caps = mOnt.getReasoner().getReasonerCapabilities(); if (caps.contains( null, ReasonerVocabulary.supportsP, OWL.ObjectProperty) )
Model caps = mOnt.getReasoner().getReasonerCapabilities(); if (caps.contains( null, ReasonerVocabulary.supportsP, OWL.ObjectProperty) )