A question you rightfully may be pondering is: Why translate object oriented classes into OWL? The answer is that it can help you to find logical inconsistencies in your class designs. In this post I will introduce the tools that will eventually enable you to find logical inconsistencies in your class designs.
The tool we will use is called Protégé. Download and installations instructions for Protégé can be found at https://protegewiki.stanford.edu/wiki/Install_Protege5.
In this post I will provide two screencasts:
- In the first screencast I will show you how to enter the OWL representation of the
Personclass introduced in the previous post.
- In the second screencast I will show you how to run a reasoner and how an inconsistency can arise.
On to the first screencast:
- Create a
- Create the data properties.
- Through sub-classing state that the
Personclass necessarily have a
- If we run the reasoner on this ontology, no inconsistencies will be found.
In the second screencast I show how an inconsistency can arise. The steps are as follows:
- Create an individual called
- Run the reasoner. You will see the reasoner give no errors (nothing happened). This may come as a surprise to you since we have not set the
agedata properties for the individual called
sarah. In OWL this behaviour is expected due to what is called the open world assumption. OWL makes no assumption with regards to knowledge that is not stated explicitly. Since we did not state that the
sarahindividual does not have, for example, a
name, the reasoner found no error in our ontology. This is different from typical database behaviour where absence of information is often assumed to indicate that the information does not exist, which is referred to as the closed world assumption.
- Now let us change our
sarahindividual to state that it does not have a
name. This is achieved by stating that the
sarahindividual is of type
name max 0 xsd:string. This states that the
sarahindividual can have a maximum of 0
namedata properties of type
- If we run the reasoner now it shows that we have an inconsistency. We can ask Protégé to explain the inconsistency.
- The explanation states that
sarahis of type
Personand of type
name max 0 xsd:string. But
Personis a subclass of
name some xsd:string. This states that individuals of type
Personmust have at least 1
nameproperty of type
xsd:string. Hence, the reason for the inconsistency.
Admittedly this example is contrived: there is not much sense in creating a
Person class which we state must have a
name and then create an individual of type
Person which we then state does not have a
name. But this was done here to show you how to use a reasoner to find inconsistencies in your ontology and to show you what information you can expect when your ontology is inconsistent.