• Keine Ergebnisse gefunden

Chasing Sets: How to Use Existential Rules for Expressive Reasoning

N/A
N/A
Protected

Academic year: 2022

Aktie "Chasing Sets: How to Use Existential Rules for Expressive Reasoning"

Copied!
55
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Chasing Sets:


How to Use Existential Rules for Expressive Reasoning

David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

(2)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Datalog for DL reasoning?

Can we use Datalog to solve hard problems?

• ExpTime-complete combined complexity

• Fast and scalable reasoners available 


2

(3)

Datalog for DL reasoning?

Can we use Datalog to solve hard problems?

• ExpTime-complete combined complexity

• Fast and scalable reasoners available 


DL Ontology

Datalog


rules Facts

TBox ABox

Rule Engine

✓Carral et al. (KR 2018): Horn-ALCHOIQ

(4)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Datalog for DL reasoning?

Can we use Datalog to solve hard problems?

• ExpTime-complete combined complexity

• Fast and scalable reasoners available 


2

DL Ontology

Datalog


rules Facts

TBox ABox

Rule Engine

✓Carral et al. (KR 2018): Horn-ALCHOIQ

➡ exponentially many rules

(5)

Datalog for DL reasoning?

Can we use Datalog to solve hard problems?

• ExpTime-complete combined complexity

• Fast and scalable reasoners available 


DL Ontology

Datalog


rules Facts

TBox ABox

Rule Engine

✓Carral et al. (KR 2018): Horn-ALCHOIQ

➡ exponentially many rules

✓ Ahmetaj et al. (ICDT 2018): guarded existential rules

(6)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Datalog for DL reasoning?

Can we use Datalog to solve hard problems?

• ExpTime-complete combined complexity

• Fast and scalable reasoners available 


2

DL Ontology

Datalog


rules Facts

TBox ABox

Rule Engine

✓Carral et al. (KR 2018): Horn-ALCHOIQ

➡ exponentially many rules

✓ Ahmetaj et al. (ICDT 2018): guarded existential rules

➡ predicates with linearly large arities

(7)

Is there an efficient way to solve hard problems

with rule engines,

nonetheless?

(8)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Our contribution

4

(9)

Our contribution

By moving from Datalog to existential rules we can

(10)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Our contribution

By moving from Datalog to existential rules we can

• solve hard (ExpTime-complete) real-world problems

4

(11)

Our contribution

By moving from Datalog to existential rules we can

• solve hard (ExpTime-complete) real-world problems

• using existing rule engines

(12)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Our contribution

By moving from Datalog to existential rules we can

• solve hard (ExpTime-complete) real-world problems

• using existing rule engines

• with a fixed set of rules

4

(13)

Our contribution

By moving from Datalog to existential rules we can

• solve hard (ExpTime-complete) real-world problems

• using existing rule engines

• with a fixed set of rules

(14)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Our contribution

By moving from Datalog to existential rules we can

• solve hard (ExpTime-complete) real-world problems

• using existing rule engines

• with a fixed set of rules

‣ Available reasoners use the chase algorithm

4

(15)

Our contribution

By moving from Datalog to existential rules we can

• solve hard (ExpTime-complete) real-world problems

• using existing rule engines

• with a fixed set of rules

‣ Available reasoners use the chase algorithm

‣ Chase algorithm may not terminate

(16)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Our contribution

By moving from Datalog to existential rules we can

• solve hard (ExpTime-complete) real-world problems

• using existing rule engines

• with a fixed set of rules

‣ Available reasoners use the chase algorithm

‣ Chase algorithm may not terminate

‣ Sufficient conditions for chase termination

4

(17)

Our contribution

By moving from Datalog to existential rules we can

• solve hard (ExpTime-complete) real-world problems

• using existing rule engines

• with a fixed set of rules

‣ Available reasoners use the chase algorithm

‣ Chase algorithm may not terminate

‣ Sufficient conditions for chase termination

‣ characterise rule sets of PTime data complexity (like Datalog)

(18)

How can we get the

required expressivity?

(19)

Datalog(S)

Surface language for existential rules with terminating chase

• ExpTime-complete data complexity

• polynomial translation from Datalog(S) to existential rules

(20)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Datalog(S)

Surface language for existential rules with terminating chase

• ExpTime-complete data complexity

• polynomial translation from Datalog(S) to existential rules

6

person(x)likesAll(x, ∅) (1)

likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

(21)

Datalog(S)

Surface language for existential rules with terminating chase

• ExpTime-complete data complexity

• polynomial translation from Datalog(S) to existential rules

person(x)likesAll(x, ∅) (1)

likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

likesAll(x, S ) → allLikeAll({x}, S ) (3)

allLikeAll(S, T ) ∧ likesAll(x, T ) → allLikeAll(S ∪ {x}, T ) (4)

(22)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Datalog(S)

Surface language for existential rules with terminating chase

• ExpTime-complete data complexity

• polynomial translation from Datalog(S) to existential rules

6

person(x)likesAll(x, ∅) (1)

likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

likesAll(x, S ) → allLikeAll({x}, S ) (3)

allLikeAll(S, T ) ∧ likesAll(x, T ) → allLikeAll(S ∪ {x}, T ) (4)

allLikeAll(S, S ) ∧ aliceScliqueOfAlice(S ) (5)

(23)

Datalog(S): Definition

Logic with two sorts: objects and sets of objects

• Each predicate position has a sort

• Object and set variables are distinct

• Set terms:

• Built-in predicates (only in body):

∅ {object} Set 1Set 2

objectSet Set 1Set 2

(24)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Datalog(S): Definition

Logic with two sorts: objects and sets of objects

• Each predicate position has a sort

• Object and set variables are distinct

• Set terms:

• Built-in predicates (only in body):

7

All set variables must occur in a regular body atom (not built-in)

∅ {object} Set 1Set 2

objectSet Set 1Set 2

(25)

Datalog(S): Definition

Logic with two sorts: objects and sets of objects

• Each predicate position has a sort

• Object and set variables are distinct

• Set terms:

• Built-in predicates (only in body):

All set variables must occur in a regular body atom (not built-in)

Theorem: Datalog(S) has ExpTime-complete combined and data complexity.

∅ {object} Set 1Set 2

objectSet Set 1Set 2

(26)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe 8

person(x)likesAll(x, ∅) (1)

likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

(27)

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′)

(28)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe 8

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′)

likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

(29)

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′) likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

person(Eve)

likes(Eve, a)

likes(Eve, b)

(30)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe 8

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′) likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

person(Eve)

likes(Eve, a)

likes(Eve, b)

Eve

(31)

n

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′) likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

person(Eve)

likes(Eve, a)

likes(Eve, b)

Eve

(32)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe 8

n

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′) likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

person(Eve) likes(Eve, a) likes(Eve, b) Eve

likesAll

(33)

n

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′) likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

person(Eve) likes(Eve, a) likes(Eve, b) Eve

likesAll SU n {a}

a

(34)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe 8

n n {a,b}

b

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′) likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

person(Eve) likes(Eve, a) likes(Eve, b) Eve

likesAll SU n {a}

a

(35)

n n {a,b}

b

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′) likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

person(Eve) likes(Eve, a) likes(Eve, b) Eve

n {a,a}

a

likesAll SU n {a}

a

(36)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe 8

n n {a,b}

b

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′) likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

person(Eve) likes(Eve, a) likes(Eve, b) Eve

n {a,a}

a

likesAll SU n {a}

a n {a,a,a}

a

(37)

n n {a,b}

b

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′) likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

person(Eve) likes(Eve, a) likes(Eve, b) Eve

likesAll SU n {a}

a

(38)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe 8

n n {a,b}

b

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′)

SU(V, y, V )

likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

person(Eve) likes(Eve, a) likes(Eve, b) Eve

likesAll SU n {a}

a

(39)

n n {a,b}

b b

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′)

SU(V, y, V )

likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

a

person(Eve) likes(Eve, a) likes(Eve, b) Eve

likesAll SU n {a}

a

(40)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe 8

n n {a,b,a}

n {a,b}

b b

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′)

SU(V, y, V )

likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

a

a

person(Eve) likes(Eve, a) likes(Eve, b) Eve

likesAll SU n {a}

a

a

(41)

n n {a,b}

b b

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′)

SU(V, y, V )

likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ )

a

person(Eve) likes(Eve, a) likes(Eve, b) Eve

likesAll SU n {a}

a

(42)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe 8

n n {a,b}

b b

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′)

SU(V, y, V )

likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ ) SU(U, x, V ) ∧ SU(U, y, U ) → SU(V, y, V ) (2′′ )

a

person(Eve) likes(Eve, a) likes(Eve, b) Eve

likesAll SU n {a}

a

(43)

n n {a,b}

b b

person(x)likesAll(x, ∅) (1) likesAll(x, S ) ∧ likes(x, y)likesAll(x, S ∪ {y}) (2)

→ ∃ V . empty(V ) (1′ )

person(x)empty(Y ) → likesAll(x, Y ) (1′′)

SU(V, y, V )

likesAll(x, S ) ∧ likes(x, y) → ∃ V . likesAll(x, V ) ∧ SU(S, y, V ) (2′ ) SU(U, x, V ) ∧ SU(U, y, U ) → SU(V, y, V ) (2′′ )

a

person(Eve) likes(Eve, a) likes(Eve, b)

a Eve

likesAll SU n {a}

a

(44)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Datalog(S) to existential rules

Theorem: Any Datalog(S) rule set can be

• polynomially translated

• into a consequence-preserving set of existential rules

• with a terminating Datalog-first standard chase.

✓ Datalog-first is implemented by some rule engines

9

(45)

Datalog(S) for

DL Reasoning?

(46)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

DL Reasoning using Datalog(S)

11

Rule Engine Datalog(S) 


rules Reasoning 


calculus

Existential
 rules

Facts DL Ontology

TBox ABox

(47)

Classification for Horn-SHIQ

(Kazakov,IJCAI 2009)

(48)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Consequence-driven classification

13

H ⊑ ∃ R . K HA

H ⊑ ∃ R . (K ⊓ B) : A ⊑ ∀ R . B ∈ 𝒪

(49)

Consequence-driven classification

H ⊑ ∃ R . K HA

H ⊑ ∃ R . (K ⊓ B) : A ⊑ ∀ R . B ∈ 𝒪 Exists (H, r, K ) ∧ SubClass (H, a) ∧ ax ⊑∀ (a, r, b)

→ Exists (H, r, K ∪ {b})

(50)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe 14

Classification Class Retrieval

1 100 10000

G O x- an at om y G O x- ta xo n Gaz etteer ChE BI mo l. f c. NCI Re ac to m e 1. 7M Re ac to m e 3. 1M Re ac to m e 4. 4M UO BM 1.9M UO BM 4M UO BM 5.9M

Evaluation

time(s)

(51)

• Consequence-based classification and class retrieval for Horn-ALC:

• Kazakov (IJCAI 2011)

• Fact entailment for guarded existential rules:

• Ahmetaj et al. (ICDT 2018)

What can we use Datalog(S) for?

IN PAPER

IN PAPER

(52)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

• Consequence-based classification and class retrieval for Horn-ALC:

• Kazakov (IJCAI 2011)

• Fact entailment for guarded existential rules:

• Ahmetaj et al. (ICDT 2018)

What can we use Datalog(S) for?

15

• Combined-approach materialisation for Horn-ALCHOIQ:

• Carral et al. (KR 2018)

• Reasoning tasks for non-Horn DLs

• Simančík et al. (IJCAI 2011): ALCH

IN PAPER

IN PAPER

(53)

• Consequence-based classification and class retrieval for Horn-ALC:

• Kazakov (IJCAI 2011)

• Fact entailment for guarded existential rules:

• Ahmetaj et al. (ICDT 2018)

What can we use Datalog(S) for?

• Combined-approach materialisation for Horn-ALCHOIQ:

• Carral et al. (KR 2018)

• Reasoning tasks for non-Horn DLs

• Simančík et al. (IJCAI 2011): ALCH

• ?

IN PAPER

IN PAPER

(54)

Chasing Sets: How to Use Existential Rules for Expressing Reasoning David Carral, Irina Dragoste, Markus Krötzsch, Christian Lewe

Summary

We provide a practical new way of solving

• ExpTime-complete problems

• using current existential rule engines Next steps:

• Logical reasoning: solve new ExpTime-complete problems

• Rule engine development: optimise and benchmark

• Characterising chase termination: discover syntactic criteria

16

(55)

C ONT ACT J OI N US I N

DRE S DE N

Open posi on available immediately Ph.D. students & postdocs

100% English & Interna onal KR / Databases / AI

Markus Krötzsch markus.kroetzsch@tu-dresden.de

Referenzen

ÄHNLICHE DOKUMENTE

Eiter et al. bounded Rudolph et al. bounded Bienvenu et al. bounded Carral et al. bounded Carral et al. bounded Horn- SRIQ Datalog 2exp. bounded Ortiz et al. unbounded Ahmetaj et

If we further ˆ encode guarded rules, atoms, and mappings in Datalog(S) facts as indicated, we obtain a fixed Datalog(S) program that can reason on arbitrary guarded existential

The Combined Approach to Query Answering in Horn-ALCHOIQi David Carral, Irina Dragoste, and Markus Krötzsch.. In Principles of Knowledge Representation and

• Rules are a powerful data query paradigm (Datalog!) – applications in data management, program analysis, business analytics, social network

The maximal nesting depth of function terms in the chase tree is bounded by the number of existentially quantified variables in R, since a greater depth can only be achieved

The disjunctive skolem chase is a sound and complete (albeit non-terminating) algorithm that can be used to solve conjunctive query answering over DL ontologies and programs

The complexity refers to the size of the two involved rules rather than to the size of the whole program: in practice, positive reliances can be checked efficiently by checking

• We show that R-stratified programs have unique stable models, so that reasoning becomes deterministic, and that if programs are also R-acyclic, reasoning becomes 2E XP T IME