• Aucun résultat trouvé

Une dichotomie sur l’évaluation de requêtes closes sous homomorphismes sur les graphes probabilistes

N/A
N/A
Protected

Academic year: 2022

Partager "Une dichotomie sur l’évaluation de requêtes closes sous homomorphismes sur les graphes probabilistes"

Copied!
103
0
0

Texte intégral

(1)

Une dichotomie sur l’évaluation de requêtes closes sous homomorphismes sur les graphes probabilistes

Antoine Amarilli1and İsmail İlkan Ceylan2 29 octobre 2020

1Télécom Paris

2University of Oxford

1/12

(2)

Uncertain data management

In this talk, we managedatarepresented as alabeled graph

WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud

Benny Technion

İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we are notcertainabout the true state of the data

(3)

Uncertain data management

In this talk, we managedatarepresented as alabeled graph

WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud

Benny Technion

İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we are notcertainabout the true state of the data

2/12

(4)

Uncertain data management

In this talk, we managedatarepresented as alabeled graph

WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud

Benny Technion

İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we are notcertainabout the true state of the data

(5)

Uncertain data management

In this talk, we managedatarepresented as alabeled graph

WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud

Benny Technion

İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we are notcertainabout the true state of the data

2/12

(6)

Uncertain data management

In this talk, we managedatarepresented as alabeled graph

WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud

Benny Technion

İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we are notcertainabout the true state of the data

(7)

Uncertain data management

In this talk, we managedatarepresented as alabeled graph

WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud

Benny Technion

İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we are notcertainabout the true state of the data

2/12

(8)

Uncertain data management

In this talk, we managedatarepresented as alabeled graph

WorksAt

Antoine Télécom Paris Antoine Paris Sud

Benny Paris Sud

Benny Technion

İsmail U. Oxford

MemberOf

Télécom Paris ParisTech Télécom Paris IP Paris

Paris Sud IP Paris Paris Sud Paris-Saclay Technion CESAER

A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

→ Problem:we are notcertainabout the true state of the data 2/12

(9)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

80% 10%

40% 80%

100%

90% 90% 50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Each fact (edge) carries aprobability

Each fact exists with its givenprobability

All facts areindependent

Possible worldW:subset of facts

What is theprobabilityof this possible world?0.03%

Pr(W) = Y

F∈W

Pr(F)

!

× Y

F∈W/

1−Pr(F)

!

3/12

(10)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Each fact (edge) carries aprobability

Each fact exists with its givenprobability

All facts areindependent

Possible worldW:subset of facts

What is theprobabilityof this possible world?0.03%

Pr(W) = Y

F∈W

Pr(F)

!

× Y

F∈W/

1−Pr(F)

!

(11)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Each fact (edge) carries aprobability

Each fact exists with its givenprobability

All facts areindependent

Possible worldW:subset of facts

What is theprobabilityof this possible world?0.03%

Pr(W) = Y

F∈W

Pr(F)

!

× Y

F∈W/

1−Pr(F)

!

3/12

(12)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Each fact (edge) carries aprobability

Each fact exists with its givenprobability

All facts areindependent

Possible worldW:subset of facts

What is theprobabilityof this possible world?0.03%

Pr(W) = Y

F∈W

Pr(F)

!

× Y

F∈W/

1−Pr(F)

!

(13)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

80% 10%

40% 80%

100%

90% 90% 50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Each fact (edge) carries aprobability

Each fact exists with its givenprobability

All facts areindependent

Possible worldW:subset of facts

What is theprobabilityof this possible world?0.03%

Pr(W) = Y

F∈W

Pr(F)

!

× Y

F∈W/

1−Pr(F)

!

3/12

(14)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER

80% 10%

40% 80%

100%

90% 90% 50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Each fact (edge) carries aprobability

Each fact exists with its givenprobability

All facts areindependent

Possible worldW:subset of facts

What is theprobabilityof this possible world?

0.03%

Pr(W) = Y

F∈W

Pr(F)

!

× Y

F∈W/

1−Pr(F)

!

(15)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Each fact (edge) carries aprobability

Each fact exists with its givenprobability

All facts areindependent

Possible worldW:subset of facts

What is theprobabilityof this possible world?

0.03%

Pr(W) = Y

F∈W

Pr(F)

!

× Y

F∈W/

1−Pr(F)

!

3/12

(16)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Each fact (edge) carries aprobability

Each fact exists with its givenprobability

All facts areindependent

Possible worldW:subset of facts

What is theprobabilityof this possible world?0.03%

Pr(W) = Y

F∈W

Pr(F)

!

× Y

F∈W/

1−Pr(F)

!

(17)

Uncertain data model A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Uncertain data model:TID, for tuple-independent database

Each fact (edge) carries aprobability

Each fact exists with its givenprobability

All facts areindependent

Possible worldW:subset of facts

What is theprobabilityof this possible world?0.03%

Pr(W) = Y

F∈W

Pr(F)

!

× Y

F∈W/

1−Pr(F)

!

3/12

(18)

Queries

Query:maps a graph (without probabilities) to YES/NO

Conjunctive query(CQ): can I find a match of apattern? e.g., x y z

We want ahomomorphismfrom the pattern to the graph (not necessarilyinjective)

Union of conjunctive queries(UCQ): can I find a match ofsome pattern?

→ Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

Intuition about homomorphism-closed queries:

GeneralizeCQsandUCQs, but alsoregular path queries(RPQs),Datalog, etc.

Do not allow forinequalitiesornegation

A homomorphism-closed query can be seen as aninfinite union of CQs:

The query isboundedif the union is finite (it is a UCQ),unboundedotherwise

Allows pretty wild things, e.g., “There is a path whose length is prime”

(19)

Queries

Query:maps a graph (without probabilities) to YES/NO

Conjunctive query(CQ): can I find a match of apattern? e.g., x y z

We want ahomomorphismfrom the pattern to the graph (not necessarilyinjective)

Union of conjunctive queries(UCQ): can I find a match ofsome pattern?

→ Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

Intuition about homomorphism-closed queries:

GeneralizeCQsandUCQs, but alsoregular path queries(RPQs),Datalog, etc.

Do not allow forinequalitiesornegation

A homomorphism-closed query can be seen as aninfinite union of CQs:

The query isboundedif the union is finite (it is a UCQ),unboundedotherwise

Allows pretty wild things, e.g., “There is a path whose length is prime”

4/12

(20)

Queries

Query:maps a graph (without probabilities) to YES/NO

Conjunctive query(CQ): can I find a match of apattern? e.g., x y z

We want ahomomorphismfrom the pattern to the graph (not necessarilyinjective)

Union of conjunctive queries(UCQ): can I find a match ofsome pattern?

→ Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

Intuition about homomorphism-closed queries:

GeneralizeCQsandUCQs, but alsoregular path queries(RPQs),Datalog, etc.

Do not allow forinequalitiesornegation

A homomorphism-closed query can be seen as aninfinite union of CQs:

The query isboundedif the union is finite (it is a UCQ),unboundedotherwise

Allows pretty wild things, e.g., “There is a path whose length is prime”

(21)

Queries

Query:maps a graph (without probabilities) to YES/NO

Conjunctive query(CQ): can I find a match of apattern? e.g., x y z

We want ahomomorphismfrom the pattern to the graph (not necessarilyinjective)

Union of conjunctive queries(UCQ): can I find a match ofsome pattern?

→ Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

Intuition about homomorphism-closed queries:

GeneralizeCQsandUCQs, but alsoregular path queries(RPQs),Datalog, etc.

Do not allow forinequalitiesornegation

A homomorphism-closed query can be seen as aninfinite union of CQs:

The query isboundedif the union is finite (it is a UCQ),unboundedotherwise

Allows pretty wild things, e.g., “There is a path whose length is prime”

4/12

(22)

Queries

Query:maps a graph (without probabilities) to YES/NO

Conjunctive query(CQ): can I find a match of apattern? e.g., x y z

We want ahomomorphismfrom the pattern to the graph (not necessarilyinjective)

Union of conjunctive queries(UCQ): can I find a match ofsome pattern?

→ Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

Intuition about homomorphism-closed queries:

GeneralizeCQsandUCQs, but alsoregular path queries(RPQs),Datalog, etc.

Do not allow forinequalitiesornegation

A homomorphism-closed query can be seen as aninfinite union of CQs:

The query isboundedif the union is finite (it is a UCQ),unboundedotherwise

Allows pretty wild things, e.g., “There is a path whose length is prime”

(23)

Queries

Query:maps a graph (without probabilities) to YES/NO

Conjunctive query(CQ): can I find a match of apattern? e.g., x y z

We want ahomomorphismfrom the pattern to the graph (not necessarilyinjective)

Union of conjunctive queries(UCQ): can I find a match ofsome pattern?

→ Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

Intuition about homomorphism-closed queries:

GeneralizeCQsandUCQs, but alsoregular path queries(RPQs),Datalog, etc.

Do not allow forinequalitiesornegation

A homomorphism-closed query can be seen as aninfinite union of CQs:

The query isboundedif the union is finite (it is a UCQ),unboundedotherwise

Allows pretty wild things, e.g., “There is a path whose length is prime”

4/12

(24)

Queries

Query:maps a graph (without probabilities) to YES/NO

Conjunctive query(CQ): can I find a match of apattern? e.g., x y z

We want ahomomorphismfrom the pattern to the graph (not necessarilyinjective)

Union of conjunctive queries(UCQ): can I find a match ofsome pattern?

→ Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

Intuition about homomorphism-closed queries:

GeneralizeCQsandUCQs, but alsoregular path queries(RPQs),Datalog, etc.

Do not allow forinequalitiesornegation

A homomorphism-closed query can be seen as aninfinite union of CQs:

The query isboundedif the union is finite (it is a UCQ),unboundedotherwise

Allows pretty wild things, e.g., “There is a path whose length is prime”

(25)

Queries

Query:maps a graph (without probabilities) to YES/NO

Conjunctive query(CQ): can I find a match of apattern? e.g., x y z

We want ahomomorphismfrom the pattern to the graph (not necessarilyinjective)

Union of conjunctive queries(UCQ): can I find a match ofsome pattern?

→ Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

Intuition about homomorphism-closed queries:

GeneralizeCQsandUCQs, but alsoregular path queries(RPQs),Datalog, etc.

Do not allow forinequalitiesornegation

A homomorphism-closed query can be seen as aninfinite union of CQs:

The query isboundedif the union is finite (it is a UCQ),unboundedotherwise

Allows pretty wild things, e.g., “There is a path whose length is prime”

4/12

(26)

Queries

Query:maps a graph (without probabilities) to YES/NO

Conjunctive query(CQ): can I find a match of apattern? e.g., x y z

We want ahomomorphismfrom the pattern to the graph (not necessarilyinjective)

Union of conjunctive queries(UCQ): can I find a match ofsome pattern?

→ Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

Intuition about homomorphism-closed queries:

GeneralizeCQsandUCQs, but alsoregular path queries(RPQs),Datalog, etc.

Do not allow forinequalitiesornegation

A homomorphism-closed query can be seen as aninfinite union of CQs:

The query isboundedif the union is finite (it is a UCQ),unboundedotherwise

Allows pretty wild things, e.g., “There is a path whose length is prime”

(27)

Queries

Query:maps a graph (without probabilities) to YES/NO

Conjunctive query(CQ): can I find a match of apattern? e.g., x y z

We want ahomomorphismfrom the pattern to the graph (not necessarilyinjective)

Union of conjunctive queries(UCQ): can I find a match ofsome pattern?

→ Homomorphism-closed queryQ: ifGsatisfiesQandGhas a homomorphism toG0 thenG0 also satisfiesQ

Intuition about homomorphism-closed queries:

GeneralizeCQsandUCQs, but alsoregular path queries(RPQs),Datalog, etc.

Do not allow forinequalitiesornegation

A homomorphism-closed query can be seen as aninfinite union of CQs:

The query isboundedif the union is finite (it is a UCQ),unboundedotherwise

Allows pretty wild things, e.g., “There is a path whose length is prime” 4/12

(28)

Problem statement: Probabilistic query evaluation (PQE)

Wefixa queryQ, for instance the CQ: x y z

Theinputis a TIDD: A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40% 80%

100%

90% 90% 50%

90%

100%

Theoutputis thetotal probabilityof the worlds which satisfy the query:

• Formally:P

W⊆D,W|=QPr(W)

Intuition:theprobabilitythat the query is true

→ What is thecomplexityof the problemPQE(Q), depending on the queryQ?

(29)

Problem statement: Probabilistic query evaluation (PQE)

Wefixa queryQ, for instance the CQ: x y z

Theinputis a TIDD: A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Theoutputis thetotal probabilityof the worlds which satisfy the query:

• Formally:P

W⊆D,W|=QPr(W)

Intuition:theprobabilitythat the query is true

→ What is thecomplexityof the problemPQE(Q), depending on the queryQ?

5/12

(30)

Problem statement: Probabilistic query evaluation (PQE)

Wefixa queryQ, for instance the CQ: x y z

Theinputis a TIDD: A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Theoutputis thetotal probabilityof the worlds which satisfy the query:

• Formally:P

W⊆D,W|=QPr(W)

Intuition:theprobabilitythat the query is true

→ What is thecomplexityof the problemPQE(Q), depending on the queryQ?

(31)

Problem statement: Probabilistic query evaluation (PQE)

Wefixa queryQ, for instance the CQ: x y z

Theinputis a TIDD: A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Theoutputis thetotal probabilityof the worlds which satisfy the query:

• Formally:P

W⊆D,W|=QPr(W)

Intuition:theprobabilitythat the query is true

→ What is thecomplexityof the problemPQE(Q), depending on the queryQ?

5/12

(32)

Problem statement: Probabilistic query evaluation (PQE)

Wefixa queryQ, for instance the CQ: x y z

Theinputis a TIDD: A.

B.

İ.

Télécom Paris

Paris Sud

Technion

U. Oxford

ParisTech

IP Paris

Paris-Saclay

CESAER 80%

10%

40%

80%

100%

90%

90%

50%

90%

100%

Theoutputis thetotal probabilityof the worlds which satisfy the query:

• Formally:P

W⊆D,W|=QPr(W)

Intuition:theprobabilitythat the query is true

→ What is thecomplexityof the problemPQE(Q), depending on the queryQ?

(33)

Existing results on PQE

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

The CQ x y z issafe, but the CQ x y z w isunsafe What aboutmore expressive queries?

Work by [Fink and Olteanu, 2016] aboutnegation

No work aboutrecursive queries(but no works about RPQs, Datalog, etc.)

Only exception: work onontology-mediated query answering[Jung and Lutz, 2012]

6/12

(34)

Existing results on PQE

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

The CQ x y z issafe, but the CQ x y z w isunsafe

What aboutmore expressive queries?

Work by [Fink and Olteanu, 2016] aboutnegation

No work aboutrecursive queries(but no works about RPQs, Datalog, etc.)

Only exception: work onontology-mediated query answering[Jung and Lutz, 2012]

(35)

Existing results on PQE

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

The CQ x y z issafe, but the CQ x y z w isunsafe What aboutmore expressive queries?

Work by [Fink and Olteanu, 2016] aboutnegation

No work aboutrecursive queries(but no works about RPQs, Datalog, etc.)

Only exception: work onontology-mediated query answering[Jung and Lutz, 2012]

6/12

(36)

Existing results on PQE

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

The CQ x y z issafe, but the CQ x y z w isunsafe What aboutmore expressive queries?

Work by [Fink and Olteanu, 2016] aboutnegation

No work aboutrecursive queries(but no works about RPQs, Datalog, etc.)

Only exception: work onontology-mediated query answering[Jung and Lutz, 2012]

(37)

Existing results on PQE

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

The CQ x y z issafe, but the CQ x y z w isunsafe What aboutmore expressive queries?

Work by [Fink and Olteanu, 2016] aboutnegation

No work aboutrecursive queries(but no works about RPQs, Datalog, etc.)

Only exception: work onontology-mediated query answering[Jung and Lutz, 2012]

6/12

(38)

Existing results on PQE

Dichotomy on theunions of conjunctive queries(UCQs):

Theorem [Dalvi and Suciu, 2012]

Some UCQsQaresafeandPQE(Q)is inPTIME

All others areunsafeandPQE(Q)is#P-hard

The CQ x y z issafe, but the CQ x y z w isunsafe What aboutmore expressive queries?

Work by [Fink and Olteanu, 2016] aboutnegation

No work aboutrecursive queries(but no works about RPQs, Datalog, etc.)

Only exception: work onontology-mediated query answering[Jung and Lutz, 2012]

(39)

Our result

We study PQE forhomomorphism-closed queriesand show:

Theorem

For anyquery Q closed under homomorphisms:

EitherQis equivalent to asafe UCQ(hencebounded) andPQE(Q)is inPTIME

In all other cases,PQE(Q)is#P-hard

This extends the result of [Jung and Lutz, 2012] and covers RPQs, Datalog, etc.

Example: theRPQQ:

• It isnot equivalent to a UCQ: infinite disjunction i

for alliN

• Hence,PQE(Q)is#P-hard

We do not study thecomplexity of deciding which case applies

• Depends on how queries arerepresented

7/12

(40)

Our result

We study PQE forhomomorphism-closed queriesand show:

Theorem

For anyquery Q closed under homomorphisms:

EitherQis equivalent to asafe UCQ(hencebounded) andPQE(Q)is inPTIME

In all other cases,PQE(Q)is#P-hard

This extends the result of [Jung and Lutz, 2012] and covers RPQs, Datalog, etc.

Example: theRPQQ:

• It isnot equivalent to a UCQ: infinite disjunction i

for alliN

• Hence,PQE(Q)is#P-hard

We do not study thecomplexity of deciding which case applies

• Depends on how queries arerepresented

(41)

Our result

We study PQE forhomomorphism-closed queriesand show:

Theorem

For anyquery Q closed under homomorphisms:

EitherQis equivalent to asafe UCQ(hencebounded) andPQE(Q)is inPTIME

In all other cases,PQE(Q)is#P-hard

This extends the result of [Jung and Lutz, 2012] and covers RPQs, Datalog, etc.

Example: theRPQQ:

• It isnot equivalent to a UCQ: infinite disjunction i

for alliN

• Hence,PQE(Q)is#P-hard

We do not study thecomplexity of deciding which case applies

• Depends on how queries arerepresented

7/12

(42)

Our result

We study PQE forhomomorphism-closed queriesand show:

Theorem

For anyquery Q closed under homomorphisms:

EitherQis equivalent to asafe UCQ(hencebounded) andPQE(Q)is inPTIME

In all other cases,PQE(Q)is#P-hard

This extends the result of [Jung and Lutz, 2012] and covers RPQs, Datalog, etc.

Example: theRPQQ:

• It isnot equivalent to a UCQ: infinite disjunction i

for alliN

• Hence,PQE(Q)is#P-hard

We do not study thecomplexity of deciding which case applies

• Depends on how queries arerepresented

(43)

Our result

We study PQE forhomomorphism-closed queriesand show:

Theorem

For anyquery Q closed under homomorphisms:

EitherQis equivalent to asafe UCQ(hencebounded) andPQE(Q)is inPTIME

In all other cases,PQE(Q)is#P-hard

This extends the result of [Jung and Lutz, 2012] and covers RPQs, Datalog, etc.

Example: theRPQQ:

• It isnot equivalent to a UCQ: infinite disjunction i

for alliN

• Hence,PQE(Q)is#P-hard

We do not study thecomplexity of deciding which case applies

• Depends on how queries arerepresented

7/12

(44)

Our result

We study PQE forhomomorphism-closed queriesand show:

Theorem

For anyquery Q closed under homomorphisms:

EitherQis equivalent to asafe UCQ(hencebounded) andPQE(Q)is inPTIME

In all other cases,PQE(Q)is#P-hard

This extends the result of [Jung and Lutz, 2012] and covers RPQs, Datalog, etc.

Example: theRPQQ:

• It isnot equivalent to a UCQ: infinite disjunction i

for alliN

• Hence,PQE(Q)is#P-hard

We do not study thecomplexity of deciding which case applies

• Depends on how queries arerepresented

(45)

Proof structure

(46)

Basic idea: finding a tight pattern

The challenging part is to show:

Theorem

For any queryQclosed under homomorphisms andunbounded,PQE(Q)is#P-hard

Idea: find atight pattern, i.e., a graph with three distinguished edges such that:

• •

• satisfiesQ

but •

• violatesQ

Theorem

Any unbounded query closed under homomorphisms has a tight pattern

(47)

Basic idea: finding a tight pattern

The challenging part is to show:

Theorem

For any queryQclosed under homomorphisms andunbounded,PQE(Q)is#P-hard Idea: find atight pattern, i.e., a graph with three distinguished edges such that:

• •

• satisfiesQ

but •

• violatesQ

Theorem

Any unbounded query closed under homomorphisms has a tight pattern

8/12

(48)

Basic idea: finding a tight pattern

The challenging part is to show:

Theorem

For any queryQclosed under homomorphisms andunbounded,PQE(Q)is#P-hard Idea: find atight pattern, i.e., a graph with three distinguished edges such that:

• •

• satisfiesQ

but

• violatesQ

Theorem

Any unbounded query closed under homomorphisms has a tight pattern

(49)

Basic idea: finding a tight pattern

The challenging part is to show:

Theorem

For any queryQclosed under homomorphisms andunbounded,PQE(Q)is#P-hard Idea: find atight pattern, i.e., a graph with three distinguished edges such that:

• •

• satisfiesQ

but •

• violatesQ

Theorem

Any unbounded query closed under homomorphisms has a tight pattern

8/12

(50)

Basic idea: finding a tight pattern

The challenging part is to show:

Theorem

For any queryQclosed under homomorphisms andunbounded,PQE(Q)is#P-hard Idea: find atight pattern, i.e., a graph with three distinguished edges such that:

• •

• satisfiesQ

but •

• violatesQ

Theorem

Any unbounded query closed under homomorphisms has a tight pattern

(51)

Using tight patterns to show hardness of PQE

Fix the queryQand thetight pattern:

• •

• satisfiesQ

but •

• violatesQ

AND •

• violatesQ

We reduce from PQE for theunsafeCQ:Q0: x y z w a01

a02 a03

a1

a2

a3

b1

b2

b01

b02 1/2

1/2 1/2

1/2

1/2

is coded as

1/21/21/2

1/2 1/2

Idea:possible worlds at thelefthave a path that matchesQ0

iff the corresponding possible world of the TID at therightsatisfies the queryQ... ... except we needmorefrom the tight pattern!

9/12

(52)

Using tight patterns to show hardness of PQE

Fix the queryQand thetight pattern:

• •

• satisfiesQ

but •

• violatesQ

AND •

• violatesQ

We reduce from PQE for theunsafeCQ:Q0: x y z w

a01 a02 a03

a1

a2

a3

b1

b2

b01

b02 1/2

1/2 1/2

1/2

1/2

is coded as

1/21/21/2

1/2 1/2

Idea:possible worlds at thelefthave a path that matchesQ0

iff the corresponding possible world of the TID at therightsatisfies the queryQ... ... except we needmorefrom the tight pattern!

(53)

Using tight patterns to show hardness of PQE

Fix the queryQand thetight pattern:

• •

• satisfiesQ

but •

• violatesQ

AND •

• violatesQ

We reduce from PQE for theunsafeCQ:Q0: x y z w a01

a02 a03

a1

a2

a3

b1

b2

b01

b02 1/2

1/2 1/2

1/2

1/2

is coded as

1/21/21/2

1/2 1/2

Idea:possible worlds at thelefthave a path that matchesQ0

iff the corresponding possible world of the TID at therightsatisfies the queryQ... ... except we needmorefrom the tight pattern!

9/12

(54)

Using tight patterns to show hardness of PQE

Fix the queryQand thetight pattern:

• •

• satisfiesQ

but •

• violatesQ

AND •

• violatesQ

We reduce from PQE for theunsafeCQ:Q0: x y z w a01

a02 a03

a1

a2

a3

b1

b2

b01

b02 1/2

1/2 1/2

1/2

1/2

is coded as

1/21/21/2

1/2 1/2

Idea:possible worlds at thelefthave a path that matchesQ0

iff the corresponding possible world of the TID at therightsatisfies the queryQ...

... except we needmorefrom the tight pattern!

(55)

Using tight patterns to show hardness of PQE

Fix the queryQand thetight pattern:

• •

• satisfiesQ

but •

• violatesQ

AND •

• violatesQ

We reduce from PQE for theunsafeCQ:Q0: x y z w a01

a02 a03

a1

a2

a3

b1

b2

b01

b02

1/2 1/2 1/2

1/2

1/2

is coded as

1/21/21/2

1/2 1/2

Idea:possible worlds at thelefthave a path that matchesQ0

iff the corresponding possible world of the TID at therightsatisfies the queryQ...

... except we needmorefrom the tight pattern!

9/12

(56)

Using tight patterns to show hardness of PQE

Fix the queryQand thetight pattern:

• •

• satisfiesQ

but •

• violatesQ

AND •

• violatesQ

We reduce from PQE for theunsafeCQ:Q0: x y z w a01

a02 a03

a1

a2

a3

b1

b2

b01

b02

1/2 1/2 1/2

1/2

1/2

is coded as

1/21/21/2

1/2 1/2

Idea:possible worlds at thelefthave a path that matchesQ0

iff the corresponding possible world of the TID at therightsatisfies the queryQ...

... except we needmorefrom the tight pattern!

(57)

Using tight patterns to show hardness of PQE

Fix the queryQand thetight pattern:

• •

• satisfiesQ

but •

• violatesQ

AND •

• violatesQ

We reduce from PQE for theunsafeCQ:Q0: x y z w a01

a02 a03

a1

a2

a3

b1

b2

b01

b02

1/2 1/2 1/2

1/2

1/2

is coded as

1/21/21/2

1/2 1/2

Idea:possible worlds at thelefthave a path that matchesQ0

iff the corresponding possible world of the TID at therightsatisfies the queryQ...

... except we needmorefrom the tight pattern! 9/12

(58)

Using tight patterns to show hardness of PQE

Fix the queryQand thetight pattern:

• •

• satisfiesQ

but •

• violatesQ

AND •

• violatesQ

We reduce from PQE for theunsafeCQ:Q0: x y z w a01

a02 a03

a1

a2

a3

b1

b2

b01

b02

1/2 1/2 1/2

1/2

1/2

is coded as

1/21/21/2

1/2 1/2

Idea:possible worlds at thelefthave a path that matchesQ0

iff the corresponding possible world of the TID at therightsatisfies the queryQ...

... except we needmorefrom the tight pattern! 9/12

(59)

Saving the proof

We know that we have atight pattern:

• •

• satisfiesQ

but •

• violatesQ

Consider itsiterates

for eachn∈N:

• • • •

n

Case 1:some iterateviolatesthe query:

• • • •

i

satisfiesQ

but •

• • • •

i+1

violatesQ

→ Reduce fromPQE(Q0)as we explained Case 2:all iteratessatisfythe query:

• • • •

n

satisfiesQfor alln ∈N

but •

• violatesQ

→ Call this aniterable pattern

10/12

(60)

Saving the proof

We know that we have atight pattern:

• •

• satisfiesQ

but •

• violatesQ Consider itsiterates

for eachn∈N:

• • • •

n

Case 1:some iterateviolatesthe query:

• • • •

i

satisfiesQ

but •

• • • •

i+1

violatesQ

→ Reduce fromPQE(Q0)as we explained Case 2:all iteratessatisfythe query:

• • • •

n

satisfiesQfor alln∈N

but •

• violatesQ

→ Call this aniterable pattern

(61)

Saving the proof

We know that we have atight pattern:

• •

• satisfiesQ

but •

• violatesQ Consider itsiteratesfor eachn∈N:

• • • •

n

Case 1:some iterateviolatesthe query:

• • • •

i

satisfiesQ

but •

• • • •

i+1

violatesQ

→ Reduce fromPQE(Q0)as we explained Case 2:all iteratessatisfythe query:

• • • •

n

satisfiesQfor alln∈N

but •

• violatesQ

→ Call this aniterable pattern

10/12

(62)

Saving the proof

We know that we have atight pattern:

• •

• satisfiesQ

but •

• violatesQ Consider itsiteratesfor eachn∈N:

• • • •

n

Case 1:some iterateviolatesthe query:

• • • •

i

satisfiesQ

but •

• • • •

i+1

violatesQ

→ Reduce fromPQE(Q0)as we explained Case 2:all iteratessatisfythe query:

• • • •

n

satisfiesQfor alln∈N

but •

• violatesQ

→ Call this aniterable pattern

(63)

Saving the proof

We know that we have atight pattern:

• •

• satisfiesQ

but •

• violatesQ Consider itsiteratesfor eachn∈N:

• • • •

n

Case 1:some iterateviolatesthe query:

• • • •

i

satisfiesQ

but •

• • • •

i+1

violatesQ

→ Reduce fromPQE(Q0)as we explained Case 2:all iteratessatisfythe query:

• • • •

n

satisfiesQfor alln∈N

but •

• violatesQ

→ Call this aniterable pattern

10/12

(64)

Saving the proof

We know that we have atight pattern:

• •

• satisfiesQ

but •

• violatesQ Consider itsiteratesfor eachn∈N:

• • • •

n

Case 1:some iterateviolatesthe query:

• • • •

i

satisfiesQ

but •

• • • •

i+1

violatesQ

→ Reduce fromPQE(Q0)as we explained

Case 2:all iteratessatisfythe query:

• • • •

n

satisfiesQfor alln∈N

but •

• violatesQ

→ Call this aniterable pattern

Références

Documents relatifs

Here we show that the problem is ExpTime -complete and, in fact, deciding whether two OWL 2 QL knowledge bases (each with its own data) give the same answers to any conjunctive query

This analysis shown in Figure 6 shows that participants found data source and triple pattern(s) related information helpful for understanding the query result derivation, but have

cept of perfect homomorphisms to the study of perfect-injectives and Gleason envelope in the category of completely regular frames.. For general background on frames,

Fi- nally, to improve the accuracy of SPARQL query generated, we evaluate the semantic importance of each word in a question via TF-IDF dur- ing the generating queries

While query answering with Description Logics (DLs) is now well-developed, this is much less the case for reasoning services that support ontology engineering and target query

As our focus in this paper is on polynomial time algorithms for view-based rewriting, it is thus natural to ask if view-based rewriting over probabilistic data remains tractable

More restricted instances: Words, trees and bounded treewidth (1 slide) More restricted instances: Unweighted instances (1 slide)... Uncertain

We study PQE for homomorphism-closed queries and show: Theorem [Amarilli and Ceylan, 2020]. For any query Q closed