}
public NodeSet<OWLClass> getObjectPropertyDomains(OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
ensurePrepared();
DefaultNodeSet<OWLClass> result = new OWLClassNodeSet();
for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
for (OWLObjectPropertyDomainAxiom axiom : ontology.getObjectPropertyDomainAxioms(pe)) {
result.addNode(getEquivalentClasses(axiom.getDomain()));
if (!direct) {
result.addAllNodes(getSuperClasses(axiom.getDomain(), false).getNodes());
}
}
for (OWLObjectPropertyExpression invPe : getInverseObjectProperties(pe).getEntities()) {
for (OWLObjectPropertyRangeAxiom axiom : ontology.getObjectPropertyRangeAxioms(invPe)) {
result.addNode(getEquivalentClasses(axiom.getRange()));
if (!direct) {
result.addAllNodes(getSuperClasses(axiom.getRange(), false).getNodes());
}
}
}
}
return result;