@Override public Node<OWLDataProperty> getEquivalentDataProperties(OWLDataProperty property) { return dataPropertyHierarchyNodeToNode(getHierarchyNode(property)); } @Override
public Node<OWLClass> getEquivalentClasses(OWLClassExpression classExpression) { HierarchyNode<AtomicConcept> node=getHierarchyNode(classExpression); return atomicConceptHierarchyNodeToNode(node); } public NodeSet<OWLClass> getSuperClasses(OWLClassExpression classExpression,boolean direct) {
@Override public Node<OWLClass> getEquivalentClasses(OWLClassExpression classExpression) { HierarchyNode<AtomicConcept> node=getHierarchyNode(classExpression); return atomicConceptHierarchyNodeToNode(node); } @Override
@Override public Node<OWLObjectPropertyExpression> getEquivalentObjectProperties(OWLObjectPropertyExpression propertyExpression) { return objectPropertyHierarchyNodeToNode(getHierarchyNode(propertyExpression)); } @Override
public Node<OWLObjectPropertyExpression> getEquivalentObjectProperties(OWLObjectPropertyExpression propertyExpression) { return objectPropertyHierarchyNodeToNode(getHierarchyNode(propertyExpression)); } public NodeSet<OWLClass> getObjectPropertyDomains(OWLObjectPropertyExpression propertyExpression,boolean direct) {
public Node<OWLDataProperty> getEquivalentDataProperties(OWLDataProperty property) { return dataPropertyHierarchyNodeToNode(getHierarchyNode(property)); } public NodeSet<OWLClass> getDataPropertyDomains(OWLDataProperty property,boolean direct) {
public NodeSet<OWLObjectPropertyExpression> getSuperObjectProperties(OWLObjectPropertyExpression propertyExpression,boolean direct) { HierarchyNode<Role> node=getHierarchyNode(propertyExpression); Set<HierarchyNode<Role>> result=new HashSet<HierarchyNode<Role>>(); if (direct) for (HierarchyNode<Role> n : node.getParentNodes()) result.add(n); else { result=node.getAncestorNodes(); result.remove(node); } return objectPropertyHierarchyNodesToNodeSet(result); } public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties(OWLObjectPropertyExpression propertyExpression,boolean direct) {
public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties(OWLObjectPropertyExpression propertyExpression,boolean direct) { HierarchyNode<Role> node=getHierarchyNode(propertyExpression); Set<HierarchyNode<Role>> result=new HashSet<HierarchyNode<Role>>(); if (direct) for (HierarchyNode<Role> n : node.getChildNodes()) result.add(n); else { result=node.getDescendantNodes(); result.remove(node); } return objectPropertyHierarchyNodesToNodeSet(result); } public Node<OWLObjectPropertyExpression> getEquivalentObjectProperties(OWLObjectPropertyExpression propertyExpression) {
public NodeSet<OWLClass> getSuperClasses(OWLClassExpression classExpression,boolean direct) { HierarchyNode<AtomicConcept> node=getHierarchyNode(classExpression); Set<HierarchyNode<AtomicConcept>> result; if (direct) result=node.getParentNodes(); else { result=new HashSet<HierarchyNode<AtomicConcept>>(node.getAncestorNodes()); result.remove(node); } return atomicConceptHierarchyNodesToNodeSet(result); } public NodeSet<OWLClass> getSubClasses(OWLClassExpression classExpression,boolean direct) {
public NodeSet<OWLClass> getSubClasses(OWLClassExpression classExpression,boolean direct) { HierarchyNode<AtomicConcept> node=getHierarchyNode(classExpression); Set<HierarchyNode<AtomicConcept>> result; if (direct) result=node.getChildNodes(); else { result=new HashSet<HierarchyNode<AtomicConcept>>(node.getDescendantNodes()); result.remove(node); } return atomicConceptHierarchyNodesToNodeSet(result); } public Node<OWLClass> getUnsatisfiableClasses() {
public NodeSet<OWLDataProperty> getSubDataProperties(OWLDataProperty property,boolean direct) { HierarchyNode<AtomicRole> node=getHierarchyNode(property); Set<HierarchyNode<AtomicRole>> result; if (direct) result=node.getChildNodes(); else { result=new HashSet<HierarchyNode<AtomicRole>>(node.getDescendantNodes()); result.remove(node); } return dataPropertyHierarchyNodesToNodeSet(result); } public Node<OWLDataProperty> getEquivalentDataProperties(OWLDataProperty property) {
public NodeSet<OWLDataProperty> getSuperDataProperties(OWLDataProperty property,boolean direct) { HierarchyNode<AtomicRole> node=getHierarchyNode(property); Set<HierarchyNode<AtomicRole>> result; if (direct) result=node.getParentNodes(); else { result=new HashSet<HierarchyNode<AtomicRole>>(node.getAncestorNodes()); result.remove(node); } return dataPropertyHierarchyNodesToNodeSet(result); } public NodeSet<OWLDataProperty> getSubDataProperties(OWLDataProperty property,boolean direct) {
@Override public NodeSet<OWLClass> getSubClasses(OWLClassExpression classExpression,boolean direct) { HierarchyNode<AtomicConcept> node=getHierarchyNode(classExpression); Set<HierarchyNode<AtomicConcept>> result; if (direct) result=node.getChildNodes(); else { result=new HashSet<>(node.getDescendantNodes()); result.remove(node); } return atomicConceptHierarchyNodesToNodeSet(result); } @Override
@Override public NodeSet<OWLDataProperty> getSubDataProperties(OWLDataProperty property,boolean direct) { HierarchyNode<AtomicRole> node=getHierarchyNode(property); Set<HierarchyNode<AtomicRole>> result; if (direct) result=node.getChildNodes(); else { result=new HashSet<>(node.getDescendantNodes()); result.remove(node); } return dataPropertyHierarchyNodesToNodeSet(result); } @Override
@Override public NodeSet<OWLClass> getSuperClasses(OWLClassExpression classExpression,boolean direct) { HierarchyNode<AtomicConcept> node=getHierarchyNode(classExpression); Set<HierarchyNode<AtomicConcept>> result; if (direct) result=node.getParentNodes(); else { result=new HashSet<>(node.getAncestorNodes()); result.remove(node); } return atomicConceptHierarchyNodesToNodeSet(result); } @Override
@Override public NodeSet<OWLDataProperty> getSuperDataProperties(OWLDataProperty property,boolean direct) { HierarchyNode<AtomicRole> node=getHierarchyNode(property); Set<HierarchyNode<AtomicRole>> result; if (direct) result=node.getParentNodes(); else { result=new HashSet<>(node.getAncestorNodes()); result.remove(node); } return dataPropertyHierarchyNodesToNodeSet(result); } @Override
@Override public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties(OWLObjectPropertyExpression propertyExpression,boolean direct) { HierarchyNode<Role> node=getHierarchyNode(propertyExpression); if (direct) return objectPropertyHierarchyNodesToNodeSet(node.getChildNodes()); Set<HierarchyNode<Role>> result=node.getDescendantNodes(); result.remove(node); return objectPropertyHierarchyNodesToNodeSet(result); } @Override
@Override public NodeSet<OWLObjectPropertyExpression> getSuperObjectProperties(OWLObjectPropertyExpression propertyExpression,boolean direct) { HierarchyNode<Role> node=getHierarchyNode(propertyExpression); if (direct) return objectPropertyHierarchyNodesToNodeSet(node.getParentNodes()); Set<HierarchyNode<Role>> result=node.getAncestorNodes(); result.remove(node); return objectPropertyHierarchyNodesToNodeSet(result); } @Override
protected Set<HierarchyNode<AtomicConcept>> getDisjointConceptNodes(HierarchyNode<AtomicConcept> node) { if (m_directDisjointClasses.containsKey(node)) return m_directDisjointClasses.get(node); else { Set<HierarchyNode<AtomicConcept>> result=new HashSet<HierarchyNode<AtomicConcept>>(); OWLDataFactory factory=getDataFactory(); OWLClassExpression negated=factory.getOWLObjectComplementOf(factory.getOWLClass(IRI.create(node.getRepresentative().getIRI()))); HierarchyNode<AtomicConcept> equivalentToComplement=getHierarchyNode(negated); for (AtomicConcept equiv : equivalentToComplement.getEquivalentElements()) { if (!Prefixes.isInternalIRI(equiv.getIRI())) { HierarchyNode<AtomicConcept> rootDisjoint=m_atomicConceptHierarchy.getNodeForElement(equiv); result=Collections.singleton(rootDisjoint); m_directDisjointClasses.put(node,result); return result; } } result=equivalentToComplement.getChildNodes(); m_directDisjointClasses.put(node,result); return result; } } public void precomputeDisjointClasses() {
protected Set<HierarchyNode<AtomicConcept>> getDisjointConceptNodes(HierarchyNode<AtomicConcept> node) { if (m_directDisjointClasses.containsKey(node)) return m_directDisjointClasses.get(node); else { OWLDataFactory factory=getDataFactory(); OWLClassExpression negated=factory.getOWLObjectComplementOf(factory.getOWLClass(IRI.create(node.getRepresentative().getIRI()))); HierarchyNode<AtomicConcept> equivalentToComplement=getHierarchyNode(negated); for (AtomicConcept equiv : equivalentToComplement.getEquivalentElements()) { if (!Prefixes.isInternalIRI(equiv.getIRI())) { HierarchyNode<AtomicConcept> rootDisjoint=m_atomicConceptHierarchy.getNodeForElement(equiv); Set<HierarchyNode<AtomicConcept>> result=Collections.singleton(rootDisjoint); m_directDisjointClasses.put(node,result); return result; } } Set<HierarchyNode<AtomicConcept>> result=equivalentToComplement.getChildNodes(); m_directDisjointClasses.put(node,result); return result; } } /**