@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof NodeSet)) { return false; } NodeSet<?> other = (NodeSet<?>) obj; return nodes.equals(other.getNodes()); }
@Override public Set<OWLClass> getChildren(OWLClass node) { logger.debug("getChildren(" + node + ")"); try { Set<OWLClass> children = new HashSet<>(); NodeSet<OWLClass> subsets = getReasoner().getSubClasses(node, true); for (Node<OWLClass> synset : subsets.getNodes()){ if (!synset.isBottomNode()){ children.addAll(synset.getEntities()); } } return children; } catch (OWLReasonerRuntimeException e) { logger.error(e.getMessage(), e); } return Collections.emptySet(); }
@Nonnull @Override public NodeSet<OWLClass> getDataPropertyDomains(@Nonnull OWLDataProperty pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLDataPropertyDomainAxiom axiom : ontology.getDataPropertyDomainAxioms(pe)) { result.addNode(getEquivalentClasses(axiom.getDomain())); if (!direct) { result.addAllNodes(getSuperClasses(axiom.getDomain(), false).getNodes()); } } } return result; }
@Nonnull @Override public NodeSet<OWLDataProperty> getDisjointDataProperties(@Nonnull OWLDataPropertyExpression pe) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLDataProperty> result = new OWLDataPropertyNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLDisjointDataPropertiesAxiom axiom : ontology.getDisjointDataPropertiesAxioms(pe.asOWLDataProperty())) { for (OWLDataPropertyExpression dpe : axiom.getPropertiesMinus(pe)) { if (!dpe.isAnonymous()) { result.addNode(dataPropertyHierarchyInfo.getEquivalents(dpe.asOWLDataProperty())); result.addAllNodes(getSubDataProperties(dpe.asOWLDataProperty(), false).getNodes()); } } } } return result; }
@Nonnull @Override public NodeSet<OWLClass> getTypes(@Nonnull OWLNamedIndividual ind, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLClassAssertionAxiom axiom : ontology.getClassAssertionAxioms(ind)) { OWLClassExpression ce = axiom.getClassExpression(); if (!ce.isAnonymous()) { result.addNode(classHierarchyInfo.getEquivalents(ce.asOWLClass())); if (!direct) { result.addAllNodes(getSuperClasses(ce, false).getNodes()); } } } } return result; }
public NodeSet<OWLClass> getDataPropertyDomains(OWLDataProperty pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLDataPropertyDomainAxiom axiom : ontology.getDataPropertyDomainAxioms(pe)) { result.addNode(getEquivalentClasses(axiom.getDomain())); if (!direct) { result.addAllNodes(getSuperClasses(axiom.getDomain(), false).getNodes()); } } } return result; }
public NodeSet<OWLClass> getDataPropertyDomains(OWLDataProperty pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLDataPropertyDomainAxiom axiom : ontology.getDataPropertyDomainAxioms(pe)) { result.addNode(getEquivalentClasses(axiom.getDomain())); if (!direct) { result.addAllNodes(getSuperClasses(axiom.getDomain(), false).getNodes()); } } } return result; }
public NodeSet<OWLClass> getDataPropertyDomains(OWLDataProperty pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLDataPropertyDomainAxiom axiom : ontology.getDataPropertyDomainAxioms(pe)) { result.addNode(getEquivalentClasses(axiom.getDomain())); if (!direct) { result.addAllNodes(getSuperClasses(axiom.getDomain(), false).getNodes()); } } } return result; }
public NodeSet<OWLClass> getObjectPropertyRanges(OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLObjectPropertyRangeAxiom axiom : ontology.getObjectPropertyRangeAxioms(pe)) { result.addNode(getEquivalentClasses(axiom.getRange())); if (!direct) { result.addAllNodes(getSuperClasses(axiom.getRange(), false).getNodes()); } } for (OWLObjectPropertyExpression invPe : getInverseObjectProperties(pe).getEntities()) { for (OWLObjectPropertyDomainAxiom axiom : ontology.getObjectPropertyDomainAxioms(invPe)) { result.addNode(getEquivalentClasses(axiom.getDomain())); if (!direct) { result.addAllNodes(getSuperClasses(axiom.getDomain(), false).getNodes()); } } } } return result; }
public NodeSet<OWLClass> getObjectPropertyDomains(OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { 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; }
public NodeSet<OWLClass> getTypes(OWLNamedIndividual ind, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLClassAssertionAxiom axiom : ontology.getClassAssertionAxioms(ind)) { OWLClassExpression ce = axiom.getClassExpression(); if (!ce.isAnonymous()) { result.addNode(classHierarchyInfo.getEquivalents(ce.asOWLClass())); if (!direct) { result.addAllNodes(getSuperClasses(ce, false).getNodes()); } } } } return result; }
public NodeSet<OWLClass> getObjectPropertyRanges(OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLObjectPropertyRangeAxiom axiom : ontology.getObjectPropertyRangeAxioms(pe)) { result.addNode(getEquivalentClasses(axiom.getRange())); if (!direct) { result.addAllNodes(getSuperClasses(axiom.getRange(), false).getNodes()); } } for (OWLObjectPropertyExpression invPe : getInverseObjectProperties(pe).getEntities()) { for (OWLObjectPropertyDomainAxiom axiom : ontology.getObjectPropertyDomainAxioms(invPe)) { result.addNode(getEquivalentClasses(axiom.getDomain())); if (!direct) { result.addAllNodes(getSuperClasses(axiom.getDomain(), false).getNodes()); } } } } return result; }
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; }
public NodeSet<OWLClass> getObjectPropertyRanges(OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLObjectPropertyRangeAxiom axiom : ontology.getObjectPropertyRangeAxioms(pe)) { result.addNode(getEquivalentClasses(axiom.getRange())); if (!direct) { result.addAllNodes(getSuperClasses(axiom.getRange(), false).getNodes()); } } for (OWLObjectPropertyExpression invPe : getInverseObjectProperties(pe).getEntities()) { for (OWLObjectPropertyDomainAxiom axiom : ontology.getObjectPropertyDomainAxioms(invPe)) { result.addNode(getEquivalentClasses(axiom.getDomain())); if (!direct) { result.addAllNodes(getSuperClasses(axiom.getDomain(), false).getNodes()); } } } } return result; }
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; }
public NodeSet<OWLClass> getTypes(OWLNamedIndividual ind, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLClassAssertionAxiom axiom : ontology.getClassAssertionAxioms(ind)) { OWLClassExpression ce = axiom.getClassExpression(); if (!ce.isAnonymous()) { result.addNode(classHierarchyInfo.getEquivalents(ce.asOWLClass())); if (!direct) { result.addAllNodes(getSuperClasses(ce, false).getNodes()); } } } } return result; }
public NodeSet<OWLClass> getTypes(OWLNamedIndividual ind, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLClass> result = new OWLClassNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLClassAssertionAxiom axiom : ontology.getClassAssertionAxioms(ind)) { OWLClassExpression ce = axiom.getClassExpression(); if (!ce.isAnonymous()) { result.addNode(classHierarchyInfo.getEquivalents(ce.asOWLClass())); if (!direct) { result.addAllNodes(getSuperClasses(ce, false).getNodes()); } } } } return result; }
public NodeSet<OWLDataProperty> getDisjointDataProperties(OWLDataPropertyExpression pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { DefaultNodeSet<OWLDataProperty> result = new OWLDataPropertyNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLDisjointDataPropertiesAxiom axiom : ontology.getDisjointDataPropertiesAxioms(pe.asOWLDataProperty())) { for (OWLDataPropertyExpression dpe : axiom.getPropertiesMinus(pe)) { if (!dpe.isAnonymous()) { result.addNode(dataPropertyHierarchyInfo.getEquivalents(dpe.asOWLDataProperty())); if (!direct) { result.addAllNodes(getSubDataProperties(dpe.asOWLDataProperty(), false).getNodes()); } } } } } return result; }
public NodeSet<OWLDataProperty> getDisjointDataProperties(OWLDataPropertyExpression pe) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLDataProperty> result = new OWLDataPropertyNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLDisjointDataPropertiesAxiom axiom : ontology.getDisjointDataPropertiesAxioms(pe.asOWLDataProperty())) { for (OWLDataPropertyExpression dpe : axiom.getPropertiesMinus(pe)) { if (!dpe.isAnonymous()) { result.addNode(dataPropertyHierarchyInfo.getEquivalents(dpe.asOWLDataProperty())); result.addAllNodes(getSubDataProperties(dpe.asOWLDataProperty(), false).getNodes()); } } } } return result; }
public NodeSet<OWLDataProperty> getDisjointDataProperties(OWLDataPropertyExpression pe) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { ensurePrepared(); DefaultNodeSet<OWLDataProperty> result = new OWLDataPropertyNodeSet(); for (OWLOntology ontology : getRootOntology().getImportsClosure()) { for (OWLDisjointDataPropertiesAxiom axiom : ontology.getDisjointDataPropertiesAxioms(pe.asOWLDataProperty())) { for (OWLDataPropertyExpression dpe : axiom.getPropertiesMinus(pe)) { if (!dpe.isAnonymous()) { result.addNode(dataPropertyHierarchyInfo.getEquivalents(dpe.asOWLDataProperty())); result.addAllNodes(getSubDataProperties(dpe.asOWLDataProperty(), false).getNodes()); } } } } return result; }