for (HierarchyNode<AtomicConcept> descendantNode : hierarchyNode.getDescendantNodes())
loadIndividualsOfNode(descendantNode,result);
OWLDataFactory factory=getDataFactory();
OWLClass queryClass=factory.getOWLClass(IRI.create("internal:query-concept"));
OWLAxiom queryClassDefinition=factory.getOWLSubClassOfAxiom(queryClass,classExpression.getObjectComplementOf());
Tableau tableau=getTableau(queryClassDefinition);
AtomicConcept queryConcept=AtomicConcept.create("internal:query-concept");
Set<HierarchyNode<AtomicConcept>> visitedNodes=new HashSet<HierarchyNode<AtomicConcept>>(hierarchyNode.getChildNodes());
List<HierarchyNode<AtomicConcept>> toVisit=new ArrayList<HierarchyNode<AtomicConcept>>(hierarchyNode.getParentNodes());
while (!toVisit.isEmpty()) {
HierarchyNode<AtomicConcept> node=toVisit.remove(toVisit.size()-1);
if (visitedNodes.add(node)) {
AtomicConcept nodeAtomicConcept=node.getRepresentative();
Set<Individual> realizationForNodeConcept=m_realization.get(nodeAtomicConcept);
if (realizationForNodeConcept!=null)
for (Individual individual : realizationForNodeConcept)
if (isResultRelevantIndividual(individual))
if (!tableau.isSatisfiable(true,true,Collections.singleton(Atom.create(queryConcept,individual)),null,null,null,null,ReasoningTaskDescription.isInstanceOf(individual,classExpression)))
result.add(individual);
toVisit.addAll(node.getChildNodes());
}
}
}