public Set<OWLClass> getChildren(OWLClass object) { Set<OWLClass> subs = getReasoner().getSubClasses(object, true).getFlattened(); // Add in owl:Nothing if there are inconsistent classes if (object.isOWLThing() && !owlModelManager.getReasoner().getUnsatisfiableClasses().isSingleton()) { subs.add(owlNothing); } else if (object.isOWLNothing()) { subs.addAll(getReasoner().getUnsatisfiableClasses().getEntities()); subs.remove(owlNothing); } else { // Class which is not Thing or Nothing subs.remove(owlNothing); for (Iterator<OWLClass> it = subs.iterator(); it.hasNext();) { if (!getReasoner().isSatisfiable(it.next())) { it.remove(); } } } return subs; }
public Set<OWLClass> getChildren(OWLClass object) { getReadLock().lock(); try { Set<OWLClass> subs = getReasoner().getSubClasses(object, true).getFlattened(); // Add in owl:Nothing if there are inconsistent classes if (object.isOWLThing() && !owlModelManager.getReasoner().getUnsatisfiableClasses().isSingleton()) { subs.add(owlNothing); } else if (object.isOWLNothing()) { subs.addAll(getReasoner().getUnsatisfiableClasses().getEntities()); subs.remove(owlNothing); } else { // Class which is not Thing or Nothing subs.remove(owlNothing); for (Iterator<OWLClass> it = subs.iterator(); it.hasNext();) { if (!getReasoner().isSatisfiable(it.next())) { it.remove(); } } } return subs; } finally { getReadLock().unlock(); } }
public Set<OWLClass> getUnfilteredChildren(OWLClass object) { // getReadLock().lock(); try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } Set<OWLClass> subs = getReasoner().getSubClasses(object, true).getFlattened(); // Add in owl:Nothing if there are inconsistent classes if (object.isOWLThing() && !owlModelManager.getReasoner().getUnsatisfiableClasses().isSingleton()) { subs.add(owlNothing); } else if (object.isOWLNothing()) { subs.addAll(getReasoner().getUnsatisfiableClasses().getEntitiesMinus(owlNothing)); } else { // Class which is not Thing or Nothing subs.remove(owlNothing); for (Iterator<OWLClass> it = subs.iterator(); it.hasNext();) { if (!getReasoner().isSatisfiable(it.next())) { it.remove(); } } } return subs; } finally { // getReadLock().unlock(); } }
public Set<OWLClass> getUnfilteredChildren(OWLClass object) { // getReadLock().lock(); try { if(!getReasoner().isConsistent()) { return Collections.emptySet(); } Set<OWLClass> subs = getReasoner().getSubClasses(object, true).getFlattened(); // Add in owl:Nothing if there are inconsistent classes if (object.isOWLThing() && !owlModelManager.getReasoner().getUnsatisfiableClasses().isSingleton()) { subs.add(owlNothing); } else if (object.isOWLNothing()) { subs.addAll(getReasoner().getUnsatisfiableClasses().getEntitiesMinus(owlNothing)); } else { // Class which is not Thing or Nothing subs.remove(owlNothing); for (Iterator<OWLClass> it = subs.iterator(); it.hasNext();) { if (!getReasoner().isSatisfiable(it.next())) { it.remove(); } } } return subs; } finally { // getReadLock().unlock(); } }