Uncertain Data Management Open-World Query Answering
Antoine Amarilli1, Silviu Maniu2 November 28th, 2016
1Télécom ParisTech
2LRI
1/37
Table of contents
Basics
Contexts Languages Chase
Advanced topics
Incompleteness
• We have aninstanceI
• Thetruestate of the world isW
• Wemay haveI6=W
• Imay becorrect:I⊆W
• Imay becomplete:W⊆I
→ Today,Iiscorrectbut notcomplete
Incompleteness
• We have aninstanceI
• Thetruestate of the world isW
• Wemay haveI6=W
• Imay becorrect:I⊆W
• Imay becomplete:W⊆I
→ Today,Iiscorrectbut notcomplete
Incompleteness
• We have aninstanceI
• Thetruestate of the world isW
• Wemay haveI6=W
• Imay becorrect:I⊆W
• Imay becomplete:W⊆I
→ Today,Iiscorrectbut notcomplete
Incompleteness and query evaluation
• Weknow:evaluate a queryQonI
• Wewant:evaluateQonW
• Wedon’t haveW
→ What can we do?!
Incompleteness and query evaluation
• Weknow:evaluate a queryQonI
• Wewant:evaluateQonW
• Wedon’t haveW
→ What can we do?!
Constraints to the rescue!
• We know thatI⊆W (correct)
• We know thatWsatisfies somelogical constraintsΘ
• QisentailedifW|=QforallW ⊇Isuch thatW |= Θ Definition (Open-World Query Answering – OWQA)
Given an instanceI, Boolean CQQ, and constraintsΘ, decide whether allW⊇Ithat satisfyΘalso satisfyQ.
Combined complexity. Input isI,Θ,Q Data complexity. Input isI
Constraints to the rescue!
• We know thatI⊆W (correct)
• We know thatWsatisfies somelogical constraintsΘ
• QisentailedifW|=QforallW ⊇Isuch thatW |= Θ
Definition (Open-World Query Answering – OWQA)
Given an instanceI, Boolean CQQ, and constraintsΘ, decide whether allW⊇Ithat satisfyΘalso satisfyQ.
Combined complexity. Input isI,Θ,Q Data complexity. Input isI
Constraints to the rescue!
• We know thatI⊆W (correct)
• We know thatWsatisfies somelogical constraintsΘ
• QisentailedifW|=QforallW ⊇Isuch thatW |= Θ Definition (Open-World Query Answering – OWQA)
Given an instanceI, Boolean CQQ, and constraintsΘ, decide whether allW⊇Ithat satisfyΘalso satisfyQ.
Combined complexity. Input isI,Θ,Q Data complexity. Input isI
Constraints to the rescue!
• We know thatI⊆W (correct)
• We know thatWsatisfies somelogical constraintsΘ
• QisentailedifW|=QforallW ⊇Isuch thatW |= Θ Definition (Open-World Query Answering – OWQA)
Given an instanceI, Boolean CQQ, and constraintsΘ, decide whether allW⊇Ithat satisfyΘalso satisfyQ.
Combined complexity. Input isI,Θ,Q Data complexity. Input isI
Example
RelationClassinI
date teacher resp name num
2016-11-28 Antoine Fabian Uncert. Data Mgmt 2 2016-12-05 Antoine Fabian Uncert. Data Mgmt 3
BookinI
date room prof
2016-12-05 E242 John
Θ:∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof)
“Every class has a booking.” Q:∃t rBook(“2016-11-28”,t,r)
“Is there a room booked on Nov 28th?”
Example
RelationClassinI
date teacher resp name num
2016-11-28 Antoine Fabian Uncert. Data Mgmt 2 2016-12-05 Antoine Fabian Uncert. Data Mgmt 3
BookinI
date room prof
2016-12-05 E242 John
Θ:∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof)
“Every class has a booking.”
Q:∃t rBook(“2016-11-28”,t,r)
“Is there a room booked on Nov 28th?”
Example
RelationClassinI
date teacher resp name num
2016-11-28 Antoine Fabian Uncert. Data Mgmt 2 2016-12-05 Antoine Fabian Uncert. Data Mgmt 3
BookinI
date room prof
2016-12-05 E242 John
Θ:∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof)
“Every class has a booking.”
Q:∃t rBook(“2016-11-28”,t,r)
“Is there a room booked on Nov 28th?”
Table of contents
Basics
Contexts
Languages Chase
Advanced topics
Logical satisfiability
OWQA is equivalent to:
isI∧Θ∧ ¬Qsatisfiable?
Is it just logical satisfiability then?!
• Iis where we want toscale
• ΘandQare usuallydifferentlanguages...
• ... if we express both in thesamelanguage, it will be hard to achieve goodcomplexities! (or evendecidability...)
Logical satisfiability
OWQA is equivalent to:
isI∧Θ∧ ¬Qsatisfiable?
Is it just logical satisfiability then?!
• Iis where we want toscale
• ΘandQare usuallydifferentlanguages...
• ... if we express both in thesamelanguage, it will be hard to achieve goodcomplexities! (or evendecidability...)
Logical satisfiability
OWQA is equivalent to:
isI∧Θ∧ ¬Qsatisfiable?
Is it just logical satisfiability then?!
• Iis where we want toscale
• ΘandQare usuallydifferentlanguages...
• ... if we express both in thesamelanguage, it will be hard to achieve goodcomplexities! (or evendecidability...)
Logical satisfiability
OWQA is equivalent to:
isI∧Θ∧ ¬Qsatisfiable?
Is it just logical satisfiability then?!
• Iis where we want toscale
• ΘandQare usuallydifferentlanguages...
• ... if we express both in thesamelanguage, it will be hard to achieve goodcomplexities! (or evendecidability...)
Logical satisfiability
OWQA is equivalent to:
isI∧Θ∧ ¬Qsatisfiable?
Is it just logical satisfiability then?!
• Iis where we want toscale
• ΘandQare usuallydifferentlanguages...
• ... if we express both in thesamelanguage, it will be hard to achieve goodcomplexities!
(or evendecidability...)
Repairing the database
Class
date teacher resp name num
2016-11-28 Antoine Fabian Uncert. Data Mgmt 2 2016-12-05 Antoine Fabian Uncert. Data Mgmt 3 2016-12-12 Antoine Fabian Uncert. Data Mgmt 4 2017-01-09 Silviu Fabian Uncert. Data Mgmt 5
? Fabian ? ? ?
? ? ? ? 1
Constraints:
• Theresponsiblefor a class must teachsomeclass
• Every class must have afirstsession
→ What can wededuce?
→ Qis true iff it is true onallcompletions
Repairing the database
Class
date teacher resp name num
2016-11-28 Antoine Fabian Uncert. Data Mgmt 2 2016-12-05 Antoine Fabian Uncert. Data Mgmt 3 2016-12-12 Antoine Fabian Uncert. Data Mgmt 4 2017-01-09 Silviu Fabian Uncert. Data Mgmt 5
? Fabian ? ? ?
? ? ? ? 1
Constraints:
• Theresponsiblefor a class must teachsomeclass
• Every class must have afirstsession
→ What can wededuce?
→ Qis true iff it is true onallcompletions
Repairing the database
Class
date teacher resp name num
2016-11-28 Antoine Fabian Uncert. Data Mgmt 2 2016-12-05 Antoine Fabian Uncert. Data Mgmt 3 2016-12-12 Antoine Fabian Uncert. Data Mgmt 4 2017-01-09 Silviu Fabian Uncert. Data Mgmt 5
? Fabian ? ? ?
? ? ? ? 1
Constraints:
• Theresponsiblefor a class must teachsomeclass
• Every class must have afirstsession
→ What can wededuce?
→ Qis true iff it is true onallcompletions
Repairing the database
Class
date teacher resp name num
2016-11-28 Antoine Fabian Uncert. Data Mgmt 2 2016-12-05 Antoine Fabian Uncert. Data Mgmt 3 2016-12-12 Antoine Fabian Uncert. Data Mgmt 4 2017-01-09 Silviu Fabian Uncert. Data Mgmt 5
? Fabian ? ? ?
? ? ? ? 1
Constraints:
• Theresponsiblefor a class must teachsomeclass
• Every class must have afirstsession
→ What can wededuce?
→ Qis true iff it is true onallcompletions
Repairing the database
Class
date teacher resp name num
2016-11-28 Antoine Fabian Uncert. Data Mgmt 2 2016-12-05 Antoine Fabian Uncert. Data Mgmt 3 2016-12-12 Antoine Fabian Uncert. Data Mgmt 4 2017-01-09 Silviu Fabian Uncert. Data Mgmt 5
? Fabian ? ? ?
? ? ? ? 1
Constraints:
• Theresponsiblefor a class must teachsomeclass
• Every class must have afirstsession
→ What can wededuce?
But why deal with broken databases?
• The data may have come from adifferent source
• The constraints may have been imposedafter the fact
• User input may beincorrect
• You want aresilientsystem...
But why deal with broken databases?
• The data may have come from adifferent source
• The constraints may have been imposedafter the fact
• User input may beincorrect
• You want aresilientsystem...
Reasoning (AI)
• Artificialreasoning: drawconsequencesfrom what you know
• Icontains thefacts
• Θare thereasoning rules
• Qis what we want tofigure out
→ Can wededuceQfromIusingΘ?
→ IsQcertainto hold?
Reasoning (AI)
• Artificialreasoning: drawconsequencesfrom what you know
• Icontains thefacts
• Θare thereasoning rules
• Qis what we want tofigure out
→ Can wededuceQfromIusingΘ?
→ IsQcertainto hold?
Data integration
• IcontainsI1, . . . ,In, the course databases of all D&K schools
• We want to create a virtualglobaldatabaseIof classes
• Fix arelationClass for the global database
• Θ: whenever someIi contains a class,createit inR Class1
date name
2016-11-28 UDM 2016-12-05 UDM 2016-12-12 UDM 2017-01-14 UDM
Class
date teacher resp name num
2016-11-28 ? ? UDM ?
2016-12-05 ? ? UDM ?
2016-12-12 ? ? UDM ?
2017-01-14 ? ? UDM ?
Data integration
• IcontainsI1, . . . ,In, the course databases of all D&K schools
• We want to create a virtualglobaldatabaseIof classes
• Fix arelationClass for the global database
• Θ: whenever someIi contains a class,createit inR Class1
date name
2016-11-28 UDM 2016-12-05 UDM 2016-12-12 UDM 2017-01-14 UDM
Class
date teacher resp name num
2016-11-28 ? ? UDM ?
2016-12-05 ? ? UDM ?
2016-12-12 ? ? UDM ?
2017-01-14 ? ? UDM ?
Data integration
• IcontainsI1, . . . ,In, the course databases of all D&K schools
• We want to create a virtualglobaldatabaseIof classes
• Fix arelationClass for the global database
• Θ: whenever someIi contains a class,createit inR Class1
date name
2016-11-28 UDM 2016-12-05 UDM 2016-12-12 UDM 2017-01-14 UDM
Class
date teacher resp name num
2016-11-28 ? ? UDM ?
2016-12-05 ? ? UDM ?
2016-12-12 ? ? UDM ?
2017-01-14 ? ? UDM ?
Data integration
• IcontainsI1, . . . ,In, the course databases of all D&K schools
• We want to create a virtualglobaldatabaseIof classes
• Fix arelationClass for the global database
• Θ: whenever someIi contains a class,createit inR Class1
date name
2016-11-28 UDM 2016-12-05 UDM 2016-12-12 UDM 2017-01-14 UDM
Class
date teacher resp name num
2016-11-28 ? ? UDM ?
2016-12-05 ? ? UDM ?
2016-12-12 ? ? UDM ?
2017-01-14 ? ? UDM ?
Ontology-based data access
• In general: use acommonschema for reasoning
• Icontains heterogeneousdata sources
• Θdescribesmappingsfrom sources to common schema andreasoning rulesandconstraintson the common schema
• Qis thequery posed the common schema
���������������
������������
������ ������
������
���������
�������
�������
Table of contents
Basics Contexts
Languages
Chase
Advanced topics
First-order logic
AllconstraintsforΘare infirst-order logic(FO):
• containsatomsR(x,y,z)
• closed under Boolean AND, OR, NOT
• existential quantification∃xφ(x)
• universal quantification∀xφ(x)
→ Why not just use FO for constraints then?!
First-order logic
AllconstraintsforΘare infirst-order logic(FO):
• containsatomsR(x,y,z)
• closed under Boolean AND, OR, NOT
• existential quantification∃xφ(x)
• universal quantification∀xφ(x)
→ Why not just use FO for constraints then?!
FO is undecidable!
Given an input FO formulaΘ, is itsatisfiable? (i.e., OWQA withI=∅andQ:False).
→ This problem isundecidable!
• Proof: Encode a tiling system, or
encode transition rules for a Turing machine
→ We considerweaker languages
. . . . . . . . . ... ... ... ... ... ...
FO is undecidable!
Given an input FO formulaΘ, is itsatisfiable? (i.e., OWQA withI=∅andQ:False).
→ This problem isundecidable!
• Proof: Encode a tiling system, or
encode transition rules for a Turing machine
→ We considerweaker languages
. . . . . . . . . ... ... ... ... ... ...
FO is undecidable!
Given an input FO formulaΘ, is itsatisfiable? (i.e., OWQA withI=∅andQ:False).
→ This problem isundecidable!
• Proof: Encode a tiling system, or
encode transition rules for a Turing machine
→ We considerweaker languages
. . . . . . . . . ... ... ... ... ... ...
FO is undecidable!
Given an input FO formulaΘ, is itsatisfiable? (i.e., OWQA withI=∅andQ:False).
→ This problem isundecidable!
• Proof: Encode a tiling system, or
encode transition rules for a Turing machine
→ We considerweaker languages
. . . . . . . . . ... ... ... ... ... ...
Tuple-generating dependencies
Tuple-generating dependencies(TGDs), classical database rules:
∀xQ0(x)⇒ ∃yQ00(x,y)
whereQ0 andQ00areCQs.
∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof) Intuition:facts causemore factsto be created
Useful for:
• Integrity constraints:see above
• Schema mappings:copy facts fromI1 toI
• Reasoning:∀xHuman(x)⇒Mortal(x)
Tuple-generating dependencies
Tuple-generating dependencies(TGDs), classical database rules:
∀xQ0(x)⇒ ∃yQ00(x,y)
whereQ0 andQ00areCQs.
∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof) Intuition:facts causemore factsto be created
Useful for:
• Integrity constraints:see above
• Schema mappings:copy facts fromI1 toI
• Reasoning:∀xHuman(x)⇒Mortal(x)
Tuple-generating dependencies
Tuple-generating dependencies(TGDs), classical database rules:
∀xQ0(x)⇒ ∃yQ00(x,y)
whereQ0 andQ00areCQs.
∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof) Intuition:facts causemore factsto be created
Useful for:
• Integrity constraints:see above
• Schema mappings:copy facts fromI1 toI
• Reasoning:∀xHuman(x)⇒Mortal(x)
OWQA for TGDs is undecidable!
• Satisfiabilityof TGDsΘistrivial...
→ takeW=∅
• Satisfiabilityof TGDsΘand instanceIiseasy...
→ always possible –infiniterepair of violations (thechase– see later)
• OWQAforI,ΘandQisundecidable!
from [Chandra et al., 1981, Beeri and Vardi, 1981]
→ We needless expressivelanguages
OWQA for TGDs is undecidable!
• Satisfiabilityof TGDsΘistrivial...
→ takeW=∅
• Satisfiabilityof TGDsΘand instanceIiseasy...
→ always possible –infiniterepair of violations (thechase– see later)
• OWQAforI,ΘandQisundecidable!
from [Chandra et al., 1981, Beeri and Vardi, 1981]
→ We needless expressivelanguages
OWQA for TGDs is undecidable!
• Satisfiabilityof TGDsΘistrivial...
→ takeW=∅
• Satisfiabilityof TGDsΘand instanceIiseasy...
→ always possible –infiniterepair of violations (thechase– see later)
• OWQAforI,ΘandQisundecidable!
from [Chandra et al., 1981, Beeri and Vardi, 1981]
→ We needless expressivelanguages
OWQA for TGDs is undecidable!
• Satisfiabilityof TGDsΘistrivial...
→ takeW=∅
• Satisfiabilityof TGDsΘand instanceIiseasy...
→ always possible –infiniterepair of violations (thechase– see later)
• OWQAforI,ΘandQisundecidable!
from [Chandra et al., 1981, Beeri and Vardi, 1981]
→ We needless expressivelanguages
OWQA for TGDs is undecidable!
• Satisfiabilityof TGDsΘistrivial...
→ takeW=∅
• Satisfiabilityof TGDsΘand instanceIiseasy...
→ always possible –infiniterepair of violations (thechase– see later)
• OWQAforI,ΘandQisundecidable!
from [Chandra et al., 1981, Beeri and Vardi, 1981]
→ We needless expressivelanguages
OWQA for TGDs is undecidable!
• Satisfiabilityof TGDsΘistrivial...
→ takeW=∅
• Satisfiabilityof TGDsΘand instanceIiseasy...
→ always possible –infiniterepair of violations (thechase– see later)
• OWQAforI,ΘandQisundecidable!
from [Chandra et al., 1981, Beeri and Vardi, 1981]
→ We needless expressivelanguages
Inclusion dependencies
Inclusion dependencies(IDs), classical database rules:
∀xA0(x)⇒ ∃yA00(x,y)
whereAandA0areatomsrather than CQs.
The TGD example was in factalso an ID:
∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof)
Inclusion dependencies
Inclusion dependencies(IDs), classical database rules:
∀xA0(x)⇒ ∃yA00(x,y)
whereAandA0areatomsrather than CQs.
The TGD example was in factalso an ID:
∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof)
OWQA for IDs is decidable
• Satisfiabilityfor IDs isstill trivial
• OWQA:determine whetherQis implied byIand IDsΘ?
• Decidable!
• PSPACE-completecombined complexity [Johnson and Klug, 1984]
• Data complexityis PTIME, even AC0
→ Intuition: we canrewritethe queryQ
→ We will study otherdecidable classesof TGDs
OWQA for IDs is decidable
• Satisfiabilityfor IDs isstill trivial
• OWQA:determine whetherQis implied byIand IDsΘ?
• Decidable!
• PSPACE-completecombined complexity [Johnson and Klug, 1984]
• Data complexityis PTIME, even AC0
→ Intuition: we canrewritethe queryQ
→ We will study otherdecidable classesof TGDs
OWQA for IDs is decidable
• Satisfiabilityfor IDs isstill trivial
• OWQA:determine whetherQis implied byIand IDsΘ?
• Decidable!
• PSPACE-completecombined complexity [Johnson and Klug, 1984]
• Data complexityis PTIME, even AC0
→ Intuition: we canrewritethe queryQ
→ We will study otherdecidable classesof TGDs
OWQA for IDs is decidable
• Satisfiabilityfor IDs isstill trivial
• OWQA:determine whetherQis implied byIand IDsΘ?
• Decidable!
• PSPACE-completecombined complexity [Johnson and Klug, 1984]
• Data complexityis PTIME, even AC0
→ Intuition: we canrewritethe queryQ
→ We will study otherdecidable classesof TGDs
Table of contents
Basics Contexts Languages Chase
Advanced topics
Chase example
Class
date teacher resp name num
2016-12-05 Antoine Fabian Uncert. Data Mgmt 3 2016-12-12 Antoine Fabian Uncert. Data Mgmt 4
∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof) Book
date room prof
2016-12-05
?1
Antoine 2016-12-12
?2
Antoine
Chase example
Class
date teacher resp name num
2016-12-05 Antoine Fabian Uncert. Data Mgmt 3 2016-12-12 Antoine Fabian Uncert. Data Mgmt 4
∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof)
Book
date room prof
2016-12-05
?1
Antoine 2016-12-12
?2
Antoine
Chase example
Class
date teacher resp name num
2016-12-05 Antoine Fabian Uncert. Data Mgmt 3 2016-12-12 Antoine Fabian Uncert. Data Mgmt 4
∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof) Book
date room prof
2016-12-05
?1
Antoine 2016-12-12
?2
Antoine
Chase example
Class
date teacher resp name num
2016-12-05 Antoine Fabian Uncert. Data Mgmt 3 2016-12-12 Antoine Fabian Uncert. Data Mgmt 4
∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof) Book
date room prof
2016-12-05 ?1 Antoine 2016-12-12 ?2 Antoine
Chase
• OWQA:test if instanceIand TGDsΘentailqueryQ
• Thechase: a most genericrepair ofIbyΘ
• Iterative process:start withI
• At each stage, findviolationsof each TGD inΘ
• TGD∀xQ0(x)⇒ ∃yQ00(x,y)
• findasuch thatQ0(a)but notQ00(a,b)for anyb
• Createnew elementsb
• Createnew facts to makeQ0(a,b)true
→ Take theinfinite resultof this process
Chase
• OWQA:test if instanceIand TGDsΘentailqueryQ
• Thechase: a most genericrepair ofIbyΘ
• Iterative process:start withI
• At each stage, findviolationsof each TGD inΘ
• TGD∀xQ0(x)⇒ ∃yQ00(x,y)
• findasuch thatQ0(a)but notQ00(a,b)for anyb
• Createnew elementsb
• Createnew facts to makeQ0(a,b)true
→ Take theinfinite resultof this process
Chase
• OWQA:test if instanceIand TGDsΘentailqueryQ
• Thechase: a most genericrepair ofIbyΘ
• Iterative process:start withI
• At each stage, findviolationsof each TGD inΘ
• TGD∀xQ0(x)⇒ ∃yQ00(x,y)
• findasuch thatQ0(a)but notQ00(a,b)for anyb
• Createnew elementsb
• Createnew facts to makeQ0(a,b)true
→ Take theinfinite resultof this process
Chase
• OWQA:test if instanceIand TGDsΘentailqueryQ
• Thechase: a most genericrepair ofIbyΘ
• Iterative process:start withI
• At each stage, findviolationsof each TGD inΘ
• TGD∀xQ0(x)⇒ ∃yQ00(x,y)
• findasuch thatQ0(a)but notQ00(a,b)for anyb
• Createnew elementsb
• Createnew facts to makeQ0(a,b)true
→ Take theinfinite resultof this process
Chase
• OWQA:test if instanceIand TGDsΘentailqueryQ
• Thechase: a most genericrepair ofIbyΘ
• Iterative process:start withI
• At each stage, findviolationsof each TGD inΘ
• TGD∀xQ0(x)⇒ ∃yQ00(x,y)
• findasuch thatQ0(a)but notQ00(a,b)for anyb
• Createnew elementsb
• Createnew facts to makeQ0(a,b)true
→ Take theinfinite resultof this process
Infinite chase example
∀t uMentor(t,u)⇒ ∃sMentor(s,t) Mentor
master padawan
Antoine Arthur Dent Silviu Arthur Dent
?1 Antoine
?2 Silviu
?3 ?1
?4 ?2
?5 ?3
?6 ?4
... ...
Infinite chase example
∀t uMentor(t,u)⇒ ∃sMentor(s,t) Mentor
master padawan Antoine Arthur Dent Silviu Arthur Dent
?1 Antoine
?2 Silviu
?3 ?1
?4 ?2
?5 ?3
?6 ?4
... ...
Infinite chase example
∀t uMentor(t,u)⇒ ∃sMentor(s,t) Mentor
master padawan Antoine Arthur Dent Silviu Arthur Dent
?1 Antoine
?2 Silviu
?3 ?1
?4 ?2
?5 ?3
?6 ?4
... ...
Infinite chase example
∀t uMentor(t,u)⇒ ∃sMentor(s,t) Mentor
master padawan Antoine Arthur Dent Silviu Arthur Dent
?1 Antoine
?2 Silviu
?3 ?1
?4 ?2
?5 ?3
?6 ?4
... ...
Infinite chase example
∀t uMentor(t,u)⇒ ∃sMentor(s,t) Mentor
master padawan Antoine Arthur Dent Silviu Arthur Dent
?1 Antoine
?2 Silviu
?3 ?1
?4 ?2
?5 ?3
?6 ?4
... ...
Infinite chase example
∀t uMentor(t,u)⇒ ∃sMentor(s,t) Mentor
master padawan Antoine Arthur Dent Silviu Arthur Dent
?1 Antoine
?2 Silviu
?3 ?1
?4 ?2
?5 ?3
?6 ?4
... ...
Chase universality
• The chase is themost genericcompletion
• Can be shown usinghomomorphisms
→ A query is true in the chaseiffit is entailed Theorem
For any instanceI, TGDsΘ, Boolean CQQ, the following areequivalent:
• IandΘentailQ
• the chase ofIbyΘsatisfiesQ
→ How toreasonabout this infinite chase?
Chase universality
• The chase is themost genericcompletion
• Can be shown usinghomomorphisms
→ A query is true in the chaseiffit is entailed
Theorem
For any instanceI, TGDsΘ, Boolean CQQ, the following areequivalent:
• IandΘentailQ
• the chase ofIbyΘsatisfiesQ
→ How toreasonabout this infinite chase?
Chase universality
• The chase is themost genericcompletion
• Can be shown usinghomomorphisms
→ A query is true in the chaseiffit is entailed Theorem
For any instanceI, TGDsΘ, Boolean CQQ, the following areequivalent:
• IandΘentailQ
• the chase ofIbyΘsatisfiesQ
→ How toreasonabout this infinite chase?
Chase universality
• The chase is themost genericcompletion
• Can be shown usinghomomorphisms
→ A query is true in the chaseiffit is entailed Theorem
For any instanceI, TGDsΘ, Boolean CQQ, the following areequivalent:
• IandΘentailQ
• the chase ofIbyΘsatisfiesQ
→ How toreasonabout this infinite chase?
Chase termination
• Sometimes, the chase ofIbyΘisfinite
• We can thendecidewhether a queryQis entailed:
• Constructthe chase
• EvaluateQon the chase
→ When is the chasefinite?
Chase termination
• Sometimes, the chase ofIbyΘisfinite
• We can thendecidewhether a queryQis entailed:
• Constructthe chase
• EvaluateQon the chase
→ When is the chasefinite?
Chase termination
• Sometimes, the chase ofIbyΘisfinite
• We can thendecidewhether a queryQis entailed:
• Constructthe chase
• EvaluateQon the chase
→ When is the chasefinite?
Full dependencies
• If no TGD has an∃, then the chase isfinite
→ Nonew elementsare created
• Good:∀d r pBook(d,r,p)⇒Room(r)
• Bad:∀x Mentor(x)⇒ ∃yMentor(x,y)
Full dependencies
• If no TGD has an∃, then the chase isfinite
→ Nonew elementsare created
• Good:∀d r pBook(d,r,p)⇒Room(r)
• Bad:∀x Mentor(x)⇒ ∃yMentor(x,y)
Acyclicity
• Simplesufficient conditionfor finite chase:
If arelation nameoccurs at theleftof a TGD then it does not occur at theright
• Good:∀xClass(x)⇒ ∃y Book(x)
• Bad: ∀xMentor(x)⇒ ∃yMentor(x,y)
• More generalacyclicity conditions
Acyclicity
• Simplesufficient conditionfor finite chase:
If arelation nameoccurs at theleftof a TGD then it does not occur at theright
• Good:∀x Class(x)⇒ ∃y Book(x)
• Bad: ∀xMentor(x)⇒ ∃yMentor(x,y)
• More generalacyclicity conditions
Acyclicity
• Simplesufficient conditionfor finite chase:
If arelation nameoccurs at theleftof a TGD then it does not occur at theright
• Good:∀x Class(x)⇒ ∃y Book(x)
• Bad: ∀xMentor(x)⇒ ∃yMentor(x,y)
• More generalacyclicity conditions
Infinite chase
• What can we do if the chase isinfinite?
• Bounded derivation depth:we cantruncatethe chase:
• we fixΘand look at thesizeofQ
• bound the maximaldepthin the chase whereQcan be made true
• Bounded treewidth:the chase is like atree:
• we can reason aboutinfiniteandregulartrees
• usetree automata, following Courcelle’s theorem
• some rules preserve this, e.g., theguarded fragments
Infinite chase
• What can we do if the chase isinfinite?
• Bounded derivation depth:we cantruncatethe chase:
• we fixΘand look at thesizeofQ
• bound the maximaldepthin the chase whereQcan be made true
• Bounded treewidth:the chase is like atree:
• we can reason aboutinfiniteandregulartrees
• usetree automata, following Courcelle’s theorem
• some rules preserve this, e.g., theguarded fragments
Table of contents
Basics Contexts Languages Chase
Advanced topics
Query rewriting
• Thechase:reason aboutconsequencesofIunderΘ
• Other option: reason abouthow to proveQ
Θ:∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof)
Q:∃t rBook(“2016-11-28”,t,r)
Q2:∃prof,r,n,i, Class(“2016-11-28”,prof,r,n,i)
Query rewriting
• Thechase:reason aboutconsequencesofIunderΘ
• Other option: reason abouthow to proveQ
Θ:∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof)
Q:∃t rBook(“2016-11-28”,t,r)
Q2:∃prof,r,n,i, Class(“2016-11-28”,prof,r,n,i)
Query rewriting
• Thechase:reason aboutconsequencesofIunderΘ
• Other option: reason abouthow to proveQ
Θ:∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof)
Q:∃t rBook(“2016-11-28”,t,r)
Q2:∃prof,r,n,i, Class(“2016-11-28”,prof,r,n,i)
Query rewriting
• Thechase:reason aboutconsequencesofIunderΘ
• Other option: reason abouthow to proveQ
Θ:∀date,prof,r,n,i, Class(date,prof,r,n,i)⇒
∃room, Book(date,room,prof)
Q:∃t rBook(“2016-11-28”,t,r)
Q2:∃prof,r,n,i, Class(“2016-11-28”,prof,r,n,i)
Query rewriting and inclusion dependencies
• To show that OWQA forinclusion dependenciesis decidable...
∀xA0(x)⇒ ∃yA00(x,y)
• Rewrite all atoms in the query inall possible ways
→ Each atom rewritten byonly one atom
→ The query size does notincrease
• ReplaceQby aunionof conjunctive queries
→ OWQA for IDs isdecidable
→ OWQA for IDs hastractabledata complexity
Query rewriting and inclusion dependencies
• To show that OWQA forinclusion dependenciesis decidable...
∀xA0(x)⇒ ∃yA00(x,y)
• Rewrite all atoms in the query inall possible ways
→ Each atom rewritten byonly one atom
→ The query size does notincrease
• ReplaceQby aunionof conjunctive queries
→ OWQA for IDs isdecidable
→ OWQA for IDs hastractabledata complexity
Query rewriting and inclusion dependencies
• To show that OWQA forinclusion dependenciesis decidable...
∀xA0(x)⇒ ∃yA00(x,y)
• Rewrite all atoms in the query inall possible ways
→ Each atom rewritten byonly one atom
→ The query size does notincrease
• ReplaceQby aunionof conjunctive queries
→ OWQA for IDs isdecidable
→ OWQA for IDs hastractabledata complexity
Description logics
• TGDscannot expresseverything
∀xQ0(x)⇒ ∃yQ00(x,y)
• Disjunction:ifAthen BorC
• Negation:youcannothave bothAandB
→ Description logics:expressive rules
• signature must havearityat most2
Description logics
• TGDscannot expresseverything
∀xQ0(x)⇒ ∃yQ00(x,y)
• Disjunction:ifAthenBorC
• Negation:youcannothave bothAandB
→ Description logics:expressive rules
• signature must havearityat most2
Description logics
• TGDscannot expresseverything
∀xQ0(x)⇒ ∃yQ00(x,y)
• Disjunction:ifAthenBorC
• Negation:youcannothave bothAandB
→ Description logics:expressive rules
• signature must havearityat most2
Description logics (2)
• Description logics have a specificsyntax
Teacher v Proft(∃Advisor−.Prof)
• Description logics exist in manyvariants
• Idea:precisecomplexityof OWQA depending on variant
Complexity Languages UNA Combined complexity Data complexity
Satisfiability Instance checking Query answering DL-Lite[core|H] NLogSpace≥[A] inAC0 inAC0 DL-Lite[horn|H] yes/no P≤[Th.8.2] ≥[A] inAC0 inAC0≤[C] DL-Lite[|H]krom NLogSpace≤[Th.8.2] inAC0 coNP≥[B] DL-Lite[bool|H] NP≤[Th.8.2] ≥[A] inAC0≤[Th.8.3] coNP DL-Lite[F|N |(HF)|(HN)]
core NLogSpace inAC0 inAC0
DL-Lite[F|N |(HF)|(HN)]
horn yes P ≤[Th.5.8, 5.13] inAC0 inAC0≤[Th.7.1]
DL-Lite[F|N |(HF)|(HN)]
krom NLogSpace≤[Th.5.7,5.13] inAC0 coNP DL-Lite[F|N |(HF)|(HN)]
bool NP ≤[Th.5.6, 5.13] inAC0≤[Cor.6.2] coNP
DL-Lite[F|(HF)]core/horn P≤[Cor.8.8] ≥[Th.8.7] P≥[Th.8.7] P
DL-Lite[F|(HF)]krom P≤[Cor.8.8] P coNP
DL-Lite[F|(HF)]bool no NP P≤[Cor.8.8] coNP
DL-Lite[N |(HN)]core/horn NP≥[Th.8.4] coNP≥[Th.8.4] coNP DL-Lite[N |(HN)]krom/bool NP≤[Th.8.5] coNP coNP DL-LiteHFcore/horn ExpTime≥[Th.5.10] P≥[Th.6.7] P≤[D] DL-LiteHFkrom/bool
yes/no ExpTime coNP≥[Th.6.5] coNP
DL-LiteHNcore/horn ExpTime coNP≥[Th.6.6] coNP
DL-LiteHNkrom/bool ExpTime≤[F] coNP coNP≤[E]
Description logics (2)
• Description logics have a specificsyntax
Teacher v Proft(∃Advisor−.Prof)
• Description logics exist in manyvariants
• Idea:precisecomplexityof OWQA depending on variant
Complexity Languages UNA Combined complexity Data complexity
Satisfiability Instance checking Query answering DL-Lite[core|H] NLogSpace≥[A] inAC0 inAC0 DL-Lite[horn|H] yes/no P≤[Th.8.2] ≥[A] inAC0 inAC0≤[C] DL-Lite[|H]krom NLogSpace≤[Th.8.2] inAC0 coNP≥[B] DL-Lite[bool|H] NP≤[Th.8.2] ≥[A] inAC0≤[Th.8.3] coNP DL-Lite[F|N |(HF)|(HN)]
core NLogSpace inAC0 inAC0
DL-Lite[F|N |(HF)|(HN)]
horn yes P ≤[Th.5.8, 5.13] inAC0 inAC0≤[Th.7.1]
DL-Lite[F|N |(HF)|(HN)]
krom NLogSpace≤[Th.5.7,5.13] inAC0 coNP DL-Lite[F|N |(HF)|(HN)]
bool NP ≤[Th.5.6, 5.13] inAC0≤[Cor.6.2] coNP
DL-Lite[F|(HF)]core/horn P≤[Cor.8.8] ≥[Th.8.7] P≥[Th.8.7] P
DL-Lite[F|(HF)]krom P≤[Cor.8.8] P coNP
DL-Lite[F|(HF)]bool no NP P≤[Cor.8.8] coNP
DL-Lite[N |(HN)]core/horn NP≥[Th.8.4] coNP≥[Th.8.4] coNP DL-Lite[N |(HN)]krom/bool NP≤[Th.8.5] coNP coNP DL-LiteHFcore/horn ExpTime≥[Th.5.10] P≥[Th.6.7] P≤[D] DL-LiteHFkrom/bool
yes/no ExpTime coNP≥[Th.6.5] coNP
DL-LiteHNcore/horn ExpTime coNP≥[Th.6.6] coNP
DL-LiteHNkrom/bool ExpTime≤[F] coNP coNP≤[E]
Description logics (2)
• Description logics have a specificsyntax
Teacher v Proft(∃Advisor−.Prof)
• Description logics exist in manyvariants
• Idea:precisecomplexityof OWQA depending on variant
Complexity Languages UNA Combined complexity Data complexity
Satisfiability Instance checking Query answering DL-Lite[core|H] NLogSpace≥[A] inAC0 inAC0 DL-Lite[horn|H] yes/no P≤[Th.8.2] ≥[A] inAC0 inAC0≤[C]
DL-Lite[|H]krom NLogSpace≤[Th.8.2] inAC0 coNP≥[B]
DL-Lite[bool|H] NP≤[Th.8.2] ≥[A] inAC0≤[Th.8.3] coNP DL-Lite[F|N |(HF)|(HN)]
core NLogSpace inAC0 inAC0
DL-Lite[F|N |(HF)|(HN)]
horn yes P ≤[Th.5.8, 5.13] inAC0 inAC0≤[Th.7.1]
DL-Lite[F|N |(HF)|(HN)]
krom NLogSpace≤[Th.5.7,5.13] inAC0 coNP DL-Lite[F|N |(HF)|(HN)]
bool NP ≤[Th.5.6, 5.13] inAC0≤[Cor.6.2] coNP
DL-Lite[F|(HF)]core/horn P≤[Cor.8.8] ≥[Th.8.7] P≥[Th.8.7] P
DL-Lite[F|(HF)]krom P≤[Cor.8.8] P coNP
DL-Lite[F|(HF)]bool no NP P≤[Cor.8.8] coNP
DL-Lite[N |(HN)]core/horn NP≥[Th.8.4] coNP≥[Th.8.4] coNP DL-Lite[N |(HN)]krom/bool NP≤[Th.8.5] coNP coNP DL-LiteHFcore/horn ExpTime≥[Th.5.10] P≥[Th.6.7] P≤[D]
DL-LiteHFkrom/bool
yes/no ExpTime coNP≥[Th.6.5] coNP
DL-LiteHNcore/horn ExpTime coNP≥[Th.6.6] coNP
Equality-generating dependencies
• Another important constraint forΘ: functional dependencies
• There can’t betwo bookingsfor one room at the same time
• There can’t betwo roomsfor one session
• Functional dependencies can beaddedtoΘfor OWQA
• Decidablefor description logics
• Undecidablewith inclusion dependencies
Equality-generating dependencies
• Another important constraint forΘ: functional dependencies
• There can’t betwo bookingsfor one room at the same time
• There can’t betwo roomsfor one session
• Functional dependencies can beaddedtoΘfor OWQA
• Decidablefor description logics
• Undecidablewith inclusion dependencies
Finite models
Definition (Open-World Query Answering – OWQA)
Given an instanceI, Boolean CQQ, and constraintsΘ, decide whether all
finite
W ⊇Ithat satisfyΘsatisfyQ.
• The worldW is actuallyfinite
• Shouldn’t wereflectthis?
• If thechaseis infinite, it no longer works
• Imposing finiteness may make adifference
→ Veryhardto reason about FOWQA!
Finite models
Definition (Open-World Query Answering – OWQA)
Given an instanceI, Boolean CQQ, and constraintsΘ, decide whether all
finite
W ⊇Ithat satisfyΘsatisfyQ.
• The worldWis actuallyfinite
• Shouldn’t wereflectthis?
• If thechaseis infinite, it no longer works
• Imposing finiteness may make adifference
→ Veryhardto reason about FOWQA!
Finite models
Definition (Finite Open-World Query Answering – FOWQA)
Given an instanceI, Boolean CQQ, and constraintsΘ, decide whether allfiniteW ⊇Ithat satisfyΘsatisfyQ.
• The worldWis actuallyfinite
• Shouldn’t wereflectthis?
• If thechaseis infinite, it no longer works
• Imposing finiteness may make adifference
→ Veryhardto reason about FOWQA!
Finite models
Definition (Finite Open-World Query Answering – FOWQA)
Given an instanceI, Boolean CQQ, and constraintsΘ, decide whether allfiniteW ⊇Ithat satisfyΘsatisfyQ.
• The worldWis actuallyfinite
• Shouldn’t wereflectthis?
• If thechaseis infinite, it no longer works
• Imposing finiteness may make adifference
→ Veryhardto reason about FOWQA!
Partial completeness
• We have assumed thatIwasincomplete
• Sometimes, we knowwhich relationsare complete
• e.g., the list ofroomsmay becomplete
• the list ofclassesmay beincomplete
→ Partially complete databases[Razniewski et al., 2015]
• We may knowother things:
• If I know the lecturer of a class, then I knowall lecturers
• If I knowone sessionof a class, I knowall sessions
→ Partial completeness assumption[Galárraga et al., 2013]
Partial completeness
• We have assumed thatIwasincomplete
• Sometimes, we knowwhich relationsare complete
• e.g., the list ofroomsmay becomplete
• the list ofclassesmay beincomplete
→ Partially complete databases[Razniewski et al., 2015]
• We may knowother things:
• If I know the lecturer of a class, then I knowall lecturers
• If I knowone sessionof a class, I knowall sessions
→ Partial completeness assumption[Galárraga et al., 2013]
Partial completeness
• We have assumed thatIwasincomplete
• Sometimes, we knowwhich relationsare complete
• e.g., the list ofroomsmay becomplete
• the list ofclassesmay beincomplete
→ Partially complete databases[Razniewski et al., 2015]
• We may knowother things:
• If I know the lecturer of a class, then I knowall lecturers
• If I knowone sessionof a class, I knowall sessions
→ Partial completeness assumption[Galárraga et al., 2013]
Partial completeness
• We have assumed thatIwasincomplete
• Sometimes, we knowwhich relationsare complete
• e.g., the list ofroomsmay becomplete
• the list ofclassesmay beincomplete
→ Partially complete databases[Razniewski et al., 2015]
• We may knowother things:
• If I know the lecturer of a class, then I knowall lecturers
• If I knowone sessionof a class, I knowall sessions
→ Partial completeness assumption[Galárraga et al., 2013]
Slide credits
• Slide 34:
http://www.slideshare.net/MartnRezk/slides-swat4-ls, slide 17, licence CC-BY-SA 3.01
• Slides 16 and 36: Jaques Rouxel,Les Shadoks(reproduit en vertu du droit de citation)
• Slide 34: [Artale et al., 2009], p 18
References I
Abiteboul, S., Hull, R., and Vianu, V. (1995).
Foundations of Databases.
Addison-Wesley.
http://webdam.inria.fr/Alice/pdfs/all.pdf.
Artale, A., Calvanese, D., Kontchakov, R., and Zakharyaschev, M.
(2009).
The DL-Lite family and relations.
Journal of artificial intelligence research.
https://www.jair.org/media/2820/live-2820-4662-jair.pdf.