• Keine Ergebnisse gefunden

PRACTICAL USES OF EXISTENTIAL RULES IN KNOWLEDGE REPRESENTATION

N/A
N/A
Protected

Academic year: 2022

Aktie "PRACTICAL USES OF EXISTENTIAL RULES IN KNOWLEDGE REPRESENTATION"

Copied!
36
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

PRACTICAL USES OF EXISTENTIAL RULES IN KNOWLEDGE REPRESENTATION

Part 2: Solving Horn-ALCClassification with Existential Rules

David Carral,1Markus Kr ¨otzsch,1and Jacopo Urbani2 1. TU Dresden

2. VU University Amsterdam

Special thanks to Irina Dragoste,1Ceriel Jacobs,2and Maximilian Marx1 for their invaluable contributions to the software used in this tutorial

KR 2020, September 13, 2020

(2)

Outline

Goal

Show some example where eitherrulesorrelated ideaswere crucial to achieve the state of the art

• Horn-ALCreasoning

• PLP

• Data integration

• Stream reasoning

(3)

1 st Scenario: Horn- ALC reasoning

(4)

The Description Logic Horn- ALC : Syntax

Definition. A Horn-ALContology is a set of Horn-ALCaxioms:

Av ⊥ > vB AvB AuEvB ∃R.AvB Av ∀R.B Av ∃R.B In the above;A,B, andEare concept names; andRis a role name.

Remark. Note the axioms of the formAv ∀R.B, which are notEL, such as:

CheesePizzav ∀HasTopping.Cheese

The axiom states that “all toppings in a cheese pizza are cheese toppings”.

Even though Horn-ALCis not much more expressive thanEL, (Krötzsch, Rudolph, and Hitzler 2013) have showed that:

Theorem. Solving classification over Horn-ALCis ExpTime-complete.

(5)

A Consequence-Based Calculus to Solve Classification

RCA

AvA :A∈Concepts(O) R+ CvA

Cv ∃R.B :Av ∃R.B∈ O RA Cv ∃R.D D∈D

DvD R Cv ∃R.D DvA

CvB :∃R.AvB∈ O R1u CvA

CvB :> vB∈ O R Cv ∃R.D Dv ⊥ Cv ⊥ R1u CvA

CvB :AvB∈ O R

Cv ∃R.D CvA

Cv ∃R.(DuB) :Av ∀R.B∈ O R2u CvA CvE

CvB :AuEvB∈ O

Figure: Classification Calculus for Horn-ALC. WhereA,B, andEare concept names;R is a role name; andCandDare conjunctions of concept names

Remark. The above procedure is based on the work of (Kazakov 2009).

(6)

Consequence-Based Calculus: Complexity

Theorem. The Horn-ALCclassification calculus runs in exponential time in the size of the input ontologyO.

Remark. Note that this calculus produces inferences of the form

(1) CvB and (2) Cv ∃R.D

whereBis a concept name,Ris a role name, andCandDare conjunctions of concept names. Therefore, on inputO, the calculus may produce at most

2|Concepts(O)|× |Concepts(O)| and 2×2|Concepts(O)|× |Roles(O)|

inferences of type (1) and (2), respectively.

Remark. Since classification over Horn-ALCis an ExpTime-complete problem, the calculus is worst-case optimal.

(7)

Implementing the Classification Calculus: Datalog

Because of the following result, we can not implement the Horn-ALCclassification calculus using a fixed Datalog rule set:

Theorem. The data complexity of fact entailment over Datalog is in P.

Assume that we can implement the Horn-ALCclassification calculus with a fixed Datalog rule set (as we did for theELclassification calculus). Then:

1. By the above theorem, we could solve Horn-ALCclassification in polynomial time.

2. By (1), we could solve an ExpTime-hard problem in polynomial time.

3. By (2), P=ExpTime( )

Remark. To implement the Horn-ALCclassification calculus (or any other proce- dure that solves Horn-ALCclassification), we need a rule-based language with ExpTime-hard data complexity!

(8)

Implementing the Classification Calculus: Datalog(S)

We study Datalog(S), an extension of Datalog that can model exponential computations.

Example. Consider the following Datalog(S) rule set:

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

LikesAll(x,S)→AllLikeAll({x},S) AllLikeAll(S,T)∧LikesAll(x,T)→AllLikeAll(X∪ {x},T)

AllLikeAll(S,S)∧alice∈S→CliqueOfAlice(S)

Theorem. Checking fact entailment for Datalog(S) is ExpTime-complete for both data and combined complexity.

See (Carral et al. 2019) for a complete proof of the above result.

(9)

Implementing the Classification Calculus: Datalog(S)

Using a function to encode the axioms and entities in an input ontology as facts and a fixed Datalog(S) rule set, we can implement the Horn-ALCclassification calculus.

Example. For an ontologyO, let Facts(O)be the fact set such that:

Av ⊥ 7→nf:axiomv(cA,c) ∃R.AvB7→nf:axiom∃v(cA,cR,cB)

> vB7→nf:axiomv(c>,cB) Av ∀R.B7→nf:axiomv∀(cA,cR,cB) AvB7→nf:axiomv(cA,cB) Av ∃R.B7→nf:axiomv∃(cA,cR,cB) AuEvB7→nf:axiomuv(cA,cE,cB) A∈Concepts(O)7→nf:concept(cE) In the above;cA,cB,cE,c>, andc are fresh constants unique forA,B,E,>, and

⊥, respectively; andcR is a fresh constant uniqueR.

(10)

Implementing the Classification Calculus: Datalog(S)

We translate the production rules in the Horn-ALCclassification calculus (left) into analogous Datalog(S) rules (right):

AvA:A∈Concepts(O) nf:concept(a)

→SC({a},a)

Cv ∃R.D

DvD :D∈D

Ex(C,r,D)∧d∈D

→SC(D,d)

CvA

CvB:> vB∈ O SC(C,a)∧nf:axiomv(c>,b)

→SC(C,b)

CvA

CvB:AvB∈ O SC(C,a)∧nf:axiomv(a,b)

→SC(C,b)

CvA CvE

CvB :AuEvB∈ O SC(C,a)∧SC(C,e)∧nf:axiomuv(a,e,b)

→SC(C,b)

(11)

Implementing the Classification Calculus: Datalog(S)

We translate the production rules in the Horn-ALCclassification calculus (left) into analogous Datalog(S) rules (right):

CvA

Cv ∃R.B :Av ∃R.B∈ O SC(C,a)∧nf:axiomv∃(a,r,b)

→Ex(C,r,{b})

Cv ∃R.D DvA

CvB :∃R.AvB∈ O Ex(C,r,D)∧SC(D,a)∧nf:axiom∃v(r,a,b)

→SC(C,b)

Cv ∃R.D Dv ⊥ Cv ⊥

Ex(C,r,D)∧SC(D,c)

→SC(C,c)

Cv ∃R.D CvA

Cv ∃R.(DuB) :Av ∀R.B∈ O Ex(C,r,D)∧SC(C,a)∧nf:axiomv∀(a,r,b)

→Ex(C,r,D∪ {b})

(12)

Implementing the Classification Calculus: Datalog(S)

Definition. LetRHALCbe the rule set containing all of the above rules:

nf:concept(a)→SC({a},a) SC(C,a)∧nf:axiomv(c>,b)→SC(C,b) Ex(C,r,D)∧d∈D→SC(D,d) SC(C,a)∧nf:axiomv(a,b)→SC(C,b)

SC(C,a)∧SC(C,e)∧nf:axiomuv(a,e,b)→SC(C,b) SC(C,a)∧nf:axiomv∃(a,r,b)→Ex(C,r,{b}) Ex(C,r,D)∧SC(D,a)∧nf:axiom∃v(r,a,b)→SC(C,b)

Ex(C,r,D)∧SC(D,c)→SC(C,c) Ex(C,r,D)∧SC(C,a)∧nf:axiomv∀(a,r,b)→Ex(C,r,D∪ {b})

Theorem. Consider a Horn-ALContologyOand an axiom of the formA v B.

Then,O |=AvBif and only ifRHALC∪Facts(O)|=SC(cA,cB).

(13)

Implementing the Classification Calculus: ∃ -Rules

Alas, VLog does not support Datalog(S) reasoning. But there maybe some other rule-based language with ExpTime-hard data complexity that we can use!

The following result is a recent finding by (Krötzsch, Marx, and Rudolph 2019):

Theorem. The data complexity of fact entailment over rule sets that terminate with respect to the restricted chase is ExpTime-hard.

Remark. Note that the data complexity of fact entailment over existential rule sets that terminate with respect to the Skolem chase is in P.

(Carral et al. 2019) have proposed a translation from Datalog(S) into∃-rules such that:

• The resulting rule sets terminate w.r.t. theDatalog-first restricted chase.

• Fact entailment is “preserved”.

(14)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(15)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(16)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(17)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(18)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(19)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(20)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(21)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(22)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(23)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(24)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(25)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(26)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(27)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(28)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(29)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(30)

From Datalog(S) to Existential Rules

Person(x)→LikesAll(x,∅) LikesAll(x,S)∧Likes(x,y)→LikesAll(x,S∪ {y})

(31)

Solving ExpTime-hard Problems

Step-by-step procedure to implement an ExpTime algorithm with VLog:

1. Encode input using a set of factsF.

2. Encode ExpTime algorithm using a fixed Datalog(S) rule setR.

3. Apply the translation by (Carral et al. 2019) toRto obtain a setR0of existential rules such that:

– The rule setR0“preserves” fact entailment overR.

– The rule setR0terminates w.r.t. the Datalog-first restricted chase.

4. Use VLog to compute all of the consequences ofR0∪ F.

Remark. For a detailed explanation of the above procedure, see (Carral, Dragoste, and Rudolph 2020).

(32)

Evaluation: Classification

ID #Ax. #SC VLog Konclude

00040 223K 1051K 432s 5s

00048 142K 718K 387s 3s

00477 318K 162K 1s 3s

00533 159K 965K 132s 2s

00786 152K 2283K 549s 14s

Figure: Ontologies and results for classification showing: axiom count, number ofSC facts derived, and reasoning times for VLog and Konclude

Remark. Presented in (Carral et al. 2019).

(33)

Evaluation: Class Retrieval

Definition. A Horn-ALContology is a set of Horn-ALCaxioms:

Av ⊥ > vB AvB AuEvB

∃R.AvB Av ∀R.B Av ∃R.B A(a) R(a,b) WhereA,B, andEare concepts;Ris a role; andaandbare individuals.

Definition. Class retrieval is the reasoning task of computing all axioms of the formA(a)that are logically entailed by some input ontologyO.

Remark. The Horn-ALCclassification calculus can be extended with 3 rules (as done by (Carral et al. 2019)) to solve class retrieval.

(34)

Evaluation: Class Retrieval

sec

1.7M 3.1M 4.4M

100 101 102 103

Number of assertions

Reactome

sec

1.9M 4M 5.9M

100 101 102 103

Number of assertions

UOBM

Experimental results for class retrieval for VLog (pink/grey) and Konclude (black) Remark. Presented in (Carral et al. 2019).

(35)

Conclusions and Future Work

Remark. We can use VLog to solve (ExpTime-)hard problems!

Future work:

• Rulewerk Extension: translate Datalog(S) to existential rules

• VLog Extension: native support for Datalog(S)

• Implement existing calculi using our approach

(36)

References I

Carral, David, Irina Dragoste, and Sebastian Rudolph (2020). “Reasoner = Logical Calculus + Rule Engine”.In:Künstliche Intell.

Carral, David et al. (2019). “Chasing Sets: How to Use Existential Rules for Expressive Reasoning”.In:P. of the 28th Int. Joint Conf. on AI (IJCAI 2019).

Kazakov, Yevgeny (2009). “Consequence-Driven Reasoning for Horn-SH IQ Ontologies”.In:P. of the 21st Int. Joint Conf. on AI (IJCAI 2009).

Krötzsch, Markus, Maximilian Marx, and Sebastian Rudolph (2019). “The Power of the Terminating Chase (Invited Talk)”.In:P. of the 22nd Int. Conf. on Database Theory (ICDT) 2019).

Krötzsch, Markus, Sebastian Rudolph, and Pascal Hitzler (2013). “Complexities of Horn Description Logics”.In:ACM Trans. Comput. Log.

Referenzen

ÄHNLICHE DOKUMENTE

PRACTICAL USES OF EXISTENTIAL RULES IN KNOWLEDGE REPRESENTATION Part 1: Basics / Rules for Ontology Reasoning David Carral,1 Markus Krötzsch,1 and Jacopo Urbani2 1.. Vrije

Figure 4: The search latency increase with respect to rerank size.. cost of our models, we compare the online search latency of

EL+⊥ and existential rules All axioms of EL+⊥ can be rewritten as existential rules Example: The axiom alcoholicBeverage v Drink u ∃contains.Alcohol can be written as a

Figure 4: The search latency increase with respect to rerank size.. cost of our models, we compare the online search latency of

- MOWLCorpus: TBoxes with less 1000 axioms and containing role chain axioms - 187 TBoxes: 121 computed rewritings w/o OOM errors.. Eiter, Ortiz, Simkus, Tran,

* A Practical Acyclicity Notion for Query Answering over Horn-SRIQ Ontologies [ISWC 2016]. * Restricted Chase (Non)Termination for Existential Rules with Disjunctions

Just as classical description logics, fuzzy DLs are based on concept descriptions built from the mutually disjoint sets N C , N R and N I of concept names, role names, and

The KB consists of nonmono- tonic existential rules that formally describe molecular structures and chemical classes; this representation can subsequently be used to determine