OWL Semantics Richer languages allow the definition of classes - - PowerPoint PPT Presentation

owl semantics
SMART_READER_LITE
LIVE PREVIEW

OWL Semantics Richer languages allow the definition of classes - - PowerPoint PPT Presentation

Ontology A representation of the shared background knowledge for a community Providing the intended meaning of a formal vocabulary used to describe a certain conceptualisation of objects in a domain of interest In CS, ontology taken to


slide-1
SLIDE 1

OWL Semantics

COMP60421 Sean Bechhofer University of Manchester sean.bechhofer@manchester.ac.uk

1

Ontology

  • A representation of the shared background knowledge for a community
  • Providing the intended meaning of a formal vocabulary used to describe a

certain conceptualisation of objects in a domain of interest

  • In CS, ontology taken to mean an engineering artefact
  • A vocabulary of terms plus explicit characterisations of the assumptions

made in interpreting those terms

  • Nearly always includes some notion of hierarchical classification (is-a)
  • Richer languages allow the definition of classes through description of their

characteristics – Introduce the possibility of using inference to help in management and deployment of the knowledge.

2

Toward Formalization

  • Acquisition Process

– Elicit tacit knowledge – A Set of terms/concepts

  • More explicit information

– Hierarchy and other relations – Categorizing (modifiers) – Constraints and definitions

  • Hierarchical Relations

– Nodes/Arcs representing a relationship (default IS-A) – What IS-A Is and Isn’t: An Analysis of Taxonomic Links in Semantic Networks (Brachman)

3

What is a Taxonomy?

  • An organisation of entities

– Typically hierarchical – Subclass relationships

  • Organisationally Rigid

– Things must be put in their proper place. – Multiple places for things?

  • Impoverished descriptions

– Cats are carnivores

  • Why?
  • What is it to be a Carnivore?
  • What if we say something is a Carnivore and a Herbivore?

Animal Mammal Domestic Cat Dog Cow Person Pet Farmed Cat Dog Cow

4

slide-2
SLIDE 2

More Expressivity

  • Not just term-term relationships
  • Definitions

– A carnivore is an animal that eats only meat

  • Constraints

– Carnivores are not herbivores (and vice versa)

  • What Entailments can we make?

– Carnivores eat only Meat – Cats eat only Mice – Mice are Meat – Thus Cats are Carnivores!

5

Structure of an Ontology

  • Ontologies typically have two distinct components:
  • Names for important concepts in the domain

– Paper is a concept whose members are papers. – Person is a concept whose members are persons

  • Background knowledge/constraints on the domain

– A Paper is a kind of ArgumentativeDocument – All participants in a Workshop must be Persons. – No individual can be both an InProceedings and a Journal

  • Syntax required to allow us to state/express/write down this information

– Operators that allow us to describe complex expressions

6

OWL Ontologies

  • Individuals

– Elements in the domain

  • Things, objects, members of Robert’s family
  • Properties

– (Binary) Relations between objects

  • hasFather, hasSibling

– Attributes

  • hasBirthDate
  • Classes

– Collections of things – Primitive, named classes

  • Person

– Class descriptions built up from other classes using class forming

  • perators.
  • Man
  • Axioms represent background knowledge/constraints

7

Operators

  • A primitive or atomic class gives us no indication as to the individuals that

are members of it. – We don’t know what it is to be a Cat

  • Operators allow us to form class descriptions

– Describing the characteristics of properties of the individuals that are members of the class

  • Animals that live in the Forest
  • Animals that eat other Animals
  • By expressing these definitions in a structured, explicit way, we can begin to

derive benefit (inference)

8

slide-3
SLIDE 3

OWL Class Expressions (Informal)

  • Booleans

– Human and Male – Doctor or Lawyer – not Male

  • Restrictions

– hasChild some Man – hasChild only Woman – hasDescendant min 2 Doctor – hasAncestor max 2 – hasSibling exactly 1 Woman

9

Remember: All these expressions describe Classes!

(Informal) Inference

10

Animal that eats some Animal Animal that eats some Gazelle Animal that eats some Gazelle and eats some Grass (Assuming Gazelle is a kind of Animal)

Axioms

  • We can now describe classes through a description of their characteristics.

– Lions are Animals that eat other animals – Anything that eats only animals is a carnivore – Robert is a Person

  • Axioms allow us to state these additional relationships that we expect to

hold between classes and individuals – They encapsulate the assumptions that facilitate shared interpretations

  • f our vocabulary.

11

OWL Axioms (Informal)

  • Class Axioms

– Person SubClassOf Animal – (Person and Male) EquivalentTo Man

  • Property Axioms

– transitivity – reflexivity – functional

  • Individual Axioms

– Robert type Person – Robert hasParent Margaret

12

slide-4
SLIDE 4

Necessary and Sufficient Conditions

  • Classes can be described in terms of necessary and sufficient conditions.

– This differs from some frame-based languages where we only have necessary conditions.

  • Necessary conditions

– Must hold if an object is to be an instance of the class – SubClassOf axioms

  • Sufficient conditions

– Those properties an object must have in order to be recognised as a member

  • f the class.

– EquivalentTo axioms

13

If it looks like a duck and walks like a duck, then it’s a duck!

Constraints Definitions

Syntax

  • A simple grammar for expressions (aka, descriptions)
  • Examples

– Animal that eats only Animal – eats some (not Animal) – not (eats only Animal and some Animal)

14

atomicClass ::= [A-Z][a-zA-Z]* (in camel case) atomicProperty ::= [a-z][a-zA-Z]* (in camel case) description ::= conjunction 'or' conjunction { 'or' conjunction } | conjunction conjunction ::= classIRI 'that' [ 'not' ] restriction { 'and' [ 'not' ] restriction } | primary 'and' primary { 'and' primary } | primary primary ::= [ 'not' ] ( restriction | atomic ) restriction ::= property 'some' primary | property 'only' primary

Grammar is a slightly modified subset of the one given in: http://www.w3.org/TR/owl2-manchester-syntax/

More Syntax

  • A simple grammar for axioms (aka propositions)
  • Examples

– Class: CarnivorousAnimal EquivalentTo: Animal that eats only Animal – Class: Cow SubClassOf: eats some (not Animal) – Class: ConfusedCow SubClassOf: not (eats only Animal and some Animal)

15

classFrame ::= 'Class:' atomicClass { 'Annotations:' annotation { ',' annotation } | 'SubClassOf:' description { ',' annotation } | 'EquivalentTo:' description { ',' annotation }

Formal Languages

  • The degree of formality of ontology languages varies widely
  • Increased formality makes languages more amenable to machine

processing (e.g. automated reasoning).

  • The formal semantics provides an unambiguous interpretation of the

descriptions.

16

slide-5
SLIDE 5

Why Semantics?

  • What does an expression in an ontology language mean?
  • The semantics of a language can tell us precisely how to interpret a

complex expression.

  • Well defined semantics are vital if we are to support machine interpretability

– They remove ambiguities in the interpretation of the descriptions.

Black Telephone

?

17

OWL: The Web Ontology Language

The W3C OWL 2 Web Ontology Language (OWL) is a Semantic Web language designed to represent rich and complex knowledge about things, groups of things, and relations between things. OWL is a computational logic- based language such that knowledge expressed in OWL can be reasoned with by computer programs either to verify the consistency of that knowledge or to make implicit knowledge explicit. OWL documents, known as ontologies, can be published in the World Wide Web and may refer to

  • r be referred from other OWL ontologies. OWL is part of

the W3C's Semantic Web technology stack, which includes RDF [RDF Concepts] and SPARQL [SPARQL].

http://www.w3.org/TR/owl-primer/

18

Diversion: Semantics and Model Theories

  • Ontology/KR languages aim to model (part of) world
  • Terms in language correspond to entities in world
  • Meaning given by, e.g.:

– Mapping to another formalism, such as FOL, with own well defined semantics – or a bespoke Model Theory (MT)

  • MT defines relationship between syntax and interpretations

– Can be many interpretations (models) of one piece of syntax – Models supposed to be analogue of (part of) world ! E.g., elements of model correspond to objects in world – Formal relationship between syntax and models ! Structure of models reflect relationships specified in syntax – Inference can then be defined in terms of this Model Theory

19

Set Based Model Theory

  • Many logics (including standard First Order Logic) use a model theory

based on Zermelo-Frankel set theory

  • The domain of discourse (i.e., the part of the world being modelled) is

represented as a set (often referred to as !)

  • Objects in the world are interpreted as elements of !

– Classes/concepts (unary predicates) are subsets of ! – Properties/roles (binary predicates) are subsets of ! ! ! (i.e., !2) – Ternary predicates are subsets of !3 etc.

  • The sub-class relationship between classes can be interpreted as set

inclusion

20

slide-6
SLIDE 6

Set Based Model Theory Example

World Interpretation Daisy:Cow Cow kindOf Animal Mary: Person Person kindOf Animal Z123ABC: Car ! {"a,b#,…} $ ! ! !

a b

Model Mary drives Z123ABC

21

Set Based Model Theory Example

  • Formally, the vocabulary is the set of names we use in our model of (part
  • f) the world

– {Daisy, Cow, Animal, Mary, Person, Z123ABC, Car, drives, …}

  • An interpretation I is a tuple <!,I>

– ! is the domain (a set)

– I is a mapping that maps ! Names of objects to elements of ! ! Names of unary predicates (classes/concepts) to subsets of ! ! Names of binary predicates (properties/roles) to subsets of ! X ! ! And so on for higher arity predicates (if any)

22

Direct OWL Semantics

  • OWL semantics defined by interpretations: <!,I>, where

– ! is the domain (a non-empty set)

– I is an interpretation function that maps: ! Class name A % subset AI of ! ! Property name R % binary relation RI over ! ! Individual name i % iI element of !

  • Interpretation function I tells us how to interpret atomic classes, properties

and individuals. – The semantics of class operators is given by extending the interpretation function in an obvious way.

23

OWL Class Constructors

Constructor Example Interpretation Atomic Class Human HumanI and Human and Male HumanI & MaleI

  • r

Doctor or Lawyer DoctorI ' LawyerI not not Male ! \ MaleI

24

slide-7
SLIDE 7

OWL Class Constructors

Constructor Example Interpretation some hasChild some Lawyer {x|(y."x,y#)hasChildI* y)LawyerI}

  • nly

hasChild only Doctor {x|+y."x,y#)hasChildI , y)DoctorI} min hasChild min 2 {x|#"x,y#)hasChildI - 2} max hasChild max 2 {x|#"x,y#)hasChildI . 2}

25

Interpretation Example

! = {v, w, x, y, z}

AI = {v, w, x} BI = {x, y} RI = {(v, w), (v, x), (y, x), (x, z)}

  • not B =
  • A and B =
  • not A or B =
  • R some B =
  • R only B =
  • R some (R some A) =
  • R some not(A or B) =
  • R min 1 =
  • R max 1 =

AI

v x y z w

BI

26

OWL Knowledge Bases (Ontologies)

  • An OWL ontology is a collection of axioms that describe the model.

– Axioms allow us to add further statements about arbitrary concept expressions and properties

  • An Ontology/Knowledge Base is often split into two parts

– T-box is a set of axioms of the form: ! C SubClassOf: D (subclass) ! C EquivalentTo: D (class equivalence) ! R SubPropertyOf: S (subproperty) ! R EquivalentTo: S (property equivalence) ! ... – A-box is a set of axioms of the form ! x Type: C (concept instantiation) ! "x,y# ) R (role instantiation) – OWL doesn’t formally make this distinction

27

Ontology Semantics

  • The interpretation function I can be extended to axioms.
  • An interpretation I then satisfies (models) an axiom A iff the interpretation
  • f the axiom holds in the interpretation
  • I satisfies an ontology O iff I satisfies every axiom A in O
  • The collection of axioms constrain the possible interpretations that can be

made. – Thus ensuring that our assumptions are respected

28

slide-8
SLIDE 8

Axiom Example Interpretation SubClassOf Human subClassOf: Animal HumanI $ AnimalI EquivalentTo Man EquivalentTo: Human and Male ManI = HumanI & MaleI DisjointWith Animal DisjointWith: Plant AnimalI & PlantI = /

OWL Class Axioms

29

Necessary and Sufficient Conditions

  • Classes can be described in terms of necessary and sufficient conditions.

– This differs from some frame-based languages where we only have necessary conditions.

  • Necessary conditions

– Must hold if an object is to be an instance of the class – SubClassOf axioms

  • Sufficient conditions

– Those properties an object must have in order to be recognised as a member

  • f the class.

– EquivalentTo axioms

  • Allows us to perform automated classification.

30

If it looks like a duck and walks like a duck, then it’s a duck!

Constraints Definitions

OWL Individual Axioms

Axiom Example Interpretation Types Sean Types: Human SeanI ) HumanI Facts Sean Facts: worksWith Bijan "SeanI,BijanI#)worksWithI DifferentFrom Sean DifferentFrom: Bijan SeanI " BijanI SameAs GeorgeWBush SameAs: PresidentBush GeorgeWBushI = PresidentBushI

31

OWL Property Axioms

Axiom Example Interpretation SubPropertyOf: hasMother SubPropertyOf: hasParent hasMotherI $ hasParentI functional employedBy Characteristics: Functional +x,y,z. ("x,y#)employedByI * "x,z#)employedByI) , y = z domain

  • wns Domain: Person

+x."x,y#)ownsI , x)PersonI range employs Range: Person +y."x,y#)employsI , y)PersonI transitivity hasPart Characteristics: Transitive +x,y,z. ("x,y#)hasPartI * "y,z#)hasPartI) , "x,z#)hasPartI

32

slide-9
SLIDE 9

Multiple Models -v- Single Model

  • An OWL Ontology doesn’t define a single model, it is a set of

constraints that define a set of possible models – No constraints (empty Ontology) means any model is possible – More constraints means fewer models – Too many constraints may mean no possible model (inconsistent Ontology)

  • In contrast, DBs (and frame/rule KR systems) make assumptions such

that DB/KB defines a single model – Unique name assumption ! Different names always interpreted as different individuals – Closed world assumption ! Domain consists only of individuals named in the DB/KB – Minimal models ! Extensions are as small as possible

33

I2: ! = {v, w, x, y, z} CI = {v, w, y} DI = {x, y} EI = {z} aI = v bI = x cI = w dI = z I3: ! = {v, w, x, y, z} CI = {v, w, y} DI = {x, y} EI = {z} aI = v bI = y cI = w dI = z I4: ! = {v, w, x, y, z} CI = {v, w, x, y} DI = {x, y} EI = {z} aI = v bI = x cI = y dI = z

Example of Multiple Models

KB = {} KB = {a:C, b:D, c:C, d:E} KB = {a:C, b:D, c:C, d:E, b:C} KB = {a:C, b:D, c:C, d:E, b:C D subClassOf C} KB = {a:C, b:D, c:C, d:E, b:C D subClassOf C, E subClassOf C} KB = {a:C, b:D, c:C, d:E, b:C D subClassOf C E subClassOf C, d: not C}

I1: ! = {v, w, x, y, z} CI = {v, w, y} DI = {x, y} EI = {z} aI = v bI = x cI = w dI = y

34

Example of Single Model

KB = {} KB = {a:C, b:D, c:C, d:E} KB = {a:C, b:D, c:C, d:E, b:C} KB = {a:C, b:D, c:C, d:E, b:C E subClassOf C}

I: ! = {} I: ! = {a, b, c, d} CI = {a, b, c} DI = {b} EI = {d} aI = a bI = b cI = c dI = d I: ! = {a, b, c, d} CI = {a, c} DI = {b} EI = {d} aI = a bI = b cI = c dI = d I: ! = {a, b, c, d} CI = {a, b, c, d} DI = {b} EI = {d} aI = a bI = b cI = c dI = d

35

Single Model -v- Multiple Model

Multiple models:

  • Expressively powerful

– Boolean connectives, including not and or

  • Can capture incomplete

information – E.g., using or and some

  • Monotonic

– Adding information preserves truth

  • Reasoning (e.g., querying) is

hard/slow

  • Queries may give counter-

intuitive results in some cases Single model:

  • Expressively weaker (in most

respects) – No negation or disjunction

  • Can’t capture incomplete

information

  • Nonmonotonic

– Adding information does not preserve truth

  • Reasoning (e.g., querying) is

easy/fast

  • Queries may give counter-

intuitive results in some cases

36

slide-10
SLIDE 10

Inference

  • An OWL Ontology is a set of constraints that define a set of possible models
  • We may be able to determine that particular properties must hold of this set of

models.

  • This allows us to draw inferences.
  • Knowledge is correct (captures intuitions)

– D subsumes C w.r.t. O iff for every model I of O, CI $ DI

  • Knowledge is minimally redundant (no unintended synonyms)

– C is equivalent to D w.r.t. O iff for every model I of O, CI = DI

  • Knowledge is meaningful (classes can have instances)

– C is satisfiable w.r.t. O iff there exists some model I of O s.t. CI " /

  • Querying knowledge

– x is an instance of C w.r.t. O iff for every model I of O, xI ) CI – <x,y> is an instance of R w.r.t. K iff for, every model I of O, (xI,yI) ) RI

  • Ontology consistency

– An ontology O is consistent iff there exists some model I of O

37

Reasoning

  • Tableau algorithms used to test satisfiability (consistency)
  • Try to build a tree-like model I of the input concept C
  • Decompose C syntactically

– Apply tableau expansion rules – Infer constraints on elements of model

  • Tableau rules correspond to constructors in logic (and, or etc)

– Some rules are nondeterministic (e.g., or, min) – In practice, this means search

  • Stop when no more rules applicable or clash occurs

– Clash is an obvious contradiction, e.g., A(x), not A(x)

  • Cycle check (blocking) may be needed for termination
  • C satisfiable iff rules can be applied such that a fully expanded clash free

tree is constructed

38

Defining OWL

  • OWL is defined via a Structural Specification

http://www.w3.org/TR/owl2-syntax/

  • Defines language independently of concrete syntaxes
  • Conceptual structure and abstract syntax

– UML diagrams and functional-style syntax used to define the language – Mappings to concrete syntaxes then given.

  • The structural specification provides the foundation for implementations

(e.g. OWL API as discussed later)

39

OWL Resources

  • The OWL Technical Documentation is all available online from the W3C site.

http://www.w3.org/TR/owl2-overview/

  • All the OWL documents are relevant, but in particular the Overview, Primer,

Reference Guide and Manchester Syntax Guide will help you in the initial stages.

40