Protégé

advertisement
Version 4.0 beta



Free, open-source ontology editor and
knowledge-base framework
Based on Java, is extensible, and provides a
plug-and-play environment
Supported by a strong community of
developers and academic, government and
corporate users



Pure OWL Framework
Supports both OWL1.1 and OWL 2.0
Direct connection with OWL Reasoners
◦ Pellet
◦ FaCT++

Homepage
◦ http://protege.stanford.edu/

Download
◦ http://protege.stanford.edu/download/protege/4.0
/installanywhere/

Documentation
◦ http://protegewiki.stanford.edu/index.php/Protege
4UserDocs

Plugins
◦ http://code.google.com/p/co-ode-owlplugins/downloads/list?can=3
With Protégé 4.0 beta

Classes
◦ Sets that contain individuals
◦ Thing
 Class representing the set containing all individuals
 All classes are subclasses of Thing

Properties
◦ Binary relations between two individuals (Object
Property) or one individual and a datatype (Datatype
Property)

Individuals
◦ Represent objects within the Ontology (members of
classes)

OWL does not use the Unique Name
Assumption (UNA)
◦ This means that different names may refer to the
same individual
◦ E.g. the names “Matt” and “Matthew” may refer to
the same individual (or they may not)

Cardinality restrictions rely on ‘counting’
distinct individuals
◦ Therefore it is important to specify that either
“Matt” and “Matthew” are the same individual, or
that they are different individuals

OWL Classes are assumed to ‘overlap’
◦ Individuals of a class A can also be individuals of
class B
◦ Therefore one cannot assume that an individual is
not a member of a particular class simply because it
has not been asserted to be a member of that class

To ‘separate’ a group of classes
◦ One must make them disjoint from one another
◦ If A is disjoint from B, then an individual of class A
cannot also be an individual of class B




The information
contained within the
ontology is incomplete
It is assumed there can
always be more
information
Something does not
hold unless it is
explicitly stated
E.g. The information
on the Semantic Web
Open World Assumption




The information
contained within the
ontology is complete
It is assumed the
information available is
everything
Something does not
hold by not been
stated
E.g. The information
within a Database
Close World Assumption



Pizza
PizzaBase
PizzaTopping
Make all sibling classes disjoint from each other
Using the Tools->“Create class Hierarchy…”


Select PizzaBase as root class
Add classes
◦ ThinAndCrispyBase
◦ DeepPanBase
Using the Tools->“Create class Hierarchy…”

CheeseTopping

◦ MozzarellaTopping
◦ ParmezanTopping

MeatTopping
◦
◦
◦
◦
HamTopping
PepperoniTopping
SalamiTopping
SpicyBeefTopping
SeafoodTopping
◦ AnchovyTopping
◦ TunaTopping

VegetableTopping
◦
◦
◦
◦
OliveTopping
OnionTopping
PepperTopping
TomatoTopping
Meaning: All individuals that are members of the class
TomatoTopping are members of the class VegetableTopping
and members of the class PizzaTopping…

Object Properties
◦ Relationships between two individuals
◦ Correspond to relationships in UML

Datatype Properties
◦ Relationships between an individual and data values
◦ Correspond to attributes in UML

Domain and Range

Characteristics
◦ Properties link individuals from the domain to
individuals or datatypes from the range
◦ Specify the meaning of properties

Restrictions

Super Properties
◦ Explained latter
◦ Properties can be further refined as subproperties inheriting the domain, range,
characteristics and restrictions

Functional (single valued properties)
◦ There can be at most one individual (range) that is
related to the domain individual via the property.
◦ e.g. A person only has one mother.

Inverse Functional
◦ The inverse property is functional (which does not
mean that the property is functional).

Transitive: P(A,B) and P(B,C) -> P(A,C)
◦ If a property P is transitive, and the property relates individual A
to individual B, and also individual B to individual C,
◦ Then we can infer that individual A is related to individual C via
property P.
◦ Notes
 If a property is transitive then its inverse property should also be
transitive
 If a property is transitive then it cannot be functional.
◦ e.g. An ancestor of a person’s father is also his ancestor.

Symmetric: P(A,B) -> P(B,A)
◦ If a property P is symmetric, and the property relates individual A
to individual B
◦ Then individual B is also related to individual A via property P.
◦ e.g. Two sibling persons are siblings with each other.

Antisymmetric:
P(A,B) -> ∼P(B,A)
◦ If a property P is antisymmetric, and the property relates
individual A to individual B then individual B cannot be
related to individual A via property P
◦ e.g. If a person is parent of its child, then its child never can be a
parent of that person.

Reflexive:
P(A,A)
◦ A property P is said to be reflexive when the property must
relate individual A to itself
◦ e.g. A Person always knows herself.

Irreflexive
◦ If a property P is irreflexive, it can be described as a
property that relates an individual A to individual B, where
individual A and individual B are not the same.
◦ e.g. A Person cannot be father of himself.

Domain
◦ Classes of Individuals

Range

Characteristics that
can be applied
◦ Classes of Individuals
◦
◦
◦
◦
◦
◦
◦
Functional
Inversed Functional
Transitive
Symmetric
Antisymmetric
Reflexive
Irreflexive

Inverted Properties
◦ If some property links
individual A to individual
B then its inverse
property will link
individual B to individual
A
◦ E.g. hasIngredient versus
isIngredientOf

hasIngredient
◦ hasTopping
◦ hasBase
Pizza Ingredients

isIngredientOf
◦ isToppingOf
◦ isBaseOf
Ingredients that make up
the Pizza

Maintain hasIngredient
domain and range as
Thing
◦ Since hasIngredient is to
be set as transitive
◦ Thus the domain and range
must be compatible


Specify the range for
hasTopping to
PizzaTopping
Specify the range for
hasBase to PizzaBase
Domain & Ranges


Make isIngredientOf
properties inverse of
hasIngredient
Make the hasIngredient
property transitive
◦ A ingredient of an
ingredient, is also an
ingredient of a Pizza

Make the hasBase
property functional
◦ A Pizza has only one base
Property Characteristics

Domain
◦ Classes of Individuals

Range
◦ XML Schema Datatype value
(http://www.w3.org/TR/xmlschema-2/)
◦ RDF literal
◦ XML literal

Characteristics that can be applied
◦ Functional

Cannot have Inverted Properties


Create a hasCalorificContentValue datatype
property with integer as range
Create a hasBaseProperty for PizzaBase (domain)
◦ Create a hasWidth datatype sub-property of
hasBaseProperty with integer as range
◦ Create a hasThickness datatype sub-property of
hasBaseProperty with float as range

Change characteristics to Functional of the
datatype properties
◦ hasCalorificContentValue
◦ hasWidth
◦ hasThickness

Type

◦ Specifies the class(es)
which it is an instance


◦ Specify relations over a
given object property
Same Individuals
◦ Relation between two
individuals which are
“clones” of each other
Different Individuals
Object Property
Assertions

Data Property
Assertions
◦ Specify relations over a
given datatype property
◦ Relation between two
individuals independent
individuals
Description
Property Assertions

Create a class called Country and populate it with
some individuals
◦ Italy, America, England, France, and Germany

Create example pizza individuals
◦ “Example-Margherita” with calorific value of 263 (integer)
◦ “QuattroFormaggio” with calorific value of 723 (integer)

Create a MozzarellaTopping individual

A restriction describes an anonymous
(unnamed) class
◦ The set of subclasses and individuals that satisfy
the given restriction

Applies to
◦ Classes
◦ Object Properties
◦ Datatype Properties

Quantifier Restrictions
◦ Effectively puts constraints on the relationships that the
individual participates in by
 Specifying that at least one kind (existential) of relationship
must exist, or
 e.g. Pizza hasTopping some TomatoTopping
 Specifying the only kinds (universal) of relationships that can
exist (if they exist)
 e.g. Pizza hasBase only PizzaBase

Cardinality Restrictions
◦ Specify the number of relationships that an individual may
participate in for a given property
◦ Comes in three flavors: Min, Max and Exact

Value Restrictions (covered latter)
◦ Specifies a object property relation to a specific individual

Specify that Pizza only has one PizzaBase

Specify that Pizza has at least one PizzaTopping

Create a value restriction to specify that
MozzarellaTopping has Italy as its country of origin
◦ Add a cardinality restriction to Pizza on hasBase to exactly one
PizzaBase
◦ Add to the superclasses section “hasBase exactly 1 PizzaBase”
◦ Add an existencial restriction to Pizza on hasTopping to
PizzaToppings
◦ Add to the superclasses section “hasTopping some PizzaTopping”
◦ Create hasCountryOfOrigin object property with Country as range
◦ Add to the superclass section “hasCountryOfOrigin value Italy”




If an individual is a member
of class A it must satisfy the
conditions (necessary)
One-way implication
Restrictions in the
“superclass” section
Used for checking
Consistency!





Necessary
If an individual is a member
of the class A it must satisfy
the conditions (necessary)
And if any individual
satisfies these conditions
then it must be a member
of class A (sufficient)
Two-way implication
Restrictions in the
“equivalent class” section
Used for assertion
(Classification)!
Necessary & Sufficient

A covering axiom consists of two parts
◦ The class that is being ‘covered’
 The class is equivalent to one of its subclasses
◦ The classes that form the covering
 All subclasses must be disjoint

Create a ValuePartition to represent the
spiciness of pizza toppings
◦ Create a subclass of Thing called “Spiciness”
◦ Create three new classes (Hot, Medium, and Mild)
as subclasses of “Spiciness”
◦ Make all subclasses disjoint


Create an object property called hasSpiciness
with Spiciness as range
Create a Covering Axiom for Spiciness
◦ Add to the “equivalent classes” section “Hot or
Medium or Mild”

Classes that are defined as the precisely
listing of the individuals that are the
members of the class
◦ e.g. Days of the week (Monday, Tuesday,
Wednesday, Thursday, Friday, Saturday and Sunday)

Make Country an enumerated class
◦ At the restriction to the equivalent class section
◦ Add “{America, England, France, Germany, Italy}”



Some of the common mistakes made when
modelling have been enumerated
They include:
◦ Misuse of property domain and range
◦ Misunderstanding of intersections and other
constructs
◦ Not understanding the Open World Assumption
◦ Misuse/lack of disjoints
See OWL Pizzas: Common errors & common patterns
http://www.co-ode.org/resources/papers/
With Protégé 4.0 beta

A piece of software able to infer logical
consequences from a set of asserted facts or
axioms

Consistency checking
◦ Test whether a class could have instances

Classification
◦ A classifier takes a class hierarchy and places a
class in the class hierarchy
◦ Task of turning implicit definitions already present
in the hierarchy as explicit

Built-in support
◦ Pellet (http://clarkparsia.com/pellet)
◦ FaCT ++(http://owl.man.ac.uk/factplusplus/)

Connection to external reasoners through a
DIG interface






Open-source Java OWL
DL reasoner
Support expressivity of
SROIQ(D)
Supports SWRL rules
Available through AGPL
version 3 licence
Latest version is 2.0.0
rc5
Support in Protégé for
1.5 version
Pellet






New generation and
C++ implementation
of FaCT
Support expressivity of
SROIQ(D)
No support for Rules
Available through GNU
public license
Latest version is 1.2.3
Support in Protégé for
1.2.3 version
FaCT++

Selecting…
◦ Go to the “reasoner” menu and select “Pellet” as
your reasoner

Running…
◦ In the same menu, click “Classify…”
◦ or simply type Ctrl-R

Object Properties
◦ Both isBaseOf and isToppingOf assume the range of its
inverted properties as their domain
 The domain of a property is the range of its inverted
property (and vice-versa)

Datatype Properties
◦ Both hasWidth and hasThickness inherit the
hasBaseProperty domain

Individuals
◦ Individual “MozarellaTopping_1” inherits the object
property hasCountryOfOrigin with “Italy” as range


Add a Probe Class called ProbeInconsistentTopping which is a
subclass of both CheeseTopping and VegetableTopping
Classify…
◦ Inconsistency detected since subclasses of PizzaTopping are
Disjoint.


Remove the disjoint statement between CheeseTopping and
VegetableTopping to see what happens
Classify…
◦ Consistent!

Remember to add disjoint statement at the end and remove
Probe Class


Create a subclass of Pizza called “NamedPizza”
Create Margherita, Americana, American hot and
Soho pizzas as subclasses of named pizza
◦ Margherita Pizza with toppings Mozzarella and Tomato
(add to the “superclasses” section “hasTopping some
TomatoTopping”)
◦ AmericanaPizza with toppings Mozzarella, Tomato and
Pepperoni
◦ AmericanHotPizza with toppings Mozzarella, Tomato,
Pepperoni and Pepper
◦ SohoPizza with toppings Mozzarella, Tomato, Olive and
Parmesan

Make named pizzas disjoint

Create a cheesy pizza class for pizzas with
cheese topping
◦ Create a subclass of Pizza called “CheesyPizza”
◦ Add to the “equivalent classes” section “Pizza and
hasTopping some CheeseTopping”

Classify…
◦ AmericanPizza, AmericanHotPizza,
MargheritaPizza and SohoPizza are now
subclasses of CheesyPizza.

Create a vegetarian pizza that only has
cheese and vegetable toppings
◦ Create a subclass of Pizza called “VegetarianPizza”
◦ Add to the “equivalent classes” section “Pizza and
hasTopping only (CheeseTopping or
VegetableTopping)”

Classify…
◦ Why aren’t MargheritaPizza and SohoPizza
classified as VegetarianPizza?

Remember “Open World Assumption”
◦ We have stated that Margherita pizza has toppings
that are kinds of mozzarella and also kinds of
tomato,
◦ but we did not explicitly say that a margherita pizza
only has these kinds of toppings,
◦ it is assumed that a margherita pizza could have
other toppings…

Solution
 Add a Closure Axiom for all the Existential Axioms

Change MargheritaPizza, AmericanaPizza,
AmericanHotPizza and SohoPizza to specify the toppings
as mandatory
◦ Add to the “equivalent classes” section
◦ MargheritaPizza
 “hasTopping only (MozzarellaTopping or TomatoTopping)”
◦ AmericanaPizza
 “hasTopping only (MozzarellaTopping or TomatoTopping or
PepperoniTopping)”
◦ AmericanHotPizza
 “hasTopping only (MozzarellaTopping or TomatoTopping or
PepperoniTopping or PepperTopping)”
◦ SohoPizza
 “hasTopping only (ParmezanTopping or MozzarellaTopping or
TomatoTopping or OliveTopping)”

Classify…
◦ MargheritaPizza and SohoPizza are now classified as Vegetarian
Pizzas

Create non-vegetarian pizza
◦ Create a subclass of Pizza called
“NonVegetarianPizza”
◦ Make it disjoint from VegetarianPizza
◦ Add to the “equivalent classes” section “Pizza and
not VegetarianPizza”
◦ Make sure all pizza toppings and named pizzas are
disjoint

Classify…
◦ AmericanHotPizza and AmericanaPizza are now
non-vegetarian pizzas

Create a unclosed pizza with Mozzarella topping
◦ Create a subclass of “NamedPizza” called
“UnclosedPizza”
◦ Add to the “superclasses” section “Pizza and hasTopping
some MozzarellaTopping”

Classify…
◦ UnclosedPizza is neither classified as a vegetarian pizza
or non-vegetarian pizza
◦ Why?

Remember “Open World Assumption”
◦ No assumption can be made since unclosed pizza may
or may not have other toppings

Create an Interesting Pizza that has at least
three toppings
◦ Create a subclass of Pizza called “InterestingPizza”
◦ Add to the “equivalent classes” section “Pizza and
hasTopping min 3”

Classify…
◦ AmericanaPizza, AmericanHotPizza and SohoPizza
are now subclasses of InterestingPizza


Remove all disjoint conditions from Pizza
Topping subclasses
Classify…
◦ Why AmericanaPizza, AmericanHotPizza and
SohoPizza stop being classified as Interesting
Pizzas?

Remember “Open World Assumption”
◦ Since the pizza toppings stop being disjoint no
assumption can be made for 3 different kinds of
toppings

Create a high calorie Pizza that has a calorific
value higher than or equal to 400
◦ Create a “HighCaloriePizza” as subclass of Pizza
◦ Add to the “equivalent classes” section “”

Create a low calorie Pizza that has a calorific
value lower than 400
◦ Create a “LowCaloriePizza” as subclass of Pizza
◦ Add to the “equivalent classes” section “”

Classify…

Create a Italian Topping for toppings with
Italy as country of origin
◦ Create Italian Topping class as subclass of Pizza
Topping
◦ Add to the “equivalent class” section “PizzaTopping
and hasCountryOfOrigin Italy”


Check that Mozzarella Topping is from Italy
Classify…
◦ Mozzarella Topping is now an Italian Topping

Create a individual topping from Italy
◦ Create a new individual called “ItalianTopping_1” of
class Pizza Topping
◦ Specify the “hasCountryOfOrigin” property to “Italy”

Classify…
◦ “ItalianTopping_1” is now a member of class Italian
Topping
Download