/** * @param ce The class expression whose strict (direct) super classes 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(ce, C)}. <br> * If {@code ce} is equivalent to {@code owl:Thing} then the empty {@code NodeSet} will * be returned. * @see OWLReasoner#getSuperClasses(OWLClassExpression, boolean) Return all superclasses. */ default NodeSet<OWLClass> getSuperClasses(OWLClassExpression ce) { return getSuperClasses(ce, false); }
/** * @param ce The class expression whose strict (direct) super classes 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(ce, C)}. <br> * If {@code ce} is equivalent to {@code owl:Thing} then the empty {@code NodeSet} will * be returned. * @see OWLReasoner#getSuperClasses(OWLClassExpression, boolean) Return all superclasses. */ default NodeSet<OWLClass> getSuperClasses(OWLClassExpression ce) { return getSuperClasses(ce, false); }
/** * @param ce The class expression whose strict (direct) super classes 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(ce, C)}. <br> * If {@code ce} is equivalent to {@code owl:Thing} then the empty {@code NodeSet} will * be returned. * @see OWLReasoner#getSuperClasses(OWLClassExpression, boolean) Return all superclasses. */ default NodeSet<OWLClass> getSuperClasses(OWLClassExpression ce) { return getSuperClasses(ce, false); }
@Override public NodeSet<OWLClass> getSuperClasses(OWLClassExpression ce, boolean direct) { return delegate_.getSuperClasses(ce, direct); }
/** * @param ce The class expression whose strict (direct) super classes 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(ce, C)}. <br> * If {@code ce} is equivalent to {@code owl:Thing} then the empty {@code NodeSet} will * be returned. * @see OWLReasoner#getSuperClasses(OWLClassExpression, boolean) Return all superclasses. */ default Stream<OWLClass> superClasses(OWLClassExpression ce) { return getSuperClasses(ce).entities(); }
/** * @param ce The class expression whose strict (direct) super classes 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(ce, C)}. <br> * If {@code ce} is equivalent to {@code owl:Thing} then the empty {@code NodeSet} will * be returned. * @see OWLReasoner#getSuperClasses(OWLClassExpression, boolean) Return all superclasses. */ default Stream<OWLClass> superClasses(OWLClassExpression ce) { return getSuperClasses(ce).entities(); }
/** * @param ce The class expression whose strict (direct) super classes 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(ce, C)}. <br> * If {@code ce} is equivalent to {@code owl:Thing} then the empty {@code NodeSet} will * be returned. * @see OWLReasoner#getSuperClasses(OWLClassExpression, boolean) Return all superclasses. */ default Stream<OWLClass> superClasses(OWLClassExpression ce) { return getSuperClasses(ce).entities(); }
public Set<OWLClass> getChildren(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.getSuperClasses(object, true).getFlattened(); }
@Override public Set<OWLClass> getParents(OWLClass node) { try { return getReasoner().getSuperClasses(node, true).getFlattened(); } catch (OWLReasonerRuntimeException e) { logger.error(e.getMessage(), e); } return Collections.emptySet(); }
@Override public Set<OWLClass> getAncestors(OWLClass node) { try{ return getReasoner().getSuperClasses(node, false).getFlattened(); } catch (OWLReasonerRuntimeException e) { logger.error(e.getMessage(), e); } return Collections.emptySet(); }
@Override protected Set<OWLClass> doOperation() { return session.getReasoner() .getSuperClasses(d, false).getFlattened(); } };
public Set<OWLClass> getAncestors(OWLClass object) { getReadLock().lock(); try { return getReasoner().getSuperClasses(object, false).getFlattened(); } finally { getReadLock().unlock(); } }
public Set<OWLClass> getParents(OWLClass object) { if (object.isOWLNothing()){ return Collections.singleton(owlThing); } else if (!getReasoner().isSatisfiable(object)){ return Collections.singleton(owlNothing); } Set<OWLClass> parents = getReasoner().getSuperClasses(object, true).getFlattened(); parents.remove(object); return parents; }
public Set<OWLClass> getAncestors(OWLClass object) { // getReadLock().lock(); try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } return getReasoner().getSuperClasses(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> getAncestors(OWLClass object) { // getReadLock().lock(); try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } return getReasoner().getSuperClasses(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()); } }
protected void addAxioms(OWLClass entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLSubClassOfAxiom> result) { if (reasoner.isSatisfiable(entity)) { for (OWLClass sup : reasoner.getSuperClasses(entity, true).getFlattened()) { result.add(dataFactory.getOWLSubClassOfAxiom(entity, sup)); } } else { result.add(dataFactory.getOWLSubClassOfAxiom(entity, dataFactory.getOWLNothing())); } }