@Override default boolean isTopEntity() { return isOWLTopObjectProperty(); }
@Override default boolean isTopEntity() { return isOWLTopObjectProperty(); }
@Override default boolean isTopEntity() { return isOWLTopObjectProperty(); }
protected void reservedForObjectProperty(OWLObjectProperty property) { if (!property.isOWLTopObjectProperty() && !property.isOWLBottomObjectProperty() && property.getIRI().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForObjectPropertyIRI(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void reservedForObjectProperty(OWLObjectProperty property) { if (!property.isOWLTopObjectProperty() && !property.isOWLBottomObjectProperty() && property.getIRI().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForObjectPropertyIRI(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void reservedForObjectProperty(OWLObjectProperty property) { if (!property.isOWLTopObjectProperty() && !property.isOWLBottomObjectProperty() && property.getIRI().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForObjectPropertyIRI(getCurrentOntology(), getCurrentAxiom(), property)); } }
@Override public void visit(final OWLObjectProperty prop) { if (prop.isOWLTopObjectProperty()) _term = ATermUtils.TOP_OBJECT_PROPERTY; else if (prop.isOWLBottomObjectProperty()) _term = ATermUtils.BOTTOM_OBJECT_PROPERTY; else { _term = ATermUtils.makeTermAppl(prop.getIRI().toString()); if (_addAxioms) _kb.addObjectProperty(_term); } }
public void visit(OWLObjectProperty prop) { if ( prop.isOWLTopObjectProperty() ) { term = ATermUtils.TOP_OBJECT_PROPERTY; } else if ( prop.isOWLBottomObjectProperty() ) { term = ATermUtils.BOTTOM_OBJECT_PROPERTY; } else { term = ATermUtils.makeTermAppl( prop.getIRI().toString() ); if( addAxioms ) { kb.addObjectProperty( term ); } } }
@Override public void visit(final OWLObjectProperty prop) { if (prop.isOWLTopObjectProperty()) _term = ATermUtils.TOP_OBJECT_PROPERTY; else if (prop.isOWLBottomObjectProperty()) _term = ATermUtils.BOTTOM_OBJECT_PROPERTY; else { _term = ATermUtils.makeTermAppl(prop.getIRI().toString()); if (_addAxioms) _kb.addObjectProperty(_term); } }
@Override public void visit(OWLObjectProperty prop) { if ( prop.isOWLTopObjectProperty() ) { term = ATermUtils.TOP_OBJECT_PROPERTY; } else if ( prop.isOWLBottomObjectProperty() ) { term = ATermUtils.BOTTOM_OBJECT_PROPERTY; } else { term = ATermUtils.makeTermAppl( prop.getIRI().toString() ); if( addAxioms ) { kb.addObjectProperty( term ); } } }
@Override public void visit(final OWLObjectProperty prop) { if (prop.isOWLTopObjectProperty()) _term = ATermUtils.TOP_OBJECT_PROPERTY; else if (prop.isOWLBottomObjectProperty()) _term = ATermUtils.BOTTOM_OBJECT_PROPERTY; else { _term = ATermUtils.makeTermAppl(prop.getIRI().toString()); if (_addAxioms) _kb.addObjectProperty(_term); } }
classifyObjectProperties(); Set<HierarchyNode<Role>> result=new HashSet<>(); if (propertyExpression.getNamedProperty().isOWLTopObjectProperty()) { result.add(m_objectRoleHierarchy.getBottomNode()); return objectPropertyHierarchyNodesToNodeSet(result);
classifyObjectProperties(); Set<HierarchyNode<Role>> result=new HashSet<HierarchyNode<Role>>(); if (propertyExpression.getNamedProperty().isOWLTopObjectProperty()) { result.add(m_objectRoleHierarchy.getBottomNode()); return objectPropertyHierarchyNodesToNodeSet(result);
protected boolean isSubObjectPropertyExpressionOf(List<OWLObjectPropertyExpression> subPropertyChain,OWLObjectPropertyExpression superObjectPropertyExpression) { OWLObject[] objects=new OWLObject[subPropertyChain.size()+1]; for (int i=0;i<subPropertyChain.size();i++) objects[i]=subPropertyChain.get(i); objects[subPropertyChain.size()]=superObjectPropertyExpression; checkPreConditions(objects); if (!m_isConsistent.booleanValue() || superObjectPropertyExpression.getNamedProperty().isOWLTopObjectProperty()) return true; else { OWLDataFactory factory=getDataFactory(); OWLClass pseudoNominal=factory.getOWLClass(PSEUDO_NOMINAL); OWLClassExpression allSuperNotPseudoNominal=factory.getOWLObjectAllValuesFrom(superObjectPropertyExpression,pseudoNominal.getObjectComplementOf()); OWLAxiom[] additionalAxioms=new OWLAxiom[subPropertyChain.size()+2]; int axiomIndex=0; for (OWLObjectPropertyExpression subObjectPropertyExpression : subPropertyChain) { OWLIndividual first=factory.getOWLAnonymousIndividual("fresh-individual-"+axiomIndex); OWLIndividual second=factory.getOWLAnonymousIndividual("fresh-individual-"+(axiomIndex+1)); additionalAxioms[axiomIndex++]=factory.getOWLObjectPropertyAssertionAxiom(subObjectPropertyExpression,first,second); } OWLIndividual freshIndividual0=factory.getOWLAnonymousIndividual("fresh-individual-0"); OWLIndividual freshIndividualN=factory.getOWLAnonymousIndividual("fresh-individual-"+subPropertyChain.size()); additionalAxioms[axiomIndex++]=factory.getOWLClassAssertionAxiom(pseudoNominal,freshIndividualN); additionalAxioms[axiomIndex++]=factory.getOWLClassAssertionAxiom(allSuperNotPseudoNominal,freshIndividual0); Tableau tableau=getTableau(additionalAxioms); return !tableau.isSatisfiable(true,null,null,null,null,null,new ReasoningTaskDescription(true,"subproperty chain subsumption")); } } @Override
protected boolean isSubObjectPropertyExpressionOf(List<OWLObjectPropertyExpression> subPropertyChain,OWLObjectPropertyExpression superObjectPropertyExpression) { OWLObject[] objects=new OWLObject[subPropertyChain.size()+1]; for (int i=0;i<subPropertyChain.size();i++) objects[i]=subPropertyChain.get(i); objects[subPropertyChain.size()]=superObjectPropertyExpression; checkPreConditions(objects); if (!m_isConsistent || superObjectPropertyExpression.getNamedProperty().isOWLTopObjectProperty()) return true; else { OWLDataFactory factory=getDataFactory(); OWLClass pseudoNominal=factory.getOWLClass(IRI.create("internal:pseudo-nominal")); OWLClassExpression allSuperNotPseudoNominal=factory.getOWLObjectAllValuesFrom(superObjectPropertyExpression,pseudoNominal.getObjectComplementOf()); OWLAxiom[] additionalAxioms=new OWLAxiom[subPropertyChain.size()+2]; int axiomIndex=0; for (OWLObjectPropertyExpression subObjectPropertyExpression : subPropertyChain) { OWLIndividual first=factory.getOWLAnonymousIndividual("fresh-individual-"+axiomIndex); OWLIndividual second=factory.getOWLAnonymousIndividual("fresh-individual-"+(axiomIndex+1)); additionalAxioms[axiomIndex++]=factory.getOWLObjectPropertyAssertionAxiom(subObjectPropertyExpression,first,second); } OWLIndividual freshIndividual0=factory.getOWLAnonymousIndividual("fresh-individual-0"); OWLIndividual freshIndividualN=factory.getOWLAnonymousIndividual("fresh-individual-"+subPropertyChain.size()); additionalAxioms[axiomIndex++]=factory.getOWLClassAssertionAxiom(pseudoNominal,freshIndividualN); additionalAxioms[axiomIndex++]=factory.getOWLClassAssertionAxiom(allSuperNotPseudoNominal,freshIndividual0); Tableau tableau=getTableau(additionalAxioms); return !tableau.isSatisfiable(true,null,null,null,null,null,new ReasoningTaskDescription(true,"subproperty chain subsumption")); } } public NodeSet<OWLObjectPropertyExpression> getSuperObjectProperties(OWLObjectPropertyExpression propertyExpression,boolean direct) {
public Object visit(OWLObjectProperty property) { if (!property.isOWLTopObjectProperty() && !property.isOWLBottomObjectProperty()) { if (property.getIRI().isReservedVocabulary()) { profileViolations.add(new UseOfReservedVocabularyForObjectPropertyIRI(getCurrentOntology(), getCurrentAxiom(), property)); } } if (!property.isBuiltIn() && !getCurrentOntology().isDeclared(property, true)) { profileViolations.add(new UseOfUndeclaredObjectProperty(getCurrentOntology(), getCurrentAxiom(), property)); } if (getCurrentOntology().containsDataPropertyInSignature(property.getIRI(), true)) { // TODO: Error } if (getCurrentOntology().containsAnnotationPropertyInSignature(property.getIRI(), true)) { // TODO: Error } return null; }
protected boolean isSymmetric(OWLObjectPropertyExpression propertyExpression) { checkPreConditions(propertyExpression); if (!m_isConsistent.booleanValue() || propertyExpression.getNamedProperty().isOWLTopObjectProperty()) return true; OWLDataFactory factory=getDataFactory(); OWLClass pseudoNominal=factory.getOWLClass(PSEUDO_NOMINAL); OWLClassExpression allNotPseudoNominal=factory.getOWLObjectAllValuesFrom(propertyExpression,pseudoNominal.getObjectComplementOf()); OWLIndividual freshIndividualA=factory.getOWLAnonymousIndividual("fresh-individual-A"); OWLIndividual freshIndividualB=factory.getOWLAnonymousIndividual("fresh-individual-B"); OWLAxiom assertion1=factory.getOWLObjectPropertyAssertionAxiom(propertyExpression,freshIndividualA,freshIndividualB); OWLAxiom assertion2=factory.getOWLClassAssertionAxiom(allNotPseudoNominal,freshIndividualB); OWLAxiom assertion3=factory.getOWLClassAssertionAxiom(pseudoNominal,freshIndividualA); Tableau tableau=getTableau(assertion1,assertion2,assertion3); boolean result=tableau.isSatisfiable(true,null,null,null,null,null,new ReasoningTaskDescription(true,"symmetry of {0}",propertyExpression)); tableau.clearAdditionalDLOntology(); return !result; } protected boolean isTransitive(OWLObjectPropertyExpression propertyExpression) {
protected boolean isSymmetric(OWLObjectPropertyExpression propertyExpression) { checkPreConditions(propertyExpression); if (!m_isConsistent || propertyExpression.getNamedProperty().isOWLTopObjectProperty()) return true; OWLDataFactory factory=getDataFactory(); OWLClass pseudoNominal=factory.getOWLClass(IRI.create("internal:pseudo-nominal")); OWLClassExpression allNotPseudoNominal=factory.getOWLObjectAllValuesFrom(propertyExpression,pseudoNominal.getObjectComplementOf()); OWLIndividual freshIndividualA=factory.getOWLAnonymousIndividual("fresh-individual-A"); OWLIndividual freshIndividualB=factory.getOWLAnonymousIndividual("fresh-individual-B"); OWLAxiom assertion1=factory.getOWLObjectPropertyAssertionAxiom(propertyExpression,freshIndividualA,freshIndividualB); OWLAxiom assertion2=factory.getOWLClassAssertionAxiom(allNotPseudoNominal,freshIndividualB); OWLAxiom assertion3=factory.getOWLClassAssertionAxiom(pseudoNominal,freshIndividualA); Tableau tableau=getTableau(assertion1,assertion2,assertion3); boolean result=tableau.isSatisfiable(true,null,null,null,null,null,new ReasoningTaskDescription(true,"symmetry of {0}",propertyExpression)); tableau.clearAdditionalDLOntology(); return !result; } protected boolean isTransitive(OWLObjectPropertyExpression propertyExpression) {
protected boolean isSubObjectPropertyExpressionOf(OWLObjectPropertyExpression subObjectPropertyExpression,OWLObjectPropertyExpression superObjectPropertyExpression) { checkPreConditions(subObjectPropertyExpression,superObjectPropertyExpression); if (!m_isConsistent.booleanValue() || subObjectPropertyExpression.getNamedProperty().isOWLBottomObjectProperty() || superObjectPropertyExpression.getNamedProperty().isOWLTopObjectProperty()) return true; Role subrole=H(subObjectPropertyExpression); Role superrole=H(superObjectPropertyExpression); if (m_objectRoleHierarchy!=null && !containsFreshEntities(subObjectPropertyExpression,superObjectPropertyExpression)) { HierarchyNode<Role> subroleNode=m_objectRoleHierarchy.getNodeForElement(subrole); return subroleNode.isEquivalentElement(superrole) || subroleNode.isAncestorElement(superrole); } else { OWLDataFactory factory=getDataFactory(); OWLClass pseudoNominal=factory.getOWLClass(PSEUDO_NOMINAL); OWLClassExpression allSuperNotPseudoNominal=factory.getOWLObjectAllValuesFrom(superObjectPropertyExpression,pseudoNominal.getObjectComplementOf()); OWLIndividual freshIndividualA=factory.getOWLAnonymousIndividual("fresh-individual-A"); OWLIndividual freshIndividualB=factory.getOWLAnonymousIndividual("fresh-individual-B"); OWLAxiom subObjectPropertyAssertion=factory.getOWLObjectPropertyAssertionAxiom(subObjectPropertyExpression,freshIndividualA,freshIndividualB); OWLAxiom pseudoNominalAssertion=factory.getOWLClassAssertionAxiom(pseudoNominal,freshIndividualB); OWLAxiom allSuperNotPseudoNominalAssertion=factory.getOWLClassAssertionAxiom(allSuperNotPseudoNominal,freshIndividualA); Tableau tableau=getTableau(subObjectPropertyAssertion,pseudoNominalAssertion,allSuperNotPseudoNominalAssertion); boolean result=tableau.isSatisfiable(true,null,null,null,null,null,ReasoningTaskDescription.isRoleSubsumedBy(subrole,superrole,true)); tableau.clearAdditionalDLOntology(); return !result; } } protected boolean isSubObjectPropertyExpressionOf(List<OWLObjectPropertyExpression> subPropertyChain,OWLObjectPropertyExpression superObjectPropertyExpression) {
protected boolean isSubObjectPropertyExpressionOf(OWLObjectPropertyExpression subObjectPropertyExpression,OWLObjectPropertyExpression superObjectPropertyExpression) { checkPreConditions(subObjectPropertyExpression,superObjectPropertyExpression); if (!m_isConsistent || subObjectPropertyExpression.getNamedProperty().isOWLBottomObjectProperty() || superObjectPropertyExpression.getNamedProperty().isOWLTopObjectProperty()) return true; Role subrole=H(subObjectPropertyExpression); Role superrole=H(superObjectPropertyExpression); if (m_objectRoleHierarchy!=null && !containsFreshEntities(subObjectPropertyExpression,superObjectPropertyExpression)) { HierarchyNode<Role> subroleNode=m_objectRoleHierarchy.getNodeForElement(subrole); return subroleNode.isEquivalentElement(superrole) || subroleNode.isAncestorElement(superrole); } else { OWLDataFactory factory=getDataFactory(); OWLClass pseudoNominal=factory.getOWLClass(IRI.create("internal:pseudo-nominal")); OWLClassExpression allSuperNotPseudoNominal=factory.getOWLObjectAllValuesFrom(superObjectPropertyExpression,pseudoNominal.getObjectComplementOf()); OWLIndividual freshIndividualA=factory.getOWLAnonymousIndividual("fresh-individual-A"); OWLIndividual freshIndividualB=factory.getOWLAnonymousIndividual("fresh-individual-B"); OWLAxiom subObjectPropertyAssertion=factory.getOWLObjectPropertyAssertionAxiom(subObjectPropertyExpression,freshIndividualA,freshIndividualB); OWLAxiom pseudoNominalAssertion=factory.getOWLClassAssertionAxiom(pseudoNominal,freshIndividualB); OWLAxiom allSuperNotPseudoNominalAssertion=factory.getOWLClassAssertionAxiom(allSuperNotPseudoNominal,freshIndividualA); Tableau tableau=getTableau(subObjectPropertyAssertion,pseudoNominalAssertion,allSuperNotPseudoNominalAssertion); boolean result=tableau.isSatisfiable(true,null,null,null,null,null,ReasoningTaskDescription.isRoleSubsumedBy(subrole,superrole,true)); tableau.clearAdditionalDLOntology(); return !result; } } protected boolean isSubObjectPropertyExpressionOf(List<OWLObjectPropertyExpression> subPropertyChain,OWLObjectPropertyExpression superObjectPropertyExpression) {