Забыли?

?

OWLPartIIv1

код для вставкиСкачать
```A Practical Introduction to
Ontologies & OWL
Session 2: Defined Classes and Additional
Modelling Constructs in OWL
O p en G A LEN
BioHealth
Informatics
Group
Ontogenesis Network Tutorial
Overview
в–є Defined Classes
в–є Untangling
в–є Defining Vegetarian Pizzas
в–є Union Classes
в–є Universal Restrictions
в–є The Open World Assumption
в–є Closure
Ontogenesis Network Tutorial
CheeseyPizza
в–є A CheeseyPizza is any pizza that has some
cheese on it
в–є We would expect then, that some pizzas might
be named pizzas and cheesey pizzas (among
other things later on)
в–є We can use the reasoner to help us produce this
polyhierarchy without having to assert multiple
parents
Ontogenesis Network Tutorial
Creating a CheeseyPizza
в–є
We normally create primitive classes and then migrate them
to defined classes
в–є
All of our defined pizzas will be direct subclasses of Pizza
в–є
So, we create a CheesyPizza Class (do not make it disjoint)
вЂњEvery CheeseyPizza must have at least one CheeseToppingвЂќ
в–є
Classifying shows that we currently donвЂ™t have enough
information to do any classification
в–є
We then move the
conditions from the
Necessary block to the
Necessary & Sufficient
block which changes the
meaning
в–є
And classify againвЂ¦
Ontogenesis Network Tutorial
Reasoner Classification
в–є The reasoner has been able to infer that anything that is a
Pizza that has at least one topping from CheeseTopping is a
CheeseyPizza
в–є The inferred hierarchy is
updated to reflect this and
moved classes are highlighted
in blue
Ontogenesis Network Tutorial
Why?
Necessary & Sufficient Conditions
в–є Each set of necessary & sufficient conditions is an Equivalent
Class
Pizza
пЂ¤ hasTopping
CheeseTopping
CheeseyPizza
в–є CheeseyPizza is equivalent to the intersection of Pizza and пЂ¤
hasTopping CheeseTopping
в–є Classes, all of whose individuals fit this definition are found
to be subclasses of CheeseyPizza, or are subsumed by
CheeseyPizza
Ontogenesis Network Tutorial
Untangling
в–є We can see that certain Pizzas are
now classified under multiple parents
в–є MargheritaPizza can be found under
both NamedPizza and CheeseyPizza
in the inferred hierarchy
Mission Successful!
Ontogenesis Network Tutorial
Untangling
в–є However, our unclassified version of the ontology is
a simple tree, which is much easier to maintain
в–є WeвЂ™ve now got a polyhierarchy without asserting
multiple superclass relationships
в–є Plus, we also know why certain pizzas have been
classified as CheeseyPizzas
Ontogenesis Network Tutorial
Untangling
в–є We donвЂ™t currently have many kinds of primitive
pizza but its easy to see that if we had, it would
have been a substantial task to assert
CheeseyPizza as a parent of lots, if not all, of them
в–є And then do it all over again for other defined
classes like MeatyPizza or whatever
Ontogenesis Network Tutorial
Viewing polyhierarchies
в–є As we now have
multiple inheritance,
the tree view is less
our вЂњhierarchyвЂќ
Ontogenesis Network Tutorial
Viewing our Hierarchy
Graphically
Ontogenesis Network Tutorial
OWLViz Tab
Show All Classes
View Asserted Model
View Inferred Model
Polyhierarchy
tangle
Ontogenesis Network Tutorial
Using OWLViz to untangle
в–є The asserted hierarchy should, ideally, be a tidy
tree of disjoint primitives
в–є The inferred hierarchy will be tangled
в–є By switching from the asserted to the inferred
hierarchy, it is easy to see the changes made by
the reasoner
в–є OWLViz can be used to spot tangles in the primitive
tree and also disjoints (including inherited ones) are
marked (with a В¬)
Ontogenesis Network Tutorial
Defined Classes
в–є WeвЂ™ve created a Defined Class, CheeseyPizza
в–є It has a definition. That is at least one Necessary and Sufficient
condition
в–є Classes, all of whose individuals satisfy this definition, can be inferred to
be subclasses
в–є Therefore, we can use it like a query to вЂњcollectвЂќ subclasses that satisfy
its conditions
в–є Reasoners can be used to organise the complexity of our hierarchy
в–є ItвЂ™s marked with an equivalence symbol in the interface
в–є Defined classes are rarely disjoint
Ontogenesis Network Tutorial
Exercise 5: Define a
MeatyPizza
Ontogenesis Network Tutorial
Define a Vegetarian Pizza
в–є Not as easy as it looksвЂ¦
в–є Define in words?
в–є вЂњa pizza with only vegetarian toppingsвЂќ?
в–є вЂњa pizza with no meat (or fish) toppingsвЂќ?
в–є вЂњa pizza that is not a MeatyPizzaвЂќ?
в–є More than one way to model this
Ontogenesis Network Tutorial
Define a Vegetarian Pizza
To be able to define a vegetarian pizza as
a Pizza with only Vegetarian Toppings
we need:
1. To be able to create a vegetarian topping
This requires a Union Class
2. To be able to say вЂњonlyвЂќ
This requires a Universal Restriction
Ontogenesis Network Tutorial
Union Classes
в–є aka вЂњdisjunctionвЂќ
в–є This OR That OR TheOther
в–є This
That
TheOther
A B includes all
individuals of class A and
all individuals from class B
and all individuals in the
overlap (if A and B are
not disjoint)
A
B
в–є Commonly used for:
в–є Covering axioms
в–є Closure
Ontogenesis Network Tutorial
Covering Axioms
в–є Covering axiom вЂ“ a union expression containing several
covering classes
в–є A covering axiom in the Necessary & Sufficient Conditions
of a class means:
the class cannot contain any instances other than those
from the covering classes
в–є NB. If the covering classes are subclasses of the covered
class, the covering axiom only needs to be a Necessary
condition вЂ“ it doesnвЂ™t harm to make it Necessary &
Sufficient though вЂ“ its just redundant
Ontogenesis Network Tutorial
Covering PizzaBase
PizzaBase п‚є ThinAndCrispy
DeepPan
PizzaBase
в–є In this example, the class
PizzaBase is covered by
ThinAndCrispy or DeepPan
ThinAndCrispy
DeepPan
в–є вЂњAll PizzaBases must be
ThinAndCrispy or DeepPanвЂќ
в–є вЂњThere are no other types of
PizzaBaseвЂќ
Ontogenesis Network Tutorial
Exercise 6: Define a
VegetarianTopping
Ontogenesis Network Tutorial
Universal Restrictions
в–є We need to say our VegetarianPizza can only have
toppings that are vegetarian toppings
в–є We can do this by creating a Universal or
AllValuesFrom restriction
в–є WeвЂ™ll first look at an exampleвЂ¦
Ontogenesis Network Tutorial
Real Italian Pizzas
в–є вЂњRealItalianPizzas only have bases that are
ThinAndCrispyвЂќ
в–є A Universal Restriction is
Existential one, but the
restriction type is different
в–є For now, this can be primitive вЂ“ you can make it
defined if you like
Ontogenesis Network Tutorial
What does this mean?
в–є We have created a restriction: пЂў hasBase ThinAndCrispy
on Class RealItalianPizza as a necessary condition
RealItalianPizza
ThinAndCrispy
в–є вЂњIf an individual is a member of this class, it is necessary
that it must only have a hasBase relationship with an
individual from the class ThinAndCrispyвЂќ
Ontogenesis Network Tutorial
What does this mean?
в–є We have created a restriction: пЂў hasBase ThinAndCrispy
on Class RealItalianPizza as a necessary condition
DeepPan
RealItalianPizza
ThinAndCrispy
в–є вЂњNo individual of the RealItalianPizza class can have a base
from a class other than ThinAndCrispyвЂќ
в–є NB. DeepPan and ThinAndCrispy are disjoint
Ontogenesis Network Tutorial
Warning: Trivial Satisfaction
from Class Pizza the following could hold
RealItalianPizza
Trivially
satisfied
by this
individual
ThinAndCrispy
в–є вЂњIf an individual is a member of this class, it is necessary that it
must only have a hasBase relationship with an individual from
the class ThinAndCrispy, or no hasBase relationship at allвЂќ
в–є Universal Restrictions by themselves do not state вЂњat least oneвЂќ
Ontogenesis Network Tutorial
Exercise 7: Create
VegetarianPizza
Ontogenesis Network Tutorial
VegetarianPizza Classification
в–є Nothing classifies under VegetarianPizza
в–є Actually, there is nothing wrong with our definition of
VegetarianPizza
в–є It is actually the descriptions of our Pizzas that are
incomplete
в–є The reasoner has not got enough information to infer that any
Pizza is subsumed by VegetarianPizza
в–є This is because OWL makes the Open World Assumption
Ontogenesis Network Tutorial
Open World Assumption
в–є In a closed world (like DBs), the information we have is
everything
в–є In an open world, we assume there is always more information
than is stated
в–є Where a database, for example, returns a negative if it
cannot find some data, the reasoner makes no assumption
about the completeness of the information it is given
в–є The reasoner cannot determine something does not hold
unless it is explicitly stated in the model
Ontogenesis Network Tutorial
Open World Assumption
в–є Typically we have a pattern of several Existential
restrictions on a single property with different
fillers вЂ“ like primitive pizzas on hasTopping
в–є Existential restrictions should be paraphrased by
вЂњamongst other thingsвЂ¦вЂќ
в–є Must state that a description is complete
в–є We need closure for the given property
Ontogenesis Network Tutorial
Closure
в–є This is in the form of a Universal Restriction with a
filler that is the Union of the other fillers for that
property
в–є Closure works along a single property
Ontogenesis Network Tutorial
Closure example: MargheritaPizza
All MargheritaPizzas must have:
at least 1 topping from MozzarellaTopping and
at least 1 topping from TomatoTopping and
only toppings from MozzarellaTopping or TomatoTopping
в–є The last part is paraphrased into вЂњno other toppingsвЂќ
в–є The union closes the hasTopping property on MargheritaPizza
Ontogenesis Network Tutorial
Exercise 8: Closing Pizzas
Ontogenesis Network Tutorial
в–є You can now plug your pizza ontology into the
PizzaFinder application
Ontogenesis Network Tutorial
Summary
You should now be able to:
в–є Create Defined Classes and classify using a
Reasoner to check expected results
в–є Create Covering Axioms
в–є Close Class Descriptions and understand the Open
World Assumption
Ontogenesis Network Tutorial
Value Partitions
в–є Design pattern вЂ“ solution to a modelling problem
в–є Used then there are number of possible values
в–є It reduces them to an exhaustive list
в–є So far, in our pizza ontology we have not described
how spicy a pizza is (e.g., hot, medium, mild)
Ontogenesis Network Tutorial
Exercise 10: Create a Value
Partition