Transcript
Page 1: Ontology Engineering: representation in OWL

Ontology representation

Guus Schreiber, VU

Ontology Engineering course

Page 2: Ontology Engineering: representation in OWL

RDF/OWL

Ontology language used in this course OWL = W3C Ontology Web Language RDF is basis of representation– Triples = binary relation format– Turtle is the triple syntax format most frequently

used

2

Page 3: Ontology Engineering: representation in OWL

Background reading

OWL Primer, W3C Recommendation, October 2009, http://www.w3.org/TR/owl2-primer/.

Section 4 contains the basic constructs Secs. 5-8 describe the advanced features (not all

of these will be used in the course). The Turtle syntax is easiest to read. You can hide

the other in the beginning of the document.

3

Page 4: Ontology Engineering: representation in OWL

Some notes about syntax

Protégé hides most of the syntax details OWL has quite a few syntax formats If you want to look at OWL syntax we

recommend that you use the Turtle syntax Background reading on Turtle): http://wikitravel.org/en/Wikitravel:Turtle_RDF

4

Page 5: Ontology Engineering: representation in OWL

Class

Central grouping construct Its instances are called “members” Classes can have multiple sub-classes Classes can have multiple super-classes Root class is conventionally called Thing: the

super-class of all classes– Nothing is a sub-class of all classes

5

Page 6: Ontology Engineering: representation in OWL

Property Properties define relationships RDF/OWL properties have a direction

Artist creates Artwork– Compare with UML!

Two types of properties– Object property: relationship between two classes– Datatype property: relationship between a class and a

value space (integers, strings, dates) Terminology: – Subject = left hand of relation – Object = right hand of relation

6

Page 7: Ontology Engineering: representation in OWL

Property hierarchy

Properties may have sub-properties hasChild hasDaugther hasSon

Logically sub-properties represent relationships between subsets of the super-property

7

Page 8: Ontology Engineering: representation in OWL

8

PeterMary Sue

Judith

Bob

hasChild

hasDaugther

Sue

Peter

Mary

Peter

Bob

Judith

hasSon

Page 9: Ontology Engineering: representation in OWL

Domain and range

Artist creates Artwork Artist is the domain– Class of allowed “values” at the left side (origin( of

the relationship Artwork is the range– Class of allowed “values” at the right side

(destination) of the relationship

9

Page 10: Ontology Engineering: representation in OWL

Property characteristics (1)

Functional property– For each subject this relation has at most one

object– hasBiologicalMother

Inverse-functional property– For each object this relation has are most one

subject– hasStudentNumber

10

Page 11: Ontology Engineering: representation in OWL

Property characteristics (2)

Symmetric property– IF i1 p i2 THEN i2 p i1– Example: friend

Asymmetric property– IF i1 p i2 THEN NOT i2 p i1– Example: parent

11

Page 12: Ontology Engineering: representation in OWL

Property characteristics (3)

Transitive property– IF i1 p i2 AND i2 p i3 THEN i1 p i3

Example: partOf– If Amsterdam is a part of North-Holland and

North-Holland is a part of The Netherlands, then Amsterdam is a part of the The Netherlands.

12

Page 13: Ontology Engineering: representation in OWL

Property characteristics (4)

Inverse property– P1 inverseOf p2 implies that

IF i1 p1 i2 THEN i2 p2 i1– Example: hasPart is the inverse of partOf, so if

Amsterdam is a part of North-Holland, then North-Holland must have Amsterdam as one of its parts.

13

Page 14: Ontology Engineering: representation in OWL

Property characteristics (5)

Reflexive property– FORALL p HOLDS i p i– Example: for the property knows holds that

everybody knows him/herself Irreflexive property– FORALL p MUST NOT HOLD I p I– Example: for the parent relation holds that no one

can be his own parent

14

Page 15: Ontology Engineering: representation in OWL

Individual

Instances of classes– Rembrandt is and individual and member of the

Artist class Note: Protégé-OWL supports meta-classes

(classes which members are classes) poorly! Enumerated class: a class for which all

individual members can be listed– Da Ponte opera’s of Mozart: Nozze di Figaro, Cosi

fan tutte, Don Giovanni

15

Page 16: Ontology Engineering: representation in OWL

Equality and inequality of individuals

Equality example: two people (with different URLs) are actually the same:

ex:Jim sameAs ex:James Inequality example: two people are different

Ex1:Jim differentFrom ex2:Jim Important on the Web!– Difference between closed and open world

16

Page 17: Ontology Engineering: representation in OWL

Cardinality restrictions of properties

Defines how many relationships of a certain type there can be for a particular subject

Examples: – Person marriedTo max 1– Course hasTutor min 1– Person hasParent exactly 2

17

Page 18: Ontology Engineering: representation in OWL

Value restrictions of properties

Defines to what objects a subject can be related through a particular relation

Examples– Wine producedBy only VineyardWine is only produced by vineyards– RedWine color value “Red”Red wines have a red color– Bicycle hasPart some WheelBicycles consist, amongst others, of at least one wheel

18

Page 19: Ontology Engineering: representation in OWL

Equivalent classes & properties: simple

States that two classes are the same, for example two classes in different ontologies

wn-en:Dog = wn-it:Cane

You can do the same for propertiesex1:hasPart = ex2:hasComponent

Question: do you think equivalence occurs frequently?

19

Page 20: Ontology Engineering: representation in OWL

Interlude: the notion of class extension

OWL is derived from “description logic” Description logic takes an “extensional” view of

classes:– Two classes are the same if - and only if- they have

the same class extension– The class extension is the set of members of the class

Question: does this correspond to your intuition?

20

Page 21: Ontology Engineering: representation in OWL

Equivalent classes: complex (1)

A class as the union of other classesParent = Mother or Father

In terms of class extensions:– The class extension of the class Parent is the union

of the class extensions of the classes Mother and Father

– OWL calls such formulas “class expressions” (term used in Protégé)

21

Page 22: Ontology Engineering: representation in OWL

Equivalent classes: complex (2)

A class as the intersection of other classesMother =Woman and Parent

In words: members of the Mother class must be members of both the Woman and the Parent class

You can build even more complex expressions:

Mother = Woman and some hasChild

22

Page 23: Ontology Engineering: representation in OWL

Class expressions

Statements such as Woman and Parent and Woman and some hasChild are called class expressions

Description logic treats class expressions as anonymous classes – i.e. concepts with no symbol, cf. the concept triad

23

Page 24: Ontology Engineering: representation in OWL

Equivalent classes: complex (3)

Defining a class as the negation (“complement”) of other classes

ChildlessPerson = Person and not Parent In words: a childless person is a member of

the person class who does not belong to the extension of the parent class

24

Page 25: Ontology Engineering: representation in OWL

Necessary class definitions

Description logic is used for classification reasoning

A necessary definition state a constraint which must be true for class membership, but is not enough to classify it as a member of the class

Example: red wine must have a red color– But: not all red things are red wines

25

Page 26: Ontology Engineering: representation in OWL

Necessary class definitions in description logic

The red-wine constraint is expressed as follows:– Red wine is subclass of the class of all red things

More formally: necessary conditions are stated as a constraint that the class in question (red wine) is a subclass of the anonymous class represented by the class expression (class of all red things)

This explains how Protégé uses the “Superclasses”– Test this now; you’ll get the hang of it

26

Page 27: Ontology Engineering: representation in OWL

Sufficient class definitions

Sufficient definitions allow us to classify an individual as a member of a class

Example: if we know someone belongs to the Woman and Parent class, we also know she belongs to the Mother class

The equivalent-class expression represent sufficient definitions

27

Page 28: Ontology Engineering: representation in OWL

Annotations

Annotations are used to add metadata to classes and properties

Annotations play no role in classification Example annotations:– Human-readable label (in multiple languages)– Time created– See also Dublin Core elements

28

Page 29: Ontology Engineering: representation in OWL

Class exercise: comparison with UML class diagrams

Make list of– Similarities– Differences

Don’t forget that OWL is a Web language!

29

Page 30: Ontology Engineering: representation in OWL

Guidelines for naming concepts

Keep original names, where possible Prefer more specific names over general ones Don’t be afraid of long names if you have to

invent a name Use a consistent format– Here: ClassName propertyName– But alternatives are fine

30

Page 31: Ontology Engineering: representation in OWL

Class room exercise

“Artefacts are created by humans. Art works are a kind of artefact. If a person has created an art work we call him/her an artist.”

Exercise: create with the help of Protégé an OWL ontology for this domain description.

31


Top Related