Query Rewriting in DL

advertisement
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
Query Rewriting in DL-Lite horn
Elena Botoeva, Alessandro Artale, and Diego Calvanese
KRDB Research Centre
Free University of Bozen-Bolzano
I-39100 Bolzano, Italy
Description Logics Workshop, 2010
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
1/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Outline
1 Motivation
(HN)
2 The DL DL-Litehorn
3 Knowledge Base Satisfiability
4 Query Answering
5 Conclusions
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
2/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Motivation: Ontology-Based Data Access
Application 1
Application 2
response
response
query
Data
source 1
Botoeva, Artale, Calvanese
query
Data
source 2
Data
source 3
(HN )
Query Rewriting in DL-Lite horn
3/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Motivation: Ontology-Based Data Access
• Ontologies are used for accessing data
Application
query
Ontology
response
C1
C3
R1
A1
A2
C2
Data
source 1
Data
source 2
Data
source 3
• An ontology provides a high-level conceptual view of information
sources
• Data sources can be queried through ontologies
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
3/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering by Rewriting
• We want to compute certain answers to a query
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
4/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering by Rewriting
• We want to compute certain answers to a query
• Rewriting approach:
1 Rewrite the query using the constraints in the ontology
2 Evaluate the rewritten query over the database
Reasoning
Reasoning
Schema /
Ontology
Query
Logical
Schema
Rewritten
Query
Result
Data
Source
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
4/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering by Rewriting: Example
Ontology: O = {PhDStudent v Student}
Database: DBA = {PhDStudent(john)}
Query: q(x) ← Student(x)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
5/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering by Rewriting: Example
Ontology: O = {PhDStudent v Student}
Database: DBA = {PhDStudent(john)}
Query: q(x) ← Student(x)
• The rewriting of q:
qucq (x) ← Student(x)
qucq (x) ← PhDStudent(x)
• By evaluating the rewriting over the ABox viewed as a DB :
eval(qucq , DBA ) = {john} = ans(q, hO, DBA i)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
5/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
FOL Rewritable Logics
• Such a rewriting approach can be applied only to FOL rewritable
logics.
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
6/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
FOL Rewritable Logics
• Such a rewriting approach can be applied only to FOL rewritable
logics.
• DL-Lite is a family of logics that has been shown to enjoy FOL
rewritability:
I
DL-Lite R , DL-Lite F , DL-Lite A
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
6/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
FOL Rewritable Logics
• Such a rewriting approach can be applied only to FOL rewritable
logics.
• DL-Lite is a family of logics that has been shown to enjoy FOL
rewritability:
I
DL-Lite R , DL-Lite F , DL-Lite A
• Extended DL-Lite family: additional constructs have been proposed
I
(HN )
DL-Lite horn
Botoeva, Artale, Calvanese
is the most interesting logic
(HN )
Query Rewriting in DL-Lite horn
6/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Outline
1 Motivation
(HN)
2 The DL DL-Litehorn
3 Knowledge Base Satisfiability
4 Query Answering
5 Conclusions
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
7/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
DL-Lite horn
(HN )
In this work we consider the logic DL-Lite horn :
• The most expressive tractable variant of DL-Lite [ACKZ09].
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
8/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
DL-Lite horn
(HN )
In this work we consider the logic DL-Lite horn :
• The most expressive tractable variant of DL-Lite [ACKZ09].
• Extends DL-Lite with
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
8/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
DL-Lite horn
(HN )
In this work we consider the logic DL-Lite horn :
• The most expressive tractable variant of DL-Lite [ACKZ09].
• Extends DL-Lite with
I role inclusions H
• hasConfPaper v hasPublication
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
8/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
DL-Lite horn
(HN )
In this work we consider the logic DL-Lite horn :
• The most expressive tractable variant of DL-Lite [ACKZ09].
• Extends DL-Lite with
I role inclusions H
• hasConfPaper v hasPublication
I
number restrictions N
• PhDStudent v ≥ 2 hasConfPaper
• ≥ 2 teaches − v ⊥
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
8/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
DL-Lite horn
(HN )
In this work we consider the logic DL-Lite horn :
• The most expressive tractable variant of DL-Lite [ACKZ09].
• Extends DL-Lite with
I role inclusions H
• hasConfPaper v hasPublication
I
number restrictions N
• PhDStudent v ≥ 2 hasConfPaper
• ≥ 2 teaches − v ⊥
I
horn inclusions horn
• Student u ≥ 1 teaches v PhDStudent
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
8/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Questions Addressed by Our Work
(HN )
For the logic DL-Lite horn :
• Can we check ontology satisfiability by relying on RDB technology?
• Can we answer queries by relying on RDB technology?
• Can we extend the practical algorithms developed for
the simpler DL-Lite logics?
• What is the complexity of such algorithms?
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
9/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
DL-Lite horn : Syntax
Concept and role expressions
B ::= ⊥ | A | ≥ k R
R ::= P | P −
TBox assertions
B1 u · · · u Bn v B
R1 v R2
Dis(R1 , R2 )
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
10/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
DL-Lite horn : Syntax
Concept and role expressions
B ::= ⊥ | A | ≥ k R
R ::= P | P −
TBox assertions
B1 u · · · u Bn v B
R1 v R2
Dis(R1 , R2 )
Restriction to ensure FOL rewritability:
if R has a proper sub-role, then ≥ k R with k ≥ 2
does not occur in the lhs of concept inclusions.
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
10/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
A DL-Lite horn TBox
• basic concept inclusion
≥ 1 hasPublication− v Publication
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
11/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
A DL-Lite horn TBox
• basic concept inclusion
≥ 1 hasPublication− v Publication
• role inclusion
hasConfPaper v hasPublication
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
11/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
A DL-Lite horn TBox
• basic concept inclusion
≥ 1 hasPublication− v Publication
• role inclusion
hasConfPaper v hasPublication
• number restrictions
PhDStudent v ≥ 2 hasConfPaper
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
11/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
A DL-Lite horn TBox
• basic concept inclusion
≥ 1 hasPublication− v Publication
• role inclusion
hasConfPaper v hasPublication
• number restrictions
PhDStudent v ≥ 2 hasConfPaper
• horn inclusion
Student u ≥ 1 teaches v PhDStudent
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
11/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
A DL-Lite horn TBox
• basic concept inclusion
≥ 1 hasPublication− v Publication
• role inclusion
hasConfPaper v hasPublication
• number restrictions
PhDStudent v ≥ 2 hasConfPaper
• horn inclusion
Student u ≥ 1 teaches v PhDStudent
• local functionality assertion
PhDStudent u ≥ 2 teaches v ⊥
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
11/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
(HN )
A DL-Lite horn TBox
• basic concept inclusion
≥ 1 hasPublication− v Publication
• role inclusion
hasConfPaper v hasPublication
• number restrictions
PhDStudent v ≥ 2 hasConfPaper
• horn inclusion
Student u ≥ 1 teaches v PhDStudent
• local functionality assertion
PhDStudent u ≥ 2 teaches v ⊥
• global functionality assertion
≥ 2 teaches − v ⊥
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
11/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Outline
1 Motivation
(HN)
2 The DL DL-Litehorn
3 Knowledge Base Satisfiability
4 Query Answering
5 Conclusions
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
12/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Knowledge Base Satisfiability
Negative inclusions may lead to unsatisfiability:
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
13/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Knowledge Base Satisfiability
Negative inclusions may lead to unsatisfiability:
• T : Student u Professor v ⊥, PhDStudent v Student
A : PhDStudent(john), Professor (john)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
13/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Knowledge Base Satisfiability
Negative inclusions may lead to unsatisfiability:
• T : Student u Professor v ⊥, PhDStudent v Student
A : PhDStudent(john), Professor (john)
• T : Dis(teaches, attends)
A : teaches(john, cl), attends(john, cl)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
13/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Knowledge Base Satisfiability
Negative inclusions may lead to unsatisfiability:
• T : Student u Professor v ⊥, PhDStudent v Student
A : PhDStudent(john), Professor (john)
• T : Dis(teaches, attends)
A : teaches(john, cl), attends(john, cl)
• T : PhDStudent u ≥ 2 teaches v ⊥
A : PhDStudent(john), teaches(john, cl), teaches(john, db)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
13/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Knowledge Base Satisfiability
Negative inclusions may lead to unsatisfiability:
• T : Student u Professor v ⊥, PhDStudent v Student
A : PhDStudent(john), Professor (john)
• T : Dis(teaches, attends)
A : teaches(john, cl), attends(john, cl)
• T : PhDStudent u ≥ 2 teaches v ⊥
A : PhDStudent(john), teaches(john, cl), teaches(john, db)
⇒ We need to calculate closure of NIs w.r.t. PIs
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
13/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Knowledge Base Satisfiability Algorithm
We reduce the problem to FOL query evaluation.
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
14/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Knowledge Base Satisfiability Algorithm
We reduce the problem to FOL query evaluation.
Algorithm for checking KB satisfiability
1
Calculate the closure of NIs.
2
Translate the closure into a UCQ qunsat asking for violation of some NI.
3
Evaluate qunsat over the ABox (viewed as a DB).
I
I
if eval(qunsat , DBA ) = ∅, then the KB is satisfiable;
otherwise the KB is unsatisfiable.
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
14/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Closure of Negative Inclusions
Closure of NIs cln(T ) w.r.t. PIs
• every NI is in cln(T ).
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
15/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Closure of Negative Inclusions
Closure of NIs cln(T ) w.r.t. PIs
• every NI is in cln(T ).
•
cln(T ) : Professor u PhDStudent v ⊥
T :
Student u ≥ 1 teaches v PhDStudent
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
⇒
15/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Closure of Negative Inclusions
Closure of NIs cln(T ) w.r.t. PIs
• every NI is in cln(T ).
•
cln(T ) : Professor u PhDStudent v ⊥
T :
Student u ≥ 1 teaches v PhDStudent
⇒
add to cln(T ) : Professor u Student u ≥ 1 teaches v ⊥
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
15/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Closure of Negative Inclusions
Closure of NIs cln(T ) w.r.t. PIs
• every NI is in cln(T ).
•
cln(T ) : Professor u PhDStudent v ⊥
T :
Student u ≥ 1 teaches v PhDStudent
⇒
add to cln(T ) : Professor u Student u ≥ 1 teaches v ⊥
•
cln(T ) : PhDStudent u ≥ 2 teaches v ⊥
T :
FullProfessor v ≥ 3 teaches
Botoeva, Artale, Calvanese
⇒
(HN )
Query Rewriting in DL-Lite horn
15/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Closure of Negative Inclusions
Closure of NIs cln(T ) w.r.t. PIs
• every NI is in cln(T ).
•
cln(T ) : Professor u PhDStudent v ⊥
T :
Student u ≥ 1 teaches v PhDStudent
⇒
add to cln(T ) : Professor u Student u ≥ 1 teaches v ⊥
•
cln(T ) : PhDStudent u ≥ 2 teaches v ⊥
T :
FullProfessor v ≥ 3 teaches
⇒
add to cln(T ): PhDStudent u FullProfessor v ⊥
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
15/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Closure of Negative Inclusions
Closure of NIs cln(T ) w.r.t. PIs
• every NI is in cln(T ).
•
cln(T ) : Professor u PhDStudent v ⊥
T :
Student u ≥ 1 teaches v PhDStudent
⇒
add to cln(T ) : Professor u Student u ≥ 1 teaches v ⊥
•
cln(T ) : PhDStudent u ≥ 2 teaches v ⊥
T :
FullProfessor v ≥ 3 teaches
⇒
add to cln(T ): PhDStudent u FullProfessor v ⊥
•
cln(T ) : Professor u ≥ 1 attends v ⊥
T :
registeredTo v attends
Botoeva, Artale, Calvanese
⇒
(HN )
Query Rewriting in DL-Lite horn
15/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Closure of Negative Inclusions
Closure of NIs cln(T ) w.r.t. PIs
• every NI is in cln(T ).
•
cln(T ) : Professor u PhDStudent v ⊥
T :
Student u ≥ 1 teaches v PhDStudent
⇒
add to cln(T ) : Professor u Student u ≥ 1 teaches v ⊥
•
cln(T ) : PhDStudent u ≥ 2 teaches v ⊥
T :
FullProfessor v ≥ 3 teaches
⇒
add to cln(T ): PhDStudent u FullProfessor v ⊥
•
cln(T ) : Professor u ≥ 1 attends v ⊥
T :
registeredTo v attends
⇒
add to cln(T ): Professor u ≥ 1 registeredTo v ⊥
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
15/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Closure of Negative Inclusions
Closure of NIs cln(T ) w.r.t. PIs
• every NI is in cln(T ).
•
cln(T ) : Professor u PhDStudent v ⊥
T :
Student u ≥ 1 teaches v PhDStudent
⇒
add to cln(T ) : Professor u Student u ≥ 1 teaches v ⊥
•
cln(T ) : PhDStudent u ≥ 2 teaches v ⊥
T :
FullProfessor v ≥ 3 teaches
⇒
add to cln(T ): PhDStudent u FullProfessor v ⊥
•
cln(T ) : Professor u ≥ 1 attends v ⊥
T :
registeredTo v attends
⇒
add to cln(T ): Professor u ≥ 1 registeredTo v ⊥
• ···
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
15/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Translation to FOL Queries
• Professor u Student v ⊥ ⇒
∃x.Professor (x) ∧ Student(x).
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
16/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Translation to FOL Queries
• Professor u Student v ⊥ ⇒
∃x.Professor (x) ∧ Student(x).
• ≥ 2 teaches − v ⊥ ⇒
∃x1 , x2 , y .teaches(x1 , y ) ∧ teaches(x2 , y ) ∧ x1 6= x2 .
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
16/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Translation to FOL Queries
• Professor u Student v ⊥ ⇒
∃x.Professor (x) ∧ Student(x).
• ≥ 2 teaches − v ⊥ ⇒
∃x1 , x2 , y .teaches(x1 , y ) ∧ teaches(x2 , y ) ∧ x1 6= x2 .
• Dis(attends, teaches) ⇒
∃x, y .attends(x, y ) ∧ teaches(x, y ).
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
16/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
KB Satisfiability: Complexity of the Algorithm
• Optimal data complexity: in AC0 (follows from FOL rewritability)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
17/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
KB Satisfiability: Complexity of the Algorithm
• Optimal data complexity: in AC0 (follows from FOL rewritability)
• Combined complexity: exponential
I Worst case: the size of cln(T ) is exponential in the size of the TBox
T = { A01 v A1 , . . . , A0n v An , A1 u · · · u An v ⊥ }.
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
17/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
KB Satisfiability: Complexity of the Algorithm
• Optimal data complexity: in AC0 (follows from FOL rewritability)
• Combined complexity: exponential
I Worst case: the size of cln(T ) is exponential in the size of the TBox
T = { A01 v A1 , . . . , A0n v An , A1 u · · · u An v ⊥ }.
Notice, that the problem is PTime [ACKZ09].
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
17/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Outline
1 Motivation
(HN)
2 The DL DL-Litehorn
3 Knowledge Base Satisfiability
4 Query Answering
5 Conclusions
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
18/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Example
q(x) ← hasPublication(x, y ) ∧ Publication(y )
TBox T = {
≥ 1 hasPublication− v Publication
hasConfPaper v hasPublication
PhDStudent v ≥ 2 hasConfPaper
Student u ≥ 1 teaches v PhDStudent
}
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
19/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Example
≥ 1 hasPublication− v Publication
hasConfPaper v hasPublication
PhDStudent v ≥ 2 hasConfPaper
Student u ≥ 1 teaches v PhDStudent
q(x) ← hasPublication(x, y ) ∧ Publication(y )
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
19/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Example
≥ 1 hasPublication− v Publication
hasConfPaper v hasPublication
q(x) ← hasPublication(x, y ) ∧ Publication(y )
PhDStudent v ≥ 2 hasConfPaper
−
Student u ≥ 1 teaches v PhDStudent
⇓ ≥ 1 hasPublication v Publication
q2 (x) ← hasPublication(x, y ) ∧ E1 hasPublication− (y )
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
19/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Example
≥ 1 hasPublication− v Publication
hasConfPaper v hasPublication
q(x) ← hasPublication(x, y ) ∧ Publication(y )
PhDStudent v ≥ 2 hasConfPaper
−
Student u ≥ 1 teaches v PhDStudent
⇓ ≥ 1 hasPublication v Publication
q2 (x) ← hasPublication(x, y ) ∧ E1 hasPublication− (y )
⇓ unify the atoms
q3 (x) ← hasPublication(x, y )
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
19/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Example
≥ 1 hasPublication− v Publication
hasConfPaper v hasPublication
q(x) ← hasPublication(x, y ) ∧ Publication(y )
PhDStudent v ≥ 2 hasConfPaper
−
Student u ≥ 1 teaches v PhDStudent
⇓ ≥ 1 hasPublication v Publication
q2 (x) ← hasPublication(x, y ) ∧ E1 hasPublication− (y )
⇓ unify the atoms
q3 (x) ← hasPublication(x, y )
⇓ remove unbound variables
q3 (x) ← E1 hasPublication(x)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
19/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Example
≥ 1 hasPublication− v Publication
hasConfPaper v hasPublication
q(x) ← hasPublication(x, y ) ∧ Publication(y )
PhDStudent v ≥ 2 hasConfPaper
−
Student u ≥ 1 teaches v PhDStudent
⇓ ≥ 1 hasPublication v Publication
q2 (x) ← hasPublication(x, y ) ∧ E1 hasPublication− (y )
⇓ unify the atoms
q3 (x) ← hasPublication(x, y )
⇓ remove unbound variables
q3 (x) ← E1 hasPublication(x)
⇓ hasConfPaper v hasPublication
q4 (x) ← E1 hasConfPaper (x)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
19/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Example
≥ 1 hasPublication− v Publication
hasConfPaper v hasPublication
q(x) ← hasPublication(x, y ) ∧ Publication(y )
PhDStudent v ≥ 2 hasConfPaper
−
Student u ≥ 1 teaches v PhDStudent
⇓ ≥ 1 hasPublication v Publication
q2 (x) ← hasPublication(x, y ) ∧ E1 hasPublication− (y )
⇓ unify the atoms
q3 (x) ← hasPublication(x, y )
⇓ remove unbound variables
q3 (x) ← E1 hasPublication(x)
⇓ hasConfPaper v hasPublication
q4 (x) ← E1 hasConfPaper (x)
⇓ ≥ 2 hasConfPaper v ≥ 1 hasConfPaper
q5 (x) ← E2 hasConfPaper (x)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
19/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Example
≥ 1 hasPublication− v Publication
hasConfPaper v hasPublication
q(x) ← hasPublication(x, y ) ∧ Publication(y )
PhDStudent v ≥ 2 hasConfPaper
−
Student u ≥ 1 teaches v PhDStudent
⇓ ≥ 1 hasPublication v Publication
q2 (x) ← hasPublication(x, y ) ∧ E1 hasPublication− (y )
⇓ unify the atoms
q3 (x) ← hasPublication(x, y )
⇓ remove unbound variables
q3 (x) ← E1 hasPublication(x)
⇓ hasConfPaper v hasPublication
q4 (x) ← E1 hasConfPaper (x)
⇓ ≥ 2 hasConfPaper v ≥ 1 hasConfPaper
q5 (x) ← E2 hasConfPaper (x)
⇓ PhDStudent v ≥ 2 hasConfPaper
q6 (x) ← PhDStudent(x)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
19/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Example
≥ 1 hasPublication− v Publication
hasConfPaper v hasPublication
q(x) ← hasPublication(x, y ) ∧ Publication(y )
PhDStudent v ≥ 2 hasConfPaper
−
Student u ≥ 1 teaches v PhDStudent
⇓ ≥ 1 hasPublication v Publication
q2 (x) ← hasPublication(x, y ) ∧ E1 hasPublication− (y )
⇓ unify the atoms
q3 (x) ← hasPublication(x, y )
⇓ remove unbound variables
q3 (x) ← E1 hasPublication(x)
⇓ hasConfPaper v hasPublication
q4 (x) ← E1 hasConfPaper (x)
⇓ ≥ 2 hasConfPaper v ≥ 1 hasConfPaper
q5 (x) ← E2 hasConfPaper (x)
⇓ PhDStudent v ≥ 2 hasConfPaper
q6 (x) ← PhDStudent(x)
⇓ Student u ≥ 1 teaches v PhDStudent
q7 (x) ← Student(x) ∧ E1 teaches(x)
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
19/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering Algorithm
1
Compute the rewriting of the initial query, a UCQ.
I
Application of PIs to query atoms.
q(x) ← hasPublication(x, y ) ∧ Publication(y )
⇓ ≥ 1 hasPublication− v Publication
0
q (x) ← hasPublication(x, y ) ∧ E1 hasPublication− (y )
I
Unification of query atoms.
q(x) ← hasPublication(x, y ) ∧ E1 hasPublication− (y )
⇓ unify
q 0 (x) ← hasPublication(x, y )
2
Evaluate the obtained UCQ over the ABox viewed as a DB.
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
20/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
What Is New?
Differences w.r.t. the algorithm for simpler variants of DL-Lite
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
21/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
What Is New?
Differences w.r.t. the algorithm for simpler variants of DL-Lite
• Number restrictions imply new inclusions:
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
21/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
What Is New?
Differences w.r.t. the algorithm for simpler variants of DL-Lite
• Number restrictions imply new inclusions: extend the TBox
I
I
≥ k R v ≥ k 0 R, where k > k 0
≥ k R v ≥ k R 0 for each subrole R of R 0
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
21/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
What Is New?
Differences w.r.t. the algorithm for simpler variants of DL-Lite
• Number restrictions imply new inclusions: extend the TBox
I
I
≥ k R v ≥ k 0 R, where k > k 0
≥ k R v ≥ k R 0 for each subrole R of R 0
• Introduce new predicates Ek R(x) to handle inequalities
implied by number restrictions ≥ k R
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
21/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
What Is New?
Differences w.r.t. the algorithm for simpler variants of DL-Lite
• Number restrictions imply new inclusions: extend the TBox
I
I
≥ k R v ≥ k 0 R, where k > k 0
≥ k R v ≥ k R 0 for each subrole R of R 0
• Introduce new predicates Ek R(x) to handle inequalities
implied by number restrictions ≥ k R
• Unification for newly introduced predicates
I
I
P(x,y) unifies with P(z,w), E1 P(z), or E1 P − (w)
Ek R(x) unifies with E1 R − ( )
Notice that E1 R − ( ) stands for R( , )
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
21/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
What Is New?
Differences w.r.t. the algorithm for simpler variants of DL-Lite
• Number restrictions imply new inclusions: extend the TBox
I
I
≥ k R v ≥ k 0 R, where k > k 0
≥ k R v ≥ k R 0 for each subrole R of R 0
• Introduce new predicates Ek R(x) to handle inequalities
implied by number restrictions ≥ k R
• Unification for newly introduced predicates
I
I
P(x,y) unifies with P(z,w), E1 P(z), or E1 P − (w)
Ek R(x) unifies with E1 R − ( )
Notice that E1 R − ( ) stands for R( , )
• Horn inclusions increase the length of the query
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
21/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
What Is New?
Differences w.r.t. the algorithm for simpler variants of DL-Lite
• Number restrictions imply new inclusions: extend the TBox
I
I
≥ k R v ≥ k 0 R, where k > k 0
≥ k R v ≥ k R 0 for each subrole R of R 0
• Introduce new predicates Ek R(x) to handle inequalities
implied by number restrictions ≥ k R
• Unification for newly introduced predicates
I
I
P(x,y) unifies with P(z,w), E1 P(z), or E1 P − (w)
Ek R(x) unifies with E1 R − ( )
Notice that E1 R − ( ) stands for R( , )
• Horn inclusions increase the length of the query
I
remove duplicated atoms
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
21/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
What Is New?
Differences w.r.t. the algorithm for simpler variants of DL-Lite
• Number restrictions imply new inclusions: extend the TBox
I
I
≥ k R v ≥ k 0 R, where k > k 0
≥ k R v ≥ k R 0 for each subrole R of R 0
• Introduce new predicates Ek R(x) to handle inequalities
implied by number restrictions ≥ k R
• Unification for newly introduced predicates
I
I
P(x,y) unifies with P(z,w), E1 P(z), or E1 P − (w)
Ek R(x) unifies with E1 R − ( )
Notice that E1 R − ( ) stands for R( , )
• Horn inclusions increase the length of the query
I
I
remove duplicated atoms
remove Ek 0 R(z), if Ek R(x) occurs in the query and k > k 0
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
21/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Complexity of the Algorithm
• Optimal data complexity: in AC0
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
22/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Query Answering: Complexity of the Algorithm
• Optimal data complexity: in AC0
• Combined complexity: in NP
Note that the size of the rewriting is exponential
already w.r.t. the size of the TBox.
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
22/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Outline
1 Motivation
(HN)
2 The DL DL-Litehorn
3 Knowledge Base Satisfiability
4 Query Answering
5 Conclusions
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
23/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Conclusion
• We reduced knowledge satisfiability and query answering in
(HN )
DL-Lite horn to FOL evaluation.
I
I
Practically implementable algorithms.
We can rely on relational database technology for managing the data
and query evaluation.
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
24/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Conclusion
• We reduced knowledge satisfiability and query answering in
(HN )
DL-Lite horn to FOL evaluation.
I
I
Practically implementable algorithms.
We can rely on relational database technology for managing the data
and query evaluation.
• The computational complexity of the algorithms is optimal w.r.t.
data complexity:
I
in AC0 .
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
24/25
(HN)
Motivation
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Conclusion
• We reduced knowledge satisfiability and query answering in
(HN )
DL-Lite horn to FOL evaluation.
I
I
Practically implementable algorithms.
We can rely on relational database technology for managing the data
and query evaluation.
• The computational complexity of the algorithms is optimal w.r.t.
data complexity:
I
in AC0 .
• Future work:
I Implement the developed algorithms.
I Study optimization techniques for the algorithm.
I Extend the practical algorithm to positive existential queries.
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
24/25
Motivation
(HN)
The DL DL-Litehorn
Knowledge Base Satisfiability
Query Answering
Conclusions
Thank you
for your attention!
Botoeva, Artale, Calvanese
(HN )
Query Rewriting in DL-Lite horn
25/25
Download