Declaring a #URI both as a Class and as a Type of another Class in an Ontology

Usually in an Ontology, we have classes, instances of classes and properties. Have you ever thought of a situation where a class has been declared and the same Class has been made as an instance of another Class? This is an interesting state where something behaves both as a Class as well as an instance of another Class. I am jotting down my thoughts on the same and elaborating the advantages/purpose of doing so while defining an Ontology. The points below are borrowed from a discussion recently on Semantic Overflow.

Consider the following case for an Ontology. Let’s say we have a Class named Animal which is a sub-class of Mammal. On the same lines, let’s say we have another Class named AnimalSpecies which is a sub-class of MammalSpecies. Now, let’s consider there is a sub-class of Animal which is Cat. These relationships are described below in the following code written in OWL:

ex: Animal a Class ; rdfs:subClassOf ex: Mammal .

ex: AnimalSpecies a Class ; rdfs:subClassOf:MammalSpecies .

Now, let’s say we have a sub-class of Animal which is a Cat. This is written as follows:

ex:Cat a Class ; rdfs:subClassOf ex: Animal

Any OWL reasoner would infer that any instance of Cat (i.e. anything that is a Cat) is also an Animal; and since Animal is a sub-class of Mammal, it is also a Mammal.

Until above, we spoke of the usual OWL code that we write. Now, let’s discuss about something called Meta-Modeling or Punning supported by OWL. Suppose we add the following statement to the above set of statements:

ex:Cat a ex:AnimalSpecies

Let’s quickly create an instance of Class Cat:

ex:Tiger a ex:Cat

Now, it gets a little tricky because for anyone who is not familiar with the concept of Meta-Modeling, it may sound like we are declaring Cat both as a Class and as an instance of another Class AnimalSpecies. Well, now we are talking punning :) . Basically, the concept above is slightly tricky but is very intuitive once you get the hang of it. For a moment, consider that we would like to enhance the knowledge of the Ontology domain by adding statements which say Cat is an AnimalSpecies. Well, the last OWL statement above just does this. It just simply says Cat is an AnimalSpecies. it gets confusing when you think of Cat both as a resource and as an instance of another Class, but it gets intuitive when you basically think of it as an added knowledge element to the domain represented by the Ontology.

Having said this, the following inferences may be made from the above data-model besides what is already conveyed by the code written above.

1) Tiger is a Cat.

1) Anything that is a Cat (i.e. any instance of the Class Cat) is also an Animal; and also a Mammal (since Animal is a sub-class of Mammal).

Hence, Tiger is an Animal and Tiger is a Mammal too.

2) Cat is an AnimalSpecies.

3) Cat is also a MammalSpecies.  (Since AnimalSpecies is a subclass of MammalSpecies)

It is very important to note that an instance of Cat (anything that is a Cat) is not an AnimalSpecies; it is neither a MammalSpecies. So, it is incorrect to say that Tiger is an AnimalSpecies. It is also incorrect to say Tiger is a MammalSpecies. This is because unlike the rdfs:subClassOf relation, the a (or rdf:type) relation is not transitive.

There are several examples that you may come across while reading different Ontologies and it is important to keep the above point in mind and not to confuse and mix the attributes together :) Your thoughts are welcome.

Advertisement

About abhishekclearforest
Passionate about what I do. If I can't put my heart into it, I take myself out of it. Passionate about technology, leadership, semantic web and trying to make this planet a better place to live.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.