Upload
nguyende2004
View
248
Download
0
Embed Size (px)
Citation preview
8/3/2019 Protege Tutor Slide
1/107
Tutorial
L Phc Sn
CS Master Course 2008 2010
8/3/2019 Protege Tutor Slide
2/107
what is protg? Protg is a free, open-source platform
Provides a suite of tools to construct domain
models and knowledge-based applications withontologies
Support the creation, visualization, and
manipulation of ontologies in various
representation formats.
8/3/2019 Protege Tutor Slide
3/107
what is protg?The Protg platform supports two main ways of
modeling ontologies:
The Protg-Frames editor
The Protg-OWL editor
8/3/2019 Protege Tutor Slide
4/107
protg-owlThe Protg-OWL editor enables users to:
Load and save OWL and RDF ontologies.
Edit and visualize classes, properties, and SWRLrules.
Define logical class characteristics as OWLexpressions.
Execute reasoners such as description logicclassifiers.
Edit OWL individuals for Semantic Web markup.
8/3/2019 Protege Tutor Slide
5/107
downloa
dprotg-owl
http://protege.stanford.edu/
Protg 4 - support for OWL 2.0
Protg 3 - support for OWL 1.0, RDF(S), and
Frames
8/3/2019 Protege Tutor Slide
6/107
protg-owl3.4.1
8/3/2019 Protege Tutor Slide
7/107
install protg-owl3.4.1
Select Basic + OWL in the installation Wizard
8/3/2019 Protege Tutor Slide
8/107
Protg User Interface
8/3/2019 Protege Tutor Slide
9/107
Properties Tab
8/3/2019 Protege Tutor Slide
10/107
Individuals Tab
8/3/2019 Protege Tutor Slide
11/107
Saving Projects
8/3/2019 Protege Tutor Slide
12/107
Building an OWL Ontology
8/3/2019 Protege Tutor Slide
13/107
Components of OWL Ontologies
Individuals: represent objects in the domain that
we are interested in.
8/3/2019 Protege Tutor Slide
14/107
Components of OWL Ontologies
Properties: binary relations on individuals.
8/3/2019 Protege Tutor Slide
15/107
Components of OWL Ontologies
Classes: sets that contain individuals.
8/3/2019 Protege Tutor Slide
16/107
Building an OWL Ontology
Start Protg
When the Create
New Project dialogbox appears, select
OWL/RDF Files
from the Project
Type list section.
8/3/2019 Protege Tutor Slide
17/107
Building an OWL Ontology
Specify a URI
for this ontology.
Pizza Ontology
8/3/2019 Protege Tutor Slide
18/107
Building an OWL Ontology
Select which
elements of OWL
and RDF you wantto use in your
project.
8/3/2019 Protege Tutor Slide
19/107
Creating named class
Select the classes tab use the Create subclass to
create Pizza, PizzaBase and PizzaTopping.
Ensuring that owl:Thing is selected before theCreate subclass button is pressed;
Rename the class using the Class editor widget.
8/3/2019 Protege Tutor Slide
20/107
Creating named class
8/3/2019 Protege Tutor Slide
21/107
8/3/2019 Protege Tutor Slide
22/107
DisjointClasses
To specify classes that are disjoint from the
selected class the Disjoints widget which is
located in the lower right hand corner of the
OWLClasses tab is used.
8/3/2019 Protege Tutor Slide
23/107
DisjointClasses
Select the class Pizza in the class hierarchy.
Press the Add all siblings... button on the disjoint
classes widget.
8/3/2019 Protege Tutor Slide
24/107
Using The OWL Wizards
To Create Classes
The OWL Wizards plugin is an extensible set of
Wizards that are designed to make carrying out
common, repetitive and time consuming tasks easy.
8/3/2019 Protege Tutor Slide
25/107
Using The OWL Wizards
To Create Classes
Use the Create multiple subclasses... Wizard to
create ThinAndCrispy and DeepPan as subclasses
ofPizzaBase.
8/3/2019 Protege Tutor Slide
26/107
Using The OWL Wizards
To Create Classes
8/3/2019 Protege Tutor Slide
27/107
Using The OWL Wizards
To Create Classes
8/3/2019 Protege Tutor Slide
28/107
Using The OWL Wizards
To Create Classes
8/3/2019 Protege Tutor Slide
29/107
Using The OWL Wizards
To Create Classes
PizzaTopping: MeatTopping, VegetableTopping,
CheeseTopping and SeafoodTopping.
MeatTopping: SpicyBeefTopping, PepperoniTopping,
SalamiTopping, HamTopping. VegetableTopping: TomatoTopping, OliveTopping,
MushroomTopping, PepperTopping, OnionTopping and
CaperTopping.
PepperTopping: RedPepperT
opping, GreenPepperT
oppingand JalapenoPepperTopping.
CheeseTopping:MozzarellaTopping, ParmezanTopping.
SeafoodTopping: TunaTopping, AnchovyTopping and
PrawnTopping.
8/3/2019 Protege Tutor Slide
30/107
ClassHierarchy
8/3/2019 Protege Tutor Slide
31/107
Meaning of subClasses
8/3/2019 Protege Tutor Slide
32/107
OWL Properties
There are two main types of properties, Object properties
and Datatype properties.
Object properties link an individual to an individual.
Datatype properties link an individual to an XM
L SchemaDatatype value or an rdf literal.
OWL also has a third type of property Annotation
properties.
Annotation properties can be used to add information
(metadata data about data) to classes, individuals and
object/datatype properties.
8/3/2019 Protege Tutor Slide
33/107
T
he DifferentTypes of
OWL Properties
8/3/2019 Protege Tutor Slide
34/107
Create Properties
8/3/2019 Protege Tutor Slide
35/107
Create Properties
8/3/2019 Protege Tutor Slide
36/107
Create subProperties
8/3/2019 Protege Tutor Slide
37/107
Inverse Properties
8/3/2019 Protege Tutor Slide
38/107
Inverse Properties
8/3/2019 Protege Tutor Slide
39/107
Inverse Properties
8/3/2019 Protege Tutor Slide
40/107
Inverse Properties
isToppingOf < - - > hasTopping
8/3/2019 Protege Tutor Slide
41/107
Functional Properties
Property Characteristics
Widget
8/3/2019 Protege Tutor Slide
42/107
Inverse Functional Properties
8/3/2019 Protege Tutor Slide
43/107
Transitive Properties
8/3/2019 Protege Tutor Slide
44/107
Transitive Properties
8/3/2019 Protege Tutor Slide
45/107
Symmetric Properties
8/3/2019 Protege Tutor Slide
46/107
Property Domain and Range
The domain and range for the hasTopping
property and its inverse property isToppingOf
8/3/2019 Protege Tutor Slide
47/107
Property Domain and Range
Specify the range of hasT
opping
Range Widget
8/3/2019 Protege Tutor Slide
48/107
Property Domain and Range
Specify the domain of hasT
opping
Domain Widget
8/3/2019 Protege Tutor Slide
49/107
Property Domain and Range
Specify the domain of isToppingOf
-> Specify the domain and range for the hasBase propertyand its inverse property isBaseOf
8/3/2019 Protege Tutor Slide
50/107
Describing andDefiningClass
Property Restrictions
- Quantifier Restrictions
- Cardinality Restrictions
- hasValue Restrictions.
8/3/2019 Protege Tutor Slide
51/107
Describing andDefiningClass
Quantifier Restrictions
- The existential quantifier, which can be read
as at least one, or some.
- The universal quantifier, which can be read asonly
8/3/2019 Protege Tutor Slide
52/107
Existential Restrictions
The Restriction hasToppingMozzarella. This restrictiondescribes the class of individuals that have at least one topping
that isMozzarella. The restriction describes an anonymous
(unnamed) class of individuals that satisfy the restriction.
8/3/2019 Protege Tutor Slide
53/107
Existential Restrictions
Conditions Widget
8/3/2019 Protege Tutor Slide
54/107
Existential Restrictions
Add a restriction to Pizza that specifies a
Pizza must have a PizzaBase
Type PizzaBase or ...
8/3/2019 Protege Tutor Slide
55/107
Existential Restrictions
Conditions Widget: Description of a Pizza
8/3/2019 Protege Tutor Slide
56/107
Existential Restrictions
In order for something to be a Pizza it is necessary for
it to have a (at least one) PizzaBase
8/3/2019 Protege Tutor Slide
57/107
CreatingSome Different Kinds Of
Pizzas
Create a subclass of Pizza called NamedPizza, and a
subclass of NamedPizza calledMargheritaPizza
8/3/2019 Protege Tutor Slide
58/107
CreatingSome Different Kinds Of
Pizzas
Create an existential restriction onMargheritaPizza to
specify that aMargheritaPizza has at least one
MozzarellaTopping
ff d f
8/3/2019 Protege Tutor Slide
59/107
CreatingSome Different Kinds Of
Pizzas
Create an existential restriction onMargheritaPizza to
specify that aMargheritaPizza has at least one
TomatoTopping
C S ff d Of
8/3/2019 Protege Tutor Slide
60/107
CreatingSome Different Kinds Of
Pizzas
Create AmericanaPizza by cloning and modifying the
description ofMargheritaPizza
C S D ff K d Of
8/3/2019 Protege Tutor Slide
61/107
CreatingSome Different Kinds Of
Pizzas
Create AmericanaPizza by cloning and modifying the
description ofMargheritaPizza
C i S Diff Ki d Of
8/3/2019 Protege Tutor Slide
62/107
CreatingSome Different Kinds Of
Pizzas
Create an AmericanHotPizza and a SohoPizza
An AmericanHotPizza is almost the same as an
AmericanaPizza, but has Jalapeno peppers on itcreate this
by cloning the class AmericanaPizza and adding an
existential restriction along the hasTopping property with a
filler of JalapenoPepperTopping.
A SohoPizza is almost the same as a MargheritaPizza but
has additional toppings of olives and and parmezan cheese
create this by cloning MargheritaPizza and adding two
existential restrictions along the property hasTopping, onewith a filler of OliveTopping, and one with a filler of
ParmezanTopping.
C i S Diff Ki d Of
8/3/2019 Protege Tutor Slide
63/107
CreatingSome Different Kinds Of
Pizzas
Create an AmericanHotPizza and a SohoPizza
C i S Diff Ki d Of
8/3/2019 Protege Tutor Slide
64/107
CreatingSome Different Kinds Of
Pizzas
Create an AmericanHotPizza and a SohoPizza
C i S Diff Ki d Of
8/3/2019 Protege Tutor Slide
65/107
CreatingSome Different Kinds Of
Pizzas
Make subclasses of NamedPizza disjoint from each other
8/3/2019 Protege Tutor Slide
66/107
Using a Reasoner
compute the inferred ontology class hierarchy
consistency checking
Determining the OWL Sub-
Language
8/3/2019 Protege Tutor Slide
67/107
Using a Reasoner
8/3/2019 Protege Tutor Slide
68/107
InconsistentClasses
Add a Probe Class called ProbeInconsistentTopping which
is a subclass of both CheeseTopping and Vegetable
8/3/2019 Protege Tutor Slide
69/107
InconsistentClasses
The Class ProbeInconsistentTopping found to be
inconsistent by the reasoner
8/3/2019 Protege Tutor Slide
70/107
InconsistentClasses
Remove the disjoint statement betweenCheeseTopping and VegetableTopping,
what happens?
N A d S ffi i t C diti
8/3/2019 Protege Tutor Slide
71/107
Necessary AndSufficientConditions
(Primitive andDefinedClasses)
All of the classes that we have created so far haveonly used necessary conditions to describe them.
Necessary conditions can be read as, If something
is a member of this class then it is necessary tofulfil these conditions.
With necessary conditions alone, we cannot saythat, If something fulfils these conditions then itmust be a member of this class.
A class that only has necessary conditions is knownas a Primitive Class.
N A d S ffi i t C diti
8/3/2019 Protege Tutor Slide
72/107
Create a subclass of Pizza called CheesyPizza and specify that
it has at least one topping that is a kind of CheeseTopping
Necessary AndSufficientConditions
(Primitive andDefinedClasses)
Necessary And Sufficient Conditions
8/3/2019 Protege Tutor Slide
73/107
Convert the necessary conditions for CheesyPizza into
necessary & sufficient conditions
Necessary AndSufficientConditions
(Primitive andDefinedClasses)
Necessary And Sufficient Conditions
8/3/2019 Protege Tutor Slide
74/107
Use the reasoner to automatically compute the subclasses of
CheesyPizza
Necessary AndSufficientConditions
(Primitive andDefinedClasses)
8/3/2019 Protege Tutor Slide
75/107
Download and install a recent version of Graphviz:
http://www.graphviz.org
OLWViz
8/3/2019 Protege Tutor Slide
76/107
OWLViz Displaying the Asserted Hierarchy for CheesyPizza
OLWViz
8/3/2019 Protege Tutor Slide
77/107
OWLViz Displaying the Inferred Hierarchy for CheesyPizza
OLWViz
8/3/2019 Protege Tutor Slide
78/107
Create a class to describe a VegetarianPizza
Universal Restrictions
8/3/2019 Protege Tutor Slide
79/107
Create a class to describe a VegetarianPizza
Universal Restrictions
8/3/2019 Protege Tutor Slide
80/107
Convert the necessary conditions for VegetarianPizza into
necessary & sufficient conditions
Universal Restrictions
8/3/2019 Protege Tutor Slide
81/107
Closure Axioms
Press the Classify taxonomy button.
You will notice that MargheritaPizza and also
SohoPizza have not been classified as subclasses of
VegetarianPizza
8/3/2019 Protege Tutor Slide
82/107
Add a closure axiom on the hasTopping property for
MargheritaPizza
Closure Axioms
8/3/2019 Protege Tutor Slide
83/107
Add a closure axiom on the hasTopping property for
SohoPizza
Closure Axioms
8/3/2019 Protege Tutor Slide
84/107
Automatically create a closure axiom on the hasTopping
property for AmericanaPizza
Closure Axioms
8/3/2019 Protege Tutor Slide
85/107
Automatically create a closure axiom on the hasTopping
property for AmericanHotPizza
Closure Axioms
8/3/2019 Protege Tutor Slide
86/107
Use the reasoner to classify the ontology
Closure Axioms
8/3/2019 Protege Tutor Slide
87/107
Visualizating in OWLViz
Closure Axioms
8/3/2019 Protege Tutor Slide
88/107
Visualizating in OWLViz
Closure Axioms
8/3/2019 Protege Tutor Slide
89/107
Value Partitions
to refine our descriptions of various classes.
l
8/3/2019 Protege Tutor Slide
90/107
Value Partitions
Create a ValuePartition to represent the spiciness of pizza toppings
l
8/3/2019 Protege Tutor Slide
91/107
Value Partitions
Create a ValuePartition to represent the spiciness of pizza toppings
V l P
8/3/2019 Protege Tutor Slide
92/107
Value Partitions
Create a ValuePartition to represent the spiciness of pizza toppings
V l P
8/3/2019 Protege Tutor Slide
93/107
Value Partitions
Create a ValuePartition to represent the spiciness of pizza toppings
U i Q i k R i i Edi
8/3/2019 Protege Tutor Slide
94/107
Using Quick Restriction Editor
Use the properties matrix wizard to specify the spiciness of
pizza toppings
U i Q i k R i i Edi
8/3/2019 Protege Tutor Slide
95/107
Using Quick Restriction Editor
Use the properties matrix wizard to specify the spiciness of
pizza toppings
U i Q i k R i i Edi
8/3/2019 Protege Tutor Slide
96/107
Using Quick Restriction Editor
Use the properties matrix wizard to specify the spiciness of
pizza toppings
U i Q i k R i i Edi
8/3/2019 Protege Tutor Slide
97/107
Using Quick Restriction Editor
Use the properties matrix wizard to specify the spiciness of
pizza toppings
U i Q i k R t i ti Edit
8/3/2019 Protege Tutor Slide
98/107
Using Quick Restriction Editor
Use the properties matrix wizard to specify the spiciness of
pizza toppings
C ti I di id l
8/3/2019 Protege Tutor Slide
99/107
Creating Individuals
The Individuals Tab
C ti I di id l
8/3/2019 Protege Tutor Slide
100/107
Creating Individuals
Create a class called Country and populate it with some
individuals
C ti I di id l
8/3/2019 Protege Tutor Slide
101/107
Creating Individuals
Create a class called Country and populate it with some
individuals
h V l R t i ti
8/3/2019 Protege Tutor Slide
102/107
hasValue Restrictions
A hasValue restriction, denoted by the symbol ,describes
the set of individuals that have at least one relationship
along a specified property to a specific individual.
For example, the hasValue restriction hasCountryOfOriginItaly (where Italy is an individual) describes the set of
individuals (the anonymous class of individuals) that have at
least one relationship along the hasCountryOfOrigin
property to the specific individual Italy.
h V l R t i ti
8/3/2019 Protege Tutor Slide
103/107
hasValue Restrictions
Create a hasValue restriction to specify that
MozzarellaTopping has Italy as its country of origin
h V l R t i ti
8/3/2019 Protege Tutor Slide
104/107
hasValue Restrictions
Create a hasValue restriction to specify that
MozzarellaTopping has Italy as its country of origin
hasValue Restrictions
8/3/2019 Protege Tutor Slide
105/107
hasValue Restrictions
Create a hasValue restriction to specify that
MozzarellaTopping has Italy as its country of origin
Some different problems
8/3/2019 Protege Tutor Slide
106/107
Some different problems
Will be presented in the next time???
Cardinality Restrictions
Enumerated Classes
Annotation Properties
. . .
8/3/2019 Protege Tutor Slide
107/107
Thanks for your attention