public NodeSet<OWLClass> getSubClasses(OWLClassExpression arg0, boolean arg1) throws ReasonerInterruptedException, TimeOutException, FreshEntitiesException, InconsistentOntologyException, ClassExpressionNotInProfileException { return reasoner.getSubClasses(arg0, arg1); }
@Override public NodeSet<OWLClass> getSubClasses(OWLClassExpression ce, boolean direct) { return delegate_.getSubClasses(ce, direct); }
@Override public NodeSet<OWLClass> getSubClasses(OWLClassExpression ce, boolean direct) { return delegate_.getSubClasses(ce, direct); }
/** * Returns all subclasses. * * @param ce The class expression whose strict (direct) subclasses are to be retrieved. * @return a {@code NodeSet} such that for each class {@code C} in the {@code NodeSet} the set * of reasoner axioms entails {@code StrictSubClassOf(C, ce)}. <br> * If {@code ce} is equivalent to {@code owl:Nothing} then the empty {@code NodeSet} * will be returned. * @see OWLReasoner#getSubClasses(OWLClassExpression, boolean) */ default NodeSet<OWLClass> getSubClasses(OWLClassExpression ce) { return getSubClasses(ce, false); }
@Override public synchronized NodeSet<OWLClass> getSubClasses(OWLClassExpression ce, boolean direct) { return r.getSubClasses(ce, direct); }
/** * Returns all subclasses. * * @param ce The class expression whose strict (direct) subclasses are to be retrieved. * @return a {@code NodeSet} such that for each class {@code C} in the {@code NodeSet} the set * of reasoner axioms entails {@code StrictSubClassOf(C, ce)}. <br> * If {@code ce} is equivalent to {@code owl:Nothing} then the empty {@code NodeSet} * will be returned. * @see OWLReasoner#getSubClasses(OWLClassExpression, boolean) */ default Stream<OWLClass> subClasses(OWLClassExpression ce) { return getSubClasses(ce).entities(); }
@Override public SortedSet<OWLClassExpression> visit(OWLClass ce) { SortedSet<OWLClassExpression> refinements = new TreeSet<>(); refinements.addAll(reasoner.getSubClasses(ce, true).getFlattened()); return refinements; }
/** * Returns all subclasses. * * @param ce The class expression whose strict (direct) subclasses are to be retrieved. * @return a {@code NodeSet} such that for each class {@code C} in the {@code NodeSet} the set * of reasoner axioms entails {@code StrictSubClassOf(C, ce)}. <br> * If {@code ce} is equivalent to {@code owl:Nothing} then the empty {@code NodeSet} * will be returned. * @see OWLReasoner#getSubClasses(OWLClassExpression, boolean) */ default Stream<OWLClass> subClasses(OWLClassExpression ce) { return getSubClasses(ce).entities(); }
public Set<OWLClass> getParents(OWLClass object) { // Simply get the superclasses from the reasoner if (reasoner == null) { return Collections.emptySet(); } if (!reasoner.isSatisfiable(object)) { // We don't want every class in the ontology!! return Collections.emptySet(); } return reasoner.getSubClasses(object, true).getFlattened(); }
public static void main(String[] args) throws Exception { OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); // load the importing ontology OWLOntology ontology = manager.loadOntologyFromOntologyDocument(new StringDocumentSource(test_owl)); OWLReasoner r = new FaCTPlusPlusReasonerFactory().createReasoner(ontology); OWLClass person = ontology.getOWLOntologyManager().getOWLDataFactory().getOWLClass(IRI.create("http://localhost/CA/SmartHome/SmartHome_1113#Person")); Set<OWLClass> classes = r.getSubClasses(person, false).getFlattened(); System.out.println(classes); }
@Override public Set<OWLClass> getDescendants(OWLClass node) { logger.debug("getDescendants(" + node + ")"); try { return getReasoner().getSubClasses(node, false).getFlattened(); } catch (OWLReasonerRuntimeException e) { logger.error(e.getMessage(), e); } return Collections.emptySet(); }
@Override protected Set<OWLClass> doOperation() { return session.getReasoner().getSubClasses(d, false).getFlattened(); } };
public Set<OWLClass> getDescendants(OWLClass object) { getReadLock().lock(); try { return getReasoner().getSubClasses(object, false).getFlattened(); } finally { getReadLock().unlock(); } }
protected static void negativeLevel(boolean superVsSub, OWLReasoner reasoner, Set<OWLClass> classesInSig, Set<OWLClass> superOrSubClasses) { for (OWLClassExpression ent : classesInSig) { NodeSet<OWLClass> nodes; if (superVsSub) { nodes = reasoner.getSuperClasses(ent, false); } else { nodes = reasoner.getSubClasses(ent, false); } add(superOrSubClasses, nodes.entities()); } }
public Set<OWLClass> getDescendants(OWLClass object) { // getReadLock().lock(); try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } return getReasoner().getSubClasses(object, false).getFlattened(); } finally { // getReadLock().unlock(); } }
protected static void negativeLevel(boolean superVsSub, OWLReasoner reasoner, Set<OWLClass> classesInSig, Set<OWLClass> superOrSubClasses) { for (OWLClassExpression ent : classesInSig) { NodeSet<OWLClass> nodes; if (superVsSub) { nodes = reasoner.getSuperClasses(ent, false); } else { nodes = reasoner.getSubClasses(ent, false); } add(superOrSubClasses, nodes.entities()); } }
protected static void negativeLevel(boolean superVsSub, OWLReasoner reasoner, Set<OWLClass> classesInSig, Set<OWLClass> superOrSubClasses) { for (OWLClassExpression ent : classesInSig) { NodeSet<OWLClass> nodes; if (superVsSub) { nodes = reasoner.getSuperClasses(ent, false); } else { nodes = reasoner.getSubClasses(ent, false); } add(superOrSubClasses, nodes.entities()); } }
protected static void negativeLevel(boolean superVsSub, OWLReasoner reasoner, Set<OWLClass> classesInSig, Set<OWLClass> superOrSubClasses) { for (OWLClassExpression ent : classesInSig) { NodeSet<OWLClass> nodes; if (superVsSub) { nodes = reasoner.getSuperClasses(ent, false); } else { nodes = reasoner.getSubClasses(ent, false); } add(superOrSubClasses, nodes.entities()); } }
public Set<OWLClass> getDescendants(OWLClass object) { // getReadLock().lock(); try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } return getReasoner().getSubClasses(object, false).getFlattened(); } finally { // getReadLock().unlock(); } }
private void populateSubClasses(OWLClass c, OWLReasoner r, Model m) { for (OWLClass sub : r.getSubClasses(c, false).getFlattened()) { log.debug(sub + " is subclass of " + c); if (!sub.isOWLNothing()) { m.add(toResource(sub), OWL_SUBCLASS_OF, toResource(c)); } } }