}
};
return HierarchySearch.search(predicate,Collections.singleton(m_atomicConceptHierarchy.getTopNode()),null);
}
protected NodeSet<OWLNamedIndividual> sortBySameAsIfNecessary(Set<Individual> individuals) {
OWLDataFactory factory=getDataFactory();
Set<Node<OWLNamedIndividual>> result=new HashSet<Node<OWLNamedIndividual>>();
if (m_configuration.individualNodeSetPolicy==IndividualNodeSetPolicy.BY_SAME_AS) {
// group the individuals by same as equivalence classes
while (!individuals.isEmpty()) {
Individual individual=individuals.iterator().next();
Set<Individual> sameIndividuals=getSameAsIndividuals(individual);
Set<OWLNamedIndividual> sameNamedIndividuals=new HashSet<OWLNamedIndividual>();
sameNamedIndividuals.add(factory.getOWLNamedIndividual(IRI.create(individual.getIRI())));
for (Individual sameIndividual : sameIndividuals) {
individuals.remove(sameIndividual);
sameNamedIndividuals.add(factory.getOWLNamedIndividual(IRI.create(sameIndividual.getIRI())));
}
result.add(new OWLNamedIndividualNode(sameNamedIndividuals));
}
}
else {
for (Individual individual : individuals)
result.add(new OWLNamedIndividualNode(factory.getOWLNamedIndividual(IRI.create(individual.getIRI()))));
}
return new OWLNamedIndividualNodeSet(result);
}