daml+oil ontology tutorial chris wroe, robert stevens (sean bechhofer, carole goble, alan rector,...

39
DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Upload: noah-garrison

Post on 23-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

DAML+OIL Ontology Tutorial

Chris Wroe, Robert Stevens(Sean Bechhofer, Carole Goble, Alan

Rector, Ian Horrocks….)

University of Manchester

Page 2: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

3 goals for today

1. Why use DAML+OIL ontologies?2. What are the design principles?3. What is the syntax of

DAML+OIL?

Page 3: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

a) Prevent the user spelling magherita differently

b) Prevent me from adding a type of car to that field

c) Ensure the users and application have the same notion of a magherita pizza

d) Help an application answer queries such as how many vegetarian pizza’s were sold?

Providing a controlled vocabulary

Day Location Qty Pizza type

02/01/02

Cambridge Margherita

Pizza DB

Applications

1

Page 4: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Schema integration

8 9 89

89

G = )

Database 1 Database 2

Database 3

Schema 1 Schema 2

Schema 3

Ontology

Applications

Page 5: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

TAMBIS

Applications

Page 6: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Ontologies to support rules

Date Medication

311299

Atenolol 25mg tabs bd

Atenolol

oral

25mg

Drug Catalogue

IffAntianginal

then...? Patient Record

Rules

Page 7: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Date Medication

Ontologies to support rules

Date Medication

311299

Atenolol 25mg tabs bd

Atenolol

Atenolol

oral

25mg

B-BlockerAntianginal

Drug Ontology Drug Catalogue

IffAntianginal

then...?

Patient RecordGuideline

Page 8: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

How are ontologies encoded?

Margherita

Capricciosa

….….….….….

1. List 3. Multiple hierarchy2. Tree

American hot pizza

meat pizza

spicy pizza

Page 9: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Property driven classification

• Most taxonomies are hand crafted– Difficult to maintain when large or intricate– Become too large to use but too small to

capture what you want to say

• Now possible to calculate a hierarchy– Supply the ‘lego’ building blocks to allow

the ontology author or user to define classes

– Use reasoning to check consistency and calculate classification based on these definitions

Principles

Page 10: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Descriptions are key

• Classification driven by description• Effort moved from manual placement of

classes in a taxonomy to formal definition of classes.

• The same classes can be classified in different ways for different purposes

Page 11: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Applications can dynamically build descriptions

• Pizza finder

Page 12: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 1

• Specific Tasks– Use the information in the menus to write

definitions for margherita, la reine, soho and neptune pizzas

– List the concepts and relationships used in the definitions

• General questions– How else could do you describe types of pizza?– What parts of the description will drive classification?– What kinds of concepts are used in the description?

Page 13: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Pizza template

• Pizza types are mainly defined in terms of their topping ingredients

• Many high level groups of pizza types depends on a categorisation of ingredients

Page 14: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 2

• Use card sorting to categorise pizza ingredients.

Page 15: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 2 beginning with OilEd

• Open an ontology (pizza-tutorial-ex-2.daml)• Set the namespace• Add classes to an ontology

– (ham, olive, parmesan)

• Add superclasses (parents) to a class– (meat, fish, vegetable, and cheese ingredient)

• Reason with the ontology (nothing happens)• Save an ontology

Page 16: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Organisation Terms

– Classification• A grouping of things into classes

– Instances• Members of a class

– Hierarchy• A stratified organisation of things in

which there is a top and a bottom

– Taxonomy• A hierarchical classification

Principles

Page 17: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Disjointness

• In the DAML+OIL world every class is assumed to overlap with every other.

• We need to explicitly state something cannot be a member of two classes at the same time e.g. man and women

Page 18: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 3 – adding a disjoint axiom

• Make tuna a subclass of both meat and fish ingredient classes.

• Verify the ontology• Add a disjoint axiom between meat and

fish ingredient.• Send the ontology to the reasoner

(verify).• At this point also add disjoint axioms

between meat, cheese and vegetable ingredient classes.

Page 19: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Relationships

• Non taxonomic links• Relationship type is called a

Property• Properties can be placed in a

taxonomy of their own

Page 20: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 4

• Add a property has_topping_ingredient

• Add a property has_part • Make has_part a super property of

has_topping_ingredient

Page 21: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Restrictions

• Describing a class in terms of its relationships to other classes

• Restricting class membership to only those individuals that posses these criteria.

Page 22: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 5

• Create a restriction relating margherita pizza to its topping ingredients mozzarella and tomato

Page 23: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Necessary and sufficient criteria

• To be a member I must have these relationships (necessary = subclassOf)

• If I have these relationships I must be a member (necessary and sufficient = sameClassAs)

Page 24: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 6

• Load ontology pizza-tutorial-ex-6.daml• Create a class called ‘cheesy pizza’ as

a subclass of pizza which has a topping ingredient of cheese ingredient.

• Change to a SameClassAs definition• Send the ontology to the reasoner

(verify).

Page 25: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Negation and disjunction

• DAML+OIL allows logical expressions to be used anywhere a named class could be used.

• Allows much more precision and flexibility in defining classes.

Page 26: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 7

• Write down a definition for a vegetarian pizza

• Create a new class in the ontology called vegetarian pizza and represent the paper based definition in DAML+OIL

• Send the ontology to the reasoner.

Page 27: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Types of relationship

• hasClass – members of class A have this relationship with some members of class B

• toClass – members of class A (if they have this relationship) only have this relationship with members of class B

Page 28: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 8

• Change restriction type in the vegetarian pizza to toClass.

• Send the ontology to the reasoner

Page 29: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Open world assumption

• Open world of the web - always assumes someone could add some extra information

• Some one could come along and add a statement to say margherita pizza has ham on it.

• We have to ‘cap off’ the description to say margherita pizza has these toppings and I know it doesn’t have any meat ingredients. (It may have herbs etc.)

Page 30: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 9

• ‘Cap off’ the definition of margherita pizza with a toClass restriction.

• Send the ontology to the reasoner.• (Note we can now explicitly say Neptune

has no cheese ingredient in the same way)

• Load ontology pizza-tutorial-ex-10.daml to see more definitions.

Page 31: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Transitivity

• Vegetarians are picky!• Soho pizza isn’t classed as vegetarian in

the menu• Some cheeses are made with meat

products (rennin)• The ingredient property is transitive. If

parmesan has a meat ingredient in it any pizza with parmesan should be also be classed as containing a meat ingredient

Page 32: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 10

• Make the has_part relationship transitive

• Add rennin as a subclass of meat ingredient

• Add a restriction on parmesan to say it has_part some rennin.

• Send the ontology to the reasoner.

Page 33: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Cardinality

• More precise numerical constraints can be placed on relationships.

• It should be read as ‘members of class A are related by this property to this many members of class B ‘

Page 34: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 11

• Change the definition of cheesy pizza to ‘a pizza with at least 2 types of cheese’

• Add a new type of pizza called ‘four cheese pizza’ which has exactly four topping ingredients of type cheese ingredient

• Use the reasoner• Add a disjoint axiom between parmesan

and mozzarella.• Use the reasoner

Page 35: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Domain and range constraints

• Used to specify what classes can be used with properties

• May be useful but can have undesirable effects

Page 36: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Exercise 12

• For has_topping_ingredient add a domain of pizza and a range of ingredient

• Make intentional errors to test the system e.g. add ham as a topping ingredient of onion and add four cheeses pizza as a topping of margherita pizza.

• Use the reasoner• Examine the superclasses of onion• Add a disjoint axiom between pizza and

ingredient• Use the reasoner

Page 37: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Things not covered

• Inverse properties, symmetrical properties, unique properties.

• Subclass and sameClass axioms. • Use of individuals

Page 38: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Current example ontologies

• GONG

• myGrid

Page 39: DAML+OIL Ontology Tutorial Chris Wroe, Robert Stevens (Sean Bechhofer, Carole Goble, Alan Rector, Ian Horrocks….) University of Manchester

Current example applications

• Clinergy – not DAML+OIL

• PEDro