62
In The Name Of Allah

Ontology development in protégé-آنتولوژی در پروتوغه

Embed Size (px)

Citation preview

Page 1: Ontology development in protégé-آنتولوژی در پروتوغه

In The Name Of Allah

Page 2: Ontology development in protégé-آنتولوژی در پروتوغه

Instructor: Dr.Ghasem-Aghaie

Presentation: Mohammad Sadegh Salehi

Ontology Development in

Protégé

Page 3: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Session 1: Ontology And OWL Basics, Syntatic Web,

Problem of Syntatic Web,

Semantic Web,

Ontology and Pizza Example,

OWL,

Session 2: Protégé & Protégé-OWL, What is Protégé?

Protégé and OWL,

Pizza in Protégé ,

Agenda

Page 4: Ontology development in protégé-آنتولوژی در پروتوغه

Ontology and OWL

Page 5: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Hard Work using the Syntactic Web…

Find images of Tim Bray and Alan Rector…

Tim Bray

Sun

Microsystems

Rev. Alan M.

Gates,

Associate

Rector of the

Church of the

Holy Spirit,

Lake Forest,

Illinois

Prof Alan

Rector,

University of

Manchester,

Medical

Informatics

Group

Page 6: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Impossible (?) using the Syntactic Web…

Complex queries involving background knowledge Find information about “animals that use sonar but are not either bats

or dolphins”, e.g., Barn owl

Locating information in data repositories Travel enquiries

Prices of goods and services

Finding and using “web services” Book me a holiday next weekend somewhere warm, not too far

away, and where they speak French or English

Page 7: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

What is the Problem?

Consider a typical web page:

Markup consists of:

Rendering information

(e.g., font size and colour)

Hyper-links to related content

Semantic content is accessible

to humans but not (easily) to

computers…

Page 8: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

What is the Problem?

WWW2002

The eleventh international world wide web conference

Sheraton waikiki hotel

Honolulu, hawaii, USA

7-11 may 2002

1 location 5 days learn interact

Registered participants coming from

australia, canada, chile denmark, france, germany, ghana, hong kong, india, ireland, italy, japan, malta, new zealand,

the netherlands, norway, singapore, switzerland, the united kingdom, the united states, vietnam, zaire

Register now

On the 7 May Honolulu will provide the backdrop of the eleventh international

world wide web conference. This prestigious event …

Speakers confirmed

Tim berners-lee

Tim is the well known inventor of the Web, …

Ian Foster

Ian is the pioneer of the Grid, the next generation internet …

What information can we see…

Page 9: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

What is the Problem?

What information can a machine see…

Page 10: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

What is the Problem?Solution: XML markup with “meaningful” tags?

<name>

</name>

<location>

</location>

<date> </date>

<slogan> </slogan>

<participants>

</participants>

<introduction>

… </introduction>

<speaker> </speaker>

<bio> </bio>…

Page 11: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

What is the Problem?But What About… Machine sees…

<>

</>

<>

</>

<> </>

<> </>

<>

</>

<>

</>

<> </>

<> </>

<> </>

<> </>

Page 12: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Need to Add “Semantics”

Use Ontologies to specify meaning of annotationsOntologies provide a vocabulary of terms

New terms can be formed by combining existing ones

Meaning (semantics) of such terms is formall specified

Can also specify relationships between terms in

Page 13: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Our Domain

Pizzas have been used in Manchester tutorials for years,

Tutorial developed by BioHealth Informatics Group in Manchester,

Page 14: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Pizzas…

are fun

are internationally known

are highly compositional

are limited in scope

are fairly uncontroversial

Page 15: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Pizzas Ontology …

PizzaPizza Topping Pizza_base

Vegetarian

Pizza Vegetable

Topping

Margareta

PizzaTomato

Topping

Cheese

Topping

Spicy Beef

Pizza

Mozzarella

Topping

Deep

Dish base

Regular

base

Page 16: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Is the Web Ontology Language…

is a standard – Web Ontology Language

comes in 3 flavours (lite, DL and full) we are using OWL DL (Description Logic)

DL = decidable fragment of First Order Logic (FOL)

Is used for capturing knowledge in a machine understandable way

Review of OWL

Page 17: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

OWL helps us …

Describe something, rather than just name it.

Class (BlueThing) does not mean anything

Class (BlueThing completeowl:Thing

restriction (hasColour someValuesFrom (Blue)))

Page 18: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

OWL is a syntax independent language that has several common representations

– Abstract Syntax

– N3

– RDF/XML

OWL Syntax

Page 19: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

One of the clearer human-readable syntaxes

OWL Syntax: Abstract Syntax

Class(SpicyPizza complete

annotation(rdfs:label "PizzaTemperada"@pt)

annotation(rdfs:comment "Any pizza that has a spicy topping

is a SpicyPizza"@en)

Pizza

restriction(hasTopping someValuesFrom(SpicyTopping))

)

Page 20: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

OWL Constructs

Person Country

= class (concept)

Animal

= individual (instance)

Belgium

Paraguay

China

Latvia

Elvis

Hai

Holger

Kylie

S.Claus

Rudolph

Flipper

= property (relationship)

Page 21: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé & Protégé-OWL

Page 22: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Developed by Stanford Medical Informatics,

Has a large user community (approx 300k),

Free, open source ontology editor and knowledge-base framework.

What is Protégé?

Page 23: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Based on Java, is extensible,

Provides a plug-and-play environment

Supported by a strong community of developers and academic, government and corporate users

What is Protégé?(Cont.)

Page 24: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Keep in mind that Protégé is...

...not a programming language.

...only a tool. It will not prevent you from making mistakes.

Notice that we will be referring to Protégé 4.3 in this and the following hands-on exercise.

What is Protégé?(Cont.)

Page 25: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Create a new ontology from scratch

Download and extend an existing ontology

Export ontologies in a variety of formats

OWL

RDF

XML Schema

What can you do with Protégé?

Page 26: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Homepage http://protege.stanford.edu/

Download http://protege.stanford.edu/download/protege/4.3/installanywh

ere/

Documentation http://protegewiki.stanford.edu/index.php/Protege4UserDocs

Plugins http://code.google.com/p/co-ode-owl-

plugins/downloads/list?can=3

Get Protégé

Page 27: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Protégé Overview

Page 28: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Classes in OWL

Classes: ‟OWL classes are interpreted as sets.”

Primitive Classes: ‟Classes that only have necessary

conditions”; Example: Animal, Cat…

Defined Classes: ‟A class that has at least one necessary

and sufficient condition”; Example: All things that are biped

and lack feathers.

Page 29: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Classes in Protégé

All classes are subclasses of Thing

Classes overlap by default!

Can use tools menu to create class hierarchies

Page 30: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Properties in OWL

Object Properties

Relationships between two individuals

Correspond to relationships in UML

Examples: is_part_of, is_kissing

Datatype Properties

Relationships between an individual and data values

Correspond to attributes in UML

Examples: has_DateValue, has StringValue

Page 31: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Properties in Protégé

Object or data type

Properties can have

Subproperties

Inverse properties

Page 32: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Protégé Tabs

Protégé tabs

Page 33: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Protégé OWL plugin: Tabs

Used in this tutorial

Changing the GUI

Populating the

model

Top-level

functionality

Extensions

(visualisation)

Page 34: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Classes Tab

Page 35: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

ClassesTab: Asserted Class Hierarchy

Subsumption hierarchy (superclass/subclass)

Structure as asserted by the ontology engineer

Create and Delete classes (actually subclasses!!)

Everything is a subclass of owl:Thing

Search for class

Page 36: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

ClassesTab: Class Editor

Page 37: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

ClassesTab: Class Editor

Class annotations (for class metadata)

Class name and documentation

Properties

“available”

to Class

Disjoints

widget

Conditions Widget

Class-specific tools (find usage etc)

Page 38: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Create Classes

1. Click the “Create Class” button

(this is above the class hierarchy)

A new class will be created as a subclass of owl:Thing

2. Type in a new name “DomainConcept” over the default

(return updates the hierarchy)

3. Req. for later labs: document your class using the rdfs:comment field

4. Create another class called “Pizza” using the same method

You will notice that Pizza has been created as a subclass of

DomainConcept as this was the class selected when the button was

pressed. You can also right-click any class and select “Create Class”

5. Create two more subclasses of DomainConcept called “PizzaTopping”

and “PizzaBase”.

Any mistakes, use the “Delete Class” button next to “Create Class”

Start with your empty ontology

Page 39: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Concept: Disjointness

All classes could potentially overlap

Pizza Ice Cream

= individual

This means an individual could be both a Pizza and a

IceCream at the same time.

Page 40: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Concept: Disjointness

If we state that classes are disjoint

This means an individual cannot be both a Pizza and a Ice

Cream at the same time

We must do this explicitly in the interface

Pizza Ice Cream

= individual

Page 41: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Concept: Disjointness

Add siblings as disjoint

Add new disjoint Remove disjoint siblings

List of disjoint classes

Page 42: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

ClassesCreate Pizza Ontology classes

Pizza

PizzaBase

PizzaTopping

Page 43: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

ClassesPizza Toppings classes

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…

Page 44: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Creating Properties

Properties can be in a hierarchy

Search for property

Create property

Page 45: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Creating Properties

There can be at most one individual (range)

that is related to the domain individual

via the property: “hasMother”

The inverse property is functional:

“hasMother → hasChild”

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: “hasAncestor”

P(A,B) -> P(B,A)

If a property P is symmetric, and the property

relates individual A to individual B : “hasSibling”

Page 46: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Properties in Protégé

Page 47: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

RestrictionsDefinition

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

Page 48: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

RestrictionsAdd restrictions

Specify that Pizza only has one PizzaBase◦ Add a cardinality restriction to Pizza on hasBase to exactly one

PizzaBase◦ Add to the superclasses section “hasBase exactly 1 PizzaBase”

Specify that Pizza has at least one PizzaTopping◦ Add an existencial restriction to Pizza on hasTopping to

PizzaToppings◦ Add to the superclasses section “hasTopping some PizzaTopping”

Create a value restriction to specify that MozzarellaTopping has Italy as its country of origin◦ Create hasCountryOfOrigin object property with Country as range◦ Add to the superclass section “hasCountryOfOrigin value Italy”

Page 49: Ontology development in protégé-آنتولوژی در پروتوغه

With Protégé 4.3

Using a Reasoner

Page 50: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Reasoner - Definition

A piece of software able to infer logical consequences from a set of asserted facts or axioms

Page 51: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Reasoner -Used for

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

Page 52: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Reasoner- Protégé 4.3 support

Built-in support◦ Pellet (http://clarkparsia.com/pellet)

◦ FaCT ++(http://owl.man.ac.uk/factplusplus/)

Connection to external reasoners through a DIG interface

Page 53: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Reasoner - Pellet vs FaCT++

FaCT++Pellet

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

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

Page 54: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

http://protegewiki.stanford.edu/index.php/Protege4UserDocs

Pizzas and other ontologies are available from: www.co-ode.org/ontologies/

W3C Documentation http://www.w3.org/2001/sw/BestPractices/

Ian Horrocks, Sean Bechhofer: http://www.cs.man.ac.uk/~horrocks/Slides/Innsbruck-tutorial/

Practical Guide To Building OWL Ontologies Using Prot´eg´e 4 and CO-ODE Tools, Mathew Horridge, Edition 1.2, 2009,university of manchester

Refrences

Page 55: Ontology development in protégé-آنتولوژی در پروتوغه
Page 56: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Pizzas…

Most often it is not the domain expert that formalises their knowledge

Because of the complexity of the modelling task it is normally a specialist “knowledge engineer” Hopefully, as tools get easier to use, this will change

Having access to experts is critical for most domains

Luckily, we are all experts in Pizzas, so we just need some material to verify our knowledge…

Page 57: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Ontology in Linguistics

Concept

Form

/ SymbolReferent

“semiotic

triangle”activates Relates to

“Tank“

[Ogden, Richards, 1923]

Stands for

“a concept, is the

mediator that relates

the symbol to its

object” John F Sowa

Page 58: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Datatype PropertiesAdd datatype 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

Page 59: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Datatype Properties

Page 60: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Object Properties

Page 61: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Object PropertiesCreate some Object Properties

isIngredientOf◦ isToppingOf

◦ isBaseOf

hasIngredient◦ hasTopping

◦ hasBase

Pizza IngredientsIngredients that make up

the Pizza

Page 62: Ontology development in protégé-آنتولوژی در پروتوغه

Protégé – Winter 2014

Structure of an Ontology

Ontologies typically have two distinct components: Terminology

Names for important concepts in the domain Elephant is a concept whose members are a kind of animal

Herbivore is a concept whose members are exactly those animals who eat only plants or parts of plants

Adult_Elephant is a concept whose members are exactly those elephants whose age is > 20 years

Background knowledge/constraints on the domain: Axioms Adult_Elephants weigh at least 2,000 kg

All Elephants are either African_Elephants or Indian_Elephants

No individual can be both a Herbivore and a Carnivore