unit 2 rdf formal semantics in detail · 2013. 9. 23. · unit1–overview organization...

115
Unit 1 – Overview Unit 2 – RDF Formal Semantics in Detail Axel Polleres Siemens AG Österreich VU 184.729 Semantic Web Technologies A. Polleres VU 184.729 1/41

Upload: others

Post on 05-Aug-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview

Unit 2 – RDF Formal Semantics in Detail

Axel Polleres

Siemens AG Österreich

VU 184.729 Semantic Web Technologies

A. Polleres VU 184.729 1/41

Page 2: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview

Where are we?

Last time we learnt:• Basic ideas about RDF and how it is published• Turtle Syntax for RDF - we know how to write RDF• Basic SPARQL queries - we (roughly) know how to query RDF

We skipped:• Overview of RDF Schema . . . we will get to that today• Overview of OWL . . . we will get to that later

Next today:• RDF formal semantics...• ... which will be the basis for SPARQL’s formal semantics• ... and also for RDF Schema & OWL

Next time:... continue with RDFS semantics & SPARQL semanticsDiscuss Assignment 1 (no new assignment today)

A. Polleres VU 184.729 2/41

Page 3: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview

Organization

First two organizational items:1 We need to find a replacement date for 11/05/2012 !2 Assignments can be improved until Wednesday noon, (re-)send them

to [email protected] (please use this email only)

A. Polleres VU 184.729 3/41

Page 4: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview

Unit Outline

1. What does that data mean? Ontologies described in RDFS + OWL

2. RDF Graph – Formal Definitions

3. RDF Interpretations and Simple Entailment

4. APPENDIX: Simple RDF Entailment is NP-complete

A. Polleres VU 184.729 4/41

Page 5: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL

Unit Outline

1. What does that data mean? Ontologies described in RDFS + OWL

2. RDF Graph – Formal Definitions

3. RDF Interpretations and Simple Entailment

4. APPENDIX: Simple RDF Entailment is NP-complete

A. Polleres VU 184.729 5/41

Page 6: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL

What does RDF data mean?

Ontologies are formal descriptions of what the vocabulary used in an RDFdocument means.

By vocabulary, we mean here mostly:• properties,i.e., predicates• classes, i.e., objects of rdf:type triples• (individuals, i.e., concrete objects )1

Ontologies describe relations among properties, classes and individuals(subclasses, subproperties, equivalence, domain, range, etc.)

The W3C has published two standards to describe ontologies, namely RDFSchema (RDFS) [Brickley and Guha (eds.), 2004] and the Web Ontologylanguage (OWL) [Patel-Schneider et al., 2004]• RDFS . . . simple schema language with minimal expressivity, mostly expressible in

simple forward chaining inference rules (Horn Rules)• OWL . . . higher expressivity, foundations in Description Logics• both RDFS and OWL ontologies are RDF graphs themselves, i.e., OWL and

RDFS provide “an RDF vocabulary to describe RDF vocabularies”

1“data” rather than “ontology”, in DL terminology this distinction is oftencalled ABox vs. TBox.

A. Polleres VU 184.729 6/41

Page 7: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL

What does RDF data mean?

Ontologies are formal descriptions of what the vocabulary used in an RDFdocument means.

By vocabulary, we mean here mostly:• properties,i.e., predicates• classes, i.e., objects of rdf:type triples• (individuals, i.e., concrete objects )1

Ontologies describe relations among properties, classes and individuals(subclasses, subproperties, equivalence, domain, range, etc.)

The W3C has published two standards to describe ontologies, namely RDFSchema (RDFS) [Brickley and Guha (eds.), 2004] and the Web Ontologylanguage (OWL) [Patel-Schneider et al., 2004]• RDFS . . . simple schema language with minimal expressivity, mostly expressible in

simple forward chaining inference rules (Horn Rules)• OWL . . . higher expressivity, foundations in Description Logics• both RDFS and OWL ontologies are RDF graphs themselves, i.e., OWL and

RDFS provide “an RDF vocabulary to describe RDF vocabularies”

1“data” rather than “ontology”, in DL terminology this distinction is oftencalled ABox vs. TBox.

A. Polleres VU 184.729 6/41

Page 8: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL

What does RDF data mean?

Ontologies are formal descriptions of what the vocabulary used in an RDFdocument means.

By vocabulary, we mean here mostly:• properties,i.e., predicates• classes, i.e., objects of rdf:type triples• (individuals, i.e., concrete objects )1

Ontologies describe relations among properties, classes and individuals(subclasses, subproperties, equivalence, domain, range, etc.)

The W3C has published two standards to describe ontologies, namely RDFSchema (RDFS) [Brickley and Guha (eds.), 2004] and the Web Ontologylanguage (OWL) [Patel-Schneider et al., 2004]• RDFS . . . simple schema language with minimal expressivity, mostly expressible in

simple forward chaining inference rules (Horn Rules)• OWL . . . higher expressivity, foundations in Description Logics• both RDFS and OWL ontologies are RDF graphs themselves, i.e., OWL and

RDFS provide “an RDF vocabulary to describe RDF vocabularies”

1“data” rather than “ontology”, in DL terminology this distinction is oftencalled ABox vs. TBox.

A. Polleres VU 184.729 6/41

Page 9: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL

What does RDF data mean?

Ontologies are formal descriptions of what the vocabulary used in an RDFdocument means.

By vocabulary, we mean here mostly:• properties,i.e., predicates• classes, i.e., objects of rdf:type triples• (individuals, i.e., concrete objects )1

Ontologies describe relations among properties, classes and individuals(subclasses, subproperties, equivalence, domain, range, etc.)

The W3C has published two standards to describe ontologies, namely RDFSchema (RDFS) [Brickley and Guha (eds.), 2004] and the Web Ontologylanguage (OWL) [Patel-Schneider et al., 2004]• RDFS . . . simple schema language with minimal expressivity, mostly expressible in

simple forward chaining inference rules (Horn Rules)• OWL . . . higher expressivity, foundations in Description Logics• both RDFS and OWL ontologies are RDF graphs themselves, i.e., OWL and

RDFS provide “an RDF vocabulary to describe RDF vocabularies”

1“data” rather than “ontology”, in DL terminology this distinction is oftencalled ABox vs. TBox.

A. Polleres VU 184.729 6/41

Page 10: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL

Example Vocabulary – The FOAF ontology:

Properties: foaf:name, foaf:knows, foaf:homepage, foaf:primaryTopic etc.

Classes: foaf:Person, foaf:Agent, foaf:Document, foaf:Organisation, etc.

Relations: e.g.

• Each Person is a Agent (subclass)

• The img property is more specific than depiction(subproperty)

• img is a relation between Persons and Imgages(domain/range)

• knows is a relation between two Persons(domain/range)

• homepage denotes unique homepage of an Agent(uniquely identifying property)

...

A. Polleres VU 184.729 7/41

Page 11: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL

Example Vocabulary – The FOAF ontology:

Properties: foaf:name, foaf:knows, foaf:homepage, foaf:primaryTopic etc.

Classes: foaf:Person, foaf:Agent, foaf:Document, foaf:Organisation, etc.

Relations: e.g.

• Each Person is a Agent (subclass)

• The img property is more specific than depiction(subproperty)

• img is a relation between Persons and Imgages(domain/range)

• knows is a relation between two Persons(domain/range)

• homepage denotes unique homepage of an Agent(uniquely identifying property)

...

A. Polleres VU 184.729 7/41

Page 12: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL

Example Vocabulary – The FOAF ontology:

Properties: foaf:name, foaf:knows, foaf:homepage, foaf:primaryTopic etc.

Classes: foaf:Person, foaf:Agent, foaf:Document, foaf:Organisation, etc.

Relations: e.g.

• Each Person is a Agent (subclass)

• The img property is more specific than depiction(subproperty)

• img is a relation between Persons and Imgages(domain/range)

• knows is a relation between two Persons(domain/range)

• homepage denotes unique homepage of an Agent(uniquely identifying property)

...

A. Polleres VU 184.729 7/41

Page 13: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL

Example Vocabulary – The FOAF ontology:

Properties: foaf:name, foaf:knows, foaf:homepage, foaf:primaryTopic etc.

Classes: foaf:Person, foaf:Agent, foaf:Document, foaf:Organisation, etc.

Relations: e.g.

• Each Person is a Agent (subclass)

• The img property is more specific than depiction(subproperty)

• img is a relation between Persons and Imgages(domain/range)

• knows is a relation between two Persons(domain/range)

• homepage denotes unique homepage of an Agent(uniquely identifying property)

...

A. Polleres VU 184.729 7/41

Page 14: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL

Example Vocabulary – The FOAF ontology:

Properties: foaf:name, foaf:knows, foaf:homepage, foaf:primaryTopic etc.

Classes: foaf:Person, foaf:Agent, foaf:Document, foaf:Organisation, etc.

Relations: e.g.

• Each Person is a Agent (subclass)

• The img property is more specific than depiction(subproperty)

• img is a relation between Persons and Imgages(domain/range)

• knows is a relation between two Persons(domain/range)

• homepage denotes unique homepage of an Agent(uniquely identifying property)

...

A. Polleres VU 184.729 7/41

Page 15: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.1 RDFS Vocabulary

RDF(S) vocabulary: RDF and RDFS themselves are vocabularies!

Properties: rdf:type, rdfs:domain, rdfs:range, rdfs:subClassOf,rdfs:subPropertyOf, rdf:first, rdf:rest etc.

Classes: rdf:XMLLiteral, rdf:Literal, rdfs:Resource,rdf:Property,rdfs:Class, rdf:List, etc.

Relations:

The semantics of the RDFs vocabulary is defined in [Hayes, 2004]; it isa “meta vocabulary” used to define the semantics of other vocabularies

A. Polleres VU 184.729 8/41

Page 16: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.1 RDFS Vocabulary

RDF(S) vocabulary: RDF and RDFS themselves are vocabularies!

Properties: rdf:type, rdfs:domain, rdfs:range, rdfs:subClassOf,rdfs:subPropertyOf, rdf:first, rdf:rest etc.

Classes: rdf:XMLLiteral, rdf:Literal, rdfs:Resource,rdf:Property,rdfs:Class, rdf:List, etc.

Relations:The semantics of the RDFs vocabulary is defined in [Hayes, 2004]; it isa “meta vocabulary” used to define the semantics of other vocabularies

A. Polleres VU 184.729 8/41

Page 17: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.2 Semantics of RDF + RDFS

The Semantics of RDF graphs:

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix foaf: <http://xmlns.com/foaf/0.1/> .<http://www.mat.unical.it/˜ianni/foaf.rdf> a foaf:PersonalProfileDocument.<http://www.mat.unical.it/˜ianni/foaf.rdf> foaf:maker _:me .<http://www.mat.unical.it/˜ianni/foaf.rdf> foaf:primaryTopic _:me .:me a foaf:Person .:me foaf:name "Giovambattista Ianni" .:me foaf:homepage <http://www.gibbi.com> .:me foaf:phone <tel:+39-0984-496430> .:me foaf:knows [ a foaf:Person ;

foaf:name "Wolfgang Faber" ;rdfs:seeAlso <http://www.kr.tuwien.ac.at/staff/faber/foaf.rdf>].

:me foaf:knows [ a foaf:Person .foaf:name "Axel Polleres" ;rdfs:seeAlso <http://www.polleres.net/foaf.rdf>].

:me foaf:knows [ a foaf:Person .foaf:name "Thomas Eiter" ] .

:me foaf:knows [ a foaf:Person .foaf:name "Alessandra Martello" ] .

A. Polleres VU 184.729 9/41

Page 18: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.2 Semantics of RDF + RDFS

The Semantics of RDF graphs:

As we will see in the next Units, each RDF graph can – essentially – be viewed as afirst-order formula:

∃b1 , b2 , b3 , b4(triple(foaf.rdf, rdf:type, PersonalProfileDocument)∧ triple(foaf.rdf, maker,me)∧ triple(foaf.rdf, primaryTopic,me)∧ triple(me, rdf:type, Person)∧ triple(me, name, "Giovambattista Ianni")∧ triple(me, homepage, http://www.gibbi.com)∧ triple(me, phone, tel:+39-0984-496430)∧ triple(me, knows, b2) ∧ triple(b1 , type, Person)∧ triple(b1 , name, "Wolfgang Faber")∧ triple(b1 , rdfs:seeAlso, http://www.kr.tuwien...)∧ triple(me, knows, b1) ∧ triple(b1 , rdf:type, Person)∧ triple(b2 , name, "Axel Polleres")∧ triple(b2 , rdfs:seeAlso, http://www.polleres...)∧ triple(me, knows, b3) ∧ triple(b1 , rdf:type, Person)∧ triple(b3 , name, "Thomas Eiter")∧ triple(me, knows, b4) ∧ triple(b1 , type, Person)∧ triple(b4 , name, "Alessandra Martello"))

A. Polleres VU 184.729 9/41

Page 19: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.2 Semantics of RDF + RDFS

The Semantics of the RDFS vocabulary:The formal semantics of RDF(S) [Hayes, 2004] is accompanied by a set of(informative) entailment rules . . . can be written down as the following first-orderformulas:

∀S, P,O (triple(S, P,O) ⊃ triple(S, rdf:type, rdfs:Resource))

∀S, P,O (triple(S, P,O) ⊃ triple(P, rdf:type, rdf:Property))

∀S, P,O (triple(S, P,O) ⊃ triple(O, rdf:type, rdfs:Resource))

∀S, P,O (triple(S, P,O) ∧ triple(P, rdfs:domain, C) ⊃ triple(S, rdf:type, C))

∀S, P,O,C (triple(S, P,O) ∧ triple(P, rdfs:range, C) ⊃ triple(O, rdf:type, C))

∀C (triple(C, rdf:type, rdfs:Class) ⊃ triple(C, rdfs:subClassOf, rdfs:Resource))

∀C1, C2, C3 (triple(C1, rdfs:subClassOf, C2) ∧triple(C2, rdfs:subClassOf, C3) ⊃ triple(C1, rdfs:subClassOf, C3))

∀S,C1, C2 (triple(S, rdf:type, C1) ∧ triple(C1, rdfs:subClassOf, C2) ⊃ triple(S, rdf:type, C2))

∀S,C (triple(S, rdf:type, C) ⊃ triple(C, rdf:type, rdfs:Class))

∀C (triple(C, rdf:type, rdfs:Class) ⊃ triple(C, rdfs:subClassOf, C))

∀P1, P2, P3 (triple(P1, rdfs:subPropertyOf, P2) ∧triple(P2, rdfs:subPropertyOf, P3) ⊃ triple(P1, rdfs:subPropertyOf, P3))

∀S, P1, P2, O (triple(S, P1, O) ∧ triple(P1, rdfs:subPropertyOf, P2) ⊃ triple(S, P2, O))

∀P (triple(P, rdf:type, rdf:Property) ⊃ triple(P, rdfs:subPropertyOf, P ))

plus the axiomatic triples from [Hayes, 2004, Sections 3.1 and 4.1].A. Polleres VU 184.729 10/41

Page 20: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.2 Semantics of RDF + RDFS

The Semantics of the RDFS vocabulary:The formal semantics of RDF(S) [Hayes, 2004] is accompanied by a set of(informative) entailment rules . . . can be written down as the following first-orderformulas:

∀S, P,O (triple(S, P,O) ⊃ triple(S, rdf:type, rdfs:Resource))

∀S, P,O (triple(S, P,O) ⊃ triple(P, rdf:type, rdf:Property))

∀S, P,O (triple(S, P,O) ⊃ triple(O, rdf:type, rdfs:Resource))

∀S, P,O (triple(S, P,O) ∧ triple(P, rdfs:domain, C) ⊃ triple(S, rdf:type, C))

∀S, P,O,C (triple(S, P,O) ∧ triple(P, rdfs:range, C) ⊃ triple(O, rdf:type, C))

∀C (triple(C, rdf:type, rdfs:Class) ⊃ triple(C, rdfs:subClassOf, rdfs:Resource))

∀C1, C2, C3 (triple(C1, rdfs:subClassOf, C2) ∧triple(C2, rdfs:subClassOf, C3) ⊃ triple(C1, rdfs:subClassOf, C3))

∀S,C1, C2 (triple(S, rdf:type, C1) ∧ triple(C1, rdfs:subClassOf, C2) ⊃ triple(S, rdf:type, C2))

∀S,C (triple(S, rdf:type, C) ⊃ triple(C, rdf:type, rdfs:Class))

∀C (triple(C, rdf:type, rdfs:Class) ⊃ triple(C, rdfs:subClassOf, C))

∀P1, P2, P3 (triple(P1, rdfs:subPropertyOf, P2) ∧triple(P2, rdfs:subPropertyOf, P3) ⊃ triple(P1, rdfs:subPropertyOf, P3))

∀S, P1, P2, O (triple(S, P1, O) ∧ triple(P1, rdfs:subPropertyOf, P2) ⊃ triple(S, P2, O))

∀P (triple(P, rdf:type, rdf:Property) ⊃ triple(P, rdfs:subPropertyOf, P ))

plus the axiomatic triples from [Hayes, 2004, Sections 3.1 and 4.1].A. Polleres VU 184.729 10/41

Page 21: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.2 Semantics of RDF + RDFS

The Semantics of the RDFS vocabulary:

Note:All those rules were Datalog expressible, i.e. no negation, no function symbols.

A. Polleres VU 184.729 11/41

Page 22: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.2 Semantics of RDF + RDFS

RDFS Semantics Example: The FOAF ontology

FOAF Ontology:Each Person is a Agent (subclass)

The img property is more specific than depiction (subproperty)

img is a relation between Persons and Imgages (domain/range)

knows is a relation between two Persons (domain/range)

homepage denotes unique homepage of an Agent (uniquely identifying property)...

RDFS: Semantics...

∀S,C1, C2 (triple(S, rdf:type, C1) ∧ triple(C1, rdfs:subClassOf, C2) ⊃ triple(S, rdf:type, C2))...

Data:

:me rdf:type foaf:Person .

:me rdf:type foaf:Agent .

A. Polleres VU 184.729 12/41

Page 23: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.2 Semantics of RDF + RDFS

RDFS Semantics Example: The FOAF ontology

FOAF Ontology in RDF:foaf:Person rdfs:subClassOf foaf:Agent .

foaf:img rdfs:subPropertyOf foaf:depiction .

foaf:img rdfs:domain foaf:Person ; rdfs:range foaf:Image .

foaf:knows rdfs:domain foaf:Person ; rdfs:range foaf:Person .

???...

RDFS: Semantics...

∀S,C1, C2 (triple(S, rdf:type, C1) ∧ triple(C1, rdfs:subClassOf, C2) ⊃ triple(S, rdf:type, C2))...

Data:

:me rdf:type foaf:Person .:me rdf:type foaf:Agent .

A. Polleres VU 184.729 12/41

Page 24: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.2 Semantics of RDF + RDFS

RDFS Semantics Example: The FOAF ontology

FOAF Ontology in RDF:foaf:Person rdfs:subClassOf foaf:Agent .

foaf:img rdfs:subPropertyOf foaf:depiction .

foaf:img rdfs:domain foaf:Person ; rdfs:range foaf:Image .

foaf:knows rdfs:domain foaf:Person ; rdfs:range foaf:Person .

homepage denotes unique homepage of an Agent ???...

RDFS: Semantics...

∀S,C1, C2 (triple(S, rdf:type, C1) ∧ triple(C1, rdfs:subClassOf, C2) ⊃ triple(S, rdf:type, C2))...

Data:

:me rdf:type foaf:Person .:me rdf:type foaf:Agent .

A. Polleres VU 184.729 12/41

Page 25: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 1. What does it mean? RDFS+OWL 1.2 Semantics of RDF + RDFS

Summary

We should all have a rough idea about where to find RDF now.We should all have a rough idea about how to read RDF now.We should all have a rough idea of how to query RDF (SPARQL).We should all have an idea of how the semantics of RDFvocabularies and data can be described (RDF Schema ... we’ll keepfor OWL later)

Details to come!

A. Polleres VU 184.729 13/41

Page 26: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Unit Outline

1. What does that data mean? Ontologies described in RDFS + OWL

2. RDF Graph – Formal Definitions

3. RDF Interpretations and Simple Entailment

4. APPENDIX: Simple RDF Entailment is NP-complete

A. Polleres VU 184.729 14/41

Page 27: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

RDF Graph – Formal Definitions

Let U be the set of URIs, B be the set of blank nodes (or “variables”),L = Lt ∪ Lp ∪ Llang be the set of literals (i.e., typed, plain, and plainlang-tagged)

An RDF graph, or simply a graph, is a set of RDF triples fromUB × U × UBL.2

A vocabulary of a graph VG is the subset of UL mentioned in the graph.

A graph or triple without blank nodes is also called ground

2We write short e.g. UBL for U ∪B ∪ L.A. Polleres VU 184.729 15/41

Page 28: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

RDF Graph – Example 1

Node: “edge labels” may appear as nodes and vice versa, e.g.G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G2 :

ex:alice rdf:type foaf:Person.

G3 :

__ :alice foaf:knows ex:bob.__ :alice foaf:name __ :name.

G4 :

__ :alice foaf:knows ex:bob.__ :alice foaf:name __ :alice.

Again, we will occasionally write blank nodes as like this V ar, to make clearerthat actually they ammount to existentially quantified variables.

A. Polleres VU 184.729 16/41

Page 29: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

RDF Graph – Example 1

Node: “edge labels” may appear as nodes and vice versa, e.g.G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G2 :

ex:alice rdf:type foaf:Person.

G3 :

Alice foaf:knows ex:bob.Alice foaf:name Name.

G4 :

Alice foaf:knows ex:bob.Alice foaf:name Alice.

Again, we will occasionally write blank nodes as like this V ar, to make clearerthat actually they ammount to existentially quantified variables.

A. Polleres VU 184.729 16/41

Page 30: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

RDF Graph – Example 2

That is also a valid RDF graph:

G5 :

rdfs:Resource rdf:type rdfs:Class.rdf:Property rdf:type rdfs:Resource.rdf:Property rdfs:subclassOf rdfs:Resource.rdf:Property rdf:type rdfs:Class.rdfs:Class rdf:type rdfs:Resource.rdfs:Class rdf:type rdfs:Class.rdfs:Class rdfs:subclassOf rdfs:Resource.rdfs:Class rdfs:subclassOf rdfs:Class.

A. Polleres VU 184.729 17/41

Page 31: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

RDF Graph – Example 2

That is also a valid RDF graph:

G5 :

A. Polleres VU 184.729 17/41

Page 32: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

RDF Graph – Example 3

Or that:

G6 :

rdfs:subClassOf rdfs:subPropertyOf rdfs:Resource.rdfs:subClassOf rdfs:subPropertyOf rdfs:subPropertyOf.rdf:type rdfs:subPropertyOf rdfs:subClassOf.rdfs:subClassOf rdf:type owl:SymmetricProperty.

A. Polleres VU 184.729 18/41

Page 33: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Definitions

Assume a blank node mapping µ : B → UBL.

By µ(G) we denote the graph obtained from G by replacing each blank node xwith µ(x).

We call µ(G) an instance of G.

A proper instance of a graph is an instance in which a blank node has beenreplaced by a constant (form U or L), or two blank nodes in the graph havebeen mapped into the same node in the instance.

An RDF graph is lean if it has no instance which is a proper subgraph of thegraph. Non-lean graphs have internal redundancy and express the same contentas their lean subgraphs.

Two graphs which differ only in the identity of their blank nodes, are consideredto be equivalent.

The merge of a set of graphs is obtained by renaming (“standardize apart”)blank nodes in each graph such that no blank nodes between any two graphs arein common and then taking the union of all triples, we write G1 ]G2 for thegraph merge between two graphs G1, G2.

Questions

What is meant by “redundancy” and “same content” here?

A. Polleres VU 184.729 19/41

Page 34: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Definitions

Assume a blank node mapping µ : B → UBL.

By µ(G) we denote the graph obtained from G by replacing each blank node xwith µ(x).

We call µ(G) an instance of G.

A proper instance of a graph is an instance in which a blank node has beenreplaced by a constant (form U or L), or two blank nodes in the graph havebeen mapped into the same node in the instance.

An RDF graph is lean if it has no instance which is a proper subgraph of thegraph. Non-lean graphs have internal redundancy and express the same contentas their lean subgraphs.

Two graphs which differ only in the identity of their blank nodes, are consideredto be equivalent.

The merge of a set of graphs is obtained by renaming (“standardize apart”)blank nodes in each graph such that no blank nodes between any two graphs arein common and then taking the union of all triples, we write G1 ]G2 for thegraph merge between two graphs G1, G2.

Questions

What is meant by “redundancy” and “same content” here?

A. Polleres VU 184.729 19/41

Page 35: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Definitions

Assume a blank node mapping µ : B → UBL.

By µ(G) we denote the graph obtained from G by replacing each blank node xwith µ(x).

We call µ(G) an instance of G.

A proper instance of a graph is an instance in which a blank node has beenreplaced by a constant (form U or L), or two blank nodes in the graph havebeen mapped into the same node in the instance.

An RDF graph is lean if it has no instance which is a proper subgraph of thegraph. Non-lean graphs have internal redundancy and express the same contentas their lean subgraphs.

Two graphs which differ only in the identity of their blank nodes, are consideredto be equivalent.

The merge of a set of graphs is obtained by renaming (“standardize apart”)blank nodes in each graph such that no blank nodes between any two graphs arein common and then taking the union of all triples, we write G1 ]G2 for thegraph merge between two graphs G1, G2.

Questions

What is meant by “redundancy” and “same content” here?

A. Polleres VU 184.729 19/41

Page 36: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Definitions

Assume a blank node mapping µ : B → UBL.

By µ(G) we denote the graph obtained from G by replacing each blank node xwith µ(x).

We call µ(G) an instance of G.

A proper instance of a graph is an instance in which a blank node has beenreplaced by a constant (form U or L), or two blank nodes in the graph havebeen mapped into the same node in the instance.

An RDF graph is lean if it has no instance which is a proper subgraph of thegraph. Non-lean graphs have internal redundancy and express the same contentas their lean subgraphs.

Two graphs which differ only in the identity of their blank nodes, are consideredto be equivalent.

The merge of a set of graphs is obtained by renaming (“standardize apart”)blank nodes in each graph such that no blank nodes between any two graphs arein common and then taking the union of all triples, we write G1 ]G2 for thegraph merge between two graphs G1, G2.

Questions

What is meant by “redundancy” and “same content” here?

A. Polleres VU 184.729 19/41

Page 37: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Definitions

Assume a blank node mapping µ : B → UBL.

By µ(G) we denote the graph obtained from G by replacing each blank node xwith µ(x).

We call µ(G) an instance of G.

A proper instance of a graph is an instance in which a blank node has beenreplaced by a constant (form U or L), or two blank nodes in the graph havebeen mapped into the same node in the instance.

An RDF graph is lean if it has no instance which is a proper subgraph of thegraph. Non-lean graphs have internal redundancy and express the same contentas their lean subgraphs.

Two graphs which differ only in the identity of their blank nodes, are consideredto be equivalent.

The merge of a set of graphs is obtained by renaming (“standardize apart”)blank nodes in each graph such that no blank nodes between any two graphs arein common and then taking the union of all triples, we write G1 ]G2 for thegraph merge between two graphs G1, G2.

Questions

What is meant by “redundancy” and “same content” here?

A. Polleres VU 184.729 19/41

Page 38: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Definitions

Assume a blank node mapping µ : B → UBL.

By µ(G) we denote the graph obtained from G by replacing each blank node xwith µ(x).

We call µ(G) an instance of G.

A proper instance of a graph is an instance in which a blank node has beenreplaced by a constant (form U or L), or two blank nodes in the graph havebeen mapped into the same node in the instance.

An RDF graph is lean if it has no instance which is a proper subgraph of thegraph. Non-lean graphs have internal redundancy and express the same contentas their lean subgraphs.

Two graphs which differ only in the identity of their blank nodes, are consideredto be equivalent.

The merge of a set of graphs is obtained by renaming (“standardize apart”)blank nodes in each graph such that no blank nodes between any two graphs arein common and then taking the union of all triples, we write G1 ]G2 for thegraph merge between two graphs G1, G2.

Questions

What is meant by “redundancy” and “same content” here?

A. Polleres VU 184.729 19/41

Page 39: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Definitions

Assume a blank node mapping µ : B → UBL.

By µ(G) we denote the graph obtained from G by replacing each blank node xwith µ(x).

We call µ(G) an instance of G.

A proper instance of a graph is an instance in which a blank node has beenreplaced by a constant (form U or L), or two blank nodes in the graph havebeen mapped into the same node in the instance.

An RDF graph is lean if it has no instance which is a proper subgraph of thegraph. Non-lean graphs have internal redundancy and express the same contentas their lean subgraphs.

Two graphs which differ only in the identity of their blank nodes, are consideredto be equivalent.

The merge of a set of graphs is obtained by renaming (“standardize apart”)blank nodes in each graph such that no blank nodes between any two graphs arein common and then taking the union of all triples, we write G1 ]G2 for thegraph merge between two graphs G1, G2.

Questions

What is meant by “redundancy” and “same content” here?

A. Polleres VU 184.729 19/41

Page 40: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Definitions

Assume a blank node mapping µ : B → UBL.

By µ(G) we denote the graph obtained from G by replacing each blank node xwith µ(x).

We call µ(G) an instance of G.

A proper instance of a graph is an instance in which a blank node has beenreplaced by a constant (form U or L), or two blank nodes in the graph havebeen mapped into the same node in the instance.

An RDF graph is lean if it has no instance which is a proper subgraph of thegraph. Non-lean graphs have internal redundancy and express the same contentas their lean subgraphs.

Two graphs which differ only in the identity of their blank nodes, are consideredto be equivalent.

The merge of a set of graphs is obtained by renaming (“standardize apart”)blank nodes in each graph such that no blank nodes between any two graphs arein common and then taking the union of all triples, we write G1 ]G2 for thegraph merge between two graphs G1, G2.

Questions

What is meant by “redundancy” and “same content” here?

A. Polleres VU 184.729 19/41

Page 41: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Lean and non-lean graphs: Examples

G7 : non-lean

__ :x foaf:knows ex:bob.__ :x foaf:knows __ :y.

G8 : lean

__ :x foaf:knows ex:bob.__ :x foaf:knows __ :x.

Why?

Becomes clear if we look at first-order “reading” of the RDF graph,where we treat blank nodes as existential variables and triples in a predicatetriple.With this reading, one could say:G′7 = {__ :x foaf:knows ex:bob.} |= G7

We use first-order entailment here. Entailment is typically defined in terms of amodel theory (interpretation, satisfaction, models). . .RDF has its own model theory!

A. Polleres VU 184.729 20/41

Page 42: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Lean and non-lean graphs: Examples

G7 : non-lean

∃x, y.triple(x, knows, bob) ∧ triple(x, knows, y)

G8 : lean

∃x, y.triple(x, knows, bob) ∧ triple(x, knows, x)

Becomes clear if we look at first-order “reading” of the RDF graph, where wetreat blank nodes as existential variables and triples in a predicate triple.Withthis reading, one could say: G′7 = {__ :x foaf:knows ex:bob.} |= G7

We use first-order entailment here. Entailment is typically defined in terms of amodel theory (interpretation, satisfaction, models). . .RDF has its own model theory!

A. Polleres VU 184.729 20/41

Page 43: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 2. RDF(S)

Lean and non-lean graphs: Examples

G7 : non-lean

∃x, y.triple(x, knows, bob) |=∃x, y.triple(x, knows, bob) ∧ triple(x, knows, y)

G8 : lean

∃x, y.triple(x, knows, bob) 6|=∃x, y.triple(x, knows, bob) ∧ triple(x, knows, x)

Becomes clear if we look at first-order “reading” of the RDF graph, where wetreat blank nodes as existential variables and triples in a predicate triple.Withthis reading, one could say: G′7 = {__ :x foaf:knows ex:bob.} |= G7

We use first-order entailment here. Entailment is typically defined in terms of amodel theory (interpretation, satisfaction, models). . .RDF has its own model theory!

A. Polleres VU 184.729 20/41

Page 44: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Unit Outline

1. What does that data mean? Ontologies described in RDFS + OWL

2. RDF Graph – Formal Definitions

3. RDF Interpretations and Simple Entailment

4. APPENDIX: Simple RDF Entailment is NP-complete

A. Polleres VU 184.729 21/41

Page 45: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Model theoretic semantics – in general

A model theory is usually defined using the following “components”:Defining a notion of an interpretation I, consisting of separateinterpretation functions• i.e., defining how are constants, variables and logical conectives,

formulas being “interpreted” in a possible real world.A satisfaction relation between interpretations and theories (in ourcase graphs), written I |= G, which says:• I is an interpretation satisfying G, or I is a model of G

An entailment relation between theories (in our case graphs), writtenG |= G′, which says• all models of G are also models of G′

A. Polleres VU 184.729 22/41

Page 46: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations1/4

“ interpretation I: . . . i.e. how are constants, variables, predicates,formulas being “interpreted” in a possible real world.”

What does that mean for RDF?RDF “constants” . . . subjects, objects, i.e. ULRDF “variables” . . . blank nodes, i.e. BRDF “predicates” . . . predicates, i.e. URDF “formulas” . . . triples, graphs.

Now here we have something unlike classical logic... URIs can actuallyneed to be interpreted “as predicates” or “as constants” depending onwhere they appear in the graph.

To cater for that, RDF defines a very general notion of interpretation.

A. Polleres VU 184.729 23/41

Page 47: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations1/4

“ interpretation I: . . . i.e. how are constants, variables, predicates,formulas being “interpreted” in a possible real world.”

What does that mean for RDF?RDF “constants” . . . subjects, objects, i.e. ULRDF “variables” . . . blank nodes, i.e. BRDF “predicates” . . . predicates, i.e. URDF “formulas” . . . triples, graphs.

Now here we have something unlike classical logic... URIs can actuallyneed to be interpreted “as predicates” or “as constants” depending onwhere they appear in the graph.

To cater for that, RDF defines a very general notion of interpretation.

A. Polleres VU 184.729 23/41

Page 48: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 2/4

A simple interpretation I over vocabulary V is a 6-tupleI = 〈IR, IP, IEXT, IS, IL, LV 〉, s.t.

1 A non-empty set IR of resources.

• called the domain or universe of I

2 A set IP , called the set of properties of I,

• not necessaily disjoint of IR!

3 A mapping IEXT : IP → 2(IR×IR), i.e. assigns a set of pairs 〈x, y〉 withx, y ∈ IR.

• intuitivelty, assigns a binary relation between subjects and objects to properties.

4 A mapping IS : U ∩ V → IR ∪ IP

• this basically says, URIs can be both constants and predicates

5 A mapping IL : Lt ∩ V into IR.

• typed literals are constants.

6 A distinguished subset LV ⊂ IR, called the set of literal values, whichcontains all the plain literals in V, i.e. LV ⊆ Lp ∪ Llang.

• plain literals in RDF are special, they are always interpreted as themselves

A. Polleres VU 184.729 24/41

Page 49: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 2/4

A simple interpretation I over vocabulary V is a 6-tupleI = 〈IR, IP, IEXT, IS, IL, LV 〉, s.t.

1 A non-empty set IR of resources.• called the domain or universe of I

2 A set IP , called the set of properties of I,• not necessaily disjoint of IR!

3 A mapping IEXT : IP → 2(IR×IR), i.e. assigns a set of pairs 〈x, y〉 withx, y ∈ IR.• intuitivelty, assigns a binary relation between subjects and objects to properties.

4 A mapping IS : U ∩ V → IR ∪ IP• this basically says, URIs can be both constants and predicates

5 A mapping IL : Lt ∩ V into IR.• typed literals are constants.

6 A distinguished subset LV ⊂ IR, called the set of literal values, whichcontains all the plain literals in V, i.e. LV ⊆ Lp ∪ Llang.• plain literals in RDF are special, they are always interpreted as themselves

A. Polleres VU 184.729 24/41

Page 50: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 2/4

A simple interpretation I over vocabulary V is a 6-tupleI = 〈IR, IP, IEXT, IS, IL, LV 〉, s.t.

1 A non-empty set IR of resources.• called the domain or universe of I

2 A set IP , called the set of properties of I,• not necessaily disjoint of IR!

3 A mapping IEXT : IP → 2(IR×IR), i.e. assigns a set of pairs 〈x, y〉 withx, y ∈ IR.• intuitivelty, assigns a binary relation between subjects and objects to properties.

4 A mapping IS : U ∩ V → IR ∪ IP• this basically says, URIs can be both constants and predicates

5 A mapping IL : Lt ∩ V into IR.• typed literals are constants.

6 A distinguished subset LV ⊂ IR, called the set of literal values, whichcontains all the plain literals in V, i.e. LV ⊆ Lp ∪ Llang.• plain literals in RDF are special, they are always interpreted as themselves

A. Polleres VU 184.729 24/41

Page 51: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 2/4

A simple interpretation I over vocabulary V is a 6-tupleI = 〈IR, IP, IEXT, IS, IL, LV 〉, s.t.

1 A non-empty set IR of resources.• called the domain or universe of I

2 A set IP , called the set of properties of I,• not necessaily disjoint of IR!

3 A mapping IEXT : IP → 2(IR×IR), i.e. assigns a set of pairs 〈x, y〉 withx, y ∈ IR.• intuitivelty, assigns a binary relation between subjects and objects to properties.

4 A mapping IS : U ∩ V → IR ∪ IP• this basically says, URIs can be both constants and predicates

5 A mapping IL : Lt ∩ V into IR.• typed literals are constants.

6 A distinguished subset LV ⊂ IR, called the set of literal values, whichcontains all the plain literals in V, i.e. LV ⊆ Lp ∪ Llang.• plain literals in RDF are special, they are always interpreted as themselves

A. Polleres VU 184.729 24/41

Page 52: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 2/4

A simple interpretation I over vocabulary V is a 6-tupleI = 〈IR, IP, IEXT, IS, IL, LV 〉, s.t.

1 A non-empty set IR of resources.• called the domain or universe of I

2 A set IP , called the set of properties of I,• not necessaily disjoint of IR!

3 A mapping IEXT : IP → 2(IR×IR), i.e. assigns a set of pairs 〈x, y〉 withx, y ∈ IR.• intuitivelty, assigns a binary relation between subjects and objects to properties.

4 A mapping IS : U ∩ V → IR ∪ IP• this basically says, URIs can be both constants and predicates

5 A mapping IL : Lt ∩ V into IR.• typed literals are constants.

6 A distinguished subset LV ⊂ IR, called the set of literal values, whichcontains all the plain literals in V, i.e. LV ⊆ Lp ∪ Llang.• plain literals in RDF are special, they are always interpreted as themselves

A. Polleres VU 184.729 24/41

Page 53: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 2/4

A simple interpretation I over vocabulary V is a 6-tupleI = 〈IR, IP, IEXT, IS, IL, LV 〉, s.t.

1 A non-empty set IR of resources.• called the domain or universe of I

2 A set IP , called the set of properties of I,• not necessaily disjoint of IR!

3 A mapping IEXT : IP → 2(IR×IR), i.e. assigns a set of pairs 〈x, y〉 withx, y ∈ IR.• intuitivelty, assigns a binary relation between subjects and objects to properties.

4 A mapping IS : U ∩ V → IR ∪ IP• this basically says, URIs can be both constants and predicates

5 A mapping IL : Lt ∩ V into IR.• typed literals are constants.

6 A distinguished subset LV ⊂ IR, called the set of literal values, whichcontains all the plain literals in V, i.e. LV ⊆ Lp ∪ Llang.• plain literals in RDF are special, they are always interpreted as themselves

A. Polleres VU 184.729 24/41

Page 54: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 2/4

A simple interpretation I over vocabulary V is a 6-tupleI = 〈IR, IP, IEXT, IS, IL, LV 〉, s.t.

1 A non-empty set IR of resources.• called the domain or universe of I

2 A set IP , called the set of properties of I,• not necessaily disjoint of IR!

3 A mapping IEXT : IP → 2(IR×IR), i.e. assigns a set of pairs 〈x, y〉 withx, y ∈ IR.• intuitivelty, assigns a binary relation between subjects and objects to properties.

4 A mapping IS : U ∩ V → IR ∪ IP• this basically says, URIs can be both constants and predicates

5 A mapping IL : Lt ∩ V into IR.• typed literals are constants.

6 A distinguished subset LV ⊂ IR, called the set of literal values, whichcontains all the plain literals in V, i.e. LV ⊆ Lp ∪ Llang.• plain literals in RDF are special, they are always interpreted as themselves

A. Polleres VU 184.729 24/41

Page 55: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 3/4

Interpreting ground graphs (i.e. without blank nodes):

Interpreting constants:• if e = ”aaa” ∈ V ∩ Lp, then I(e) = aaa ∈ LV• if e = ”aaa”@ttt ∈ V ∩ Llang , then I(e) =< aaa, ttt >∈ LV• if e ∈ V ∩ Lt, then I(e) = IL(e)• if e ∈ V ∩ U , then I(e) = IS(e)

Interpreting ground triples:• if t = s p o., is a ground triple, then

I(t) = true if s, p, o ∈ V ∧ I(p) ∈ IP ∧ 〈I(s), I(o)〉 ∈ IEXT (I(p))I(t) = false, otherwise

Interpreting ground graphs:• if G is a ground RDF graph then I(G) = true if and only if I(t) = true for all

triples t ∈ G, .

SatisfactionIf I(G) = true we also say I satisfies G, written I |= G

A. Polleres VU 184.729 25/41

Page 56: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 3/4

Interpreting ground graphs (i.e. without blank nodes):

Interpreting constants:• if e = ”aaa” ∈ V ∩ Lp, then I(e) = aaa ∈ LV• if e = ”aaa”@ttt ∈ V ∩ Llang , then I(e) =< aaa, ttt >∈ LV• if e ∈ V ∩ Lt, then I(e) = IL(e)• if e ∈ V ∩ U , then I(e) = IS(e)

Interpreting ground triples:• if t = s p o., is a ground triple, then

I(t) = true if s, p, o ∈ V ∧ I(p) ∈ IP ∧ 〈I(s), I(o)〉 ∈ IEXT (I(p))I(t) = false, otherwise

Interpreting ground graphs:• if G is a ground RDF graph then I(G) = true if and only if I(t) = true for all

triples t ∈ G, .

SatisfactionIf I(G) = true we also say I satisfies G, written I |= G

A. Polleres VU 184.729 25/41

Page 57: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 3/4

Interpreting ground graphs (i.e. without blank nodes):

Interpreting constants:• if e = ”aaa” ∈ V ∩ Lp, then I(e) = aaa ∈ LV• if e = ”aaa”@ttt ∈ V ∩ Llang , then I(e) =< aaa, ttt >∈ LV• if e ∈ V ∩ Lt, then I(e) = IL(e)• if e ∈ V ∩ U , then I(e) = IS(e)

Interpreting ground triples:• if t = s p o., is a ground triple, then

I(t) = true if s, p, o ∈ V ∧ I(p) ∈ IP ∧ 〈I(s), I(o)〉 ∈ IEXT (I(p))I(t) = false, otherwise

Interpreting ground graphs:• if G is a ground RDF graph then I(G) = true if and only if I(t) = true for all

triples t ∈ G, .

SatisfactionIf I(G) = true we also say I satisfies G, written I |= G

A. Polleres VU 184.729 25/41

Page 58: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 3/4

Interpreting ground graphs (i.e. without blank nodes):

Interpreting constants:• if e = ”aaa” ∈ V ∩ Lp, then I(e) = aaa ∈ LV• if e = ”aaa”@ttt ∈ V ∩ Llang , then I(e) =< aaa, ttt >∈ LV• if e ∈ V ∩ Lt, then I(e) = IL(e)• if e ∈ V ∩ U , then I(e) = IS(e)

Interpreting ground triples:• if t = s p o., is a ground triple, then

I(t) = true if s, p, o ∈ V ∧ I(p) ∈ IP ∧ 〈I(s), I(o)〉 ∈ IEXT (I(p))I(t) = false, otherwise

Interpreting ground graphs:• if G is a ground RDF graph then I(G) = true if and only if I(t) = true for all

triples t ∈ G, .

SatisfactionIf I(G) = true we also say I satisfies G, written I |= G

A. Polleres VU 184.729 25/41

Page 59: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretation – Example ground graphs

Take the following artificial vocabulary:{ex : a, ex : b, ex : c, ”whatever”, ”whatever”∧∧ex : b}IR = LV ∪ {1, 2}IP = {1}IEXT (1) = {< 1, 2 >,< 2, 1 >}IS(ex : a) = IS(ex : b) = 1, IS(ex : c) = 2

IL(”whatever”∧∧ex : b) = 2

G9 :

ex:a ex:b ex:c .ex:c ex:a ex:a .ex:c ex:b ex:a .ex:a ex:b "whatever"∧∧ex:b .

I(G9) = true, i.e., I |= G9:

A. Polleres VU 184.729 26/41

Page 60: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretation – Example ground graphs

Take the following artificial vocabulary:{ex : a, ex : b, ex : c, ”whatever”, ”whatever”∧∧ex : b}IR = LV ∪ {1, 2}IP = {1}IEXT (1) = {< 1, 2 >,< 2, 1 >}IS(ex : a) = IS(ex : b) = 1, IS(ex : c) = 2

IL(”whatever”∧∧ex : b) = 2

G9 :

ex:a ex:b ex:c .ex:c ex:a ex:a .ex:c ex:b ex:a .ex:a ex:b "whatever"∧∧ex:b .

I(G9) = true, i.e., I |= G9:

A. Polleres VU 184.729 26/41

Page 61: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretation – Example ground graphs

Take the following artificial vocabulary:{ex : a, ex : b, ex : c, ”whatever”, ”whatever”∧∧ex : b}IR = LV ∪ {1, 2}IP = {1}IEXT (1) = {< 1, 2 >,< 2, 1 >}IS(ex : a) = IS(ex : b) = 1, IS(ex : c) = 2

IL(”whatever”∧∧ex : b) = 2

G9 :

ex:a ex:b ex:c .ex:c ex:a ex:a .ex:c ex:b ex:a .ex:a ex:b "whatever"∧∧ex:b .

I(G9) = true, i.e., I |= G9:

A. Polleres VU 184.729 26/41

Page 62: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretation – Example ground graphs

Take the following artificial vocabulary:{ex : a, ex : b, ex : c, ”whatever”, ”whatever”∧∧ex : b}IR = LV ∪ {1, 2}IP = {1}IEXT (1) = {< 1, 2 >,< 2, 1 >}IS(ex : a) = IS(ex : b) = 1, IS(ex : c) = 2

IL(”whatever”∧∧ex : b) = 2

G′9 :

ex:a ex:c ex:b .ex:a ex:b ex:b .ex:c ex:b ex:c .ex:a ex:b "whatever".

I(G′9) = false, i.e., I doesn’t satisfy any triple in G′9:

A. Polleres VU 184.729 26/41

Page 63: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretation – Example ground graphs

Take the following artificial vocabulary:{ex : a, ex : b, ex : c, ”whatever”, ”whatever”∧∧ex : b}IR = LV ∪ {1, 2}IP = {1}IEXT (1) = {< 1, 2 >,< 2, 1 >}IS(ex : a) = IS(ex : b) = 1, IS(ex : c) = 2

IL(”whatever”∧∧ex : b) = 2

G′9 :

ex:a ex:c ex:b . IS(ex : c) = 2 6∈ IPex:a ex:b ex:b . 〈1, 1〉 6∈ IEXT (IS(ex : b))ex:c ex:b ex:c . 〈2, 2〉 6∈ IEXT (IS(ex : b))ex:a ex:b "whatever". 〈1, ”whatever”〉 6∈ IEXT (IS(ex : b))

I(G′9) = false, i.e., I doesn’t satisfy any triple in G′9:

A. Polleres VU 184.729 26/41

Page 64: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretations 4/4

Dealing with blank nodes is analogously to dealing with existential variables infirst-order logic:

We call some function A : B → IR an assignment.Given an interpretation I, and an assignment A, [I +A] is defined just like I,except that it uses A to interpret blank nodes.

Interpreting non-ground graphs:• if G is a non-ground RDF graph then I(G) = true if and only if there exists an

assignment A such that [I +A](G) = true.

A. Polleres VU 184.729 27/41

Page 65: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretation – Example non-ground graphs

Same interpretation as before, artificial vocabulary:{ex : a, ex : b, ex : c, ”whatever”, ”whatever”∧∧ex : b}IR = LV ∪ {1, 2}IP = {1}IEXT (1) = {< 1, 2 >,< 2, 1 >}IS(ex : a) = IS(ex : b) = 1, IS(ex : c) = 2

IL(”whatever”∧∧ex : b) = 2

A. Polleres VU 184.729 28/41

Page 66: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretation – Example non-ground graphs

Same interpretation as before, artificial vocabulary:{ex : a, ex : b, ex : c, ”whatever”, ”whatever”∧∧ex : b}IR = LV ∪ {1, 2}IP = {1}IEXT (1) = {< 1, 2 >,< 2, 1 >}IS(ex : a) = IS(ex : b) = 1, IS(ex : c) = 2

IL(”whatever”∧∧ex : b) = 2

G10 :

__ :x <ex:a> <ex:b> .<ex:c> <ex:b> __ :y .

I(G10) = true, i.e., I |= G10:

E.g. take the assignment A(x) = 2, A(y) = 1

A. Polleres VU 184.729 28/41

Page 67: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Interpretation – Example non-ground graphs

Same interpretation as before, artificial vocabulary:{ex : a, ex : b, ex : c, ”whatever”, ”whatever”∧∧ex : b}IR = LV ∪ {1, 2}IP = {1}IEXT (1) = {< 1, 2 >,< 2, 1 >}IS(ex : a) = IS(ex : b) = 1, IS(ex : c) = 2

IL(”whatever”∧∧ex : b) = 2

G′10 :

__ :x <ex:a> <ex:b> .<ex:c> <ex:b> __ :x .

I(G′10) = false, i.e., I 6|= G′10:

If A maps x to 1 then the first triple is false, and if it maps it to 2 then the second one.

A. Polleres VU 184.729 28/41

Page 68: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment between RDF Graphs

The usual entailment relation as we know it from first-order theories:

Simple Entailment

An RDF graph G (simply) entails a graph E, written G |= E, if everyinterpretation which satisfies G also satisfies E

“Entailment is the key idea which connects model-theoretic semantics toreal-world applications” [Hayes, 2004] . . . indeed, simple entailment is thekey for SPARQL graph pattern matching.

A. Polleres VU 184.729 29/41

Page 69: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment between RDF Graphs

The usual entailment relation as we know it from first-order theories:

Simple Entailment (for sets of graphs)

A set S of RDF graphs (simply) entails a graph E, written S |= E, ifevery interpretation which satisfies every member of S also satisfies E

“Entailment is the key idea which connects model-theoretic semantics toreal-world applications” [Hayes, 2004] . . . indeed, simple entailment is thekey for SPARQL graph pattern matching.

A. Polleres VU 184.729 29/41

Page 70: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Properties

Merging lemma

The merge of a set S of RDF graphs is entailed by S, and entails everymember of S, i.e.S |=

⊎s∈S s and

⊎s∈S s |= s′, where s′ ∈ S.

Recall the example from before:G′10:

__ :x <ex:a> <ex:b> .<ex:c> <ex:b> __ :x .

This example shows the difference of union and merge:The merge of each triple by itself taken as a singleton graph is NOT equivalent to G′10!

(Recall the definition of merge: Obtained by “standardizing apart” blank nodes.)

A. Polleres VU 184.729 30/41

Page 71: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Properties

Merging lemma

The merge of a set S of RDF graphs is entailed by S, and entails everymember of S, i.e.S |=

⊎s∈S s and

⊎s∈S s |= s′, where s′ ∈ S.

Recall the example from before:G′10:

__ :x <ex:a> <ex:b> .<ex:c> <ex:b> __ :x .

This example shows the difference of union and merge:The merge of each triple by itself taken as a singleton graph is NOT equivalent to G′10!

(Recall the definition of merge: Obtained by “standardizing apart” blank nodes.)

A. Polleres VU 184.729 30/41

Page 72: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Properties

Main result for simple RDF inference is:

Interpolation LemmaS entails a graph E if and only if a subgraph of S is an instance of E.

What does this mean?Recall: We call µ(G) an instance of G, where µ maps blank nodes to UBL.So, you can test entailment G |=?G′ by

1 guessing a mapping µ and

2 test whether µ(G′) ⊆ G

ComplexitySimple entailment is NP-complete.

(proof in the end of the slides, time allowed)

A. Polleres VU 184.729 31/41

Page 73: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Properties

Main result for simple RDF inference is:

Interpolation LemmaS entails a graph E if and only if a subgraph of S is an instance of E.

What does this mean?Recall: We call µ(G) an instance of G, where µ maps blank nodes to UBL.So, you can test entailment G |=?G′ by

1 guessing a mapping µ and

2 test whether µ(G′) ⊆ G

ComplexitySimple entailment is NP-complete.

(proof in the end of the slides, time allowed)

A. Polleres VU 184.729 31/41

Page 74: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Properties

Main result for simple RDF inference is:

Interpolation LemmaS entails a graph E if and only if a subgraph of S is an instance of E.

What does this mean?Recall: We call µ(G) an instance of G, where µ maps blank nodes to UBL.So, you can test entailment G |=?G′ by

1 guessing a mapping µ and

2 test whether µ(G′) ⊆ G

ComplexitySimple entailment is NP-complete.

(proof in the end of the slides, time allowed)

A. Polleres VU 184.729 31/41

Page 75: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 1/4

G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G3 :

__ :alice foaf:knows ex:bob.__ :alice foaf:name __ :name.

G4 :

__ :alice foaf:knows ex:bob.__ :alice foaf:name __ :alice.

A. Polleres VU 184.729 32/41

Page 76: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 1/4

G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G3 :

Alice foaf:knows ex:bob.Alice foaf:name Name.

G4 :

Alice foaf:knows ex:bob.Alice foaf:name Alice.

G1|=G3 :

µ(Alice) = ex : alice, µ(Name) = ”Alice”⇒ µ(G3) ⊆ G1

A. Polleres VU 184.729 32/41

Page 77: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 1/4

G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G3 :

Alice foaf:knows ex:bob.Alice foaf:name Name.

G4 :

Alice foaf:knows ex:bob.Alice foaf:name Alice.

G1|=G3 :µ(Alice) = ex : alice, µ(Name) = ”Alice”⇒ µ(G3) ⊆ G1

A. Polleres VU 184.729 32/41

Page 78: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 1/4

G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G3 :

Alice foaf:knows ex:bob.Alice foaf:name Name.

G4 :

Alice foaf:knows ex:bob.Alice foaf:name Alice.

G1 6|=G4 :

no blank node mapping µ makes µ(G4) a subset of G1

A. Polleres VU 184.729 32/41

Page 79: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 1/4

G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G3 :

Alice foaf:knows ex:bob.Alice foaf:name Name.

G4 :

Alice foaf:knows ex:bob.Alice foaf:name Alice.

G1 6|=G4 :no blank node mapping µ makes µ(G4) a subset of G1

A. Polleres VU 184.729 32/41

Page 80: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 1/4

G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G3 :

Alice foaf:knows ex:bob.Alice foaf:name Name.

G4 :

Alice foaf:knows ex:bob.Alice foaf:name Alice.

G3 6|=G4 :

no blank node mapping µ makes µ(G4) a subset of G3

A. Polleres VU 184.729 32/41

Page 81: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 1/4

G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G3 :

Alice foaf:knows ex:bob.Alice foaf:name Name.

G4 :

Alice foaf:knows ex:bob.Alice foaf:name Alice.

G3 6|=G4 :no blank node mapping µ makes µ(G4) a subset of G3

A. Polleres VU 184.729 32/41

Page 82: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 1/4

G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G3 :

Alice foaf:knows ex:bob.Alice foaf:name Name.

G4 :

Alice foaf:knows ex:bob.Alice foaf:name Alice.

G4|=G3 :

µ(Alice) = Alice, µ(Name) = Alice⇒ µ(G3) ⊆ G4

A. Polleres VU 184.729 32/41

Page 83: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 1/4

G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G3 :

Alice foaf:knows ex:bob.Alice foaf:name Name.

G4 :

Alice foaf:knows ex:bob.Alice foaf:name Alice.

G4|=G3 :µ(Alice) = Alice, µ(Name) = Alice⇒ µ(G3) ⊆ G4

A. Polleres VU 184.729 32/41

Page 84: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 2/44

G7 : non-leanX foaf:knows ex:bob.X foaf:knows Y .

G8 : leanX foaf:knows ex:bob.X foaf:knows X.

G′7 : leanX foaf:knows ex:bob.

G′8 : leanX foaf:knows X.

G7 6|= G8, G7 6|= G′8G8 |= G7, G7 |= G′7

Finally: G′7 |= G7 !!!! that confirms non-leanness!3

3since G′7 is a subgraph that is a proper instance entailing the whole graph4draw on whiteboard

A. Polleres VU 184.729 33/41

Page 85: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 2/44

G7 : non-leanX foaf:knows ex:bob.X foaf:knows Y .

G8 : leanX foaf:knows ex:bob.X foaf:knows X.

G′7 : leanX foaf:knows ex:bob.

G′8 : leanX foaf:knows X.

G7 6|= G8, G7 6|= G′8

G8 |= G7, G7 |= G′7

Finally: G′7 |= G7 !!!! that confirms non-leanness!3

3since G′7 is a subgraph that is a proper instance entailing the whole graph4draw on whiteboard

A. Polleres VU 184.729 33/41

Page 86: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 2/44

G7 : non-leanX foaf:knows ex:bob.X foaf:knows Y .

G8 : leanX foaf:knows ex:bob.X foaf:knows X.

G′7 : leanX foaf:knows ex:bob.

G′8 : leanX foaf:knows X.

G7 6|= G8, G7 6|= G′8G8 |= G7, G7 |= G′7

Finally: G′7 |= G7 !!!! that confirms non-leanness!3

3since G′7 is a subgraph that is a proper instance entailing the whole graph4draw on whiteboard

A. Polleres VU 184.729 33/41

Page 87: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 2/44

G7 : non-leanX foaf:knows ex:bob.X foaf:knows Y .

G8 : leanX foaf:knows ex:bob.X foaf:knows X.

G′7 : leanX foaf:knows ex:bob.

G′8 : leanX foaf:knows X.

G7 6|= G8, G7 6|= G′8G8 |= G7, G7 |= G′7

Finally: G′7 |= G7 !!!! that confirms non-leanness!3

3since G′7 is a subgraph that is a proper instance entailing the whole graph4draw on whiteboard

A. Polleres VU 184.729 33/41

Page 88: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 3/4

Now what about G2?G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G2 :

ex:alice rdf:type foaf:Person.

Obviously, no simple entailment: G1 6|= G2!

Would need “special” interpretation of the rdf: and rdfs: vocabulary!

This is needed to interpret ontologies. . .

A. Polleres VU 184.729 34/41

Page 89: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 3/4

Now what about G2?G1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice".foaf:knows rdfs:domain foaf:Person.

G2 :

ex:alice rdf:type foaf:Person.

Obviously, no simple entailment: G1 6|= G2!

Would need “special” interpretation of the rdf: and rdfs: vocabulary!

This is needed to interpret ontologies. . .

A. Polleres VU 184.729 34/41

Page 90: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Recall from before – The FOAF ontology:

Properties: foaf:name, foaf:knows, foafhomepage, foaf:primaryTopic etc.

Classes: foaf:Person, foaf:Agent, foaf:Document, foaf:Organisation, etc.

Relations: e.g.

• Each Person is a Agent (subclass)

• The img property is more specific than depiction(subproperty)

• img is a relation between Persons and Imgages(domain/range)

• knows is a relation between two Persons(domain/range)

• homepage denotes unique homepage of an Agent(uniquely identifying property)

...

A. Polleres VU 184.729 35/41

Page 91: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Recall from before – The FOAF ontology:

Properties: foaf:name, foaf:knows, foafhomepage, foaf:primaryTopic etc.

Classes: foaf:Person, foaf:Agent, foaf:Document, foaf:Organisation, etc.

Relations: e.g.

• Each Person is a Agent (subclass)

• The img property is more specific than depiction(subproperty)

• img is a relation between Persons and Imgages(domain/range)

• knows is a relation between two Persons(domain/range)

• homepage denotes unique homepage of an Agent(uniquely identifying property)

...

A. Polleres VU 184.729 35/41

Page 92: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Recall from before – The FOAF ontology:

Properties: foaf:name, foaf:knows, foafhomepage, foaf:primaryTopic etc.

Classes: foaf:Person, foaf:Agent, foaf:Document, foaf:Organisation, etc.

Relations: e.g.

• Each Person is a Agent (subclass)

• The img property is more specific than depiction(subproperty)

• img is a relation between Persons and Imgages(domain/range)

• knows is a relation between two Persons(domain/range)

• homepage denotes unique homepage of an Agent(uniquely identifying property)

...

A. Polleres VU 184.729 35/41

Page 93: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Recall from before – The FOAF ontology:

Properties: foaf:name, foaf:knows, foafhomepage, foaf:primaryTopic etc.

Classes: foaf:Person, foaf:Agent, foaf:Document, foaf:Organisation, etc.

Relations: e.g.

• Each Person is a Agent (subclass)

• The img property is more specific than depiction(subproperty)

• img is a relation between Persons and Imgages(domain/range)

• knows is a relation between two Persons(domain/range)

• homepage denotes unique homepage of an Agent(uniquely identifying property)

...

A. Polleres VU 184.729 35/41

Page 94: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Recall from before – The FOAF ontology:

Properties: foaf:name, foaf:knows, foafhomepage, foaf:primaryTopic etc.

Classes: foaf:Person, foaf:Agent, foaf:Document, foaf:Organisation, etc.

Relations: e.g.

• Each Person is a Agent (subclass)

• The img property is more specific than depiction(subproperty)

• img is a relation between Persons and Imgages(domain/range)

• knows is a relation between two Persons(domain/range)

• homepage denotes unique homepage of an Agent(uniquely identifying property)

...

A. Polleres VU 184.729 35/41

Page 95: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 4/4G′1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice". ex:alice ex:age "30.0"∧∧xs:decimal.

GFOAF : <http://xmlns.com/foaf/0.1/>

foaf:knows rdfs:domain foaf:Person.foaf:knows rdfs:range foaf:Person.foaf:Person rdfs:subclassOf foaf:Agent.

Intuitively, G′1 ]GFOAF should entail: G′2 :

ex:alice rdf:type foaf:Person.ex:bob rdf:type foaf:Person.ex:alice rdf:type foaf:Agent.ex:bob rdf:type foaf:Agent.ex:alice ex:age "30"∧∧xs:integer

The RDF semantics specification[Hayes, 2004] defines three refinements of simple

interpretations and entailment relations which cover these entailments![Hayes, 2004]. . .

A. Polleres VU 184.729 36/41

Page 96: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 4/4G′1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice". ex:alice ex:age "30.0"∧∧xs:decimal.

GFOAF : <http://xmlns.com/foaf/0.1/>

foaf:knows rdfs:domain foaf:Person.foaf:knows rdfs:range foaf:Person.foaf:Person rdfs:subclassOf foaf:Agent.

Intuitively, G′1 ]GFOAF should entail: G′2 :

ex:alice rdf:type foaf:Person.ex:bob rdf:type foaf:Person.ex:alice rdf:type foaf:Agent.ex:bob rdf:type foaf:Agent.ex:alice ex:age "30"∧∧xs:integer

The RDF semantics specification[Hayes, 2004] defines three refinements of simple

interpretations and entailment relations which cover these entailments![Hayes, 2004]. . .

A. Polleres VU 184.729 36/41

Page 97: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 4/4G′1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice". ex:alice ex:age "30.0"∧∧xs:decimal.

GFOAF : <http://xmlns.com/foaf/0.1/>

foaf:knows rdfs:domain foaf:Person.foaf:knows rdfs:range foaf:Person.foaf:Person rdfs:subclassOf foaf:Agent.

Intuitively, G′1 ]GFOAF should entail: G′2 :

ex:alice rdf:type foaf:Person. . . . because the domain of knows is Personex:bob rdf:type foaf:Person.ex:alice rdf:type foaf:Agent.ex:bob rdf:type foaf:Agent.ex:alice ex:age "30"∧∧xs:integer

The RDF semantics specification[Hayes, 2004] defines three refinements of simple

interpretations and entailment relations which cover these entailments![Hayes, 2004]. . .

A. Polleres VU 184.729 36/41

Page 98: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 4/4G′1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice". ex:alice ex:age "30.0"∧∧xs:decimal.

GFOAF : <http://xmlns.com/foaf/0.1/>

foaf:knows rdfs:domain foaf:Person.foaf:knows rdfs:range foaf:Person.foaf:Person rdfs:subclassOf foaf:Agent.

Intuitively, G′1 ]GFOAF should entail: G′2 :

ex:alice rdf:type foaf:Person. . . . because the domain of knows is Personex:bob rdf:type foaf:Person. . . . because the range of knows is Personex:alice rdf:type foaf:Agent.ex:bob rdf:type foaf:Agent.ex:alice ex:age "30"∧∧xs:integer

The RDF semantics specification[Hayes, 2004] defines three refinements of simple

interpretations and entailment relations which cover these entailments![Hayes, 2004]. . .

A. Polleres VU 184.729 36/41

Page 99: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 4/4G′1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice". ex:alice ex:age "30.0"∧∧xs:decimal.

GFOAF : <http://xmlns.com/foaf/0.1/>

foaf:knows rdfs:domain foaf:Person.foaf:knows rdfs:range foaf:Person.foaf:Person rdfs:subclassOf foaf:Agent.

Intuitively, G′1 ]GFOAF should entail: G′2 :

ex:alice rdf:type foaf:Person. . . . because the domain of knows is Personex:bob rdf:type foaf:Person. . . . because the range of knows is Personex:alice rdf:type foaf:Agent. . . . because each Person is an Agentex:bob rdf:type foaf:Agent. . . . because each Person is an Agentex:alice ex:age "30"∧∧xs:integer

The RDF semantics specification[Hayes, 2004] defines three refinements of simple

interpretations and entailment relations which cover these entailments![Hayes, 2004]. . .

A. Polleres VU 184.729 36/41

Page 100: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

Simple Entailment - Examples 4/4G′1 :

ex:alice foaf:knows ex:bob.ex:alice foaf:name "Alice". ex:alice ex:age "30.0"∧∧xs:decimal.

GFOAF : <http://xmlns.com/foaf/0.1/>

foaf:knows rdfs:domain foaf:Person.foaf:knows rdfs:range foaf:Person.foaf:Person rdfs:subclassOf foaf:Agent.

Intuitively, G′1 ]GFOAF should entail: G′2 :

ex:alice rdf:type foaf:Person. . . . because the domain of knows is Personex:bob rdf:type foaf:Person. . . . because the range of knows is Personex:alice rdf:type foaf:Agent. . . . because each Person is an Agentex:bob rdf:type foaf:Agent. . . . because each Person is an Agentex:alice ex:age "30"∧∧xs:integer . . . simply because each 30.0 = 30

The RDF semantics specification[Hayes, 2004] defines three refinements of simple

interpretations and entailment relations which cover these entailments![Hayes, 2004]. . .

A. Polleres VU 184.729 36/41

Page 101: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

RDF Entailment regimes beyond simple Entailment

The RDF semantics specification[Hayes, 2004] defines three refinements ofsimple interpretations and entailment relations which cover these entailments!:

RDF-entailment: Interpreting the rdf: vocabulary

• e.g. imposes that {s p o .} |= p rdf:type rdf:Property

RDFS-entailment: Interpreting the rdfs: vocabulary

• e.g. imposes that G′1 ]GFOAF |= { ex:alice rdf:type foaf:Person.}

D-entailment: Interpreting datatypes

• e.g. imposing that in all interpretations that "1"∧∧xs:integer is interpreted thesame as "1.0"∧∧xs:decimal

A. Polleres VU 184.729 37/41

Page 102: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

RDF Entailment regimes beyond simple Entailment

The RDF semantics specification[Hayes, 2004] defines three refinements ofsimple interpretations and entailment relations which cover these entailments!:

RDF-entailment: Interpreting the rdf: vocabulary• e.g. imposes that {s p o .} |= p rdf:type rdf:Property

RDFS-entailment: Interpreting the rdfs: vocabulary

• e.g. imposes that G′1 ]GFOAF |= { ex:alice rdf:type foaf:Person.}

D-entailment: Interpreting datatypes

• e.g. imposing that in all interpretations that "1"∧∧xs:integer is interpreted thesame as "1.0"∧∧xs:decimal

A. Polleres VU 184.729 37/41

Page 103: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

RDF Entailment regimes beyond simple Entailment

The RDF semantics specification[Hayes, 2004] defines three refinements ofsimple interpretations and entailment relations which cover these entailments!:

RDF-entailment: Interpreting the rdf: vocabulary• e.g. imposes that {s p o .} |= p rdf:type rdf:Property

RDFS-entailment: Interpreting the rdfs: vocabulary

• e.g. imposes that G′1 ]GFOAF |= { ex:alice rdf:type foaf:Person.}

D-entailment: Interpreting datatypes

• e.g. imposing that in all interpretations that "1"∧∧xs:integer is interpreted thesame as "1.0"∧∧xs:decimal

A. Polleres VU 184.729 37/41

Page 104: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

RDF Entailment regimes beyond simple Entailment

The RDF semantics specification[Hayes, 2004] defines three refinements ofsimple interpretations and entailment relations which cover these entailments!:

RDF-entailment: Interpreting the rdf: vocabulary• e.g. imposes that {s p o .} |= p rdf:type rdf:Property

RDFS-entailment: Interpreting the rdfs: vocabulary• e.g. imposes that G′1 ]GFOAF |= { ex:alice rdf:type foaf:Person.}

D-entailment: Interpreting datatypes

• e.g. imposing that in all interpretations that "1"∧∧xs:integer is interpreted thesame as "1.0"∧∧xs:decimal

A. Polleres VU 184.729 37/41

Page 105: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

RDF Entailment regimes beyond simple Entailment

The RDF semantics specification[Hayes, 2004] defines three refinements ofsimple interpretations and entailment relations which cover these entailments!:

RDF-entailment: Interpreting the rdf: vocabulary• e.g. imposes that {s p o .} |= p rdf:type rdf:Property

RDFS-entailment: Interpreting the rdfs: vocabulary• e.g. imposes that G′1 ]GFOAF |= { ex:alice rdf:type foaf:Person.}

D-entailment: Interpreting datatypes

• e.g. imposing that in all interpretations that "1"∧∧xs:integer is interpreted thesame as "1.0"∧∧xs:decimal

A. Polleres VU 184.729 37/41

Page 106: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 3. Simple Entailment

RDF Entailment regimes beyond simple Entailment

The RDF semantics specification[Hayes, 2004] defines three refinements ofsimple interpretations and entailment relations which cover these entailments!:

RDF-entailment: Interpreting the rdf: vocabulary• e.g. imposes that {s p o .} |= p rdf:type rdf:Property

RDFS-entailment: Interpreting the rdfs: vocabulary• e.g. imposes that G′1 ]GFOAF |= { ex:alice rdf:type foaf:Person.}

D-entailment: Interpreting datatypes• e.g. imposing that in all interpretations that "1"∧∧xs:integer is interpreted the

same as "1.0"∧∧xs:decimal

A. Polleres VU 184.729 37/41

Page 107: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 4. APPENDIX: Simple RDF Entailment is NP-complete

Unit Outline

1. What does that data mean? Ontologies described in RDFS + OWL

2. RDF Graph – Formal Definitions

3. RDF Interpretations and Simple Entailment

4. APPENDIX: Simple RDF Entailment is NP-complete

A. Polleres VU 184.729 38/41

Page 108: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 4. APPENDIX: Simple RDF Entailment is NP-complete

Simple RDF Entailment is NP-complete: Membership

Recall, we had that before already: We can test entailment G |=?G′ by1 guessing a mapping µ and

2 test whether µ(G′) ⊆ G (this is obviously polynomial)

Membership in NP - done

A. Polleres VU 184.729 39/41

Page 109: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 4. APPENDIX: Simple RDF Entailment is NP-complete

Simple RDF Entailment is NP-complete: Hardness

To proof hardness we have to reduce another NP-hard problem to RDF entailment (inpolynomial time). Let’s “adapt” the proof from [Chandra and Merlin, 1977].

3-colorability: Given an undirected Graph Gr, can all nodes be colored with 3 colorsred, green, blue without two adjacent nodes having the same color?

Reduction (the “trick” is we have to convert an undirected to a directed RDF graph):Graph G1: simply encodes all "allowed" edges:

:red :edge :green. :green :edge :red.:green :edge :blue. :blue :edge :green.:blue :edge :red. :red :redge :blue.

Graph G2: for each (node1, node2) ∈ Gr we add two triples:__ :n1 :edge __ :n2. __ :n2 :edge __ :n1.

to the graph G2, i.e, we model the nodes as blank nodes.

Now, it is easy to see that:

PropositionGr is 3-colorably if and only if G1 |= G2

A. Polleres VU 184.729 40/41

Page 110: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 4. APPENDIX: Simple RDF Entailment is NP-complete

Simple RDF Entailment is NP-complete: Hardness

To proof hardness we have to reduce another NP-hard problem to RDF entailment (inpolynomial time). Let’s “adapt” the proof from [Chandra and Merlin, 1977].

3-colorability: Given an undirected Graph Gr, can all nodes be colored with 3 colorsred, green, blue without two adjacent nodes having the same color?

Reduction (the “trick” is we have to convert an undirected to a directed RDF graph):Graph G1: simply encodes all "allowed" edges:

:red :edge :green. :green :edge :red.:green :edge :blue. :blue :edge :green.:blue :edge :red. :red :redge :blue.

Graph G2: for each (node1, node2) ∈ Gr we add two triples:__ :n1 :edge __ :n2. __ :n2 :edge __ :n1.

to the graph G2, i.e, we model the nodes as blank nodes.

Now, it is easy to see that:

PropositionGr is 3-colorably if and only if G1 |= G2

A. Polleres VU 184.729 40/41

Page 111: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 4. APPENDIX: Simple RDF Entailment is NP-complete

Simple RDF Entailment is NP-complete: Hardness

To proof hardness we have to reduce another NP-hard problem to RDF entailment (inpolynomial time). Let’s “adapt” the proof from [Chandra and Merlin, 1977].

3-colorability: Given an undirected Graph Gr, can all nodes be colored with 3 colorsred, green, blue without two adjacent nodes having the same color?

Reduction (the “trick” is we have to convert an undirected to a directed RDF graph):Graph G1: simply encodes all "allowed" edges:

:red :edge :green. :green :edge :red.:green :edge :blue. :blue :edge :green.:blue :edge :red. :red :redge :blue.

Graph G2: for each (node1, node2) ∈ Gr we add two triples:__ :n1 :edge __ :n2. __ :n2 :edge __ :n1.

to the graph G2, i.e, we model the nodes as blank nodes.

Now, it is easy to see that:

PropositionGr is 3-colorably if and only if G1 |= G2

A. Polleres VU 184.729 40/41

Page 112: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 4. APPENDIX: Simple RDF Entailment is NP-complete

Simple RDF Entailment is NP-complete: Hardness

To proof hardness we have to reduce another NP-hard problem to RDF entailment (inpolynomial time). Let’s “adapt” the proof from [Chandra and Merlin, 1977].

3-colorability: Given an undirected Graph Gr, can all nodes be colored with 3 colorsred, green, blue without two adjacent nodes having the same color?

Reduction (the “trick” is we have to convert an undirected to a directed RDF graph):Graph G1: simply encodes all "allowed" edges:

:red :edge :green. :green :edge :red.:green :edge :blue. :blue :edge :green.:blue :edge :red. :red :redge :blue.

Graph G2: for each (node1, node2) ∈ Gr we add two triples:__ :n1 :edge __ :n2. __ :n2 :edge __ :n1.

to the graph G2, i.e, we model the nodes as blank nodes.

Now, it is easy to see that:

PropositionGr is 3-colorably if and only if G1 |= G2

A. Polleres VU 184.729 40/41

Page 113: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 4. APPENDIX: Simple RDF Entailment is NP-complete

Recommended Reading

[Gutiérrez et al., 2004], excellent article on the logical foundations ofRDF[de Bruijn et al., 2005], relating RDF entailment to normal first-orderlogic.

A bit more tough reading (specs), but also recommended:[Hayes, 2004, Sections 1–2], official RDF semantics specification.[Mallea et al., 2011] . . . all you ever wanted to know about blanknodes and never dared to ask.

A. Polleres VU 184.729 41/41

Page 114: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 5. References

Dan Brickley and R.V. Guha (eds.).RDF vocabulary description language 1.0: RDF Schema, February 2004.W3C Recommendation, available at http://www.w3.org/TR/rdf-schema/.

A. K. Chandra and P. M. Merlin.Optimal Implementation of Conjunctive Queries in Relational Data Bases.In Conference Record of the Ninth Annual ACM Symposium on Theory of Computing,pages 77–90, 1977.

Jos de Bruijn, Enrico Franconi, and Sergio Tessaris.Logical reconstruction of normative RDF.In OWL: Experiences and Directions Workshop (OWLED-2005), Galway, Ireland,November 2005.

Claudio Gutiérrez, Carlos A. Hurtado, and Alberto O. Mendelzon.Foundations of semantic web databases.In PODS, pages 95–106, 2004.

P. Hayes.RDF semantics, 2004.http://www.w3.org/TR/rdf-mt/.

Alejandro Mallea, Marcelo Arenas, Aidan Hogan, and Axel Polleres.On Blank Nodes.In Proceedings of the 10th International Semantic Web Conference (ISWC 2011),volume 7031 of Lecture Notes in Computer Science (LNCS), Bonn, Germany, October2011. Springer.

A. Polleres VU 184.729 41/41

Page 115: Unit 2 RDF Formal Semantics in Detail · 2013. 9. 23. · Unit1–Overview Organization Firsttwoorganizationalitems: 1 Weneedtofindareplacementdatefor11/05/2012! 2 AssignmentscanbeimproveduntilWednesdaynoon,(re-)sendthem

Unit 1 – Overview 5. References

Nominated for best paper award.

Peter F. Patel-Schneider, Patrick Hayes, and Ian Horrocks.OWL Web Ontology Language Semantics and Abstract Syntax, February 2004.W3C Recommendation.

A. Polleres VU 184.729 41/41