Reasoning with Ontologies
Introduction
OWL is based on Description Logics formalism – if you want to know more about it, you can familiarize yourself with optional
Intro to Description Logics lab.
Lab instructions
1 TBox and ABox [10 minutes]

Let's check if you understand this difference properly: Take your
ontology from Protégé lab. Identify which statements belong to Terminology (TBox) and World Description (ABox). Put them in the report divided into two sections: TBox and ABox (5 statements for each section).
2 OWL Reasoning - Class Inference [10 minutes]
Model the following ontology axioms in Protege:
Class: bus_driver
EquivalentTo:
person
that drives some bus
Class: driver
EquivalentTo:
person
that drives some vehicle
Class: bus
SubClassOf:
vehicle
Hints:
To build the first axiom:
Create appropriate classes
and ObjectProperties:
Define the BusDriver class with
Equivalent classes
button

Build the second axiom analogously:
Build the third axiom using the
SubClass of
button:
Start the reasoner (
Reasoner → start reasoner
) and observe the inferred class hierarchy. What conclusions have been drawn?

Include the modified ontology in the report.

Explain the inferred relations and conclusions.
Analyze the reasoning examples given
here in „Class Inferences” section.
3 OWL Reasoning - Instance Inferences [10 minutes]
In Description Logics on which the OWL language is based there are the following reasoning tasks for instances (world description, ABox):
Class membership (is instance a contained in class C?)
Instance retrieval (find all (known) individuals belonging to a given class)
and for the whole Knowledge Base (ABox+TBox):
Global consistency of a knowledge base (Is the knowledge base meaningful?)
Download the
pre-prepared ontology and load it in Protege (
NB: the ontology classes and those on screenshots may differ a little).
Model the following ontology axioms in Protege:
Individual: Daily_Mirror
Types:
owl:Thing
Individual: Q123ABC
Types:
van,
white_thing
Individual: Mick
Types:
man
Facts:
reads Daily_Mirror,
drives Q123ABC
Class: white_van_man
EquivalentTo:
man
that drives some (van
and white_thing)
SubClassOf:
reads only tabloid
For those not familiar with UK culture, White Van Man is a stereotype used to describe a particular kind of driver. Wikipedia provides an entry with some additional information and references.
Hints:
Create appropriate instances in
Individuals
tab

If the instance is of 2 types, create it only once and then add the second type:

Add object properties to connect individuals:

Define the class:

Start the reasoner (Reasoner → start reasoner
) and observe the inferred class hierarchy. Where is the white_van_man
? What conclusions have been drawn?

Include the modified ontology in the report.

Explain the inferred relations and conclusions.
Analyze the reasoning examples given
here in „Instance Inferences” section.
4 OWL Reasoning - Reasoners [5 minutes]
DL reasoners may be integrated with other tools - as in the case of Protege presented before - as well as run independently via various interfaces. Popular DL reasoners include: FaCT++, Pellet, HermiT, RacerPro and many others.
We will use the Pellet reasoner.
Unpack the zip.
Run pellet.sh help
to get familiar with available commands.
Try pellet.sh consistency <ontology>
where the <ontology>
is:
-
people+pets.owl
ontology provided with Pellet in examples/data/
directory
and observe the results.
Try pellet.sh classify <ontology>
with the two above mentioned ontologies and observe the results.

What are the results? Write them down or provide a screenshot of the answer in the report.
5 Advanced OWL reasoning [50 minutes]
5.1 Warm up
Open (Family-tree-0.owl
)
It contains Sex
, Female
, Male
, Person
, Man
and Woman
Classes.
Create hasSex
property, Set domain and ranges on hasSex
(Person/Sex), make it functional.
Create restrictions on Person
hasSex some Sex
.
Make Man and Woman
defined (use
Equivalent classes
):
Man EquivalentTo Person that hasSex some Male
etc.

Import plain-individuals, observe that none of them have any assertions on them. (Active Ontology
tab → Imported ontologies
→ Direct imports
).
Choose an individual, add
Types
:
Person and (hasSex some Male)

Using the
Reasoner
menu in Protege (
Reasoner → Start/Synchronize reasoner
), classify the ontology. What inferences are made? Write them in the report

5.2 Characteristics of properties
Close the previous ontology. Load Family-tree-1.owl
. Check how Man
and Woman
classes are defined.
Create object properties:
hasFather
,
hasMother
, make them
functional, add
domain and
range:
Person
,
Man/Woman
, add
inverse properties:

Create restrictions on Person:
has Mother some Woman
,
hasFather some Man

Load individuals-1-parantage.owl
file.
Classify the ontology. What inferences are made? Write them in the report

5.3 Datatype properties
Close the previous ontology. Load Family-tree-2.owl
.
Create or find datatype properties:
birthYear
,
deathYear
, make them
functional.

Create Victorian
class: Person and birthYear some integer[>=1837, ⇐1901]
Classify the ontology. How many individuals have been classified as Victorians?

5.4 Transitive properties
Close the previous ontology. Load Family-tree-3.owl
.
Create a new super-property of hasParent
called hasAncestor
,
Make it transitive and create inverse property.
Clasify, look at property hierarchy. What do we know about Robert?

Close the previous ontology. Load Family-tree-4.owl
.
Model the information about David:

Classify the ontology. Answer the questions:
What type does David_bright_1934 have?

How many children does he have?

5.5 Property chains
Close the previous ontology. Load Family-tree-5.owl.
Add hasGrandParent sub prop of hasAncestor (inverse grandparentOf)
Add domain and ranges
Add sub properties hasGrandMother/Father
+ domains and ranges
Add property chain
hasParent o hasFather/Mother → hasGrandFather/Mother

Classify the ontology. What do we learn about Robert?

5.6 Classes with Individuals, Open World Assumption
Close the previous ontology. Load Family-tree-6.owl.
Make class of all ancestors and class of robert's ancestors.

Classify. What are the results?
Make class of people with min 3 children.
Classify the ontology, do we find parents with 3 children? Why?

How to really find parents that have 3 children?

How to make individuals different from each other?

Materials
If you want to know more
Lecture:
Software:
Reading:
OWL Tutorials: