25
Ontology Model and OWL STANLEY W ANG SOLUTION ARCHITECT , TECH LEAD @SWANG68 http://www.linkedin.com/in/stanley-wang-a2b143b

Ontology model and owl

Embed Size (px)

Citation preview

Page 1: Ontology model and owl

Ontology Model and OWL

STANLEY WANG SOLUTION ARCHITECT, TECH LEAD @SWANG68 http://www.linkedin.com/in/stanley-wang-a2b143b

Page 2: Ontology model and owl

Web Ontology Language (OWL) • OWL is based on Description Logics knowledge representation

formalism; • W3C standard recommendation in 2004; • OWL is a richer vocabulary description language for describing

properties and classes; • Layered on top of RDF & RDFS and has a rich set of constructs; • Explicitly represents meaning of terms in vocabularies and the

relationships between those terms • Supports inference;

OWL is a language for defining Ontologies Model and their associated Knowledge Bases

Page 3: Ontology model and owl

Components of an OWL Ontology

• Individuals

• Classes

• Properties

Research Methods in IT

Philippines

Clement

Acosta

Advanced Accounting

Kenya

UK

isCitizenOf

hasColleague

hasWritten

Employee

Publication

Country

Page 4: Ontology model and owl

The Three Species of OWL

• OWL-Full No restrictions on how/where language constructs can be used. Full union of OWL and RDF Schema and not decidable.

• OWL-DL Restricted version to FOL fragment of OWL-Full. Corresponds to a description logic. Certain restrictions on how/where language constructs can be used

in order to guarantee decidability.

• OWL-Lite A subset of OWL-DL. Simplest and easiest to implement of the three species.

Tools to build Ontologies exists e.g. Protégé

Separate layers have been defined balancing expressibility vs. implementability (OWL Lite, OWL DL, OWL Full)

Automated reasoning over ontologies that are written in OWL-Lite and OWL-DL.

Page 5: Ontology model and owl

Example • There are two types of animals, Male and Female.

<rdfs:Class rdf:ID="Male">

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

</rdfs:Class>

• The subClassOf element asserts that its subject - Male - is a

subclass of its object -- the resource identified by #Animal.

<rdfs:Class rdf:ID="Female">

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

<owl:disjointWith rdf:resource="#Male"/>

</rdfs:Class>

• Some animals are Female, too, but nothing can be both

Male and Female (in this ontology) because these two

classes are disjoint (using the disjointWith tag).

Page 6: Ontology model and owl

OWL Features

• Class – Person superclass

– Man, Woman subclasses

• Properties – isWifeOf, isHusbandOf

• Property characteristics, restrictions – inverseOf

– domain

– range

– Cardinality

• Class expressions – disjointWith

Page 7: Ontology model and owl

• 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, …

All In One on OWL

Legend: Properties are indicated by: P, P1,

P2, etc

Specific classes are indicated by:

x, y, z

Generic classes are indicated by:

C, C1, C2

Values are indicated by: v, v1, v2

Instance documents are indicated

by: I1, I2, I3, etc.

A number is indicated by: N

P(x,y) is read as: “property P

relates x to y”

Page 8: Ontology model and owl

OWL 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 9: Ontology model and owl

OWL Example in Protégé

Page 10: Ontology model and owl

OWL Example in Protégé

Page 11: Ontology model and owl

11

Rules

• OWL DL and OWL Lite are based on Description Logic; there

are things that DL cannot express

o Attempts to combine ontologies and rules include RuleML, SWRL,

cwm, etc.

• There is also an increasing number of rule-based systems

that want to interchange rules

• The W3C Rule Interchange Format Working Group is

focused on this area

Page 12: Ontology model and owl

Trust & Rules

• Claims can be verified if there is supporting evidence

from another (trusted) source

– Only believe that someone is a professor at a

university if the university also claims that person

is a professor, and the university is on a list I trust.

believe(c1) :- claims(x, c1) ^ predicate(c1, professorAt) ^ arg1(c1, x) ^ arg2(c1, y) ^ claims(c2, y) ^ predicate(c2, professorAt) ^ arg1(c2, x) ^ arg2(c2, y) ^ AccreditedUniversity(y) AcknowledgedUniversity(u) :- link-from(“http://www.cs.umd.edu/university-list”,u)

Notice this one

Page 13: Ontology model and owl

Rules on top of Semantic Web (“Metasemantics”)

?????????????

橡钿箨鲨铐睇?

镳噔桦? 镳噔桦?

吗屐屙睇?

镳噔桦?

彦爨眚梓羼觇?

彦爨眚梓羼赅

皴螯1

2

3

5

410

11 89

6

7

R T

S

P

M

Production

Rules

Temporal

Rules

Semantic

Rules

Semantic

Web

Metasemantics

Page 14: Ontology model and owl

State of a Semantic Net

)A,L,(AP)A,L,(AP=S(t) qnmt

0=)qA,nL,m(AtPqn,m,

jkit

1=)jA,kL,i(AtPkj,i,

)A,L,P(A)A,L,P(A=S(t) 221211 )A,L,P(A)A,L,P(A 342232

A1 A

A2

3

L1

L

L

L

2

3

4

P = P(A ,L ,A )1 1 1 2 P = P(A ,L ,A )2 1 2 2

P = P(A ,L ,A )3 2 3 2 P = P(A ,L ,A )4 2 4 3

4321 PPPP=S(t)

Page 15: Ontology model and owl

Production Rules

kii P THEN )IF(S :R

kjj P THEN )IF(S :R

iki SP=S

jkj SP=S

.P THEN ))PP(PP( IF :R 243121

A1 A

A2

3

L1

L

L

3

4

A1 A

A2

3

L1

L

L

L

2

3

4

,*)ii LP(*,=P

Page 16: Ontology model and owl

Production-Based Reasoning

Initial state

State after n

transformations

Set of Production

Rules

S(t0) S(t0+n·τ)

Page 17: Ontology model and owl

Example (Model Description)

1. Mary will love John if he loves her and if he is not abusing Pete.

2. Pete will consider Mary as his friend if she is not in love with John.

3. Pete will not consider Mary as his friend if she is in love with John who is abusing him.

4. John will stop loving Mary if she does not love him or she is a friend of Pete.

5. Mary will stop loving John if he is abusing Pete.

6. John being in bad mood will abuse Pete.

7. John gets rid of bad mood if Mary loves him or if she is not a friend of Pete.

8. John will fall in a bad mood if he loves Mary and she does not love him or vice versa.

9. John will stop abusing Pete if he (John) does not love Mary any more or if she is not a friend of Pete.

Page 18: Ontology model and owl

Example (Formalised Rules)

R : IF (P P P ) THEN P1 1 4 2 2 ;

R : IF (P P ) THEN P2 2 3 3 ;

R : IF (P P P ) THEN P3 2 4 3 3 ;

R : IF ((P P ) P ) THEN P4 3 2 1 1 ;R : IF (P P ) THEN P5 2 4 2 ;R : IF (P P ) THEN P6 5 4 4 ;R : IF ((P P ) P ) THEN P7 2 3 5 5 ;R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5 ;R : IF ((P P ) P ) THEN P9 1 3 4 4 .

1. Mary will love John if he loves her and if he

is not abusing Pete.

2. Pete will consider Mary as his friend if she is

not in love with John.

3. Pete will not consider Mary as his friend if

she is in love with John who is abusing him.

4. John will stop loving Mary if she does not

love him or she is a friend of Pete.

5. Mary will stop loving John if he is abusing

Pete.

6. John being in bad mood will abuse Pete.

7. John gets rid of bad mood if Mary loves

him or if she is not a friend of Pete.

8. John will fall in a bad mood if he loves Mary

and she does not love him or vice versa.

9. John will stop abusing Pete if he (John) does

not love Mary any more or if she is not a friend

of Pete.

P1 = P(A1, L1, A2) - John loves Mary;

P2 = P(A2, L1, A1) - Mary loves John;

P3 = P(A3, L2, A2) - Pete has a friend Mary;

P4 = P(A1, L3, A3) - John is abusing Pete;

P5 = P(A1, L4, A1) - John has a bad mood.

Page 19: Ontology model and owl

Example (Reasoning, 1-st step)

John Mary

Pete

to love

to have a friend

543210 PPPPP=)S(t

R : IF (P P P ) THEN P1 1 4 2 2 ;

R : IF (P P ) THEN P2 2 3 3 ;

R : IF (P P P ) THEN P3 2 4 3 3 ;

R : IF ((P P ) P ) THEN P4 3 2 1 1 ;R : IF (P P ) THEN P5 2 4 2 ;R : IF (P P ) THEN P6 5 4 4 ;R : IF ((P P ) P ) THEN P7 2 3 5 5 ;R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5 ;R : IF ((P P ) P ) THEN P9 1 3 4 4 .

543210 PPPPP=)S(t

Page 20: Ontology model and owl

Example (Reasoning, 2-nd step)

John Mary

Pete

to love

to have a friend

R : IF (P P P ) THEN P1 1 4 2 2 ;

R : IF (P P ) THEN P2 2 3 3 ;

R : IF (P P P ) THEN P3 2 4 3 3 ;

R : IF ((P P ) P ) THEN P4 3 2 1 1 ;R : IF (P P ) THEN P5 2 4 2 ;R : IF (P P ) THEN P6 5 4 4 ;R : IF ((P P ) P ) THEN P7 2 3 5 5 ;R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5 ;R : IF ((P P ) P ) THEN P9 1 3 4 4 .

543210 PPPPP=)S(t

543210 PPPPP=)S(t 2

to have a bad mood

Page 21: Ontology model and owl

Example (Reasoning, 3-rd step)

John Mary

Pete

to love

to have a friend

R : IF (P P P ) THEN P1 1 4 2 2 ;

R : IF (P P ) THEN P2 2 3 3 ;

R : IF (P P P ) THEN P3 2 4 3 3 ;

R : IF ((P P ) P ) THEN P4 3 2 1 1 ;R : IF (P P ) THEN P5 2 4 2 ;R : IF (P P ) THEN P6 5 4 4 ;R : IF ((P P ) P ) THEN P7 2 3 5 5 ;R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5 ;R : IF ((P P ) P ) THEN P9 1 3 4 4 .

543210 PPPPP=)S(t 2

to abuse

543210 PPPPP=)S(t 3

Page 22: Ontology model and owl

Example (reasoning, 4-th step)

John Mary

Pete R : IF (P P P ) THEN P1 1 4 2 2 ;

R : IF (P P ) THEN P2 2 3 3 ;

R : IF (P P P ) THEN P3 2 4 3 3 ;

R : IF ((P P ) P ) THEN P4 3 2 1 1 ;R : IF (P P ) THEN P5 2 4 2 ;R : IF (P P ) THEN P6 5 4 4 ;R : IF ((P P ) P ) THEN P7 2 3 5 5 ;R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5 ;R : IF ((P P ) P ) THEN P9 1 3 4 4 .

543210 PPPPP=)S(t 3

to have a bad mood

543210 PPPPP=)S(t 4

Page 23: Ontology model and owl

Example (Reasoning, 5-th step)

John Mary

Pete R : IF (P P P ) THEN P1 1 4 2 2 ;

R : IF (P P ) THEN P2 2 3 3 ;

R : IF (P P P ) THEN P3 2 4 3 3 ;

R : IF ((P P ) P ) THEN P4 3 2 1 1 ;R : IF (P P ) THEN P5 2 4 2 ;R : IF (P P ) THEN P6 5 4 4 ;R : IF ((P P ) P ) THEN P7 2 3 5 5 ;R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5 ;R : IF ((P P ) P ) THEN P9 1 3 4 4 .

543210 PPPPP=)S(t 4

543210 PPPPP=)S(t 5

to abuse to have a friend

Page 24: Ontology model and owl

Example (Reasoning, Reaching terminal state)

John Mary

Pete R : IF (P P P ) THEN P1 1 4 2 2 ;

R : IF (P P ) THEN P2 2 3 3 ;

R : IF (P P P ) THEN P3 2 4 3 3 ;

R : IF ((P P ) P ) THEN P4 3 2 1 1 ;R : IF (P P ) THEN P5 2 4 2 ;R : IF (P P ) THEN P6 5 4 4 ;R : IF ((P P ) P ) THEN P7 2 3 5 5 ;R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5 ;R : IF ((P P ) P ) THEN P9 1 3 4 4 .

543210 PPPPP=)S(t 5

to have a friend

terminal state

Page 25: Ontology model and owl

Example (Asynchronous Reasoning Tree)

54321 PPPPP

R : IF (P P P ) THEN P1 1 4 2 2 ;

R : IF (P P ) THEN P2 2 3 3 ;

R : IF (P P P ) THEN P3 2 4 3 3 ;

R : IF ((P P ) P ) THEN P4 3 2 1 1 ;R : IF (P P ) THEN P5 2 4 2 ;R : IF (P P ) THEN P6 5 4 4 ;R : IF ((P P ) P ) THEN P7 2 3 5 5 ;R : IF ((P P P P ) P ) THEN P8 1 2 1 2 5 5 ;R : IF ((P P ) P ) THEN P9 1 3 4 4 .

54321 PPPPP 54321 PPPPP 54321 PPPPP

R1 R4

R8

54321 PPPPP

R4

R1

54321 PPPPP

R6

54321 PPPPP 54321 PPPPP

R4

54321 PPPPP

R8 R4 R6

54321 PPPPP

R4

54321 PPPPP

R6

54321 PPPPP R9

54321 PPPPP

R5

R3 R7

54321 PPPPP 54321 PPPPP 54321 PPPPP

R5 R9 R7

R3

54321 PPPPP

R5

R8 R9

R2

54321 PPPPP

R7

54321 PPPPP

R9

54321 PPPPP

R6 R7 R5

R8

R9

R9

54321 PPPPP

R9 R2 R2

R6

R7

R9

R2

R8