Axiom Patterns COMP60421 Robert Stevens University of Manchester - - PowerPoint PPT Presentation

axiom patterns
SMART_READER_LITE
LIVE PREVIEW

Axiom Patterns COMP60421 Robert Stevens University of Manchester - - PowerPoint PPT Presentation

Axiom Patterns COMP60421 Robert Stevens University of Manchester robert.Stevens@manchester.ac.uk 1 Previously on COMP60421 Weve looked at operational knowledge of OWL Weve looked at acquiring knowledge to put in an ontology Weve


slide-1
SLIDE 1

Axiom Patterns

COMP60421 Robert Stevens University of Manchester robert.Stevens@manchester.ac.uk

1

slide-2
SLIDE 2

Previously on COMP60421

We’ve looked at operational knowledge of OWL We’ve looked at acquiring knowledge to put in an ontology We’ve looked at formalising knowledge We’ve looked at the semantics of OWL Now we look at putting OWL axioms together in patterns to say certain things in certain ways

2

slide-3
SLIDE 3

Patterns of axioms

  • An axiom pattern is a recurring regularity in how axioms are used or appear

within an ontology

  • The most common may be a tree of classes made with SubClassOf
  • … but they get much more complex than that
  • Usually, we’re referring to syntactic patterns; how axioms are written, but

remember “axioms” are inferred as well as written

3

slide-4
SLIDE 4

Patterns and design patterns

  • Software Design Patterns are well accepted solutions for common issues

met in software construction

  • Ontology Design Patterns are the same; but ontology engineers have barely

agreed on well accepted problems, let alone their solutions

  • ODP often depend on one’s philosophical stance and more of those kinds of

pattern later

  • Meanwhile, we’ll mostly talk about patterns as recurring regularities of

asserted axioms

4

slide-5
SLIDE 5

Coding style

  • Is a sort of pattern…
  • What we want is:

– Classes: Singular nouns with initial capital letter, spaces indicated by CamelCase

  • Individuals: All lower case, spaces indicated by _
  • Properties: Initial lower case letter, camel case – usually start with

“is” or “has”

  • All classes and individuals have a label, creator, description

annotation properties

5

slide-6
SLIDE 6

Label annotations for the class Head

Class: <#Head> Annotations: rdfs:label "Kopf"@de, rdfs:label "Testa"@it, rdfs:label "Tête"@fr, rdfs:label "Head"@en

6

slide-7
SLIDE 7

Naming conventions

  • Adopt one
  • For both labels and URI fragments
  • Both for the URI fragment and for the label
  • Having a label is a “good practice”
  • Naming conventions determine what words, in what order and what one

does about symbols and acronyms

  • See http://ontogenesis.knowledgeblog.org/948 for an introduction

7

slide-8
SLIDE 8

Names can help modelling

  • Thigh, shin, foot and toe are not “leg”, but “leg part”
  • Slice of tomato, tomato sauce, and tomato puree are not “Tomato” but

“Tomato based product”

  • Professor (Robert) and professor (the academic role) are different things;

name them differently and consistently

  • Card sorting and the three card trick can help you here
  • More on this later when we talk about upper level ontologies

8

slide-9
SLIDE 9

Types of axiom patterns

  • Domain modelling patterns: How to organise the axioms describing a

domain

  • Works both in the large – the whole ontology – and in the small – how to

describe a type of sushi

  • Language patterns: Used to take advantage of language features or work

around something missing in a language

  • The latter are used in the former

9

slide-10
SLIDE 10

The Margherita Pizza

Class: `Margherita pizza’ SubClassOf Pizza, hasTopping some MozzarellaCheese, hasTopping some tomatoSauce

  • Does this pizza have a cheese topping?
  • Does this Pizza have a tomato sauce topping?
  • Does this Pizza have an beef topping?

10

slide-11
SLIDE 11

11

MozarellaTopping BeefTopping TomatoTopping MargheritaPizza MozarellaTopping BeefTopping TomatoTopping MargheritaPizza

I1 I2 hasTopping some TomatoTopping and hasTopping some MozarellaTopping

The Margherita Pizza

slide-12
SLIDE 12

12

MozarellaTopping BeefTopping TomatoTopping MargheritaPizza MozarellaTopping BeefTopping TomatoTopping MargheritaPizza

I1 I2 hasTopping some TomatoTopping and hasTopping some MozarellaTopping

The Margherita Pizza (with closure)

hasTopping only (MozzarellaTopping

  • r TomatoTopping)
slide-13
SLIDE 13

OWL’s open world assumption

  • Unless we know something to be false it may be true
  • OWL has an “open world assumption”
  • Unless we add suitable constraints, interpretations may be possible
  • A lot of answers to queries may be “I don’t know”
  • We often need to add “closure” axioms

13

slide-14
SLIDE 14

The Closure Axioms

  • The existential quantifier “some” tells us that each margherita pizza has at

least one hasTopping property to a mozzarella individual

  • Due to OWL’s open world assumption, it may have other toppings – we just

don’t know

  • We need to say “it has these toppings and no others”

14

slide-15
SLIDE 15

The universal quantifier as closure

  • The universal quantifier “only” says that if this property exists between two

individuals, then the RHS can only be of the type of the RHS

  • …, but the relationship need not exist
  • hasTopping some MozzarellaCheese (there exists a hasTopping property to

a MozzarellaCheese individual)

  • hasTopping only MozzarellaCheese (if there is a hasTopping property to an

individual, then that individual will be a MozzarellaCheese individual)

15

slide-16
SLIDE 16

The closure pattern

Class: `Margherita pizza’ SubClassOf Pizza, hasTopping some MozzarellaCheese, hasTopping some tomatoSauce hasTopping only (MozzarellaCheese or TomatoSauce)

  • The first two axioms say “there are these two toppings”
  • The last axiom says “the things at the end of hasTopping for

MargheritaPizza will be of the union (MozzarellaCheese or TomatoSauce)

16

slide-17
SLIDE 17

The Covering Axiom

  • Class X has subclasses Y and Z
  • There may be other kinds of X, we don’t know…
  • We want to say “any individual of class X has to be an individual of either

class Y or class Z”

  • That is, class X is covered by classes Y and Z

17

The pattern: Class: X SubClassOf: (Y or Z)

slide-18
SLIDE 18

Sex as an example

Class: Sex Class: Male SubClassOf: Sex Class: Female SubClassOf: Sex Male DisjointWith: Female Sex SubClassOf: (Male or Female)

  • All individuals of Male are also

individuals of Sex

  • All individuals of Female are

also individuals of Sex

  • An individual of Sex cannot be

both an individual of Male and an individual of Female (the disjointness axiom)

  • An individual of type Sex must

be an individual of either Male

  • r Female (the SubClassOf:

(Male or Female) axiom

18

slide-19
SLIDE 19

More information….

  • http://ontogenesis.knowledgeblog.org/1001
  • Lots of short, accessible articles about ontology stuff

19

slide-20
SLIDE 20

Value Partitions

  • OWL not much good at representing continuous things
  • Colour, size and so on
  • So we need a pattern to “partition” such values
  • We want to say “Size” must be one of the subclasses of Size and only one
  • f those sizes – and that an individual size cannot be two kinds of size at

the same time

20

slide-21
SLIDE 21

Value Partitions

  • Used to model descriptive features of things.
  • The features are constrained to have certain values (e.g. Size: small,

medium, large).

  • OWL elements:

– Feature (Size): functional property (has_size) or class (Size). – Values: classes or individuals. – The values it can have are constrained by the range of the property.

  • Using classes allows to make subpartitions (e.g. very large, moderately

large).

  • http://www.w3.org/TR/swbp-specified-values/

21

slide-22
SLIDE 22

Value Partitions

  • The feature to be partitioned is covered: defined by the union of its

subclasses, the subclasses being disjoint: Size ≡ Small ∪ Medium ∪ Large Size Small Medium Large

IsA IsA IsA

Human

has_size 22

slide-23
SLIDE 23

Entity Property Quality (EPQ) pattern

  • A self-standing entity has a quality and should have only one of that quality
  • Colour, height, weight, size, speed, etc
  • Two coloured things have one colour per site and may have many sites
  • Class: Colour
  • Property: hasColour – functional, range – Colour – domain, anything that

has a colour

  • The class colour is a value partition
  • Can use just hasQuality but have to muck around with cardinality

constraints and it’s hard work

23

slide-24
SLIDE 24

Using cardinality in EQ

  • hasQuality max 1 Size
  • hasQuality exactly 1 Large
  • Allows use of only one property (which can be good)
  • But is hard work keeping on top of the cardinalities and can be hard work for

reasoners

  • EPQ means lots of different properties
  • One pays the money and makes the choice

24

slide-25
SLIDE 25

Composition, Parts and Wholes

25

slide-26
SLIDE 26

Composition or Aggregation

  • Forming an object whole using other objects as parts
  • Treating complex things as a single object
  • What are the primary composition relationships?
  • What inferences can we make?
  • What might we have in our representation

languages to support this?

26

http://www.flickr.com/photos/hartini/2429653007/

slide-27
SLIDE 27

Parts & wholes: Some examples

  • Bristles are part of a toothbrush
  • Wheels are part of a shopping trolley
  • A car is partly iron
  • A cappuccino is partly milk
  • A meter is part of a kilometer
  • Manchester is part of England
  • A tree is part of a forest
  • A slice of pie is part of the pie
  • A book chapter is part of a book
  • Stan Laurel is part of Laurel and Hardy
  • These are different kinds of composition, with different characteristics and

properties.

  • Confusing them may result in incorrect (or undesirable) inferences.

27

http://www.flickr.com/photos/aramisfirefly/4585596077

slide-28
SLIDE 28

Properties of Composition

  • Winston et. al. describe properties of composition
  • Configuration/Functionality

– Do the parts bear a functional or structural relationship to one another or the object they constitute? – functional/non-functional

  • Homeomerous

– Are the parts the same kind of thing as the whole? – homeomerous/non-homeomerous

  • Invariance

– Can the parts be separated from the whole? – separable/inseparable

  • We can then discuss combinations of these properties.

– We’ll consider Odell’s classification

28

slide-29
SLIDE 29

Component-Integral Object

  • A configuration of parts within a whole
  • Bristles - toothbrush
  • Scene - film
  • A particular arrangement (not just haphazard)
  • If components cease to support the overall pattern then different

associations may arise – Handle ripped from a door of the car.

  • No longer a part but a piece

29

functional non-homeomeric separable

slide-30
SLIDE 30

Material-Object

  • Parts can’t be removed
  • Capuccino is partly milk
  • Bread is partly flour
  • Define what objects are made of.
  • Component-Integral can be separated

– Car without a door handle still a Car

  • Material-Object can’t

– Bread without flour not bread

30

functional non-homeomeric non-separable

slide-31
SLIDE 31

Portion-Object

  • Cf Material-Object, but parts are the same kinds of thing
  • Slice of bread is a portion of bread
  • meter is part of a kilometer
  • A slice of bread is bread. So slices in a loaf are similar
  • Portions divided by standard measures

– meter/kilometer – hour/day

  • Selective inheritance of properties
  • Ingredients of bread are ingredients of slice of bread

– But with different quantities

  • Slice, helping, segment, lump, drop etc.

31

functional homeomeric separable

slide-32
SLIDE 32

Place-Area

  • Unlike Portion-Object, pieces cannot be removed
  • Manchester part of England
  • Peak part of a mountain
  • Often between places and locations.
  • Pieces similar in nature.

32

functional homeomeric non-separable

slide-33
SLIDE 33

Member-Bunch

  • No requirement for a particular structural or functional relationship
  • Tree part of a Forest
  • Employee part of the Union
  • Ship part of a Fleet
  • Member-Bunch is not subclass!!!

33

non-functional non-homeomeric separable

slide-34
SLIDE 34

Member-Partnership

  • An invariant form of Member-Bunch
  • Stan Laurel is part of Laurel and Hardy
  • Fred and Ginger are a dancing couple
  • Removal of member destroys the partnership

– a different partnership may result

34

non-functional non-homeomeric non-separable

slide-35
SLIDE 35

Summary of Odell’s Compositional Relationships

35

Functional Homeomeric Separable Component-Integral

Y N Y

Material-Object

Y N N

Portion-Object

Y Y Y

Place-Area

Y Y N

Member-Bunch

N N Y

Member-Partnership

N N N

slide-36
SLIDE 36

Non Compositional Relationships

  • Topological inclusion

– I am in the lecture theatre

  • Classification inclusion

– Catch 22 is a Book – It’s an instance of Book, not a part of it, so not Member-Bunch

  • Attribution

– Properties of an object can be confused with composition – Height of a Lighthouse isn’t part of it

  • Attachment

– Earrings aren’t part of Ears – Toes are part of Feet – Sometimes attachments are parts, but not always

  • Ownership

– A bicycle has wheels – I have a bicycle – A lot of modelling is about making the right distinctions and thus helping 36

slide-37
SLIDE 37

37

So what?

slide-38
SLIDE 38

Transitivity

  • We might expect part-whole or composition relationships to behave

transitively. – But this is generally only true with the same kind of composition.

  • Engine part of the Car
  • Pistons part of the Engine
  • Pistons part of the Car
  • Sean’s arm part of Sean
  • Sean part of School of Computer Science
  • Sean’s arm part of School of Computer Science

38

X is part of Y, Y is part of Z, thus X is part of Z

slide-39
SLIDE 39

Transitivity

  • We might expect part-whole or composition relationships to behave

transitively. – But this is generally only true with the same kind of composition.

  • Engine part of the Car
  • Pistons part of the Engine
  • Pistons part of the Car
  • Sean’s arm part of Sean
  • Sean part of School of Computer Science
  • Sean’s arm part of School of Computer Science

39

X is part of Y, Y is part of Z, thus X is part of Z isPartOf isConstituentOf isPortionOf isMemberOf ...

slide-40
SLIDE 40

Transitivity

  • In partonomies, we may want to identify direct parts

– Piston directPartOf Engine; Engine directPartOf Car – Piston is not directPartOf Car, but is a partOf Car

  • I want to query for all the direct parts of the Car, but not the direct parts of

its direct parts. – So directPartOf shouldn’t be transitive

  • Solution: provide a transitive superproperty
  • Queries can use the superproperty to query transitive closure
  • Assertions use the direct part of relationship
  • A standard ontology design pattern, sometimes referred to as transitive

reduction.

40

slide-41
SLIDE 41

Transitivity

  • In partonomies, we may want to identify direct parts

– Piston directPartOf Engine; Engine directPartOf Car – Piston is not directPartOf Car, but is a partOf Car

  • I want to query for all the direct parts of the Car, but not the direct parts of

its direct parts. – So directPartOf shouldn’t be transitive

  • Solution: provide a transitive superproperty
  • Queries can use the superproperty to query transitive closure
  • Assertions use the direct part of relationship
  • A standard ontology design pattern, sometimes referred to as transitive

reduction.

41

Property: isPartOf Characteristics: Transitive Property: isDirectPartOf SubPropertyOf: isPartOf

slide-42
SLIDE 42

Aside: Transitivity and Subproperties

  • Transitive property R is one s.t.

– for any x,y,z, if x R y and y R z, then z R z – Transitivity is not “inherited” by subproperties. – Nor is a superproperty of a transitive – property necessarily transitive

42 Property: knows Property: hasFriend SubPropertyOf: knows Characteristics: Transitive Property: hasBestFriend SubPropertyOf: hasFriend

slide-43
SLIDE 43

A note on Inverses

  • OWL allows us to define inverse relationships
  • hasPet / isPetOf
  • hasParent / isChildOf
  • (x R y) iff (y inv-R x)
  • Be careful about what you can infer about inverse relationships
  • X SubClassOf (hasPart some Y)

– All X’s have a part which is a Y – Are all Y’s a part of some X?

43

slide-44
SLIDE 44

Composition

  • Composition provides a mechanism for forming an object whole using its

parts

  • By considering basis properties if this part-whole relationship, we can

identify different kinds of relationship

  • The different relationships then help us in identifying when, for example, we

can (or can’t) apply transitivity.

  • Explicitly separating these in our representation can avoid incorrect/invalid

inferences.

44

slide-45
SLIDE 45

Ontology Normalisation

45

slide-46
SLIDE 46

Ontology Normalisation

  • Poly-hierarchies are the norm
  • “Harry Potter and the Philosopher’s stone” is a book, a children’s book, a

work of fiction, a big book, written in English, and a fantasy book

  • Poly-hierarchies allow knowledge to be captured and appropriately queried
  • They are difficult to build by hand
  • Essentially impossible to get right and maintain
  • We can use OWL and automated reasoners to do the work for us
  • … but how does one manage this and get it right?

46

slide-47
SLIDE 47

A “tangled” ontology of amino acids

47

slide-48
SLIDE 48

There are several dimensions of classification here

  • The amino acids themselves – a chemical dimension
  • The size of the amino acids side chain
  • The charge on the side chain
  • The polarity of the side chain
  • The hydrophobicity of the side chain
  • We can normalise these into separate hierarchies then put them back

together again

  • Our goal is to put entities into separate trees all formed on the same basis
  • Size only talks about size; amino acid only talks about chemical composition

(based on an alpha-carbon with an amino and carboxylic acid group);and so

  • nof classification

48

slide-49
SLIDE 49

The dimensions separated

Amino Acids

  • Alanine
  • Arginine
  • Asparagine
  • Cysteine
  • Glutamate
  • Glutamine
  • Glycine
  • Histidine
  • Isoleucine
  • Leucine
  • Lysine
  • Methionine
  • Phenylalanine
  • Proline
  • Serine
  • Threonine
  • Tryptophan
  • Tyrosine
  • Valine

Charge

  • Negative
  • Neutral
  • Positive

Size • Tiny

  • Small
  • Medium
  • Large

Polarity

  • Polar
  • Nonpolar

Hydrophobicity

  • Hydrophobic
  • Hydrophilic

49

slide-50
SLIDE 50

The process

  • Hand-crafted ontologies with a polyhierarchy are “tangled”
  • Usually axiomatically lean
  • We classify along one axis and use “restrictions” to other modules to

capture other axes

  • Then re-build the polyhierarchy using the axiomatically rich ontology

50

slide-51
SLIDE 51

“Pulling out” dimensions

  • Each separate tree must be the same kind of thing
  • We don’t mix self-standing things, processes, modifiers (qualities)
  • We don’t mix our classification by, for instance, structure and then charge
  • We do that compositionally via defined classes and the automated

reasoners

51

slide-52
SLIDE 52

The amino acid pattern

Class: AminoAcid SubClassOf: hasSize some Size, hasPolarity some Polar, hasCharge some Charge, hasHydrophobicity some hydrophobicity

52

slide-53
SLIDE 53

An amino acid

Class: Lysine SubClassOf: AminoAcid, hasSize some Large, hasCharge some Positive, hasPolarity some Polar, hasHydrophobicity some Hydrophilic

53

slide-54
SLIDE 54

Rebuilding the hierarchy

Class: LargeAminoAcid EquivalentTo: AminoAcid and hasSize some Large Class: PositiveAminoAcid EquivalentTo: AminoAcid and hasCharge some Positive Class: LargePositiveAminoAcid EquivalentTo: LargeAminoAcid and PositiveAminoAcid

54

slide-55
SLIDE 55

Patterns used

  • The Amino acids ontology uses these five patterns:

– Normalisation – EPQ – Closure (via it’s functional properties – A covering axiom for all the amino acids – It’s own pattern for amino acids – There is more information via

  • http://ontogenesis.knowledgeblog.org/tag/ontology-normalization

– http://robertdavidstevens.wordpress.com/2010/12/18/an-update- to-the-amino-acids-ontology/

55

slide-56
SLIDE 56

A “tangled” ontology of amino acids

56

slide-57
SLIDE 57

Upper Level Ontologies

57

slide-58
SLIDE 58

Upper Level Ontologies

  • Domain neutral description of all entities
  • Should be able to be used to describe any domain: biology, art, politics,

business, medicine, …

  • The basic divisions: processes and the things that participate in processes

are the two major divisions that many upper ontologies make

  • Much philosophical discussion (been trying since 437 BCE and still not

sorted it out)

  • So, we’ll do something simple….

58

slide-59
SLIDE 59

The PIMPS ontology in context

59

slide-60
SLIDE 60

PIMPS: A Simple Domain Neutral Ontology

  • Thing

– Process – Immaterial – Material – Properties

  • Quality
  • Function
  • Role
  • Disposition

– Sites

60

slide-61
SLIDE 61

Material entities

  • Self-standing things I can “hold in my hand”
  • A ball, a car, a person, a leg, a pizza, a piece of seaweed, etc etc
  • All of it exists at any one point in time
  • All of Robert exists at any point in time, even though Robert himself actually

changes

  • It retains its identity

61

slide-62
SLIDE 62

Processes

  • An entity that unfolds over time such that its identity changes
  • Not all of a process is present at a given time-point in that process
  • My life unfolds over time and is different at each point in time
  • Living, dying, eating, drinking, breathing,
  • Lots of “-ation” and “…ing” words

62

slide-63
SLIDE 63

Why use an upper level ontology?

  • Consistent modelling style both within and between ontologies
  • Primarily a guide to using properties consistently
  • Continuants have parts that are continuants
  • Processes have parts that are processes
  • Independent continuants hasQuality some Quality and playRole some Role
  • Independent continuant hasFunction some Function
  • Independent continuants participate in processes
  • Sites occupy some material entity
  • Use property hierarchies…

63

slide-64
SLIDE 64

What have we done

  • Lots of stuff about modelling
  • Patterns to take advantage of language features and to work around some

infelicities of a language

  • Modelling the same kind of entities in the same way
  • Choosing the right place for entities
  • Getting the choice of properties right
  • Designing your patterns for sushi…

64