Title: Why did that happen?
1Why did that happen?
- OWL and Inference Practical examples
- Sean Bechhofer
2Inference and Classes
- The people and pets example ontology contains a
number of classes and properties intended to
illustrate particular aspects of reasoning in
OWL. - We can make inferences about relationships
between those classes, in particular subsumption
between classes - Recall that A subsumes B when it is the case that
any instance of B must necessarily be an instance
of A.
A
B
3Inference and Individuals
- In addition, the model contains a number of
individuals - We can make inferences about the individuals, in
particular inferring that particular individuals
must be instances of particular classes. - This can be because of subsumption relationships
between classes, or because of the relationships
between individuals. - The following slides examine some of the
inferences we can make in the example model and
discuss why those inferences come about.
4Unique Name Assumption
- The Unique Name Assumption (UNA) says that any
two individuals with different names are
different individuals. - OWL semantics does not make the UNA
- There are mechanisms in the language
(owldifferentFrom and owlAllDifferent) that
allow us to assert that individuals are
different. - However, many DL reasoners (including the one we
use here) assume UNA. - For the following examples, there is a tacit
assumption that all individuals are asserted to
be distinct.
5Classes
- The following examples illustrate reasoning with
classes and class definitions. - We show examples of
- Inferred Subsumptions
- Inconsistency
6Bus Drivers are Drivers
Class(abusdriver complete intersectionOf(aperso
n restriction(adrives someValuesFrom
(abus)))) Class(adriver complete
intersectionOf(aperson restriction(adrives
someValuesFrom (avehicle)))) Class(abus
partial avehicle)
- A bus driver is a person that drives a bus
- A bus is a vehicle
- A bus driver drives a vehicle, so must be a
driver - The subclass is inferred due to subclasses being
used in existential quantification.
7Cat Owners like Cats
Class(acatowner complete intersectionOf(aperson
restriction(ahas_pet someValuesFrom
(acat)))) SubPropertyOf(ahas_pet
alikes) Class(acatliker complete
intersectionOf(aperson restriction(alikes
someValuesFrom (acat))))
- Cat owners have cats as pets
- has pet is a subproperty of likes, so anything
that has a pet must like that pet. - Cat owners must like a cat.
- The subclass is inferred due to a subproperty
assertion
8Drivers are Grown Ups
Class(adriver complete intersectionOf(aperson
restriction(adrives someValuesFrom
(avehicle)))) Class(adriver partial
aadult) Class(agrownup complete
intersectionOf(aadult aperson))
- Drivers are defined as persons that drive cars
(complete definition) - We also know that drivers are adults (partial
definition) - So all drivers must be adult persons (e.g.
grownups) - An example of axioms being used to assert
additional necessary information about a class.
We do not need to know that a driver is an adult
in order to recognize one, but once we have
recognized a driver, we know that they must be
adult.
9Sheep are Vegetarians
Class(asheep partial restriction(aeats
allValuesFrom (agrass)) aanimal) Class(agras
s partial aplant) DisjointClasses(unionOf(restri
ction(apart_of someValuesFrom (aanimal))
aanimal)
unionOf(aplant restriction(apart_of
someValuesFrom (aplant)))) Class(avegetarian
complete intersectionOf( restriction(aeats
allValuesFrom (complementOf(restriction(apart_of
someValuesFrom (aanimal)))))
restriction(aeats allValuesFrom
(complementOf(aanimal))) aanimal))
- Sheep only eat grass
- Grass is a plant
- Plants and parts of plants are disjoint from
animals and parts of animals - Vegetarians only eat things which are not animals
or parts of animals - Note the complete definition, which means that we
can recognise when things are vegetarians.
10Giraffes are Vegetarians
Class(agiraffe partial aanimal
restriction(aeats allValuesFrom (aleaf)))
Class(aleaf partial restriction(apart_of
someValuesFrom (atree))) Class(atree partial
aplant) DisjointClasses(unionOf(restriction(apa
rt_of someValuesFrom (aanimal)) aanimal)
unionOf(aplant
restriction(apart_of someValuesFrom
(aplant)))) Class(avegetarian complete
intersectionOf( restriction(aeats
allValuesFrom (complementOf(restriction(apart_of
someValuesFrom (aanimal)))))
restriction(aeats allValuesFrom
(complementOf(aanimal))) aanimal))
- Giraffes only eat leaves
- Leaves are parts of trees, which are plants
- Plants and parts of plants are disjoint from
animals and parts of animals - Vegetarians only eat things which are not animals
or parts of animals - Similar to the previous example with the
additional inference provided by the existential
restriction in the definition of leaf
11Old Ladies own Cats
Class(aoldlady complete intersectionOf(apers
on afemale aelderly)) Class(aoldlady partial
intersectionOf( restriction(ahas_pet
allValuesFrom (acat)) restriction(ahas_pet
someValuesFrom (aanimal)))) Class(acatowner
complete intersectionOf(aperson
restriction(ahas_pet someValuesFrom (acat))))
- Old ladies must have a pet.
- All pets that old ladies have must be cats.
- An old lady must have a pet that is a cat.
- An example of the interaction between an
existential quantification (asserting the
existence of a pet) and a universal
quantification (constraining the types of pet
allowed). - This also illustrates that an ontology is one
view on the world you may disagree with my
modelling but I am being explicit about it.
12Mad Cows are inconsistent
Class(acow partial avegetarian) DisjointClasses
(unionOf(restriction(apart_of someValuesFrom
(aanimal)) aanimal)
unionOf(aplant restriction(apart_of
someValuesFrom (aplant)))) Class(avegetarian
complete intersectionOf( restriction(aeats
allValuesFrom (complementOf(restriction(apart_of
someValuesFrom (aanimal)))))
restriction(aeats allValuesFrom
(complementOf(aanimal))) aanimal)) Class(amad
cow complete intersectionOf(acow
restriction(aeats someValuesFrom
(intersectionOf(restriction(apart_of
someValuesFrom (asheep))
abrain))))) Class(asheep partial
aanimal restriction(aeats allValuesFrom
(agrass)))
- Cows are naturally vegetarians
- A mad cow is one that has been eating sheeps
brains - Sheep are animals
- Thus a mad cow has been eating part of an animal,
which is inconsistent with the definition of a
vegetarian.
13Individuals
- The following examples illustrate reasoning with
individuals. - We look at why particular individuals can be
inferred to be members of particular classes.
14The Daily Mirror is a Tabloid
Individual(aDailyMirror type(owlThing))
Individual(aMick type(amale) value(adrives
aQ123ABC) value(areads aDailyMirror))
Individual(aQ123ABC type(avan)
type(awhitething)) Class(awhitevanman
complete intersectionOf(aman
restriction(adrives someValuesFrom
(intersectionOf(avan awhitething)))))
Class(awhitevanman partial restriction(areads
allValuesFrom (atabloid)))
- Mick drives a white van
- Mick must be a person and an adult, so he is a
man - Mick is a man who drives a white van, so hes a
white van man - A white van man only reads tabloids, and Mick
reads the Daily Mirror, thus the Daily Mirror
must be a tabloid - Here we see interaction between complete and
partial definitions plus a universal
quantification allowing an inference about a role
filler.
15Pete is a Person, Spike is an Animal
Individual(aSpike type(owlThing)
value(ais_pet_of aPete)) Individual(aPete
type(owlThing)) ObjectProperty(ahas_pet
domain(aperson) range(aanimal)) ObjectProperty(
ais_pet_of inverseOf(ahas_pet))
- Spike is the pet of Pete
- So Pete has pet Spike
- Pete must be a Person
- Spike must be an Animal
- Here we see an interaction between an inverse
relationship and domain and range constraints on
a property.
16Walt loves animals
Individual(aWalt type(aperson)
value(ahas_pet aHuey) value(ahas_pet
aLouie) value(ahas_pet aDewey)) Individual(a
Huey type(aduck)) Individual(aDewey
type(aduck)) Individual(aLouie
type(aduck)) DifferentIndividuals(aHuey
aDewey aLouie) Class(aanimallover complete
intersectionOf(aperson restriction(ahas_pet
minCardinality(3))))
- Walt has pets Huey, Dewey and Louie
- Huey Dewey and Louie are all distinct individuals
- Walt has at least three pets and is thus an
animal lover. - Note that in this case, we dont actually need to
include person in the definition of animal lover
(as the domain restriction will allow us to draw
this inference).
17Tom is a Cat
Individual(aMinnie type(afemale)
type(aelderly) value(ahas_pet
aTom)) Individual(aTom type(owlThing)) Object
Property(ahas_pet domain(aperson)
range(aanimal)) Class(aoldlady complete
intersectionOf(aperson afemale
aelderly)) Class(aoldlady partial
intersectionOf( restriction(ahas_pet
allValuesFrom (acat)) restriction(ahas_pet
someValuesFrom (aanimal))))
- Minnie is elderly, female and has a pet, Tom
- Minnie must be a person
- Minnie is be an old lady
- All Minnies pets must be cats.
- Here the domain restriction gives us additional
information which then allows us to infer a more
specific type. The universal quantification then
allows us to infer information about the role
filler.
18Break
19General Patterns of Inference
- The next slides and examples illustrate some of
the interactions between quantification and
boolean operators. - Distribution and De Morgans laws
- We also discuss the ramifications of open world
reasoning.
20Distribution Rules
- Distribution rules for existential quantification
are similar to those for conjunction and
disjunction - restriction(some p unionOf(A B) ?
unionOf(restriction(some (p A)) restriction(some
(p B))) - There are also inferences that can be drawn
between expressions involving existential
quantification and conjunction - restriction(some p intersectionOf(A B) ?
intersectionOf(restriction(some (p A))
restriction(some (p B))) - intersectionOf(restriction(some (p A))
restriction(some (p B))) ? unionOf(restriction(s
ome (p A)) restriction(some (p B))) - intersectionOf(restriction(some (p A))
restriction(some (p B))) ? restriction(some p
unionOf(A B) - The above inferences are not logical
equivalences. - Union is distributive in existentials,
intersection is not.
21A Simple Ontology
Class(aPerson partial) Class(aAcademic partial
aPerson) Class(aHappy partial
aPerson) Class(aLecturer partial
aAcademic) Class(aProfessor partial
aAcademic) Class(aStudent partial
aPerson) ObjectProperty(ahasFriend) ObjectPrope
rty(aisFriendOf inverseOf(ahasFriend)) Disjoin
tClasses(aStudent aAcademic)
- We have some basic classes, Person, Academic,
Professor and Student. - There is also a subclass of Happy Persons.
- Students and Academics are disjoint.
22Example Individuals
Individual(aarthur type(aStudent)
type(aHappy)) Individual(abob type(aStudent)
type(complementOf(aHappy))) Individual(acharlie
type(aProfessor) type(aHappy))
Individual(adiane type(aProfessor)
type(complementOf(aHappy)))
Professor
Charlie
Diane
Happy
Student
Arthur
Bob
- Note we can infer that Professors and Students
are disjoint due to the disjointness axiom
concerning Academics.
23Example Individuals
Individual(aPatricia value(ahasFriend
aArthur)) Individual(aQuentin value(ahasFriend
aCharlie) value(ahasFriend aBob)) Individual(a
Richard value(ahasFriend aCharlie)) Individual(a
Roberta value(ahasFriend aBob))
- These individuals now provide witnesses for the
non-equivalence of definitions. - restriction(some p intersectionOf(A B ) A
- intersectionOf(restriction(some (p A))
restriction(some (p B))) B - Quentin has a friend who is Happy (Charlie) and a
friend who is a Student (Bob). Quentin is not
known to have a friend who is both Happy and a
Student. - We are able to infer that Quentin is an instance
of A, but not of B.
24Distribution Rules
- Distribution rules for universal quantification
are similar to those for and/or - restriction(all p intersectionOf(A B) ?
intersectionOf(restriction(all (p A))
restriction(all (p B))) - There are also inferences that can be drawn
between expressions involving universal
quantification and disjunction - intersectionOf(restriction(all (p A))
restriction(all (p B))) ? unionOf(restriction(al
l (p A)) restriction(all (p B))) - restriction(all p intersectionOf(A B) ?
unionOf(restriction(all (p A)) restriction(all (p
B))) - unionOf(restriction(all (p A)) restriction(all (p
B))) ? restriction(all p unionOf(A B) - Again, the above inferences are not logical
equivalences. - Intersection is distributive in existentials,
union is not.
25Closed and Open Worlds
- In our previous examples, we find that Patricia
is not an instance of - restriction(all friends intersectionOf(Student
Happy)) - This is due to the open world assumption (OWA).
- We cannot assume that if we dont know something
then it is false. - In this example, there may be other friends that
Patricia has that are not Students. - Reasoning in DLs is monotonic
- If we know that x is an instance of A, then
adding more information to the model cannot cause
this to become false.
26Example Individuals
Individual(aXanthe type(restriction(ahasFriend
cardinality(1))) value(ahasFriend aArthur))
Individual(aYolanda type(restriction(ahasFriend
cardinality(2))) value(ahasFriend aCharlie)
value(ahasFriend aBob)) Individual(aZaphod
type(restriction(ahasFriend cardinality(1)))
value(ahasFriend aCharlie)) Individual(aZeke
type(restriction(ahasFriend cardinality(1)))
value(ahasFriend aBob))
- The above individuals have extra cardinality
constraints that close the roles and allow us to
make inferences about all the friends that they
have. - So Xanthe is now an instance of
- restriction(all friends intersectionOf(Student
Happy))
27Billy No Mates
Individual(aWilliam type(restriction(ahasFriend
cardinality(0))))
- William has no friends.
- But William is an instance of
- restriction(all friends intersectionOf(Student
Happy)) - restriction(all friends unionOf(Student Happy))
- In fact hes an instance of
- restriction(all friends X)
- For any X (even Nothing).
- Universal quantification over an empty collection
is trivially true.
28UNA revisited
Individual(aFred type(restriction(ahasFriend
cardinality(1))) value(ahasFriend aJohn)
value(ahasFriend aJack)) Individual(aJohn)
Individual(aJack)
- Fred has exactly one friend.
- Fred has a friend John and friend Jack
- This allows us to infer that John and Jack must
be the same person. - Recall that this inference would not drawn by
many DL reasoners (including the current
implementation of RACER) instead in this case
an inconsistency will be deduced.