ontology design: owl constructs · 2009. 9. 10. · based on so called description logics. an...

51
Ontology Design: OWL Constructs Tutor: Aldo Gangemi Lecture 1 @ LEX09 Fiesole, Italy

Upload: others

Post on 17-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Ontology Design: OWL Constructs

Tutor: Aldo GangemiLecture 1 @ LEX09

Fiesole, Italy

Page 2: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

LEX09

Tutor info• Name: Aldo Gangemi• Institute: ISTC-CNR, Rome, Italy• Research Group: Semantic Technology Laboratory (STLab)• Role: Senior Researcher, Head of STLab• Research interest: Ontology Design, KE+NLP, Enterprise 3.0,

Legal Ontologies, Historical Knowledge Representation

Page 3: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

The Web evolves• A digital library (1.0)

– A document library with hyperlinks

• A database, an application platform (1.0, evolved)– A shared portal through which applications can be web accessible

• A multimedia and social platform (2.0)– A radio, a trailer, a telephone, a tv, a public place, a position anywhere

in the world. Collaboration, “web editing”

• A naming scheme (Semantic Web)– Unique identity for all entities: documents, persons, services, physical

things, metadata, ...– URI-based data integration is the key use-case for the semantic web

• A Global Giant Graph (3.0)– A place where people work, interact, and produce interpretations

assisted by computers 3

Page 4: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Data patterns• Use URIs as names for things• Use HTTP URIs so that people can look up those names

–Slash URIs are preferred• When someone looks up a URI, provide useful information

– Browsable graphs: a graph G is browsable if, for the URI of any node in G, if I look up that URI I will be returned information which describes the node, where describing a node means:

• Returning all statements where the node is a subject or object

• Describing all blank nodes attached to the node by one arc

• Include links to other URIs so that they can discover more things

4

from &m berners‐lee’slinked data principles

Page 5: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

5

Page 6: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

RDF vocabularies and OWL• Large use of small vocabularies

– FOAF, SIOC, SKOS • OWL representation and reasoning is the

next step at a web scale, but already a reality for intrawebs

6

Page 7: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

7

Page 8: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Preliminaries• Team in pairs or small groups• Open an editor• Create an ontology project

– Choose the reference language or syntax• Create a new ontology

– Choose the base URI of the ontology (“ID”), and the default URI (ending with either “#” or “/”)

8

Page 9: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Natural and Formal Languages

• Formal interpretation is not (only :)) an academic game

• It gives us a precise way to establish what we are talking about, and therefore to provide reliable automated inferences when needed

• Natural language is able to describe very different types of facts with the same structure, for example ...

9

Page 10: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

... different types of facts ...• Melville wrote Moby Dick [ground fact]• Captain Ahab is in command of the Pequod [literary fact]• Moby Dick is white [attributive fact]• The Pequod is a whaler [classification fact]• A whaler is a ship for hunting whales [meaning fact]• Whaler is synonym to whaleship [terminological fact]• Whaler is six characters long [information fact]• Whaler is a class [formal fact]• Whales are a delicious food for Japanese people

[contextual fact]• Moby Dick represents the hatred and rage of humanity

[interpretive fact] 10

Page 11: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

From NL to FL• This functionality of natural language

cannot be easily reproduced for machine interpretation

• The formal interpretation of OWL can do something

• More is provided by best practices• Some arbitrariness is unavoidable

– Requirements, requirements, requirements

11

Page 12: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

RDF (and OWL)• Each entity in an ontology is a web

resource, and has a URI• Each fact can be expressed as a triple

> Let's create a new ontology “Moby Dick”

12

Page 13: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Facts in OWL (or RDF)• Basic structure• Subject – Predicate – Object

> Melville wrote Moby Dick> Moby Dick is a whale

13

Page 14: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Embedding facts (RDF)• If the fact includes three entities, you can

embed a triple in another– Whales are a delicious food for Japanese

people• [Whales are a delicious food] – for – Japanese

people

• This is not allowed in OWL• Patterns do exist to approximate such

cases

14

Page 15: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Liberality of RDF• As a matter of fact, you can declare any

fact in RDF, even “unusual”, “counterintuitive”, or “abnormal” ones:? Moby Dick is white but also black? Moby Dick is in command of the Pequod? Ahab hates the third character of the white whale? Ahab is a class

• Liberality is great, but has costs: no way to make a machine detect undesired facts

15

Page 16: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL constraints• In order to limit (and to guide) the design of

ontologies, OWL restricts the expressivity of RDF

• No more is any triple allowed, but only those that respect the constraints of OWL formal semantics (lecture 1)

• Undesired facts will then be detected, if the design of the ontology reflects the conceptualization of the users

• That’s why we need good design (lecture 2)16

Page 17: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Formal interpretation (extensional)

17

Ahab

Whale

Human

hates

MobyDick

hatesI = HumanI × ThingI

WhaleI ⊆ ThingI

HumanI ⊆ ThingI

WhaleI ∩ HumanI = ∅AhabI ∈ HumanI

MobyDickI ∈ WhaleI

(Ahab,MobyDick)I ∈ hatesI

Thing

Page 18: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL exercise I:types, subclasses, and inheritance

> Ahab hates Moby Dick> Ahab is a human> Moby Dick is a whale> Whale is a class> Whale is a subclass of Mammal> Mammal is a subclass of Vertebrate> Vertebrate is a Group

18

Page 19: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Inheritance• Notice that some inferences are now

allowedMoby Dick is a whale; whales are mammals ⊢ Moby Dick is a mammalWhale is a subclass of Mammal; Mammal is a subclass of Vertebrate⊢ Whale is a subclass of Vertebrate

• This is called inheritance

19

Page 20: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Prevented inheritance• But some inferences are prevented

Moby Dick is a whale; Whale is an (OWL) class⊬ Moby Dick is an (OWL) classMammal is a subclass of Vertebrate; Vertebrate is a group⊬ Mammal is a group

20

Page 21: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Lesson learnt• In OWL we must distinguish when “is a”

means “rdf:type”, and when it means “rdfs:subClassOf”

• There are patterns to deal with these differences

• OWL2 allows more freedom

21

Page 22: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL exercise II:disjointness and consistency

use Radon or Pellet to check the ontology after each addition> Whales are not humans

• In formal languages, we can usually state when two classes are disjoint

• This provides greater clarity, and works fine for formal checking, i.e. “coherency” or “consistency”

22

Page 23: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Consistency• Equipped with the owl:disjointWith axiom,

we can now exclude the following:≯ Moby Dick is a human≯ Ahab is a whaleSince they would make an ontology inconsistent

23

Page 24: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Coherence• We can also exclude the following:

≯ Whamans are whales and humansSince it would make the ontology incoherent

24

Page 25: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL exercise III:domain, ranges, inverses, subproperties

> Whales can be food for Japanese humans> Being able to be food for something implies being able to be fed by something> Moby Dick can be food for Yukio> Hating something implies disliking it

25

Page 26: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Materialization• Some new inferences are now allowed:

Moby Dick can be food for Yukio⊢ Yukio can be fed by Moby DickAhab hates Moby Dick⊢ Ahab dislikes Moby Dick

• This is called materialization

26

Page 27: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

ClassificationYukio can be fed by Moby Dick; (as far as we know) only Japanese humans can be fed by whales⊢ Yukio is a Japanese human

• This is called classification• But this is prevented:

⊬ Yukio can be food for Moby Dick• Why?

27

Page 28: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Open World Assumption• Since the Web is an open world, if we say something

that is not explicitly put in our axioms, we cannot exclude it, and then we have to add a new axiom:

Yukio can be food for Moby Dick; whales can be food for Japanese humans⊢ Yukio is also a whale, and Moby Dick is also a Japanese human

• But, if we had modelled JapaneseHuman as a subclass of Human, this generates an inconsistency, since Human and Whale are disjoint classes, and JapaneseHuman is also disjoint with Whale, because of inheritance

28

Page 29: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL exercise IV:sameness and difference

• Due to the open world assumption, it is important to explicitly declare if any two individuals are the same or are different (when this is known)> Moby Dick is the same as “The White Whale”> Ahab is different from Yukio

29

Page 30: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Advanced modelling: restrictions and definitions in OWL

• The formal semantics of OWL is currently based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs that are interpreted as classes.

• > Let's create a new ontology “Aquatic organisms”

30

Page 31: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

• The class of things that are mammals and aquatic organisms

• The class including aquatic mammals, fishes and crustaceans

• The class of things that are not fishes

31

Fish AquaLcMammal FishCrustaceanMammal

AquaLcOrganism

not(Fish)

OWL exercise V:boolean class constructors

Page 32: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL exercise VI:relational class constructors

• The class of things that only live in a marine habitat– ∀liveIn.MarineHabitat

• The class of things that live in at least one marine habitat– ∃liveIn.MarineHabitat

• The class of things that live in the Indian Ocean– ∀liveIn.{IndianOcean}

• The class of things that live in either the Indian or Pacific Ocean– ∀liveIn.{IndianOcean PacificOcean}

• The class of things that have taxonomic species “Monodon monoceros”– ∃taxonomicSpecies.{MonodonMonoceros} 32

Page 33: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL exercise VII:“enumerating” class constructors

• The class of the following things: Indian, Pacific, and Artlantic Oceans– {IndianOcean PacificOcean AtlanticOcean}

33

Page 34: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL exercise VII:“enumerating” class constructors

• The class of the following things: Indian, Pacific, and Artlantic Oceans– {IndianOcean PacificOcean AtlanticOcean}

33

Page 35: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL exercise VIIIequivalence and automated subsumption/classification

• Differently from other conceptual modeling languages, OWL allows to state formal equivalence between two classes

• Equivalence works implicitly with class constructors – ontology APIs generate internal classes that

are equivalent to class constructors • but equivalence can be stated explicitly.

Page 36: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

... continued ...

> Aquatic mammals are mammals and aquatic organisms> Aquatic organisms only include aquatic mammals, fishes and crustaceans> Whales are not fishes> Omnivore animals are animals that eat any other animals or plants> Carnivore animals are animals that only eat other animals, and eat some of them

Page 37: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

... continued ...

> Aquatic mammals are mammals and aquatic organisms> Aquatic organisms only include aquatic mammals, fishes and crustaceans> Whales are not fishes> Omnivore animals are animals that eat any other animals or plants> Carnivore animals are animals that only eat other animals, and eat some of them

Page 38: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Fuzzy OWL• Not for all concepts or not in all contexts/

applications it is possible to assume crisp conditions, under which something is e.g. a legal subject, or an omnivore animal

• If a user needs to represent fuzzy concepts, should use a fuzzy variety of OWL

• But compare necessary conditions, sufficient conditions, scope of the ontology, and real fuzziness

36

Page 39: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

... cont. ...• Necessary condition on OmnivoreAnimal

– Omnivore animals eat any other animals or plants• Sufficient condition to OmnivoreAnimal

– Animals that eat any other animals or plants are omnivore animals

• Definition of OmnivoreAnimal – Omnivore animals are animals that eat any other

animals or plants• Fuzzy condition on OmnivoreAnimal

– Omnivore animals, under certain (but not necessarily all) relevant circumstances, eat any other animal or plant

37

Page 40: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

• Object properties can be symmetric, or transitive.

• “Sibling” is an example of both symmetric and transitive object property

OWL exercise IXsymmetry and transitivity

Page 41: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

... continued ...

> siblingOrder and siblingSpecies are symmetricand transitive

> Cetacea and Artyodactyla are sibling orders of superorder Laurasiatheria

> Within Cetacea, Monodon monoceros is a sibling species of Orcynus Orca, which is a sibling species of Balaenoptera musculus

Page 42: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

... continued ...

> siblingOrder and siblingSpecies are symmetricand transitive

> Cetacea and Artyodactyla are sibling orders of superorder Laurasiatheria

> Within Cetacea, Monodon monoceros is a sibling species of Orcynus Orca, which is a sibling species of Balaenoptera musculus

Page 43: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

When dealing with XSD datatypes, OWL uses Datatype Properties> Moby Dick is 23 metres longWhen dealing with annotations, OWL uses Annotation Properties> Moby Dick has been inspired by a long hunting for the albino sperm whale Mocha Dick near the coast of Chile (more than 100 battles with whalers)

40

OWL exercise Xdatatype and annotation properties

Page 44: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

• Everything that is true of Cetaceans ontology is true for Moby Dick ontology

OWL exercise XIimports

Page 45: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

• Everything that is true of Cetaceans ontology is true for Moby Dick ontology

OWL exercise XIimports

Page 46: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL Syntaxes• Abstract Syntax– Used in the definition of the language and the DL/Lite

semantics

• OWL in RDF (the “official” concrete syntax)– RDF/XML presentation

• XML Presentation Syntax– XML Schema definition

• Other, Human readable syntaxes– Manchester OWL Syntax– Sydney OWL Syntax– Rabbit

borrowed from Sean Bechhofer’s SSSW08 slides 42

Page 47: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Common Misconceptions

43

• Disjointness of primitives• Interpreting domain and range• And and Or• Quantification• Closed and Open Worlds

borrowed from Sean Bechhofer’s SSSW08 slides

Page 48: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Disjointness

44

• By default, primitive classes are not disjoint.

• Unless we explicitly say so, the description (Animal and Vegetable) is not inconsistent.

• Similarly with individuals -- the so-called Unique Name Assumption (often present in DL languages) does not hold, and individuals are not considered to be distinct unless explicitly asserted to be so.

borrowed from Sean Bechhofer’s SSSW08 slides

Page 49: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

Domain and Range

45

• OWL allows us to specify the domain and range of properties. • Note that this is not interpreted as a constraint.• Rather, the domain and range assertions allow us to make

inferences about individuals.• Consider the following:– ObjectProperty: employs

Domain: Company Range: PersonIndividual: IBM Facts: employs Jim

• If we haven’t said anything else about IBM or Jim, this is not an error. However, we can now infer that IBM is a Company and Jim is a Person.

borrowed from Sean Bechhofer’s SSSW08 slides

Page 50: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

And/Or and Quantification

46

• The logical connectives And and Or often cause confusion– Tea or Coffee?– Milk and Sugar?

• Quantification can also be contrary to our intuition.– Universal quantification over an empty set is true.

– Sean is a member of hasChild only Martian– Existential quantification may imply the existence

of an individual that we don’t know the name of.borrowed from Sean Bechhofer’s SSSW08 slides

Page 51: Ontology Design: OWL Constructs · 2009. 9. 10. · based on so called description logics. An important feature of description logics is the ability to declare “unnamed” constructs

OWL 2• Several new features, two are especially

important– Property chains

• Mustafa is brother of Saida; Saida is mother of Rashid

• ⊢ Mustafa is uncle of Rashid– Multiple interpretations of a constant

• Tutor(Meri)• AllowedPersonnel(Tutor)• Tutor(Alonzo,Meri)

47