1 ontologies in semantic web based on tutorials and presentations: d. lee, f. harmelen, m. arumugam,...

118
1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness, J. Broekstra, M. Klein, S. Decker, D. Fensel, DERI Group, H. Knublauch, N. Drummond, M. Horridge www.ontoknowledge.org/oil

Upload: avice-hancock

Post on 16-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

1

Ontologiesin Semantic Web

Based on tutorials and presentations:D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness, J. Broekstra, M. Klein, S. Decker, D. Fensel, DERI Group, H.

Knublauch,N. Drummond, M. Horridge

www.ontoknowledge.org/oil

Page 2: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

2

Communication between people

Page 3: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

3

The More or Less Global Agreement about Standard Terminology and Conceptual Hierarchy for a Domain Description is Necessary for the Interoperability in the Intelligent Web

Page 4: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

4

Contents

Introduction to OntologiesOntology EngineeringOWL: Web Ontology Language

Page 5: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

5

Page 6: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

6

What are ontologies?

Ontologies are content theories about the sorts of objects, properties of objects, and relations between objects that are possible in a specified domain of knowledge.

Page 7: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

7

Studer(98): Formal, explicit specification of a shared conceptualization

Machine readable

Concepts, properties,functions, axiomsare explicitly defined

Consensualknowledge

Abstract model of some phenomenain the world

What are ontologies? (3)

Page 8: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

9

Page 9: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

10

What Is “Ontology Engineering”?

Ontology Engineering: Defining terms in the domain and relations among them Defining concepts in the domain (classes) Arranging the concepts in a hierarchy (subclass-

superclass hierarchy) Defining which attributes and properties (slots)

classes can have and constraints on their values Defining individuals and filling in slot values

Page 10: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

11

Tool for Ontology Engineering

Screenshots in further examples are from Protégé-2000, which: is a graphical ontology-development tool supports a rich knowledge model is open-source and freely available

(http://protege.stanford.edu/index.shtml)

Page 11: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

12

Determine Domain and Scope

What is the domain that the ontology will cover?

For what we are going to use the ontology?For what types of questions the information in

the ontology should provide answers (competency questions)?

Answers to these questions may change during the lifecycle

Page 12: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

13

Example Ontology

French winesand

wine regions

California wines and

wine regions

Which wine should

I serve with seafood today? A sharedA shared

ONTOLOGYONTOLOGYof of

wine and foodwine and food

A sharedA sharedONTOLOGYONTOLOGY

of of wine and foodwine and food

Page 13: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

14

Competency Questions

Which wine characteristics should I consider when choosing a wine?

Is Bordeaux a red or white wine? Does Cabernet Sauvignon go well with seafood? What is the best choice of wine for grilled meat? Which characteristics of a wine affect its appropriateness

for a dish? Does a flavor or body of a specific wine change with

vintage year?

Page 14: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

15

Enumerating Terms - The Wine Ontology

wine, grape, winery, location,...

wine color, wine body, wine flavor, sugar content,...

white wine, red wine, Bordeaux wine,...

food, seafood, fish, meat, vegetables, cheese,...

Page 15: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

16

Define Classes and the Class Hierarchy

A class is a concept in the domain a class of wines a class of wineries a class of red wines …

A class is a collection of elements (instances of classes) with similar properties

Page 16: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

17

Class Inheritance

Classes usually constitute a taxonomic hierarchy (a subclass-superclass hierarchy)

A class hierarchy is usually an IS-A hierarchy:

an instance of a subclass is an instance of a superclass

If you think of a class as a set of elements, a subclass is a subset

Page 17: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

18

Class Inheritance - Example

Apple is a subclass of FruitEvery apple is a fruit

Red wines is a subclass of WineEvery red wine is a wine

Chianti wine is a subclass of Red wineEvery Chianti wine is a red wine

Page 18: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

19

Modes of Development

top-down – define the most general concepts first and then specialize them

bottom-up – define the most specific concepts and then organize them in more general classes

combination – define the more salient concepts first and then generalize and specialize them

Page 19: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

20

Documentation

Classes (and slots) usually have documentation Describing the class in natural language Listing domain assumptions relevant to the

class definition Listing synonyms

Documenting classes and slots is as important as documenting computer code!

Page 20: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

21

Define Properties of Classes – Slots

Slots in a class definition describe attributes of instances of the class and relations to other instances

Each wine will have color, sugar content, producer, etc

Page 21: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

22

Properties (Slots)

Types of properties “intrinsic” properties: flavor and color of wine “extrinsic” properties: name and price of wine parts: ingredients in a dish relations to other objects: producer of wine (winery)

Simple and complex properties simple properties (attributes): contain primitive values

(strings, numbers) complex properties: contain (or point to) other objects

(e.g., a winery instance)

Page 22: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

23

Slots for the Class Wine

(in Protégé-2000)

Page 23: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

24

Slot and Class Inheritance

A subclass inherits all the slots from the superclassIf a wine has a name and flavor, a red wine also has a name

and flavor

If a class has multiple superclasses, it inherits slots from all of themPort is both a dessert wine and a red wine. It inherits “sugar

content: high” from the former and “color:red” from the latter

Page 24: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

25

Property Constraints

Property constraints (facets) describe or limit the set of possible values for a slotThe name of a wine is a string

The wine producer is an instance of Winery

A winery has exactly one location

Page 25: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

26

Common Facets

Slot cardinality – the number of values a slot hasSlot value type – the type of values a slot hasMinimum and maximum value – a range of

values for a numeric slotDefault value – the value a slot has unless

explicitly specified otherwise

Page 26: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

27

Common Facets: Slot CardinalityMinimum cardinality

Minimum cardinality 1 means that the slot must have a value (required)

Minimum cardinality 0 means that the slot value is optional

Maximum cardinality Maximum cardinality 1 means that the slot can have at most

one value (single-valued slot) Maximum cardinality greater than 1 means that the slot can

have more than one value (multiple-valued slot)

Page 27: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

28

Common Facets: Value Type

String: a string of characters (“Château Lafite”)Number: an integer or a float (15, 4.5)Boolean: a true/false flagEnumerated type: a list of allowed values (high,

medium, low)Complex type: an instance of another class

Specify the class to which the instances belong

The Wine class is the value type for the slot “produces” at the Winery class

Page 28: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

29

Domain and Range of Slot

Domain of a slot – the class (or classes) that have the slot More precisely: class (or classes) instances of

which can have the slot

Range of a slot – the class (or classes) to which slot values belong

Page 29: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

30

Facets and Class Inheritance

A subclass inherits all the slots from the superclassA subclass can override the facets to “narrow” the

list of allowed values Make the cardinality range smaller Replace a class in the range with a subclass

Wine

Frenchwine

Winery

Frenchwinery

is-a is-a

producer

producer

Page 30: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

31

Create Instances

Create an instance of a class The class becomes a direct type of the instance Any superclass of the direct type is a type of the

instance

Assign slot values for the instance frame Slot values should conform to the facet constraints Knowledge-acquisition tools often check that

Page 31: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

32

Creating an Instance: Example

Page 32: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

33

Multiple Inheritance

A class can have more than one superclass

A subclass inherits slots and facet restrictions from all the parents

Different systems resolve conflicts differently

Page 33: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

34

Disjoint Classes Classes are disjoint if they cannot have common instances Disjoint classes cannot have any common subclasses either

Red wine, White wine,Rosé wine are disjoint

Dessert wine and Redwine are not disjoint

Wine

Redwine

Roséwine

Whitewine

Dessertwine

Port

Page 34: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

35

The Perfect Family Size (1)

If a class has only one child, there may be a modeling problem

If the only Red Burgundy we have is Côtes d’Or, why introduce the subhierarchy?

Compare to bullets in a bulleted list

Page 35: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

36

The Perfect Family Size (2)

If a class has more than a dozen children, additional subcategories may be necessary

However, if no natural classification exists, the long list may be more natural

Page 36: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

37

Single and Plural Class Names

A “wine” is not a kind-of “wines”

A wine is an instance of the class Wines

Class

Instance

instance-of

Page 37: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

38

Classes and Their Names

Classes represent concepts in the domain, not their names

The class name can change, but it will still refer to the same concept

Synonym names for the same concept are not different classes

Many systems allow listing synonyms as part of the class definition

Page 38: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

39

A Completed Hierarchy of Wines

Page 39: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

40

Inverse Slots

Maker and

Producer

are inverse slots

Page 40: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

41

Page 41: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

42

Data Exchange

Semantics+inference

Relational Data

???

Reasoning

???

OWL

Semantic Web “Layered Cake” (2001)

Page 42: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

43

Semantic Web “Layered Cake” (refreshed)

Page 43: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

44

Both use the same data model:

OWL extends vocabulary and adds axioms

OWL-RDFS Relationship

page.html “Dieter Fensel“hasAuthor

Resource

(subject)

Property

(predicate)

Value

(object)

Page 44: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

45

Description Logic Family DLs are a family of logic based KR formalisms Particular languages mainly characterized by:

Set of constructors for building complex concepts and roles from simpler ones

Set of axioms for asserting facts about concepts, roles and individuals

Examples: “Female persons”

• Person ⊓ Female “Non-female persons”

• Person ⊓ Female “Persons that have a child”

• Person ⊓ hasChild.Person “Persons all of whose children are female”

• Person ⊓ hasChild.Female “Persons that are employed or self-eployed”

• Person ⊓ (Employee ⊔ SelfEmployed) “Persons that have at most one father“

• Person ⊓ ≤1.hasFather

Page 45: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

46

Description Logic Family

Necessary and sufficient conditions

Inclusion axioms provide necessary conditions: concept ⊑ definition

Equivalence axioms provide necessary and sufficient conditions:

concept ≡ definition{ concept ⊑ definition anddefinition ⊑ concept

Page 46: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

47

Complex Classes

Union of Classes

<owl:Class rdf:ID=“Person"> <owl:unionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Woman" /> <owl:Class rdf:about="#Man" /> </owl:unionOf> </owl:Class>

Instances of the Union of two Classes are either the instance of one or both classes

Person ≡ Man ⊔ Woman

Page 47: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

48

Complex Classes

Intersection of Classes

<owl:Class rdf:ID=“Man"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Person" /> <owl:Class rdf:about="#Male" /> </owl:intersectionOf> </owl:Class>

Instances of the Intersection of two Classes are simultaneously instances of both class

Man ≡ Person ⊓ Male

Page 48: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

49

one of: Enumerated Classes

Specify a class via a direct enumeration of its members:

<owl:Class rdf:ID="WineColor"> <rdfs:subClassOf rdf:resource="#WineDescriptor"/> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#White"/> <owl:Thing rdf:about="#Rose"/> <owl:Thing rdf:about="#Red"/> </owl:oneOf> </owl:Class>

WhineColor ≡ {White, Rose, Red}

Page 49: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

50

Defining a Class by restricting its possible instances via their property values

OWL distinguishes between the following two: Value constraint

• (Mother ≡ Woman ⊓ hasChild.Person) Cardinality constraint

• (MotherWithManyChildren ≡ Mother ⊓ ≥3hasChild)

Property restrictions are local remember RDFS allows only global properties

Complex Classes Property Restrictions

Page 50: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

51

Complex Classes - Property Restrictions someValuesFrom

<owl:Class rdf:ID=“Mother"> <rdfs:subClassOf rdf:resource="#Woman" /> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasChild" /> <owl:someValuesFrom rdf:resource="#Person" /> </owl:Restriction> </rdfs:subClassOf></owl:Class>

A Mother is a Woman that has a child (some Person)

Mother ⊑ Woman ⊓ hasChild.Person

Page 51: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

52

Complex Classes - Property Restrictions allValuesFrom

<owl:Class rdf:ID=“ParentsWithOnlyDaughters"> <rdfs:subClassOf rdf:resource="#Person" /> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasChild" /> <owl:allValuesFrom rdf:resource="#Woman" /> </owl:Restriction> </rdfs:subClassOf> ... </owl:Class>

To express the set of parents that only have female children (daughters) you would write:

ParentsWithOnlyDaughters ⊑ Person ⊓ hasChild.Woman

Page 52: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

53

hasValue allows to define classes based on the existence of particular property values, their must be at least one matching property value

The set of all childs of the woman MARY would be expressed like following:

Complex Classes - Property Restrictions hasValue

<owl:Class rdf:ID=“MarysChildren">

<rdfs:subClassOf rdf:resource="#Person" /> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#hasParent" /> <owl:hasValue rdf:resource="#MARRY" /> </owl:Restriction> </rdfs:subClassOf> </rdfs:subClassOf> ... </owl:Class>

MarysChildren ⊑ Person П hasParent.{MARY}

Page 53: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

54

Definition of cardinality: the number of occurrences, either maximum (maxCardinality) or minimum (minCardinality) or exact (cardinality) based upon the context (class) in which it is used

To define a half-orphan (Halbwaise) you would write the following:

Complex Classes - Property Restrictions cardinality

<owl:Class rdf:ID=“HalfOrphan">

<rdfs:subClassOf rdf:resource="#Person" /> <rdfs:subClassOf>

<owl:Restriction>

<owl:onProperty rdf:resource="#hasParent"/>

<owl:cardinality rdf:datatype="&xsd;NonNegativeInteger">1</owl:cardinality>

</owl:Restriction>

</rdfs:subClassOf>

</rdfs:subClassOf>

</owl:Class>

HalfOrphan ⊑ Person П =1hasParent.Person

Page 54: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

55

RDF Schema provides a couple of pre defined properties: rdfs:range used to indicate the range of values for a property. rdfs:domain used to associate a property with a class. rdfs:subPropertyOf used to specialize a property.

OWL provides additional poperty classes, which allow reasoning and inferencing, i.e.

owl:functionalProperty owl:transitiveProperty owl:symetricProperty

Properties OWL vs. RDF

Page 55: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

56

OWL (DL and Lite) distinguishes between data type ptoperties and object properties (RDFS does not)

Properties OWL vs. RDF

ResourceObjectProperty

Resource

DatatypePropertyResource Value

An ObjectProperty relates one Resource to another Resource:

A DatatypeProperty relates a Resource to a Literal or an XML Schema data type:

Page 56: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

58

Example: If person A is a ancestor of person B and B of C then A is also an ancestor of C.

Properties in OWL

Transitive Property

<owl:ObjectProperty rdf:ID=“ancesotor">

<rdf:type rdf:resource="&owl;TransitiveProperty" />

<rdfs:domain rdf:resource="#Person" />

<rdfs:range rdf:resource="#Person" />

</owl:ObjectProperty>

ancestor+ ancestor

Page 57: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

59

Example: If Mary is relative to John then John is also relative to Mary

Properties in OWL

Symmetric Property

<owl:ObjectProperty rdf:ID=“relative">

<rdf:type rdf:resource="&owl;SymmetricProperty" />

<rdfs:domain rdf:resource="#Person" />

<rdfs:range rdf:resource="#Person" />

</owl:ObjectProperty>

relative- relative and relative relative-

Page 58: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

60

Example: If Mary is a child of John then John is the parent of Mary

Properties in OWL

Inverse Property

<owl:ObjectProperty rdf:ID=“hasChild">

<owl:inverseOf rdf:resource="hasParent" />

</owl:ObjectProperty>

hasChild hasParent-

Page 59: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

61

A functional property states that the value of range for a certain object in the domain is always the same:

Example: A child has always the same Father (biological)

Properties in OWL

Functional Properties

<owl:ObjectProperty rdf:ID=“hasFather">

<rdf:tyoe rdf:resource="&owl;FunctionalProperty"/></owl:ObjectProperty>

Person 1hasFather

Page 60: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

62

OWL Property Classes

rdf:Property

owl:ObjectProperty owl:DatatypeProperty

owl:SymmetricProperty owl:TransitiveProperty

owl:FunctionalProperty owl:InverseFunctionalProperty

The symmetric and transitive property may only used for connecting two resources:

Page 61: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

63

OWL as DL: Axioms

Description Logic

First Order Logic

Page 62: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

64

OWL as DL: Axioms

Social Security Number

Page 63: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

65

Accessing the Reasoner (“Racer”) in Protégé

Classify taxonomy

(and check consistency)

Just check consistency

(for efficiency)

Compute inferred types

(for individuals)

Page 64: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

66

Subsumption

The presented examples contain a number of classes and properties intended to illustrate particular aspects of reasoning in OWL.

We can make inferences about relationships between classes, in particular subsumption between classes

Recall that A subsumes B when it is the case that any instance of B must necessarily be an instance of A.

AB

Page 65: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

67

Subsumption

An Example Woman ≡ Person ⊓ Female Man ≡ Person ⊓ Woman Mother ≡ Woman ⊓ hasChild.Person Father ≡ Man ⊓ hasChild.Person Parent ≡ Father ⊔ Mother Grandmother ≡ Mother ⊓ hasChild.Parent

We can further infer (though not explicitly stated):

Grandmother Person⊑ Grandmother Man ⊑ ⊔ Woman

etc.

Page 66: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

68

Subsumption

Example in Protégé

Page 67: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

69

Subsumption

Inferred Hierarchy in Protégé

Page 68: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

70

Inconsistency

You may define Classes were no individual can fulfill its definition. Via reasoning engines such a definition can be found also in big ontologies.

Page 69: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

71

Inconsistency

Example

Cow ≡ Animal ⊓ VegetarianSheep ⊑ Animal Vegetarian ≡ eats AnimalMadCow ≡ Cow ⊓ eats.Sheep

Page 70: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

72

Inconsistency

Example in Protégé

Page 71: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

73

Inconsistency

Detected Inconsistency in Protégé

Page 72: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

74

Symmetric: if P(x, y) then P(y, x) Transitive: if P(x,y) and P(y,z) then P(x, z) Functional: if P(x,y) and P(x,z) then y=z InverseOf: if P1(x,y) then P2(y,x) InverseFunctional: if P(y,x) and P(z,x) then y=z allValuesFrom: P(x,y) and y=allValuesFrom(C) someValuesFrom: P(x,y) and y=someValuesFrom(C) hasValue: P(x,y) and y=hasValue(v) cardinality: cardinality(P) = N minCardinality: minCardinality(P) = N maxCardinality: maxCardinality(P) = N equivalentProperty: P1 = P2 intersectionOf: C = intersectionOf(C1, C2, …) unionOf: C = unionOf(C1, C2, …) complementOf: C = complementOf(C1) oneOf: C = one of(v1, v2, …) equivalentClass: C1 = C2 disjointWith: C1 != C2 sameIndividualAs: I1 = I2 differentFrom: I1 != I2 AllDifferent: I1 != I2, I1 != I3, I2 != I3, … Thing: I1, I2, …

OWL on one Slide

Legend:Properties are indicated by: P, P1, P2, etcSpecific classes are indicated by: x, y, zGeneric classes are indicated by: C, C1, C2Values are indicated by: v, v1, v2Instance documents are indicated by: I1, I2, I3, etc.A number is indicated by: NP(x,y) is read as: “property P relates x to y”

Page 73: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

75

Full

DL

Lite

OWL Full Allow meta-classes etc

OWL DLNegation (disjointWith, complementOf)

unionOf Full CardinalityEnumerated types (oneOf)

OWL Lite(sub)classes, individuals(sub)properties, domain, rangeintersection(in)equalitycardinality 0/1datatypesinverse, transitive, symmetrichasValuesomeValuesFromallValuesFrom

RDF Schema

Back to the OWL Layers (Lite, DL, Full)

Page 74: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

76

Summary

Compared with RDF/RDFS, OWL provides a more formal language which allows expressing more axioms, but also adds some restrictions

We can do inferences such as classify instances, detect inconsistencies, etc.

Last version Feb. 2004, but still under progresshttp://www.w3.org/2004/OWL/

Page 75: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

77

W3C Documents Guide: http://www.w3.org/TR/owl-guide/ Reference: http://www.w3.org/TR/owl-ref/ Semantics and Abstract Syntax:

http://www.w3.org/TR/owl-semantics/OWL Tutorials

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

Roger L. Costello, David B. Jacobs: http://www.xfront.com/owl/

Example Ontologies, e.g. here:http://www.daml.org/ontologies/

Resources

Page 76: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

78

Tutorial: Designing Ontologies with Protégé

http://www.cs.man.ac.uk/~horrocks/Teaching/cs646/

http://www.co-ode.org/resources/tutorials/ProtegeOWLTutorial.pdf

Protégé is an ontology editor and a knowledge-base editor (download from http://protege.stanford.edu ).

Protégé is also an open-source, Java tool that provides an extensible architecture for the creation of customized knowledge-based applications.

Protégé's OWL Plug-in now provides support for editing Semantic Web ontologies.

Page 77: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

79

RDF/OWL in Protégé

Example

Page 78: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

80

Protégé Screenshot: Classes

Page 79: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

81

Creating Properties

- New Datatype Property (String, int etc)

New Object Property:

Associates an individual to another individual

Delete Property

- New Annotation Properties for metadata

- New SubProperty – ie create “under” the current selection

Page 80: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

82

Naming Properties

We often create properties using 2 standard naming patterns: has… (eg. hasColour); is…Of (eg. isTeacherOf) or other suffixes (eg. …In …To).

This has several advantages: It is easier to find properties; It is easier for tools to generate a more readable form; Inverses properties typically follow this pattern

eg. hasPart, isPartOf .

Page 81: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

83

Protégé Screenshot: Datatype properties

Page 82: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

84

Protégé Screenshot: Object Properties

Page 83: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

85

Protégé Screenshot: Instances (1)

Page 84: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

86

Protégé Screenshot: Instances (2)

Page 85: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

87

Protégé Screenshot: Instances (3)

Page 86: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

88

Protégé Screenshot: Forms

Page 87: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

89

Protégé Screenshot: Ontologies

Page 88: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

90

Protégé Screenshot: Code-1 (OWL/RDF)

Page 89: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

91

Protégé Screenshot: Code-2 (OWL/RDF)

Page 90: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

92

Some issues on Editing OWL Ontologies with Protégé

From Holger KnublauchStanford University

July 06, 2004

http://protege.stanford.edu/doc/tutorial/get_started/

http://www.co-ode.org/resources/tutorials/ProtegeOWLTutorial.pdf

Page 91: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

93

Restrictions (Overview)

Define a condition for property values allValuesFrom someValuesFrom hasValue minCardinality maxCardinality cardinality

An anonymous class consisting of all individuals that fulfill the condition

Page 92: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

94

Cardinality Restrictions

Meaning: The property must have at least/at most/exactly x values

is the shortcut for andExample: A FamilyDestination is a Destination

that has at least one Accomodation and at least 2 Activities

Page 93: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

95

(Create defined class FamilyDestination)

Page 94: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

96

allValuesFrom Restrictions

Meaning: All values of the property must be of a certain type

Warning: Also individuals with no values fulfill this condition (trivial satisfaction)

Example: Hiking is a Sport that is only possible in NationalParks

Page 95: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

97

someValuesFrom Restrictions

Meaning: At least one value of the property must be of a certain type

Others may exist as wellExample: A NationalPark is a RuralArea

that has at least one Campground and offers at least one Hiking opportunity

Page 96: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

98

hasValue Restrictions

Meaning: At least one of the values of the property is a certain value

Similar to someValuesFrom but with Individuals and primitive values

Example: A PartOfSydney is a Destination where one of the values of the isPartOf property is Sydney

Page 97: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

99

Enumerated Classes

Consist of exactly the listed individuals

OneStarRating

TwoStarRatingThreeStarRating

BudgetAccomodation

Page 98: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

100

Logical Class Definitions

Define classes out of other classes unionOf (or) intersectionOf (and) complementOf (not)

Allow arbitrary nesting of class descriptions (A and (B or C) and not D)

Page 99: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

101

unionOf

The class of individuals that belong to class A or class B (or both)

Example: Adventure or Sports activities

Adventure Sports

Page 100: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

102

intersectionOf

The class of individuals that belong to both class A and class B

Example: A BudgetHotelDestination is a destination with accomodation that is a budget accomodation and a hotel

BudgetAccomodation

Hotel

Page 101: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

103

Implicit intersectionOf

When a class is defined by more than one class description, then it consists of the intersection of the descriptions

Example: A luxury hotel is a hotel that is also an accomodation with 3 stars

AccomodationWith3StarsHotel

LuxuryHotel

Page 102: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

104

complementOfThe class of all individuals that do not

belong to a certain classExample: A quiet destination is a

destination that is not a family destination

DestinationFamilyDestination

QuietDestination (grayed)

Page 103: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

105

Class Conditions

Necessary Conditions:(Primitive / partial classes)“If we know that something is a X,then it must fulfill the conditions...”

Necessary & Sufficient Conditions:(Defined / complete classes)“If something fulfills the conditions...,then it is an X.”

Page 104: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

106

Class Conditions (2)

QuietDestination

NationalPark

(not everything that fulfills theseconditions is a NationalPark)

(everything that fulfills theseconditions is a QuietDestination)

Page 105: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

107

ClassificationNationalPark

BackpackersDestination

A RuralArea is a Destination

A Campground is BudgetAccomodation

Hiking is a Sport Therefore:

Every NationalPark is a Backpackers-Destiantion

(Other BackpackerDestinations)

Page 106: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

108

Classification (2)Input: Asserted class definitionsOutput: Inferred subclass relationships

Page 107: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

109

(Create an enumerated class out of individuals)

Page 108: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

110

(Create a hasValue restriction)

Page 109: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

111

(Create a hasValue restriction)

Page 110: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

112

(Create a defined class)

Page 111: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

113

(Classify Campground)

Page 112: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

114

(Add restrictions to City and Capital)

Page 113: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

115

(Create defined class BackpackersDestination)

Page 114: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

116

(Create defined class QuietDestination)

Page 115: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

117

(Create defined class RetireeDestination)

Page 116: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

118

(Classification)

Page 117: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

119

Individuals

Page 118: 1 Ontologies in Semantic Web Based on tutorials and presentations: D. Lee, F. Harmelen, M. Arumugam, C. Goble, I. Horrocks, N. F. Noy, D.L. McGuinness,

120

Individuals