Search code examples
owlprotege

Can you assert an object property based on the property of another individual using the OWL 2 Functional-Style syntax?


Let's say we have the following declarations:

Declaration(ObjectProperty(:likes))

Declaration( NamedIndividual(:John))
Declaration( NamedIndividual(:George) )
Declaration( NamedIndividual(:Fishing))

And the following assertion:

ObjectPropertyAssertion(:likes :John :Fishing)

Is there a way to assert that George doesn't like whatever John likes?

I thought of the following:

NegativeObjectPropertyAssertion(
  :likes
  :George
  ObjectHasValue(
     ObjectInverseOf(:likes)
     :John
  )
)

But I cannot load the above ontology in Protege so I assume the syntax is not correct.


Solution

  • ObjectPropertyAssertions (respectively NegativeObjectPropertyAssertions) can only make assertions about the existence (respectively none existence) of relations between 2 individuals. What you are trying to do is define a relation between an individual and a class using property assertions. This is not possible.

    However, you can define the class of things that john likes as follows:

    EquivalentClasses(JohnLikes ObjectSomeValuesFrom(ObjectInverseOf(likes>) ObjectOneOf(john))) 
    

    Note that if you want the activities that is liked by john to be listed, you have to give a name to the class ObjectSomeValuesFrom(ObjectInverseOf(likes>) ObjectOneOf(john)) - in this case JohnLikes. This is because the reasoner only gives inferences for named classes not anonymous classes.

    Then the activities that george likes will be those that john does not like (i.e. not JohnLikes).

    Here is an example ontology that defines some known activities as well as activities liked and not liked by john:

    Ontology(<http://www.semanticweb.org/SO77732178>
    
    Declaration(Class(<http://www.semanticweb.org/SO77732178#Activity>))
    Declaration(Class(<http://www.semanticweb.org/SO77732178#GeorgeLikes>))
    Declaration(Class(<http://www.semanticweb.org/SO77732178#JohnLikes>))
    Declaration(Class(<http://www.semanticweb.org/SO77732178#Person>))
    Declaration(ObjectProperty(<http://www.semanticweb.org/SO77732178#likes>))
    Declaration(NamedIndividual(<http://www.semanticweb.org/SO77732178#chess>))
    Declaration(NamedIndividual(<http://www.semanticweb.org/SO77732178#fishing>))
    Declaration(NamedIndividual(<http://www.semanticweb.org/SO77732178#george>))
    Declaration(NamedIndividual(<http://www.semanticweb.org/SO77732178#hiking>))
    Declaration(NamedIndividual(<http://www.semanticweb.org/SO77732178#john>))
    Declaration(NamedIndividual(<http://www.semanticweb.org/SO77732178#reading>))
    
    ############################
    #   Classes
    ############################
    
    # Class: <http://www.semanticweb.org/SO77732178#Activity> (<http://www.semanticweb.org/SO77732178#Activity>)
    
    EquivalentClasses(<http://www.semanticweb.org/SO77732178#Activity> ObjectOneOf(<http://www.semanticweb.org/SO77732178#chess> <http://www.semanticweb.org/SO77732178#fishing> <http://www.semanticweb.org/SO77732178#hiking> <http://www.semanticweb.org/SO77732178#reading>))
    DisjointClasses(<http://www.semanticweb.org/SO77732178#Activity> <http://www.semanticweb.org/SO77732178#Person>)
    
    # Class: <http://www.semanticweb.org/SO77732178#GeorgeLikes> (<http://www.semanticweb.org/SO77732178#GeorgeLikes>)
    
    EquivalentClasses(<http://www.semanticweb.org/SO77732178#GeorgeLikes> ObjectComplementOf(<http://www.semanticweb.org/SO77732178#JohnLikes>))
    
    # Class: <http://www.semanticweb.org/SO77732178#JohnLikes> (<http://www.semanticweb.org/SO77732178#JohnLikes>)
    
    EquivalentClasses(<http://www.semanticweb.org/SO77732178#JohnLikes> ObjectSomeValuesFrom(ObjectInverseOf(<http://www.semanticweb.org/SO77732178#likes>) ObjectOneOf(<http://www.semanticweb.org/SO77732178#john>)))
    
    
    ############################
    #   Named Individuals
    ############################
    
    # Individual: <http://www.semanticweb.org/SO77732178#chess> (<http://www.semanticweb.org/SO77732178#chess>)
    
    ClassAssertion(<http://www.semanticweb.org/SO77732178#Activity> <http://www.semanticweb.org/SO77732178#chess>)
    
    # Individual: <http://www.semanticweb.org/SO77732178#fishing> (<http://www.semanticweb.org/SO77732178#fishing>)
    
    ClassAssertion(<http://www.semanticweb.org/SO77732178#Activity> <http://www.semanticweb.org/SO77732178#fishing>)
    
    # Individual: <http://www.semanticweb.org/SO77732178#george> (<http://www.semanticweb.org/SO77732178#george>)
    
    ClassAssertion(<http://www.semanticweb.org/SO77732178#Person> <http://www.semanticweb.org/SO77732178#george>)
    
    # Individual: <http://www.semanticweb.org/SO77732178#hiking> (<http://www.semanticweb.org/SO77732178#hiking>)
    
    ClassAssertion(<http://www.semanticweb.org/SO77732178#Activity> <http://www.semanticweb.org/SO77732178#hiking>)
    
    # Individual: <http://www.semanticweb.org/SO77732178#john> (<http://www.semanticweb.org/SO77732178#john>)
    
    ClassAssertion(<http://www.semanticweb.org/SO77732178#Person> <http://www.semanticweb.org/SO77732178#john>)
    ObjectPropertyAssertion(<http://www.semanticweb.org/SO77732178#likes> <http://www.semanticweb.org/SO77732178#john> <http://www.semanticweb.org/SO77732178#chess>)
    ObjectPropertyAssertion(<http://www.semanticweb.org/SO77732178#likes> <http://www.semanticweb.org/SO77732178#john> <http://www.semanticweb.org/SO77732178#reading>)
    NegativeObjectPropertyAssertion(<http://www.semanticweb.org/SO77732178#likes> <http://www.semanticweb.org/SO77732178#john> <http://www.semanticweb.org/SO77732178#fishing>)
    NegativeObjectPropertyAssertion(<http://www.semanticweb.org/SO77732178#likes> <http://www.semanticweb.org/SO77732178#john> <http://www.semanticweb.org/SO77732178#hiking>)
    
    # Individual: <http://www.semanticweb.org/SO77732178#reading> (<http://www.semanticweb.org/SO77732178#reading>)
    
    ClassAssertion(<http://www.semanticweb.org/SO77732178#Activity> <http://www.semanticweb.org/SO77732178#reading>)
    
    
    DifferentIndividuals(<http://www.semanticweb.org/SO77732178#chess> <http://www.semanticweb.org/SO77732178#fishing> <http://www.semanticweb.org/SO77732178#george> <http://www.semanticweb.org/SO77732178#hiking> <http://www.semanticweb.org/SO77732178#john> <http://www.semanticweb.org/SO77732178#reading>)
    )