• Aucun résultat trouvé

Query Answering with Guarded Rules and Expressive Constraints

N/A
N/A
Protected

Academic year: 2022

Partager "Query Answering with Guarded Rules and Expressive Constraints"

Copied!
144
0
0

Texte intégral

(1)

Query Answering with Guarded Rules and Expressive Constraints

Antoine Amarilli1,2, Michael Benedikt2, Pierre Bourhis3, Michael Vanden Boom2 October 20, 2016

1Télécom ParisTech, Paris, France

2University of Oxford, Oxford, United Kingdom

3CNRS CRIStAL, Lille 1/33

(2)

Open-world query answering (QA)

• We aregiven:

RelationalinstanceI(ground facts)

! LogicalconstraintsΣ

? Boolean conjunctivequeryq

(existentially quantified conjunction of atoms)

• Weask:

• Consider all possiblecompletionsJI

• Restrict to those that satisfy theconstraintsΣ

Isqcertainamong them?

(3)

Open-world query answering (QA)

• We aregiven:

RelationalinstanceI(ground facts)

! LogicalconstraintsΣ

? Boolean conjunctivequeryq

(existentially quantified conjunction of atoms)

• Weask:

• Consider all possiblecompletionsJI

• Restrict to those that satisfy theconstraintsΣ

Isqcertainamong them?

2/33

(4)

QA example

Relational instanceI

CoSup(Jamie)Jamie is a co-supervised student

! Logical constraintsΣ

∀xCoSup(x)→ ∃y zAdv(x,y)Adv(x,z)Knows(y,z)y6=z A co-supervised student has two advisors that know each other

∀x yAdv(x,y)Knows(x,y) Advisors know their students

∀x yKnows(x,y)Knows(y,x)

“Knows” is symmetric

? Boolean conjunctive queryq

∃x y zKnows(x,y)Knows(y,z)Knows(x,z) Is there a clique of 3 people that know each other?

→ The query iscertainunder the instance and constraints

(5)

QA example

Relational instanceI

CoSup(Jamie)Jamie is a co-supervised student

! Logical constraintsΣ

∀xCoSup(x)→ ∃y zAdv(x,y)Adv(x,z)Knows(y,z)y6=z A co-supervised student has two advisors that know each other

∀x yAdv(x,y)Knows(x,y) Advisors know their students

∀x yKnows(x,y)Knows(y,x)

“Knows” is symmetric

? Boolean conjunctive queryq

∃x y zKnows(x,y)Knows(y,z)Knows(x,z) Is there a clique of 3 people that know each other?

→ The query iscertainunder the instance and constraints

3/33

(6)

QA example

Relational instanceI

CoSup(Jamie)Jamie is a co-supervised student

! Logical constraintsΣ

∀xCoSup(x)→ ∃y zAdv(x,y)Adv(x,z)Knows(y,z)y6=z A co-supervised student has two advisors that know each other

∀x yAdv(x,y)Knows(x,y) Advisors know their students

∀x yKnows(x,y)Knows(y,x)

“Knows” is symmetric

? Boolean conjunctive queryq

∃x y zKnows(x,y)Knows(y,z)Knows(x,z) Is there a clique of 3 people that know each other?

→ The query iscertainunder the instance and constraints

(7)

QA example

Relational instanceI

CoSup(Jamie)Jamie is a co-supervised student

! Logical constraintsΣ

∀xCoSup(x)→ ∃y zAdv(x,y)Adv(x,z)Knows(y,z)y6=z A co-supervised student has two advisors that know each other

∀x yAdv(x,y)Knows(x,y) Advisors know their students

∀x yKnows(x,y)Knows(y,x)

“Knows” is symmetric

? Boolean conjunctive queryq

∃x y zKnows(x,y)Knows(y,z)Knows(x,z) Is there a clique of 3 people that know each other?

→ The query iscertainunder the instance and constraints

3/33

(8)

QA example

Relational instanceI

CoSup(Jamie)Jamie is a co-supervised student

! Logical constraintsΣ

∀xCoSup(x)→ ∃y zAdv(x,y)Adv(x,z)Knows(y,z)y6=z A co-supervised student has two advisors that know each other

∀x yAdv(x,y)Knows(x,y) Advisors know their students

∀x yKnows(x,y)Knows(y,x)

“Knows” is symmetric

? Boolean conjunctive queryq

∃x y zKnows(x,y)Knows(y,z)Knows(x,z) Is there a clique of 3 people that know each other?

→ The query iscertainunder the instance and constraints

(9)

QA example

Relational instanceI

CoSup(Jamie)Jamie is a co-supervised student

! Logical constraintsΣ

∀xCoSup(x)→ ∃y zAdv(x,y)Adv(x,z)Knows(y,z)y6=z A co-supervised student has two advisors that know each other

∀x yAdv(x,y)Knows(x,y) Advisors know their students

∀x yKnows(x,y)Knows(y,x)

“Knows” is symmetric

? Boolean conjunctive queryq

∃x y zKnows(x,y)Knows(y,z)Knows(x,z) Is there a clique of 3 people that know each other?

→ The query iscertainunder the instance and constraints

3/33

(10)

QA tasks

Is QAdecidable, and what is thecomplexity?

→ Depends on the language used forlogical constraints

→ E.g., for arbitraryfirst-orderconstraints, QA isundecidable (becausesatisfiabilityis undecidable)

→ Find fragments offirst-order logicwithdecidable QA

(11)

QA tasks

Is QAdecidable, and what is thecomplexity?

→ Depends on the language used forlogical constraints

→ E.g., for arbitraryfirst-orderconstraints, QA isundecidable (becausesatisfiabilityis undecidable)

→ Find fragments offirst-order logicwithdecidable QA

4/33

(12)

QA tasks

Is QAdecidable, and what is thecomplexity?

→ Depends on the language used forlogical constraints

→ E.g., for arbitraryfirst-orderconstraints, QA isundecidable (becausesatisfiabilityis undecidable)

→ Find fragments offirst-order logicwithdecidable QA

(13)

QA tasks

Is QAdecidable, and what is thecomplexity?

→ Depends on the language used forlogical constraints

→ E.g., for arbitraryfirst-orderconstraints, QA isundecidable (becausesatisfiabilityis undecidable)

→ Find fragments offirst-order logicwithdecidable QA

4/33

(14)

Tuple-generating dependencies (or existential rules)

∀x yφ(x,y)→ ∃zψ(y,z)

where thebodyφandheadψareconjunctions of atoms

→ Guarded TGDs:bodyφhas an atom withallbody variablesx,y

∀x y1y2S(x,y1)∧S(x,y2)∧U(x,y1,y2)→ ∃z S(y2,z)T(y1)

→ Frontier-one TGDs:thefrontieryhas onlyonevariable

∀xyS(x,y)→ ∃z S(y,z)

→ Frontier-guarded TGDs (FGTGDs):

bodyφhas an atom withallfrontier variablesy

∀x y1y2S(x,y1)∧S(x,y2)∧R(y1,y2)→ ∃z S(y2,z)T(y1)

→ QA for FGTGDs isdecidable[Baget et al., 2011]

(15)

Tuple-generating dependencies (or existential rules)

∀x yφ(x,y)→ ∃zψ(y,z)

where thebodyφandheadψareconjunctions of atoms

→ Guarded TGDs:bodyφhas an atom withallbody variablesx,y

∀x y1y2S(x,y1)∧S(x,y2)∧U(x,y1,y2)→ ∃z S(y2,z)T(y1)

→ Frontier-one TGDs:thefrontieryhas onlyonevariable

∀xyS(x,y)→ ∃z S(y,z)

→ Frontier-guarded TGDs (FGTGDs):

bodyφhas an atom withallfrontier variablesy

∀x y1y2S(x,y1)∧S(x,y2)∧R(y1,y2)→ ∃z S(y2,z)T(y1)

→ QA for FGTGDs isdecidable[Baget et al., 2011]

5/33

(16)

Tuple-generating dependencies (or existential rules)

∀x yφ(x,y)→ ∃zψ(y,z)

where thebodyφandheadψareconjunctions of atoms

→ Guarded TGDs:bodyφhas an atom withallbody variablesx,y

∀x y1y2S(x,y1)∧S(x,y2)∧U(x,y1,y2)→ ∃z S(y2,z)T(y1)

→ Frontier-one TGDs:thefrontieryhas onlyonevariable

∀xyS(x,y)→ ∃z S(y,z)

→ Frontier-guarded TGDs (FGTGDs):

bodyφhas an atom withallfrontier variablesy

∀x y1y2S(x,y1)∧S(x,y2)∧R(y1,y2)→ ∃z S(y2,z)T(y1)

→ QA for FGTGDs isdecidable[Baget et al., 2011]

(17)

Tuple-generating dependencies (or existential rules)

∀x yφ(x,y)→ ∃zψ(y,z)

where thebodyφandheadψareconjunctions of atoms

→ Guarded TGDs:bodyφhas an atom withallbody variablesx,y

∀x y1y2S(x,y1)∧S(x,y2)∧U(x,y1,y2)→ ∃z S(y2,z)T(y1)

→ Frontier-one TGDs:thefrontieryhas onlyonevariable

∀xyS(x,y)→ ∃z S(y,z)

→ Frontier-guarded TGDs (FGTGDs):

bodyφhas an atom withallfrontier variablesy

∀x y1y2S(x,y1)∧S(x,y2)∧R(y1,y2)→ ∃z S(y2,z)T(y1)

→ QA for FGTGDs isdecidable[Baget et al., 2011]

5/33

(18)

Tuple-generating dependencies (or existential rules)

∀x yφ(x,y)→ ∃zψ(y,z)

where thebodyφandheadψareconjunctions of atoms

→ Guarded TGDs:bodyφhas an atom withallbody variablesx,y

∀x y1y2S(x,y1)∧S(x,y2)∧U(x,y1,y2)→ ∃z S(y2,z)T(y1)

→ Frontier-one TGDs:thefrontieryhas onlyonevariable

∀xyS(x,y)→ ∃z S(y,z)

→ Frontier-guarded TGDs (FGTGDs):

bodyφhas an atom withallfrontier variablesy

∀x y y S(x,y )∧S(x,y )∧R(y ,y )→ ∃z S(y ,z)T(y )

(19)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2 Born(x,y1)Born(x,y2)y1 =y2 unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2) unguarded frontier!

• Totality:All elephants are bigger than all mice

∀y1y2Elephant(y1)Mouse(y2)y1<y2 unguarded frontier!

6/33

(20)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2 Born(x,y1)Born(x,y2)y1 =y2 unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2) unguarded frontier!

• Totality:All elephants are bigger than all mice

∀y1y2Elephant(y1)Mouse(y2)y1<y2 unguarded frontier!

(21)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2 Born(x,y1)Born(x,y2)y1 =y2 unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2) unguarded frontier!

• Totality:All elephants are bigger than all mice

∀y1y2Elephant(y1)Mouse(y2)y1<y2 unguarded frontier!

6/33

(22)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2Born(x,y1)Born(x,y2)y1 =y2

unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2) unguarded frontier!

• Totality:All elephants are bigger than all mice

∀y1y2Elephant(y1)Mouse(y2)y1<y2 unguarded frontier!

(23)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2Born(x,y1)Born(x,y2)y1 =y2 unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2) unguarded frontier!

• Totality:All elephants are bigger than all mice

∀y1y2Elephant(y1)Mouse(y2)y1<y2 unguarded frontier!

6/33

(24)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2Born(x,y1)Born(x,y2)y1 =y2 unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2) unguarded frontier!

• Totality:All elephants are bigger than all mice

∀y1y2Elephant(y1)Mouse(y2)y1<y2 unguarded frontier!

(25)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2Born(x,y1)Born(x,y2)y1 =y2 unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2)

unguarded frontier!

• Totality:All elephants are bigger than all mice

∀y1y2Elephant(y1)Mouse(y2)y1<y2 unguarded frontier!

6/33

(26)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2Born(x,y1)Born(x,y2)y1 =y2 unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2) unguarded frontier!

• Totality:All elephants are bigger than all mice

∀y1y2Elephant(y1)Mouse(y2)y1<y2 unguarded frontier!

(27)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2Born(x,y1)Born(x,y2)y1 =y2 unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2) unguarded frontier!

• Totality:All elephants are bigger than all mice

∀y1y2Elephant(y1)Mouse(y2)y1<y2 unguarded frontier!

6/33

(28)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2Born(x,y1)Born(x,y2)y1 =y2 unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2) unguarded frontier!

unguarded frontier!

(29)

FGTGDs cannot express everything

• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors

Handled byguarded logicsandguarded negation logics

• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace

∀xy1y2Born(x,y1)Born(x,y2)y1 =y2 unguarded frontier!

• Transitivity:isLocatedIn, isPartOf, subclass...

∀x y1y2Part(y1,x)Part(x,y2)Part(y1,y2) unguarded frontier!

• Totality:All elephants are bigger than all mice

∀y1y2Elephant(y1)Mouse(y2)y1<y2 unguarded frontier!

6/33

(30)

This talk

Can we extend frontier-guarded TGDs to capture some unguarded constraints while preserving the decidability of QA?

1. Combining Existential Rules and Description Logics A. A., Michael Benedikt, IJCAI’15.

Extend FGTGDs withdescription logicconstraints

on arity-two data (includes disjunction, negation, counting) 2. Query Answering with Transitive and Linear-Ordered Data

A. A., Michael Benedikt, P. Bourhis, M. Vanden Boom, IJCAI’16

Extend FGTGDs withtransitive relations

andorder relationsthat cannot be used as guards

(31)

This talk

Can we extend frontier-guarded TGDs to capture some unguarded constraints while preserving the decidability of QA?

1. Combining Existential Rules and Description Logics A. A., Michael Benedikt, IJCAI’15.

Extend FGTGDs withdescription logicconstraints

on arity-two data (includes disjunction, negation, counting)

2. Query Answering with Transitive and Linear-Ordered Data A. A., Michael Benedikt, P. Bourhis, M. Vanden Boom, IJCAI’16

Extend FGTGDs withtransitive relations

andorder relationsthat cannot be used as guards

7/33

(32)

This talk

Can we extend frontier-guarded TGDs to capture some unguarded constraints while preserving the decidability of QA?

1. Combining Existential Rules and Description Logics A. A., Michael Benedikt, IJCAI’15.

Extend FGTGDs withdescription logicconstraints

on arity-two data (includes disjunction, negation, counting) 2. Query Answering with Transitive and Linear-Ordered Data

A. A., Michael Benedikt, P. Bourhis, M. Vanden Boom, IJCAI’16

(33)

Table of contents

Introduction

Combining Existential Rules and Description Logics

Query Answering with Transitive and Linear-Ordered Data

Conclusion

8/33

(34)

Rich Description Logics

Rich description logics(DLs) FGTGDs

Emp v CEOt(∃Mgr.Emp) ∀pwvAcpt(p,w,v) → ∃f Trip(p,f,v) Arity-twoonly Arbitraryarity

Rich:disjunction, etc. Conjunctionandimplicationonly Functionality

asserts Funct(Mgr)

! n/a

(35)

Rich Description Logics

Rich description logics(DLs) FGTGDs

Emp v CEOt(∃Mgr.Emp) ∀pwvAcpt(p,w,v) → ∃f Trip(p,f,v)

Arity-twoonly Arbitraryarity

Rich:disjunction, etc. Conjunctionandimplicationonly Functionality

asserts Funct(Mgr)

! n/a

9/33

(36)

Rich Description Logics

Rich description logics(DLs) FGTGDs

Emp v CEOt(∃Mgr.Emp) ∀pwvAcpt(p,w,v) → ∃f Trip(p,f,v) Arity-twoonly Arbitraryarity

Rich:disjunction, etc. Conjunctionandimplicationonly Functionality

asserts Funct(Mgr)

! n/a

(37)

Rich Description Logics

Rich description logics(DLs) FGTGDs

Emp v CEOt(∃Mgr.Emp) ∀pwvAcpt(p,w,v) → ∃f Trip(p,f,v) Arity-twoonly Arbitraryarity

Rich:disjunction, etc. Conjunctionandimplicationonly

Functionality asserts Funct(Mgr)

! n/a

9/33

(38)

Rich Description Logics

Rich description logics(DLs) FGTGDs

Emp v CEOt(∃Mgr.Emp) ∀pwvAcpt(p,w,v) → ∃f Trip(p,f,v) Arity-twoonly Arbitraryarity

Rich:disjunction, etc. Conjunctionandimplicationonly Functionality

asserts Funct(Mgr)

! n/a

(39)

Our problem

Can we have the best of both worlds?

• QA is decidable forfrontier-guarded TGDs

• QA is decidable forrich DLs(i.e., expressible inGC2, guarded two-variable first-order logic with counting)

→ Is QA decidable forrich DLs+ someclasses of FGTGDs? We show:

• QA isundecidablefor richDLsandFGTGDs

• QA with rich DLs isdecidablefor some newFGTGD classes

• Functional dependenciescan be added under someconditions even tohigher-arity relations

10/33

(40)

Our problem

Can we have the best of both worlds?

• QA is decidable forfrontier-guarded TGDs

• QA is decidable forrich DLs(i.e., expressible inGC2, guarded two-variable first-order logic with counting)

→ Is QA decidable forrich DLs+ someclasses of FGTGDs?

We show:

• QA isundecidablefor richDLsandFGTGDs

• QA with rich DLs isdecidablefor some newFGTGD classes

• Functional dependenciescan be added under someconditions even tohigher-arity relations

(41)

Our problem

Can we have the best of both worlds?

• QA is decidable forfrontier-guarded TGDs

• QA is decidable forrich DLs(i.e., expressible inGC2, guarded two-variable first-order logic with counting)

→ Is QA decidable forrich DLs+ someclasses of FGTGDs?

We show:

• QA isundecidablefor richDLsandFGTGDs

• QA with rich DLs isdecidablefor some newFGTGD classes

• Functional dependenciescan be added under someconditions even tohigher-arity relations

10/33

(42)

Our problem

Can we have the best of both worlds?

• QA is decidable forfrontier-guarded TGDs

• QA is decidable forrich DLs(i.e., expressible inGC2, guarded two-variable first-order logic with counting)

→ Is QA decidable forrich DLs+ someclasses of FGTGDs?

We show:

• QA isundecidablefor richDLsandFGTGDs

• QA with rich DLs isdecidablefor some newFGTGD classes

• Functional dependenciescan be added under someconditions

(43)

Undecidability of frontier-guarded plus DLs

Theorem

QA isundecidablefor rich DLs and FGTGDs

Problem:

• DLs can expressFunct(↔functional dependencies, FDs)

• FGTGDs can expressinclusion dependencies(IDs)

∀x yA(x,y)→ ∃zB(y,z)with no variable repetitions

• Implicationof IDs and FDs isundecidable[Mitchell, 1983]

• Implicationreduces toQA [Calì et al., 2003]

→ Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)

11/33

(44)

Undecidability of frontier-guarded plus DLs

Theorem

QA isundecidablefor rich DLs and FGTGDs Problem:

• DLs can expressFunct(↔functional dependencies, FDs)

• FGTGDs can expressinclusion dependencies(IDs)

∀x yA(x,y)→ ∃zB(y,z)with no variable repetitions

• Implicationof IDs and FDs isundecidable[Mitchell, 1983]

• Implicationreduces toQA [Calì et al., 2003]

→ Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)

(45)

Undecidability of frontier-guarded plus DLs

Theorem

QA isundecidablefor rich DLs and FGTGDs Problem:

• DLs can expressFunct(↔functional dependencies, FDs)

• FGTGDs can expressinclusion dependencies(IDs)

∀x yA(x,y)→ ∃zB(y,z)with no variable repetitions

• Implicationof IDs and FDs isundecidable[Mitchell, 1983]

• Implicationreduces toQA [Calì et al., 2003]

→ Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)

11/33

(46)

Undecidability of frontier-one plus DLs

• Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)

• QA for frontier-oneIDsplus FDs isdecidable(separability)

However: Theorem

QA isundecidablefor rich DLs and frontier-one TGDs

Problem:

• Rule heads and bodies may containcycles

• We haveFunctassertions

→ We can build agridand encodetiling problems

(47)

Undecidability of frontier-one plus DLs

• Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)

• QA for frontier-oneIDsplus FDs isdecidable(separability) However:

Theorem

QA isundecidablefor rich DLs and frontier-one TGDs

Problem:

• Rule heads and bodies may containcycles

• We haveFunctassertions

→ We can build agridand encodetiling problems

12/33

(48)

Undecidability of frontier-one plus DLs

• Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)

• QA for frontier-oneIDsplus FDs isdecidable(separability) However:

Theorem

QA isundecidablefor rich DLs and frontier-one TGDs

Problem:

• Rule heads and bodies may containcycles

• We haveFunctassertions

(49)

Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:

• finite set ofcolors: , ,

• horizontalandverticalallowed pairs:

Thetiling problemis:

• input:initial configuration:

• output: is there aninfinite tiling?

. . . . . . . . . ... ... ... ... ... ...

→ Undecidablefor some sets of colors and configurations

13/33

(50)

Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:

• finite set ofcolors: , ,

• horizontalandverticalallowed pairs:

Thetiling problemis:

• input:initial configuration:

• output: is there aninfinite tiling?

. . . . . . . . . ... ... ... ... ... ...

→ Undecidablefor some sets of colors and configurations

(51)

Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:

• finite set ofcolors: , ,

• horizontalandverticalallowed pairs:

Thetiling problemis:

• input:initial configuration:

• output: is there aninfinite tiling?

. . . . . . . . . ... ... ... ... ... ...

→ Undecidablefor some sets of colors and configurations

13/33

(52)

Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:

• finite set ofcolors: , ,

• horizontalandverticalallowed pairs:

Thetiling problemis:

• input:initial configuration:

• output: is there aninfinite tiling?

. . . . . . . . . ... ... ... ... ... ...

→ Undecidablefor some sets of colors and configurations

(53)

Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:

• finite set ofcolors: , ,

• horizontalandverticalallowed pairs:

Thetiling problemis:

• input:initial configuration:

• output: is there aninfinite tiling? . . .

. . . . . . ... ... ... ... ... ...

→ Undecidablefor some sets of colors and configurations

13/33

(54)

Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:

• finite set ofcolors: , ,

• horizontalandverticalallowed pairs:

Thetiling problemis:

• input:initial configuration:

• output: is there aninfinite tiling? . . .

. . . . . .

(55)

Undecidability of frontier-one plus DLs: proof, cont’d

• FunctionalrelationsDfordownandRforright

• Unary predicateTfortilesandC for eachcolor

Initial instance:C −−−−→R C −−−−→R C −−−−→R C

! Constraints:

DL Disjunctionto color tiles:TvC tC tC

Frontier-one TGD:∀yT(y)⇒ ∃tzw

T(y) −−−−→R T(t)

y

D

y

D

T(z) −−−−→R T(w)

? Query: ∃x y C (x)−−−−→R C (y)for all forbidden pairs

→ There is anextension of the instanceiff there is atiling

14/33

(56)

Undecidability of frontier-one plus DLs: proof, cont’d

• FunctionalrelationsDfordownandRforright

• Unary predicateTfortilesandC for eachcolor Initial instance:C −−−−→R C −−−−→R C −−−−→R C

! Constraints:

DL Disjunctionto color tiles:TvC tC tC

Frontier-one TGD:∀yT(y)⇒ ∃tzw

T(y) −−−−→R T(t)

y

D

y

D

T(z) −−−−→R T(w)

? Query: ∃x y C (x)−−−−→R C (y)for all forbidden pairs

→ There is anextension of the instanceiff there is atiling

(57)

Undecidability of frontier-one plus DLs: proof, cont’d

• FunctionalrelationsDfordownandRforright

• Unary predicateTfortilesandC for eachcolor Initial instance:C −−−−→R C −−−−→R C −−−−→R C

! Constraints:

DL Disjunctionto color tiles:TvC tC tC

Frontier-one TGD:∀yT(y)⇒ ∃tzw

T(y) −−−−→R T(t)

y

D

y

D

T(z) −−−−→R T(w)

? Query: ∃x y C (x)−−−−→R C (y)for all forbidden pairs

→ There is anextension of the instanceiff there is atiling

14/33

(58)

Undecidability of frontier-one plus DLs: proof, cont’d

• FunctionalrelationsDfordownandRforright

• Unary predicateTfortilesandC for eachcolor Initial instance:C −−−−→R C −−−−→R C −−−−→R C

! Constraints:

DL Disjunctionto color tiles:TvC tC tC

Frontier-one TGD:∀yT(y)⇒ ∃tzw

T(y) −−−−→R T(t)

y

D

y

D

T(z) −−−−→R T(w)

? Query: ∃x y C (x)−−−−→R C (y)for all forbidden pairs

→ There is anextension of the instanceiff there is atiling

(59)

Undecidability of frontier-one plus DLs: proof, cont’d

• FunctionalrelationsDfordownandRforright

• Unary predicateTfortilesandC for eachcolor Initial instance:C −−−−→R C −−−−→R C −−−−→R C

! Constraints:

DL Disjunctionto color tiles:TvC tC tC

Frontier-one TGD:∀yT(y)⇒ ∃tzw

T(y) −−−−→R T(t)

y

D

y

D

T(z) −−−−→R T(w)

? Query:∃x y C (x)−−−−→R C (y)for all forbidden pairs

→ There is anextension of the instanceiff there is atiling

14/33

(60)

Decidability of non-looping frontier-one and DLs

Idea:prohibitcyclesin FGTGDs

R(x,y)S(y,z)T(z,x)is acycle

R(z,x,y)S(x,y,w)is also acycle

Formally:

• Berge cycle: cycle in the atom–variableincidence graph

• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)

• Non-looping frontier-one: non-looping body and head Theorem

QA isdecidablefor non-looping frontier-one TGDs + rich DLs

x y z

R(x,y) T(z,x) S(y,z)

x y

z w

R(z,x,y) S(x,y,w)

(61)

Decidability of non-looping frontier-one and DLs

Idea:prohibitcyclesin FGTGDs

R(x,y)S(y,z)T(z,x)is acycle

R(z,x,y)S(x,y,w)is also acycle

Formally:

• Berge cycle: cycle in the atom–variableincidence graph

• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)

• Non-looping frontier-one: non-looping body and head Theorem

QA isdecidablefor non-looping frontier-one TGDs + rich DLs

15/33

x y z

R(x,y) T(z,x) S(y,z)

x y

z w

R(z,x,y) S(x,y,w)

(62)

Decidability of non-looping frontier-one and DLs

Idea:prohibitcyclesin FGTGDs

R(x,y)S(y,z)T(z,x)is acycle

R(z,x,y)S(x,y,w)is also acycle

Formally:

• Berge cycle: cycle in the atom–variableincidence graph

• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)

• Non-looping frontier-one: non-looping body and head Theorem

QA isdecidablefor non-looping frontier-one TGDs + rich DLs

x y z

R(x,y) T(z,x) S(y,z)

x y

z w

R(z,x,y) S(x,y,w)

(63)

Decidability of non-looping frontier-one and DLs

Idea:prohibitcyclesin FGTGDs

R(x,y)S(y,z)T(z,x)is acycle

R(z,x,y)S(x,y,w)is also acycle

Formally:

• Berge cycle: cycle in the atom–variableincidence graph

• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)

• Non-looping frontier-one: non-looping body and head Theorem

QA isdecidablefor non-looping frontier-one TGDs + rich DLs

15/33

x y z

R(x,y) T(z,x) S(y,z)

x y

z w

R(z,x,y) S(x,y,w)

(64)

Decidability of non-looping frontier-one and DLs

Idea:prohibitcyclesin FGTGDs

R(x,y)S(y,z)T(z,x)is acycle

R(z,x,y)S(x,y,w)is also acycle

Formally:

• Berge cycle: cycle in the atom–variableincidence graph

• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)

• Non-looping frontier-one: non-looping body and head

Theorem

QA isdecidablefor non-looping frontier-one TGDs + rich DLs

x y z

R(x,y) T(z,x) S(y,z)

x y

z w

R(z,x,y) S(x,y,w)

(65)

Decidability of non-looping frontier-one and DLs

Idea:prohibitcyclesin FGTGDs

R(x,y)S(y,z)T(z,x)is acycle

R(z,x,y)S(x,y,w)is also acycle

Formally:

• Berge cycle: cycle in the atom–variableincidence graph

• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)

• Non-looping frontier-one: non-looping body and head Theorem

QA isdecidablefor non-looping frontier-one TGDs + rich DLs

15/33

x y z

R(x,y) T(z,x) S(y,z)

x y

z w

R(z,x,y) S(x,y,w)

(66)

Decidability of non-looping frontier-one and DLs (proof )

• ShredR(a,b,c)toR1(f,a),R2(f,b),R3(f,c)

• AxiomatizetheRi, e.g.,∀f ∃=1xR1(f,x)

→ QA for theshreddedinstance, TGDs, query, and axioms isequivalentto QA for the original instance, TGDs, query

• Rewriteshredded non-looping frontier-one TGDs toGC2:

• Rewrite∀xyφ(x,y)⇒ ∃zψ(y,z)to∀yφ0(y)ψ0(y),

withφ0(y)andψ0(y)the shredding of∃xφ(x,y)and∃zψ(y,z)

Example:φ(y) :=∃x1x2T(y,x1)R(y,y,x2)A(x2)

∃x1x2f T(y,x1)R1(f,y)R2(f,y)R3(f,x2)A(x2)

∃x1T(y,x1)

∃x2f R1(f,y)R2(f,y)∧ ∃y2R3(f,y2)A(y2)

Reduces toQA for GC2: decidable [Pratt-Hartmann, 2009]

(67)

Decidability of non-looping frontier-one and DLs (proof )

• ShredR(a,b,c)toR1(f,a),R2(f,b),R3(f,c)

• AxiomatizetheRi, e.g.,∀f ∃=1xR1(f,x)

→ QA for theshreddedinstance, TGDs, query, and axioms isequivalentto QA for the original instance, TGDs, query

• Rewriteshredded non-looping frontier-one TGDs toGC2:

• Rewrite∀xyφ(x,y)⇒ ∃zψ(y,z)to∀yφ0(y)ψ0(y),

withφ0(y)andψ0(y)the shredding of∃xφ(x,y)and∃zψ(y,z)

Example:φ(y) :=∃x1x2T(y,x1)R(y,y,x2)A(x2)

∃x1x2f T(y,x1)R1(f,y)R2(f,y)R3(f,x2)A(x2)

∃x1T(y,x1)

∃x2f R1(f,y)R2(f,y)∧ ∃y2R3(f,y2)A(y2)

Reduces toQA for GC2: decidable [Pratt-Hartmann, 2009]

16/33

Références

Documents relatifs

In this talk, we focus on rule-based ontol- ogy languages, and we demonstrate the tight connection between classical and consistent query answering.. More precisely, we focus on

In this work, which is a short version of [10], we performed an in-depth complexity analysis of the problem of consistent query answering under the main decidable classes of

While in the combined complexity this task remains 2E XP T IME -complete, in case of fixed arity and fixed sets of rules, we observe the classical positive effect of restricting

We use triangles in the table in Figure 1 to indicate the upper ( O / H ) and lower ( M / N ) bounds that have to be shown in order to obtain all results given in the table..

A seminal result by Grohe precisely characterizes the (recursively enumer- able) classes of CQs over schemas of bounded arity that can be evaluated in PTime : this is the case if

Answering conjunctive queries (CQs) over knowledge bases (KBs) containing dis- junctive existential rules is a relevant reasoning task which can be addressed using the disjunctive

For example, the restriction regarding the interaction of role inclusions and functional roles cannot be dropped since for unrestricted ALCHIF TBoxes of depth one, rewritability

In the linear case, CRPQ answering is E XP T IME -complete in combined complexity, PS PACE - complete in combined complexity with bounded predicate arity and NL-complete in data