cc7220-1 la web de datos - aidan...

87
CC7220-1 LA WEB DE DATOS PRIMAVERA 2017 Lecture 5: Web Ontology Language (OWL) [II] Aidan Hogan [email protected]

Upload: others

Post on 27-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

CC7220-1LA WEB DE DATOS

PRIMAVERA 2017

Lecture 5: Web Ontology Language (OWL) [II]

Aidan Hogan

[email protected]

Page 2: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Previously on“La Web de Datos”

Page 3: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

RDF: Resource Description Framework

Page 4: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

RDFS: RDF Schema

(an example)

Let’s model an RDF Schema for movies, including different types of

movies (horror, comedy, action), some different types of people

involved (actor, producer, director), and how they are related.

Page 5: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

ex:Carmelaex:Vito

ex:Sonny ex:Connie ex:Fredo ex:Michael

ex:Vincent ex:Mary

OWL : Web Ontology Language

Page 6: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

TODAY’S TOPIC …

Page 7: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

An ontology is just some definitions …

… but what do they mean?… and what can we do with ontologies?

Page 8: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Capture the main ideas of OWL

Page 9: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Defining OWL

Page 10: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

( )

:Godfather :Vito :Michael :Vincent

How can we formally define what this means?

Page 11: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

We could try with rules like:

( )

:Godfather :Vito :Michael :Vincent

rdf:typerdf:typerdf:type

Page 12: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

( )

:Godfather :Vito :Michael :Vincent

:VitoYoung

rdf:type

How do we define a rule for this case?

owl:differentFrom owl:differentFromowl:sameAs

We could try a rule like:

Page 13: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

( )

:Godfather :Vito :Michael :Vincent

:VitoYoung

rdf:type

How do we define a rule for this case?

owl:differentFrom owl:differentFromowl:sameAs

What if it's not the first element?

Have we considered all possible cases like this?

Page 14: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

What if it's not the first element?

( )

:Godfather :Vito :Michael :Vincent

:VitoYoung

rdf:type

How do we define a rule for this case?

owl:differentFrom owl:differentFromowl:sameAs

Have we considered all possible cases like this?A finite set of rules may not be able to define everything we need in OWL!

Page 15: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

( )

:Godfather :Vito :Michael :Vincent

Use set theory:There is a set of individuals (like , etc.).

There is a set of classes (like , etc.)

Classes map to sets of individuals (like ↦ { , , })

Names map to individuals (like ↦ )

Other names map to classes (like ↦ )

How can we begin to formally define what classes mean?

Page 16: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

:sibling

:sibling

:Fredo

Extend the set theory:There is a set of individuals. Classes map to sets of individuals.

There is a set of properties (like , etc.).

Properties map to sets of pairs of individuals (like ↦ { ( , ) , ... })

Names map to individuals, classes and or properties (like ↦ )

How can we begin to formally define what properties mean?

:Connie

Page 17: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

The Universe

Page 18: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies
Page 19: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

• Define the universe as a set:

– Set of everything: U

To Simplify matters

Page 20: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

To Simplify matters

• Define the universe as a set:

– Set of everything: U

Classes are (sub)sets of U

Properties are sets of pairs from U

What about classes and properties?

Page 21: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Vocabulary / Data

Page 22: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Need to name/describe things in the universe

• Vocabulary (IRIs): V

• Triples (RDF): V × V × V

– For brevity, we skip literals and blank nodes

• Graph (RDF): 2V × V × V

How do we relate the data to the universe?

Page 23: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Interpretations

Page 24: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Interpretation of a vocabulary

• Interpretation ℐ of vocabulary V: ℐ(V) = (U,I,C,P)

U: Universe / Set of everything (in the interpretation)

I: Maps a vocabulary term v ∈ V to an element of U

(interpretation of Individuals)

C: Maps a vocabulary term v ∈ V to a subset of U

(interpretation of Classes)

P: Maps a vocabulary term v ∈ V to a set of pairs from U

(interpretation of Properties)

How do we interpret data/graphs and not just terms?

Page 25: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models

Page 26: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (without semantics)

• Let G be an RDF graph using vocabulary V

• Let ℐ be an interpretation of vocabulary V:

– ℐ(V) = (U,I,C,P)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

How do we interpret semantics of classes/types?

We didn't use class interpretations (C) yet ...

Page 27: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (with classes/type)

• Let G be an RDF graph using vocabulary V

• Let ℐ be an interpretation of vocabulary V:

– ℐ(V) = (U,I,C,P)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

• If p = rdf:type then I(s) ∈ C(o)

How do we define the semantics of sub-class then?

Page 28: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (with classes/type/subclass)

• Let G be an RDF graph using vocabulary V

• Let ℐ be an interpretation of vocabulary V:

– ℐ(V) = (U,I,C,P)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

• If p = rdf:type then I(s) ∈ C(o)

• If p = rdfs:subClassOf then C(s) ⊆ C(o)

Page 29: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (with RDFS semantics)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

• If p = rdf:type then I(s) ∈ C(o)

• If p = rdfs:subClassOf then C(s) ⊆ C(o)

How do we define the semantics of sub-property?

Page 30: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (with RDFS semantics)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

• If p = rdf:type then I(s) ∈ C(o)

• If p = rdfs:subClassOf then C(s) ⊆ C(o)

• If p = rdfs:subPropertyOf then P(s) ⊆ P(o)

How do we define the semantics of domain?

Page 31: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (with RDFS semantics)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

• If p = rdf:type then I(s) ∈ C(o)

• If p = rdfs:subClassOf then C(s) ⊆ C(o)

• If p = rdfs:subPropertyOf then P(s) ⊆ P(o)

• If p = rdfs:domain then π1(P(s)) ⊆ C(o)

How do we define the semantics of range?

(πn : project nth element)

Page 32: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (with RDFS semantics)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

• If p = rdf:type then I(s) ∈ C(o)

• If p = rdfs:subClassOf then C(s) ⊆ C(o)

• If p = rdfs:subPropertyOf then P(s) ⊆ P(o)

• If p = rdfs:domain then π1(P(s)) ⊆ C(o)

• If p = rdfs:range then π2(P(s)) ⊆ C(o)

What about OWL semantics?

What about starting with OWL same-as?

Page 33: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (with RDFS/OWL semantics)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

• If p = rdf:type then I(s) ∈ C(o)

• If p = rdfs:subClassOf then C(s) ⊆ C(o)

• If p = rdfs:subPropertyOf then P(s) ⊆ P(o)

• If p = rdfs:domain then π1(P(s)) ⊆ C(o)

• If p = rdfs:range then π2(P(s)) ⊆ C(o)

• If p = owl:sameAs then I(s) = I(o)

Page 34: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (with RDFS/OWL semantics)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

• If p = rdf:type then I(s) ∈ C(o)

• If p = rdfs:subClassOf then C(s) ⊆ C(o)

• If p = rdfs:subPropertyOf then P(s) ⊆ P(o)

• If p = rdfs:domain then π1(P(s)) ⊆ C(o)

• If p = rdfs:range then π2(P(s)) ⊆ C(o)

• If p = owl:sameAs then I(s) = I(o)

• If p = owl:differentFrom then I(s) ≠ I(o)

... and so on.

Page 35: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (with RDFS/OWL semantics)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

• ...

What about OWL transitive property?

Page 36: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models (with RDFS/OWL semantics)

• ℐ is a model of G if and only if:

– For every triple (s,p,o) ∈ G

• I(s) ∈ U, I(p) ∈ U, I(o) ∈ U, and

• (I(s), I(o)) ∈ P(p)

• ...

• If p = rdf:type and o = owl:TransitiveProperty then

∀x,y,z : (x,y) ∈ P(s) and (y,z) ∈ P(s) implies (x,z) ∈ P(s)

... and so on.

Page 37: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models of ontologies

A model is any world that an ontology might describe

Is this a model of the ontology?

No, since ( ) needs to be an ( ) ( )

Page 38: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models of ontologies

A model is any world that an ontology might describe

Now we have a model of the ontology (for the given semantics).

Page 39: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Models of ontologies

A model is any world that an ontology might describe

Is this a model of the ontology?

This is also a model (given the Open World Assumption)!

Page 40: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Mapping of names to things part of model

A different mapping would mean a different model.

Page 41: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Entailment …

Page 42: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Ontology O entails O′ (O ⊧O′)

Any model of O is a model of O′ (O′ forms part of the models of O)

(O′ says nothing new over O)

Page 43: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Entailment symbol: ⊧

Page 44: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Ontology Entailment

No! There are models of O that are not models of O′ …

Mary doesn’t like cake here

Does O entail O′ (O ⊧ O′)?

Page 45: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Reasoning Tasks …

Page 46: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Materialisation: Write down entailments

Any problems with this?

Page 47: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Materialisation: Write down entailments

...

Page 48: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Materialisation: Write down entailments

...

Page 49: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Entailments are infinite ...

which is a lot of things to write down …

Materialisation: Write down entailments

Page 50: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Ontology Satisfiability: Does O have a “model”?

Does O have any model?

YES! Ontology O is Satisfiable!

Page 51: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Ontology Satisfiability: Does O have a “model”?

So does O have a model now?

YES! Ontology O is still Satisfiable!

Page 52: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Ontology Satisfiability: Does O have a “model”?

What more would we have to add to O to make it Unsatisfiable?

OR

OR

OR

OR …

Page 53: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Ontology Satisfiability: Does O have a “model”?

What more would we have to add to O to make it Unsatisfiable?

OR

OR

OR

OR …

An unsatisfiable ontology cannot model any world!

It is inconsistent!

Page 54: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Entailment checking: Does O entail O′?

Alternatively: Are all models of O models of O′ too?

Page 55: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Reasoning …

Page 56: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

How can we perform reasoning?

• Does Ontology O entail O′?

• Could instead ask: is “O ∪ ¬O′” unsatisfiable?

Can reduce entailment to unsatisfiability!

Page 57: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

So how do we test unsatisfiability then?

Audrey was clearly

not a Computer Scientist

Page 58: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Undecidability …

Page 59: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

A simple Java program …

Does this Java program terminate

on all possible (positive) inputs?

In:

(end)

Page 60: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

A simple Java program …

• Collatz conjecture: an unsolved problem in mathematics

• If we knew that this program terminates or does not terminate on all natural numbers (not just ints), this problem would be solved!

Page 61: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Halting Problem

• Input: a program and an input to that program

• Output:

– if the program halts on that input

– otherwise

• UNDECIDABLE: a general algorithm to solve

the Halting Problem does not exist!

– It will not halt for all program–input pairs!

– It may halt for some program–input pairs

Page 62: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

A quick sketch of Halting Problem proof

Page 63: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Problem: Consecutive ‘1’s in π

• Input: A natural number n

• Output:

– if π contains n consecutive ‘1’s

– otherwise

Is this problem DECIDABLE or UNDECIDABLE?… i.e., does there exist a program that halts (with the correct answer) for all n?

What if we knew the maximum sequence of consecutive ‘1’s in π?

• there must exist a sequence of consecutive ‘1’s in π (even if it’s ∞)∴ there must exist a correct program that halts (even if we don’t know its details)

∴ problem is DECIDABLE!

Page 64: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Problem: Collatz Halting Problem

• Input: [none]

• Output:

– if Collatz program halts on all inputs

– otherwise

Is this problem DECIDABLE or UNDECIDABLE?

(P1)

• either (P1) or (P2) must be correct∴ there must exist a correct program that halts (even if we don’t know it)

∴ problem is DECIDABLE!

Halting Problem UNDECIDABLE in the general case(for all programs and inputs)

(P2)

Page 65: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Domino Tiling Problem

• Input: A set of Dominos (like D)

• Output:

– if there exists a valid infinite tiling (like t)

– otherwise

Is this problem DECIDABLE or

UNDECIDABLE?

Page 66: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Can reduce from Halting to Tiling

It has been shown that there exists a program that can reduce any

Halting problem instance into a Domino Tiling problem instance

Reduction

Now is the Domino Tiling problem DECIDABLE or

UNDECIDABLE?

• is DECIDABLE∴ if were DECIDABLE, then would be DECIDABLE

• but is UNDECIDABLE∴ must be UNDECIDABLE!

If we have a decidable reduction from an UNDECIDABLE problem A to another problem B, then B must be UNDECIDABLE

Page 67: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Reduce from Tiling to OWL entailment?

Reduction

Does D have an infinite tiling?

Does OWL ontology O entail O′?

How can we encode a Domino Tiling question into an OWL ontology entailment question?

Page 68: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Some Description Logic symbols

• ⊑: sub-class/-property

• ≡: equivalent class/property

• ⊔: union

• ⊓: intersection

• ⊤: top (class of everything)

• ⊥: bottom (empty class)

• ∃: exists ( / )

• ∀: for all ( )

• ¬: not (complement, negation)

• – (superscript minus): inverse property

• {}: enumeration ( )

• Self, Trans, Dom, etc.: where symbols not available

• ∘: property chain

• C(x): class membership

• P(x,y): a triple

Page 69: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Can reduce from OWL entailment to Tiling

1. Each tile must have a domino type– Define dominos as a class D, a union of classes for each domino type:

Now what else do we need to encode?

Page 70: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Can reduce from OWL entailment to Tiling

1. Each tile must have a domino type– Define dominos as a class D, a union of classes for each domino type:

2. Each tile can only be one domino typeHow can we encode this in OWL?

Page 71: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Can reduce from OWL entailment to Tiling

1. Each tile must have a domino type– Define dominos as a class D, a union of classes for each domino type:

2. Each tile can only be one domino type– Define dominos types as pairwise disjoint:

What else do we need to encode?

Page 72: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Can reduce from OWL entailment to Tiling

1. Each tile must have a domino type– Define dominos as a class D, a union of classes for each domino type:

2. Each tile can only be one domino type– Define dominos types as pairwise disjoint:

3. Each tile must have a tile to the right and aboveHow can we encode this?

Page 73: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Can reduce from OWL entailment to Tiling

1. Each tile must have a domino type– Define dominos as a class D, a union of classes for each domino type:

2. Each tile can only be one domino type– Define dominos types as pairwise disjoint:

3. Each tile must have a tile to the right and above– Define that a domino has some values from domino for right/above:

Are we there yet?

Page 74: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Can reduce from OWL entailment to Tiling

4. Tiles to the right and tiles above must match colour– Define that a domino has all values from matching tiles right/above:

Are we there yet?

Page 75: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

What condition are we missing?

• So far we could still have trees as models

• Need to state:

Tile above and to the right = Tile to the right and above

How can we encode this?

Page 76: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Can reduce from OWL entailment to Tiling

5. Tile right then above = Tile above then right– Define diagonal tile using two property chains (above-right/right-above)

– Declare functional (a tile can only have one such diagonal tile)

Are we there yet?

Page 77: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

What’s the entailment question?

What should we put in O′?

Goal: Ontology O entails O′ if and only if D has no infinite tiling

Page 78: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

What’s the entailment question?

Goal: Ontology O entails O′ if and only if D has no infinite tilingIf D can have any member (a “tile”), it must have an infinite tiling!

If D can have no member, it must not have an infinite tiling.

Page 79: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Could also use satisfiability

Ontology O is satisfiable if and only if D has an infinite tilingHere, x is an arbitrary fresh term

Page 80: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

OWL entailment/satisfiability is undecidable!

Page 81: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

OWL satisfiability/entailment is powerful ...

OWL satisfiability/entailment also undecidable!

Otherwise could be used to solve Domino Tiling problem …

… and the Halting problem …

… and (given enough time), the Collatz conjecture …

… and a bunch of other stuff

ReductionR

edu

ction

Page 82: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

OWL entailment/satisfiability is undecidable …

• Accept incomplete reasoners that halt

– You may not get all the entailments … so what

entailments do you get?

• Accept complete reasoners that may not halt

– Java is a language that lets you write programmes that

may not halt

• Restrict OWL so we can’t solve Halting/Tiling

– Main problem tackled in Description Logics field: find

decidable sublanguages of OWL without turning off too

many features (and allowing efficient algorithms)

More next week …

Well great. What are we supposed to do now?

Page 83: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

RECAP

Page 84: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies
Page 85: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

OWL Definitions

• Models– A world that the ontology could be true for

• … and a mapping from the terms of the ontology to that world

– Not necessarily the real world (just a consistent world)

– Can be (much) larger than the ontology describes

– The more detailed the ontology, the fewer its models

• Entailment– An ontology O entails another ontology O′ if any model

of O is a model of O′• … in which case O′ adds no new information to O• … in which case O′ follows from O

Page 86: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

OWL Reasoning Tasks

• Materialisation– Write down all the entailments from O′

• Unfortunately, they are infinite

• Satisfiability– Does an ontology have any model?

• If not, it is inconsistent/unsatisfiable

• Unfortunately, satisfiability is undecidable

• Entailment (checking)– Does an ontology O entail another ontology O′?

• If so, O′ follows as a consequence of O• Can be reduced to satisfiability

• Unfortunately, entailment checking is also undecidable

Page 87: CC7220-1 La Web de Datos - Aidan Hoganaidanhogan.com/teaching/cc7220-1-2017/lectures/WdD2017-05.pdf · Let’s model an RDF Schema for movies, including different types of movies

Questions?