owlontologyprotegemanchester-syntax

When defining a class in OWL, how to constrain that an object property must refer to the same individual as another object property?


I'm studying the OWL 2 Web Ontology Language Primer and wanted to add my own classes in the context of the used "families" example ontology. So I added a new class City as well as a new object property bornIn:

ObjectProperty: bornIn
   Domain: Person
   Range: City
   Characteristics: Functional

Now I want to add another class X which represents all persons whose spouse is born in the same city as them. I feel that I have all the "ingredients" ready but I'm not sure how to combine them. It seems that I can use EquivalentTo to define the new class by the following two constraints:

  1. All individuals of X must have a spouse: hasSpouse some Person.
  2. The birthplace (i.e., an individual of City) of the original person and the spouse must be the same. It seems that I can use the property chain hasSpouse o bornIn in order to denote the birthplace of the spouse. Also, from the language primer I understood that there is owl:sameAs in order to assert that two individuals are the same. The language primer also shows that value can be used to refer to one particular individual. But in my case, it seems that I need some kind of placeholder rather than a specific individual, so I'm not sure how to combine this.

The best guess I could come up with is the following but when I add this to my class in Protégé (in the class expression editor), I get the error that the chain operator o is unexpected at this position:

Class X:
   EquivalentTo: Person and (hasSpouse some Person) and (hasSpouse o bornIn value owl:sameAs bornIn value)

Class expression editor with error message


Solution

  • This is not something that can be expressed in OWL, but it can be done with by adding a SWRL rule, assuming you have a class SpouseBornInSameCity:

    hasSpouse(?x, ?y) ^ bornIn(?x, ?z) ^ bornIn(?y, ?z) -> SpouseBornInSameCity(?x) ^ SpouseBornInSameCity(?y)