0

I tried to use the same object property between multiple classes, but I got a warning that the same object property has been set multiple times as follows, can you please let me know what is wrong with that and how to solve it? Does this restrict reasoning later on (i.e. confuse the reasoner since the same object property is set multiple times)?

enter image description here

Thanks

Avv
  • 429
  • 4
  • 17

1 Answers1

1

Contrary to the comments it actually is very problematic to use the same object property between multiple classes.

What you don't see in your visualization is that in RDF/OWL, the starting point of your relation arrows is modelled as rdfs:domain and the target point of the arrows is modelled as rdfs:range.

The semantic of an OWL class is that it is a set of individuals and rdfs:domain and rdfs:range specify the domain, respectively range of a relation. That is, they specify the sets of allowed values in subject, respectively object position of a triple with that relation in the predicate position.

If you express your example in RDF Turtle it would look like this:

:hasPart rdfs:domain :ClassA, :ClassB;
         rdfs:range :ClassB, :ClassC, :ClassD.

This causes multiple problems:

Intersection

The semantic of multiple domains, respectively ranges, is the intersection of those classes, not the union!

Even if we disregard the relation between :ClassB and :ClassD, this means :hasPart is only allowed by individuals that are instances of class C and class D at the same time!

For example, lets say class A is "car", class B is "tire" and class C is "motor". Now you want to say that a car can have tires and motors but what you actually specify is that a car can only have things that are a motor and a tire at the same time!

Unwanted but allowed usage

If you fix the first problem but specifying the union instead of the intersection, it will be very messy in serialized RDF because you need a large amount of triples to represent OWL restrictions such as unions. But even if you do that, you could now connect an instance of class A with an instance of class D, which is not allowed in the image.

Solution

The solution is simple, just separate those relations, for example into :hasB, :hasC and :hasD, although in a real scenario you can probably find a more suitable naming scheme, where the "has" prefix is often not used. For example, in DBpedia, the property for the country of a city is expressed using dbo:country, not dbo:hasCountry.

Konrad Höffner
  • 11,100
  • 16
  • 60
  • 118
  • Can I define the same hasA as you see above and then in Protege add union between corresponding classes? In Protege, you can define union between classes with equivalentTo button under class and then set ClassA or ClassB. This will make both classes union to each other. Would this be transferred to the object property hasA connecting classes above or not? – Avv Aug 18 '20 at 00:19
  • Second question, would a hasPartOf object property between the calsses that is indeed opposite to hasA, be transferred in the same way but with opposite range and domain? – Avv Aug 18 '20 at 00:22
  • Based on comment 1, in Protege classes are automatically disjoint, so do you think that will solve the issue you mentioned or I have to do it in the way you described in your solution? – Avv Aug 18 '20 at 02:26
  • @Abraheem: If Protégé defines your classes as disjoint, then your relation can never be used because the range is an intersection of disjoint classes which is empty by definition. – Konrad Höffner Aug 18 '20 at 08:19
  • @Abraheem: I am not sure that equivalentTo creates a union. I assume it will just define both classes as identical, at which point you shouldn't model both of them in the first place but just one. – Konrad Höffner Aug 18 '20 at 08:22
  • @Abraheem: You could use unions but then you wind up with the second problem described under "Unwanted but allowed usage". – Konrad Höffner Aug 18 '20 at 08:23