tutorial

106
Tutorial Le Phuoc Son Hoang Huu Hanh Hue University

Upload: rosina

Post on 24-Feb-2016

54 views

Category:

Documents


0 download

DESCRIPTION

Tutorial. Le Phuoc Son Hoang Huu Hanh Hue University. What is Protégé?. Protégé is a free, open-source platform Provides a suite of tools to construct domain models and knowledge-based applications with ontologies - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Tutorial

Tutorial

Le Phuoc SonHoang Huu Hanh

Hue University

Page 2: Tutorial

What is Protégé? • Protégé is a free, open-source platform• Provides a suite of tools to construct domain

models and knowledge-based applications with ontologies

• Support the creation, visualization, and manipulation of ontologies in various representation formats.

Page 3: Tutorial

What is Protégé? The Protégé platform supports two main ways of modeling ontologies:

• The Protégé-Frames editor • The Protégé-OWL editor

Page 4: Tutorial

Protégé-OWLThe Protégé-OWL editor enables users to:

• Load and save OWL and RDF ontologies.• Edit and visualize classes, properties, and

SWRL rules.• Define logical class characteristics as OWL

expressions.• Execute reasoners such as description logic

classifiers.• Edit OWL individuals for Semantic Web

markup.

Page 5: Tutorial

Download Protégé-OWLhttp://protege.stanford.edu/

• Protégé 4 - support for OWL 2.0• Protégé 3 - support for OWL 1.0, RDF(S), and

Frames

Page 6: Tutorial

Protégé-OWL 3.4.1

Page 7: Tutorial

Install Protégé-OWL 3.4.1

• Select “Basic + OWL” in the installation Wizard

Page 8: Tutorial

Protégé User Interface

Page 9: Tutorial

Properties Tab

Page 10: Tutorial

Individuals Tab

Page 11: Tutorial

Saving Projects

Page 12: Tutorial

Building an OWL Ontology

Page 13: Tutorial

Components of OWL Ontologies

• Individuals: represent objects in the domain that we are interested in.

Page 14: Tutorial

Components of OWL Ontologies

• Properties: binary relations on individuals.

Page 15: Tutorial

Components of OWL Ontologies

• Classes: sets that contain individuals.

Page 16: Tutorial

Building an OWL Ontology • Start Protégé• When the Create

New Project dialog box appears, select ‘OWL/RDF Files’ from the ‘Project Type’ list section.

Page 17: Tutorial

Building an OWL Ontology • Specify a URI for

this ontology.

Pizza Ontology

Page 18: Tutorial

Building an OWL Ontology • Select which

elements of OWL and RDF you want to use in your project.

Page 19: Tutorial

Creating named class• Select the Classes tab use the ‘Create subclass’

to create Pizza, PizzaBase and PizzaTopping.• Ensuring that owl:Thing is selected before the

‘Create subclass’ button is pressed;• Rename the class using the ‘Class editor

widget’.

Page 20: Tutorial

Creating named class

Page 21: Tutorial

Creating named class

The Initial Class Hierarchy

Page 22: Tutorial

Disjoint Classes• 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.

Page 23: Tutorial

Disjoint Classes• Select the class Pizza in the class hierarchy.• Press the ‘Add all siblings...’ button on the

disjoint classes widget.

Page 24: Tutorial

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.

Page 25: Tutorial

Using The OWL Wizards To Create Classes

• Use the ‘Create multiple subclasses...’ Wizard to create ThinAndCrispy and DeepPan as subclasses of PizzaBase.

Page 26: Tutorial

Using The OWL Wizards To Create Classes

Page 27: Tutorial

Using The OWL Wizards To Create Classes

Page 28: Tutorial

Using The OWL Wizards To Create Classes

Page 29: Tutorial

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: RedPepperTopping, GreenPepperTopping and JalapenoPepperTopping.

• CheeseTopping: MozzarellaTopping, ParmezanTopping.

• SeafoodTopping: TunaTopping, AnchovyTopping and PrawnTopping.

Page 30: Tutorial

ClassHierarchy

Page 31: Tutorial

Meaning of subClasses

Page 32: Tutorial

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 XML

Schema Datatype 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.

Page 33: Tutorial

The DifferentTypes of

OWL Properties

Page 34: Tutorial

Create Properties

Page 35: Tutorial

Create Properties

Page 36: Tutorial

Create subProperties

Page 37: Tutorial

Inverse Properties

Page 38: Tutorial

Inverse Properties

Page 39: Tutorial

Inverse Properties

Page 40: Tutorial

Inverse PropertiesisToppingOf < - - > hasTopping

Page 41: Tutorial

Functional Properties

Property CharacteristicsWidget

Page 42: Tutorial

Inverse Functional Properties

Page 43: Tutorial

Transitive Properties

Page 44: Tutorial

Transitive Properties

Page 45: Tutorial

Symmetric Properties

Page 46: Tutorial

Property Domain and Range

The domain and range for the hasTopping property and its inverse

property isToppingOf

Page 47: Tutorial

Property Domain and Range

Specify the range of hasTopping

Range Widget

Page 48: Tutorial

Property Domain and Range

Specify the domain of hasTopping

Domain Widget

Page 49: Tutorial

Property Domain and Range

Specify the domain of isToppingOf

=> Specify the domain and range for the hasBase property and its inverse property

isBaseOf

Page 50: Tutorial

Describing and Defining Class

• Property Restrictions- Quantifier Restrictions- Cardinality Restrictions- hasValue Restrictions.

Page 51: Tutorial

Describing and Defining Class

• Quantifier Restrictions- The existential quantifier, which can be read as at least one, or some.- The universal quantifier, which can be read as only

Page 52: Tutorial

Existential Restrictions

The Restriction hasTopping Mozzarella. This restriction describes the class of individuals that have at least one topping that is Mozzarella. The restriction describes an

anonymous (unnamed) class of individuals that satisfy the restriction.

Page 53: Tutorial

Existential Restrictions

Conditions Widget

Page 54: Tutorial

Existential Restrictions

Add a restriction to Pizza that specifies a Pizza must have a

PizzaBase

Type PizzaBase or ...

Page 55: Tutorial

Existential Restrictions

Conditions Widget: Description of a Pizza

Page 56: Tutorial

Existential Restrictions

In order for something to be a Pizza it is necessary for it to have a (at least one)

PizzaBase

Page 57: Tutorial

Creating Some Different Kinds Of Pizzas

Create a subclass of Pizza called NamedPizza, and a subclass of NamedPizza

called MargheritaPizza

Page 58: Tutorial

Creating Some Different Kinds Of Pizzas

Create an existential restriction on MargheritaPizza to specify that a MargheritaPizza has at least one

MozzarellaTopping

Page 59: Tutorial

Creating Some Different Kinds Of Pizzas

Create an existential restriction on MargheritaPizza to specify that a MargheritaPizza has at least one

TomatoTopping

Page 60: Tutorial

Creating Some Different Kinds Of Pizzas

Create AmericanaPizza by cloning and modifying the description of MargheritaPizza

Page 61: Tutorial

Creating Some Different Kinds Of Pizzas

Create AmericanaPizza by cloning and modifying the description of MargheritaPizza

Page 62: Tutorial

Creating Some Different Kinds Of Pizzas

Create an AmericanHotPizza and a SohoPizza

• An AmericanHotPizza is almost the same as an AmericanaPizza, but has Jalapeno peppers on it—create 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, one with a filler of OliveTopping, and one with a filler of ParmezanTopping.

Page 63: Tutorial

Creating Some Different Kinds Of Pizzas

Create an AmericanHotPizza and a SohoPizza

Page 64: Tutorial

Creating Some Different Kinds Of Pizzas

Create an AmericanHotPizza and a SohoPizza

Page 65: Tutorial

Creating Some Different Kinds Of Pizzas

Make subclasses of NamedPizza disjoint from each other

Page 66: Tutorial

Using a Reasoner• compute the inferred ontology class hierarchy• consistency checking

Determining the OWL Sub-Language

Page 67: Tutorial

Using a Reasoner

Page 68: Tutorial

Inconsistent Classes

Add a Probe Class called ProbeInconsistentTopping which is a subclass of

both CheeseTopping and Vegetable

Page 69: Tutorial

Inconsistent Classes

The Class ProbeInconsistentTopping found to be inconsistent by the reasoner

Page 70: Tutorial

Inconsistent Classes

Remove the disjoint statement between CheeseTopping and

VegetableTopping, what happens?

Page 71: Tutorial

Necessary And Sufficient Conditions (Primitive and

Defined Classes)• All of the classes that we have created so far

have only used necessary conditions to describe them.

• Necessary conditions can be read as, “If something is a member of this class then it is necessary to fulfil these conditions”.

• With necessary conditions alone, we cannot say that, “If something fulfils these conditions then it must be a member of this class”.

• A class that only has necessary conditions is known as a Primitive Class.

Page 72: Tutorial

Create a subclass of Pizza called CheesyPizza and specify that it has at least one topping that is a

kind of CheeseTopping

Necessary And Sufficient Conditions (Primitive and

Defined Classes)

Page 73: Tutorial

Convert the necessary conditions for CheesyPizza into necessary & sufficient conditions

Necessary And Sufficient Conditions (Primitive and

Defined Classes)

Page 74: Tutorial

Use the reasoner to automatically compute the subclasses of CheesyPizza

Necessary And Sufficient Conditions (Primitive and

Defined Classes)

Page 75: Tutorial

Download and install a recent version of Graphviz:

http://www.graphviz.org

OWLViz

Page 76: Tutorial

OWLViz Displaying the Asserted Hierarchy for CheesyPizza

OWLViz

Page 77: Tutorial

OWLViz Displaying the Inferred Hierarchy for CheesyPizza

OWLViz

Page 78: Tutorial

Create a class to describe a VegetarianPizza

Universal Restrictions

Page 79: Tutorial

Create a class to describe a VegetarianPizza

Universal Restrictions

Page 80: Tutorial

Convert the necessary conditions for VegetarianPizza into necessary & sufficient

conditions

Universal Restrictions

Page 81: Tutorial

Closure Axioms• Press the ‘Classify taxonomy’ button.• You will notice that MargheritaPizza and also

SohoPizza have not been classified as subclasses of VegetarianPizza

Page 82: Tutorial

Add a closure axiom on the hasTopping property for MargheritaPizza

Closure Axioms

Page 83: Tutorial

Add a closure axiom on the hasTopping property for SohoPizza

Closure Axioms

Page 84: Tutorial

Automatically create a closure axiom on the hasTopping property for AmericanaPizza

Closure Axioms

Page 85: Tutorial

Automatically create a closure axiom on the hasTopping property for AmericanHotPizza

Closure Axioms

Page 86: Tutorial

Use the reasoner to classify the ontology

Closure Axioms

Page 87: Tutorial

Visualizating in OWLViz

Closure Axioms

Page 88: Tutorial

Visualizating in OWLViz

Closure Axioms

Page 89: Tutorial

Value Partitions

to refine our descriptions of various classes.

Page 90: Tutorial

Value Partitions

Create a ValuePartition to represent the spiciness of pizza toppings

Page 91: Tutorial

Value Partitions

Create a ValuePartition to represent the spiciness of pizza toppings

Page 92: Tutorial

Value Partitions

Create a ValuePartition to represent the spiciness of pizza toppings

Page 93: Tutorial

Value Partitions

Create a ValuePartition to represent the spiciness of pizza toppings

Page 94: Tutorial

Using Quick Restriction Editor

Use the properties matrix wizard to specify the spiciness of pizza toppings

Page 95: Tutorial

Using Quick Restriction Editor

Use the properties matrix wizard to specify the spiciness of pizza toppings

Page 96: Tutorial

Using Quick Restriction Editor

Use the properties matrix wizard to specify the spiciness of pizza toppings

Page 97: Tutorial

Using Quick Restriction Editor

Use the properties matrix wizard to specify the spiciness of pizza toppings

Page 98: Tutorial

Using Quick Restriction Editor

Use the properties matrix wizard to specify the spiciness of pizza toppings

Page 99: Tutorial

Creating Individuals

The Individuals Tab

Page 100: Tutorial

Creating Individuals

Create a class called Country and populate it with some individuals

Page 101: Tutorial

Creating Individuals

Create a class called Country and populate it with some individuals

Page 102: Tutorial

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 hasCountryOfOrigin Italy (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.

Page 103: Tutorial

hasValue Restrictions

Create a hasValue restriction to specify that MozzarellaTopping has Italy as its country of

origin

Page 104: Tutorial

hasValue Restrictions

Create a hasValue restriction to specify that MozzarellaTopping has Italy as its country of

origin

Page 105: Tutorial

hasValue Restrictions

Create a hasValue restriction to specify that MozzarellaTopping has Italy as its country of

origin

Page 106: Tutorial

Thanks for your attention