OWL's EquivalentClass vs. SubClassOf
Asked Answered
A

3

20

What is the difference between EquivalentClass and SubClass of? While reading through OWL primer, i find the tutorial uses SubClassOf a lot to declare a new class, as follows

SubClassOf(
  :Teenager
  DataSomeValuesFrom( :hasAge
    DatatypeRestriction( xsd:integer
      xsd:minExclusive "12"^^xsd:integer
      xsd:maxInclusive "19"^^xsd:integer
    )
  )
)

Can I write

EquivalentClass(
  :Teenager
  DataSomeValuesFrom( :hasAge
    DatatypeRestriction( xsd:integer
      xsd:minExclusive "12"^^xsd:integer
      xsd:maxInclusive "19"^^xsd:integer
    )
  )
)

instead?

Arsenite answered 16/11, 2010 at 8:55 Comment(0)
E
36

When stating that A is a subclass of B, this restricts A to necessarily inherit all characteristics of B, but not the other way around. In your example, A = Teenager, and B = hasAge [12:19] (my own notation, but you get the idea).

This means that any instance of Teenager in the OWL ontology must necessarily also have the property hasAge with a value in the range [12:19], but not the other way around. Specifically, this does not mean that any instance of something with the property hasAge with a value in the range [12:19] is also an instance of Teenager. To make this clear, consider an instance (called c) of class Car. We might also say that:

c . hasAge 13

This says that instance c of Car is 13 years old. However, with the subclass axiom defining Teenager above, a reasoner would not infer that c is also an instance of Teenager (perhaps as we'd want, if teenagers are people, not cars).

The difference when using equivalence is that the subclass relationship is implied to go in both directions. So, if we were to instead include the second axiom that defined Teenager to be equivalent to anything with the property hasAge with a value in the range [12:19], then a reasoner would infer that the car c is also an instance of Teenager.

Estrade answered 17/11, 2010 at 5:43 Comment(0)
C
5

Equivalent classes might have the same members, e.g.,

:USPresident owl:equivalentClass :USCommanderInChief

will both have the same individuals (all or some of the US presidents). So if we assert that John Adams was a USCommanderInChief it can be inferred that John Adams was also a US President.

With subclass, we're indicating a hierarchy. e.g., GrannySmithApple is a type of Apple.

Commorant answered 25/4, 2012 at 18:43 Comment(0)
S
5
:USPresident owl:equivalentClass :USCommanderInChief .

is the same as

:USPresident rdfs:subClassOf :USCommanderInChief ;
:USCommanderInChief rdfs:subClassOf :USPresident .
Sawbuck answered 29/7, 2018 at 19:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.