ontologies in rdf-s/owl

30
Applied Semantic Web Timely. Practical. Reliable. http://applied-semantic-web.org Emanuele Della Valle [email protected] http://emanueledellavalle.org Ontologies in RDF-S/OWL

Upload: emanuele-della-valle

Post on 15-Jul-2015

2.434 views

Category:

Art & Photos


1 download

TRANSCRIPT

Applied Semantic WebTimely. Practical. Reliable.http://applied-semantic-web.org

Emanuele Della [email protected]://emanueledellavalle.org

Ontologies in RDF-S/OWL

Emanuele Della Valle - http://applied-semantic-web.org

Share, Remix, Reuse — Legally

This work is licensed under the Creative Commons Attribution 3.0 Unported License.

Your are free:

• to Share — to copy, distribute and transmit the work

• to Remix — to adapt the work

Under the following conditions

• Attribution — You must attribute the work by inserting– “© applied-semantic-web.org” at the end of each reused slide– a credits slide stating: these slides are partially based on

“Ontologies in RDF-S/OWL” by Emanuele Della Valle http://applied-semantic-web.org/2010/03/03_RDFS-OWL.ppt

To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/

2

Emanuele Della Valle - http://applied-semantic-web.org 3

Ontology: RDF-S and OWL

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

Ontology definition

Philosophy (400BC): • Systematic explanation of Existence

Neches (91): • Ontology defines basic terms and relations comprising the

vocabulary of a topic area as well as the rules for combining terms and relations to define extensions to the vocabulary

Gruber (93): • Explicit specification of a conceptualization

Borst (97): • Formal specification of a shared conceptualization

Studer(98)• Formal, explicit specification of a shared conceptualization

44

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

What does it mean?

Formal, explicit specification of a shared conceptualization

Machinereadable

Several peopleagrees that suchconceptual model

is adequate to describe such aspects of the

reality

A conceptual model of someaspects of the

realityIt makesdomain

assumptionexplicit

55

Emanuele Della Valle - http://applied-semantic-web.org 6

RDF-S/OWL in a nutshell

Questa è un’ontologia?

NO, perchè• È una concettualizzazione• È condivisa dalla

comunità che l’ha sviluppata

… ma non è• esplicita (la dimensione

dei rami molto probabilmente non indica la numerosità delle speci)

• formale (nessuna macchina può usarla)

Emanuele Della Valle - http://applied-semantic-web.org 7

RDF-S/OWL in a nutshell

Esempio di ontologia

Concetti e relazioni primitivi• essere umano• maschio• femmina• ha figlio

Concetti e relazioni derivate• un uomo è un essere umano ed

è un maschio• una donna è un essere umano ed

è una femmina• una madre è una donna che

ha almeno un figlio• una padre è un uomo che

ha almeno un figlio• un genitore è o un padre o una madre• un nonno è un uomo che

ha almeno un figlio che è un genitore • “essere figlio di” è la relazione inversa

a “avere un figlio”

Fatti asseriti• Antonio, Lorenzo e Carlo

sono uomini• Rosanna è una donna• Antonio ha figlio Lorenzo• Rosanna ha figlio Carlo

Carlo è figlio di LorenzoAntonio

Rosanna Lorenzo

Carlo

ha figlio

ha figlio

è figlio di

Una macchina in grado di “capire” un linguaggio ontologico “sa inferire”• Concetti: un nonno è un genitore• Fatti: Antonio è un nonno, Lorenzo è un padre, Rosanna è una madre

Emanuele Della Valle - http://applied-semantic-web.org 8

RDF-S/OWL in a nutshell

Linguaggio Ontologico

Concetti e relazioni primitivi• essere umano• maschio• femmina• ha figlio

Concetti e relazioni derivate• un uomo è un essere umano ed

è un maschio• una donna è un essere umano ed

è una femmina• una madre è una donna che

ha almeno un figlio• una padre è un uomo che

ha almeno un figlio• un genitore è o un padre o una madre• un nonno è un uomo che

ha almeno un figlio che è un genitore • “essere figlio di” è la relazione inversa

a “avere un figlio”

Fatti asseriti• Antonio, Lorenzo e Carlo

sono uomini• Rosanna è una donna• Antonio ha figlio Lorenzo• Rosanna ha figlio Carlo

Carlo è figlio di LorenzoAntonio

Rosanna Lorenzo

Carlo

ha figlio

ha figlio

è figlio di

Una macchina in grado di “capire” un linguaggio ontologico “sa inferire”• Concetti: un nonno è un genitore• Fatti: Antonio è un nonno, Lorenzo è un padre, Rosanna è una madre

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

Le parti di un linguaggio ontologico

concetti• astrazioni del dominio applicativo tipicamente visti come

insiemi

relazioni• esprimono l’esistenza di relazioni tra i concetti del dominio

tipicamente viste come relazioni binarie tra gli individui

assiomi• formalizzano quali combinazioni di concetti e relazioni sono

ammissibili

individui• elementi degli insiemi definiti dai concetti

asserzioni • dichiarano l’appartenenza di un individuo ad un insieme

fatti• legano due individui tramite una relazione

9

Emanuele Della Valle - http://applied-semantic-web.org 10

RDF-S/OWL in a nutshell

Strong vs. Weak Semantics?

“A little semantics, goes a long way”

[James Hendler, 2001]

“A Little Semantic Web Goes a Long Way in Biology”

[Wolstencroft et al., 2005]

Emanuele Della Valle - http://applied-semantic-web.org 11

RDF-S/OWL in a nutshell

A simple ontology

Artist Piece

Painter Paint

paints

Sculptor Sculpt

sculpts

creates

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

Specifying classes, sub-classes and instances

Creating a class • RDFS: Artist rdf:type owl:Class . • FOL: ∃x Artist(x)

Creating a subclass • RDFS: Painter rdfs:subClassOf Artist .• RDFS: Sculptor rdfs:subClassOf Artist .• FOL: ∀x [Painter(x) ∨ Sculptor(x) → Artist(x)]

Creating an instance• RDFS: Rodin rdf:type Sculptor .• FOL: Sculptor(Rodin)

ArtistPainter

SculptorRodin

1212

Emanuele Della Valle - http://applied-semantic-web.org

Creating a property• RDFS: creates rdf:type owl:ObjectProperty .• FOL: ∃x ∃y Creates(x,y)

Using a property• RDFS: Rodin creates TheKiss .• FOL: Creates(Rodin, TheKiss)

Creating subproperties • RDFS: paints rdfs:subPropertyOf creates .• FOL: ∀x ∀y [Paints(x,y) → Creates(x,y)]

• RDFS: sculpts rdfs:subPropertyOf creates . • FOL: ∀x ∀y [Sculpts(x,y) → Creates(x,y)]

RDF-S/OWL in a nutshell

Specifying properties and sub-properties

creates

paints

1313

Emanuele Della Valle - http://applied-semantic-web.org

È abbastanza importante parlare di OWL import e la parte di metadati di un’ontologia altrimenti non si possono validare le ontologie con http://owl.cs.manchester.ac.uk/validator/

14

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

Specifying domain/range constrains

Checking which classes and properties can be use together

RDFS:creates rdfs:domain Artist .creates rdfs:range Piece .paints rdfs:domain Painter .paints rdfs:range Paint .sculpts rdfs:domain Sculptor .sculpts rdfs:range Sculpt .

FOL:∀x ∀y [Creates(x,y) → Artist(x) ∧ Piece(y)]∀x ∀y [Paints(x,y) → Painter(x) ∧ Paint(y)]∀x ∀y [Sculpts(x,y) → Sculptor(x) ∧ Sculpt(y)]

1515

Emanuele Della Valle - http://applied-semantic-web.org 16

RDF-S/OWL in a nutshell

The ontology we specified

Artist Piece

Painter Paint

paints

Sculptor Sculpt

sculpts

creates

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

RDF-S semantics (a part of it) if then

x rdfs:subClassOf y . a rdf:type y .

a rdf:type x .

x rdfs:subClassOf y . x rdfs:subClassOf z .

y rdfs:subClassOf z .

x a y . x b y .

a rdfs:subPropertyOf b .

a rdfs:subPropertyOf b . a rdfs:subPropertyOf c .

b rdfs:subPropertyOf c .

x a y . x rdf:type z .

a rdfs:domain z .

x a u . u rdf:type z .

a rdfs:range z .Read out more in RDF Semantics http://www.w3.org/TR/rdf-mt/

1717

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

RDF-S semantics at work

Shared the ontology ...@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .@prefix ex: <http://www.ex.org/schema#> .

ex:Sculptor rdfs:subClassOf ex:Artist .ex:Painter rdfs:subClassOf ex:Artist .ex:Sculpt rdfs:subClassOf ex:Piece.ex:Painting rdfs:subClassOf ex:Piece .ex:creates rdfs:domain ex:Artist .ex:creates rdfs:range ex:Piece.ex:sculpts rdfs:subPropertyOf ex:creates .ex:sculpts rdfs:domain ex:Sculptor .ex:sculpts rdfs:range ex:Sculpt .

... when transmitting the following triple …ex:Rodin ex:sculpts ex:TheKiss .

1818

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

Without Inference

A recipient, that only understands XML syntax,

receiving<RDF> <Description about="Rodin"> <sculpts resource="TheKiss"/> </Description></RDF>

can answer the following queries• What does Rodin sculpt?RDF/Description[@about='Rodin']/sculpts/@resource

• Who does sculpt TheKiss?RDF/Description[sculpts/@resource='TheKiss']/@about

• Try out your self at http://www.mizar.dk/XPath/

but it cannot answer• Who is Rodin?• What is TheKiss?• Is there any Sculptor/Scupts?• Is there any Artist/Piece?

1919

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

Knowing the ontology and RDF-S semantics …

A recipient, that knows the ontology and “understands” RDF semantics,

Receiving Rodin sculpts TheKiss .

Artist Piece

Painter Paint

paints

Sculptor Sculpt

sculpts

creates

Rodin TheKiss

2020

Emanuele Della Valle - http://applied-semantic-web.org 21

RDF-S/OWL in a nutshell

… a reasoner can answer

the previous queries• What does Rodin sculpt?

ex:TheKiss

• Who does sculpt TheKiss?ex:Rodin

it can also answer• Who is Rodin?

ex:Artist, ex:Sculptor, rdfs:Resource

• What is TheKiss?ex:Sclupt, ex:Piece, rdfs:Resource

• Is there any Sculptor?ex:Rodin

• Is the any Artist?ex:Rodin

• Is there any Sculpt?ex:TheKiss

• Is there any Piece?ex:TheKiss

• Is there any Paint?0 results

• Is there any Painter?0 results

21

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

More expressive power 1/3

RDFS is a light ontological language that allows for defining simple vocabularies.

One may want also express• Cardinality constrains (max, min, exactly) for properties

usage– Es. a Polygon has 3 or more edges– ∀x [Polygon(x) → ≥3y Edge(y) ∧ Forms(y,x) ]

• Property types– transitive

- e.g. hasAncestor is a transitive property: if A hasAncestor B and B hasAncestor C, then A hasAncestor C.

- ∀x ∀y ∀z [HasAncestor(x,y) ∧ HasAncestor(y,z) → HasAncestor(x,z) ]

– inverse- e.g. sclupts has isSculptedBy as inverse property:

if A sclupts B then B isSculptedBy A

- ∀x ∀y [Sculpts(x,y) → IsSculptedBy(y,x) ]

2222

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

More expressive power 2/3

– simmetric- e.g. isCloseTo is a simmetric property:

if A isCloseTo B then B isCloseTo A

- ∀x ∀y [IsCloseTo(x,y) → IsCloseTo(y,x) ]

• Restrictions of usage for a specific property– All values of property must be of a certain kind

- e.g. a D.O.C. Wine can be only produced by a Certified Wienery- ∀x ∀y [DOCWine(x) ∧ Produces(x,y) → CertifiedWienery(y)]

– Some values of property must be of a certain kind- e.g. a Famous Painter must have painted some Famous Painting- ∀x [FamousPainter(x) → ∃y FamousPaint(y) ∧

IsPaintedBy(y,x)]

• A class is defined combining other classes (union, intersection, negation, ...) – A white wine is a Wine and its color is “white”– ∃x [Wine(x) ∧ White(x)]

2323

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

More expressive power 3/3

• Two instances refers to the same real object– “The Boss” and “Bruce Springsteen” are two names for the same

person– TheBoss = BruceSpringsteen

• Two classes refers to the same set– “Painters” in english and “Pittori” in italian– ∀x [Painter(x) ↔ Pittore(x)]

• Two properties refers to the same binary relationship– “Paints” in english and “Dipinge” in italian– ∀x ∀y [Paints(x,y) ↔ Dipinge(x,y)]

2424

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

Expressivity vs. Tractability

The more an ontological language is expressive the less is tractable

the Web Ontology Language (OWL) comes with several profiles that offers different trade-offs between expressivity and tractability.

2525

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

OWL 2 profiles

OWL 1 defines only one fragment (OWL Lite)• And it isn’t very tractable!

OWL 2 defines several different fragments with• Useful computational properties

– E.g., reasoning complexity in range LOGSPACE to PTIME• Useful implementation possibilities

– E.g., Smaller fragments implementable using RDBs

OWL 2 profiles• OWL 2 EL, OWL 2 QL, OWL 2 RL

2626

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

OWL 2 EL

Useful for applications employing ontologies that contain very

large number of properties and/or classes• Captures expressive power used by many large-

scaleontologies E.g.; SNOMED CT, NCI thesaurus

Features• Included: existential restrictions, intersection,

subClass,equivalentClass, disjointness, range and domain, object property inclusion possibly involving property chains, and data property inclusion, transitive properties, keys …

• Missing: include value restrictions, Cardinality restrictions (min, max and exact), disjunction and negation

Maximal language for which reasoning (including query answering) known to be worst-case polynomial

2727

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

OWL 2 QL

Useful for applications that use very large volumes of data, and where query answering is the most important task

Captures expressive power of simple ontologies like thesauri, classifications, and (most of) expressive power of ER/UML schemas

E.g., CIM10, Thesaurus of Nephrology, ...

Features• Included: limited form of existential restrictions, subClass,

equivalentClass, disjointness, range & domain, symmetric properties, …

• Missing: existential quantification to a class, self restriction, nominals, universal quantification to a class, disjunction etc.

Can be implemented on top of standard relational DBMS

Maximal language for which reasoning (including query answering) is known to be worst case logspace (same as DB)

2828

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

OWL 2 RL

Useful for applications that require scalable reasoning without sacrifying too much expressive power, and where query answering is the most important task

Support most OWL features but• with restrictions placed on the syntax of OWL 2• standard semantics only apply when they are used in a

restricted way

Can be implemented on top of rule extended DBMS• E.g., Oracle’s OWL Prime implemented using forward chaining

rules in Oracle 11g• Related to DLP and pD*

Allows for scalable (polynomial) reasoning using rule-based technologies

2929

Emanuele Della Valle - http://applied-semantic-web.org

RDF-S/OWL in a nutshell

RDF-S/OWL Resources

OWL Frequently Asked Questions• http://www.w3.org/2003/08/owlfaq.html

RDF-S/OWL implementations - community maintained list of open-source and commercial SPARQL engines• http://esw.w3.org/topic/SemanticWebTools#head-d07454b4f0d51f5e9d878822d911d0bfea9dcdfd

RDF-S Specification• http://www.w3.org/TR/rdf-schema/

OWL Working Group Wiki• http://www.w3.org/2007/OWL/wiki

30