ontology model and owl

Download Ontology model and owl

Post on 16-Apr-2017

267 views

Category:

Technology

0 download

Embed Size (px)

TRANSCRIPT

  • Ontology Model and OWL

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

  • 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

  • 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

  • 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. Protg

    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.

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

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

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

    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).

  • OWL Features

    Class Person superclass

    Man, Woman subclasses

    Properties isWifeOf, isHusbandOf

    Property characteristics, restrictions inverseOf

    domain

    range

    Cardinality

    Class expressions disjointWith

  • 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

  • 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.

  • OWL Example in Protg

  • OWL Example in Protg

  • 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

  • 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

  • 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

  • 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)

  • 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

  • Production-Based Reasoning

    Initial state

    State after n

    transformations

    Set of Production

    Rules

    S(t0) S(t0+n)

  • 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.

  • 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.

  • 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

  • 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

  • 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 :