Explaining Query Answers in Lightweight Ontologies: The DL-Lite Case - - PowerPoint PPT Presentation

explaining query answers in lightweight ontologies the dl
SMART_READER_LITE
LIVE PREVIEW

Explaining Query Answers in Lightweight Ontologies: The DL-Lite Case - - PowerPoint PPT Presentation

Explaining Query Answers in Lightweight Ontologies: The DL-Lite Case Giorgio Stefanoni Supervisor: Prof. T. Eiter Co-Supervisors: Dr. M. Ortiz Dr. M. imkus Scientific Advisor: D. Calvanese Department of Computer Science University of


slide-1
SLIDE 1

Explaining Query Answers in Lightweight Ontologies: The DL-Lite Case

Giorgio Stefanoni Supervisor: Prof. T. Eiter Co-Supervisors: Dr. M. Ortiz

  • Dr. M. Šimkus

Scientific Advisor: D. Calvanese

Department of Computer Science University of Oxford, UK

February 20, 2012

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 1 / 34

slide-2
SLIDE 2

Foundations

Outline

1

Foundations

2

Explaining Positive Answers

3

Explaining Negative Answers

4

Conclusions

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 2 / 34

slide-3
SLIDE 3

Foundations

Query Answering in Description Logics

Logical Reasoning

Data A

Query q Ontology T cert(q,T,A)

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 3 / 34

slide-4
SLIDE 4

Foundations

Conjunctive Queries

Formal counterpart of Select-Project-Join Queries in RA. q( x) ← ∃ y.ψ( x, y) ψ is a conjunction of atoms over constants and variables of the form: A(t) R(t, t′) A Union of CQs (UCQ) is a disjunction of CQs, corresponding to a union of SPJs.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 4 / 34

slide-5
SLIDE 5

Foundations

DL-LiteA

Lightweight Description Logic tailored for accessing large data sources. Concepts and roles model set of objects and relationships among them. C → A | ∃R R → P | P − A DL-LiteA ontology O = T , A is composed of: TBox T Specifying constraints at the conceptual level. C ⊑ D R1 ⊑ R2 C ⊑ ¬D (funct R) R1 ⊑ ¬R2 ABox A Specifying the facts that hold in the domain. A(b) P(a, b)

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 5 / 34

slide-6
SLIDE 6

Foundations

FO-Rewritability

The perfect reformulation embeds terminological information into rq,T .

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 6 / 34

slide-7
SLIDE 7

Foundations

Mock Ontology

PostGrad Student UnderGrad PartTime Professor Tutor Course Advanced

hasTutor teaches is-a is-a is-a is-a is-a

P ostGrad ⊑ Student UnderGrad ⊑ Student UnderGrad ⊑ ¬P ostgrad P artT ime ⊑ Student T utor ⊑ P rofessor ∃hasT utor ⊑ P artT ime ∃hasT utor− ⊑ T utor Advanced ⊑ Course ∃teaches ⊑ P rofessor ∃teaches− ⊑ Course Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 7 / 34

slide-8
SLIDE 8

Foundations

Query (1)

University Database: teaches(craig, SWT) hasTutor(peter, craig) Query: q1(x) ← Professor(x) cert(q1, T , A) = {craig} In the database there is no information on Professors, how did the system retrieve the answer?

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 8 / 34

slide-9
SLIDE 9

Foundations

Query (2)

University Database: teaches(craig, SWT) hasTutor(peter, craig) Query: q2(x) ← teaches(x, y), Advanced(y), hasTutor(z, x) cert(q2, T , A) = ∅ Why is craig not an answer? Is SWT an Advanced course? Does craig teach a course not listed in the database?

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 9 / 34

slide-10
SLIDE 10

Explaining Positive Answers

Outline

1

Foundations

2

Explaining Positive Answers

3

Explaining Negative Answers

4

Conclusions

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 10 / 34

slide-11
SLIDE 11

Explaining Positive Answers

Aim

Provide explanations of the following form: Axiom Reason hasTutor(peter, craig) craig tutors ∃hasTutor− ⊑ Tutor craig is a Tutor Tutor ⊑ Professor craig is a Professor

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 11 / 34

slide-12
SLIDE 12

Explaining Positive Answers

Aim

Provide explanations of the following form: Axiom Reason hasTutor(peter, craig) craig tutors ∃hasTutor− ⊑ Tutor craig is a Tutor Tutor ⊑ Professor craig is a Professor Strategy: Gather information on how TBox axioms are used to generate the perfect reformulation.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 11 / 34

slide-13
SLIDE 13

Explaining Positive Answers

PerfectRef (q, T ) in a (non-rigorous) Nutshell

{q} ⊆ PerfectRef (q, T ). For each r ∈ PerfectRef (q, T ), we consider different cases:

1

r(x) ← Professor(x) and Tutor ⊑ Professor ∈ T . Then, r′(x) ← Tutor(x)

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 12 / 34

slide-14
SLIDE 14

Explaining Positive Answers

PerfectRef (q, T ) in a (non-rigorous) Nutshell

{q} ⊆ PerfectRef (q, T ). For each r ∈ PerfectRef (q, T ), we consider different cases:

1

r(x) ← Professor(x) and Tutor ⊑ Professor ∈ T . Then, r′(x) ← Tutor(x)

2

r(x) ← hasTutor(x, y) and PartTime ⊑ ∃hasTutor. Then, r′(x) ← PartTime(x)

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 12 / 34

slide-15
SLIDE 15

Explaining Positive Answers

PerfectRef (q, T ) in a (non-rigorous) Nutshell

{q} ⊆ PerfectRef (q, T ). For each r ∈ PerfectRef (q, T ), we consider different cases:

1

r(x) ← Professor(x) and Tutor ⊑ Professor ∈ T . Then, r′(x) ← Tutor(x)

2

r(x) ← hasTutor(x, y) and PartTime ⊑ ∃hasTutor. Then, r′(x) ← PartTime(x)

3

r(x) ← Professor(x) and ∃teaches ⊑ Professor. Then, r′(x) ← teaches(x, _)

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 12 / 34

slide-16
SLIDE 16

Explaining Positive Answers

Computing Positive Explanations

Maintain a graph G of rewritings.

(r, r′) ∈ G means that r′ has been generated from r. Label (r, r′) with the axiom justifying the rewriting.

Let π be a match for r ∈ PerfectRef (q1, T ) in A witnessing craig. IDEA: Traverse backwards the trace of rewritings from r until q1 is

  • reached. Suitably extend π to be a match for intervening queries.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 13 / 34

slide-17
SLIDE 17

Explaining Positive Answers

Example

q1(x) ← Professor(x) teaches(craig, SWT) Database hasTutor(peter, craig)

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 14 / 34

slide-18
SLIDE 18

Explaining Positive Answers

Example

q1(x) ← Professor(x)

  • r1(x) ← Tutor(x)

teaches(craig, SWT) Database hasTutor(peter, craig)

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 14 / 34

slide-19
SLIDE 19

Explaining Positive Answers

Example

q1(x) ← Professor(x)

  • r1(x) ← Tutor(x)
  • r2(x) ← hasTutor(y, x)

teaches(craig, SWT) Database hasTutor(peter, craig) π matches x on craig and y on peter.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 14 / 34

slide-20
SLIDE 20

Explaining Positive Answers

Example

q1(x) ← Professor(x)

  • r1(x) ← Tutor(x)
  • r2(x) ← hasTutor(peter, craig)

teaches(craig, SWT) Database hasTutor(peter, craig) π matches x on craig and y on peter.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 14 / 34

slide-21
SLIDE 21

Explaining Positive Answers

Example

q1(x) ← Professor(x)

  • r1(x) ← Tutor(craig)
  • r2(x) ← hasTutor(peter, craig)

teaches(craig, SWT) Database hasTutor(peter, craig) π matches x on craig and y on peter.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 14 / 34

slide-22
SLIDE 22

Explaining Positive Answers

Algorithmic Solution

Modify PerfectRef to maintain rewriting graph. At explanation time, use Dijkstra algorithm to find shortest path between generating rewriting and user query. Extend match on generating rewriting for intervening queries. Return shortest path and extended match.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 15 / 34

slide-23
SLIDE 23

Explaining Positive Answers

Complexity

Dijkstra runs in O(|V |2). In our case, the number of vertexes is the number of conjunctive queries in PerfectRef (q, T ). Worst-case: a CQ q admits exponentially many rewritings w.r.t. DL-LiteA TBox T . Our explanation algorithm runs in exponential time w.r.t. the query. Data-complexity is still low.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 16 / 34

slide-24
SLIDE 24

Explaining Negative Answers

Outline

1

Foundations

2

Explaining Positive Answers

3

Explaining Negative Answers

4

Conclusions

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 17 / 34

slide-25
SLIDE 25

Explaining Negative Answers

Query (2)

University Database: teaches(craig, SWT) hasTutor(peter, craig) Query: q2(x) ← teaches(x, y), Advanced(y), hasTutor(z, x) cert(q2, T , A) = ∅

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 18 / 34

slide-26
SLIDE 26

Explaining Negative Answers

Method

Abductive Reasoning: solutions are assertions to be added to the

  • ntology leading the given tuple to be returned by the system.

Solutions should be non-redundant: study minimality conditions!

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 19 / 34

slide-27
SLIDE 27

Explaining Negative Answers

Abductive Reasoning

A form of non-sequitor argument, in which Γ | = B but B is assumed to follow from the premises. Solutions are set of formulae E such that Γ ∪ E | = B Natural conditions over solutions: Consistency Γ ∪ E | = ⊥ Minimality E is minimal wrt. some criterion.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 20 / 34

slide-28
SLIDE 28

Explaining Negative Answers

Reasoning over Abduction Problems

1 Does there exist a (minimal) solution? (EXIST) 2 Does a formula α occur in all (minimal) solutions? (NEC) 3 Does a formula α occur in some (minimal) solution? (REL) 4 Is a set E of formulae a (minimal) solution? (REC) Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 21 / 34

slide-29
SLIDE 29

Explaining Negative Answers

Query Abduction Problem

We call P = T , A, Q( x), a a QAP, where

1

T , A is a DL-LiteA ontology.

2

Q( x) is a Union of CQs.

3

a is a tuple of constants of matching arity.

A solution to P is an ABox E such that:

T , A ∪ E is consistent.

  • a ∈ cert(q, T , A ∪ E).

We denote with expl(P) the set of all solutions to P.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 22 / 34

slide-30
SLIDE 30

Explaining Negative Answers

Properties of QAPs

P = T , A, Q( x), a If a ∈ cert(q, T , A), we call a a negative answer to Q over the

  • ntology.

Negative answers exist only if the ontology is consistent. If the ontogy is inconsistent, the the QAP does have solutions. A solution E to QAP P can introduce constants not occurring in the ABox A.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 23 / 34

slide-31
SLIDE 31

Explaining Negative Answers

Reasoning & Preference Orders

We consider the four reasoning tasks over abductive problems under 3 different preference orders:

no minimality condition, subset-minimality order denoted by ⊆, and, minimum explanation size order denoted by ≤.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 24 / 34

slide-32
SLIDE 32

Explaining Negative Answers

Query (2)

University Database: teaches(craig, SWT) hasTutor(peter, craig) Query: q2(x) ← teaches(x, y), Advanced(y), hasTutor(z, x) ABox additions: ≤ Advanced(SWT) ⊆ teaches(craig, new : ALG), Advanced(new : ALG) none teaches(craig, new : TOC), hasTutor(new : Ben, craig), Advanced(new : TOC)

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 25 / 34

slide-33
SLIDE 33

Explaining Negative Answers

Outline of Complexity Results

  • EXIST
  • NEC
  • REL
  • REC

none PTime PTime PTime NP ≤ PTime PNP

  • PNP
  • DP

⊆ PTime PTime ΣP

2

DP

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 26 / 34

slide-34
SLIDE 34

Explaining Negative Answers

Outline of Complexity Results

  • EXIST
  • NEC
  • REL
  • REC

none PTime PTime PTime NP ≤ PTime PNP

  • PNP
  • DP

⊆ PTime PTime ΣP

2

DP

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 26 / 34

slide-35
SLIDE 35

Explaining Negative Answers

Canonical Explanations

If QAP P = T , A, Q, a has a solution, then there is a small solution. Finding a solution amounts to satisfy one of the CQs in Q. Satisfying a CQ does not require more than the number of terms contained in the query itself. Hence, one can find a solution by instantiating terms occurring in the query using a small number of new constants.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 27 / 34

slide-36
SLIDE 36

Explaining Negative Answers

Complexity of ⊆-EXIST

A minimal solution to a QAP P exists iff P has a (general) solution. Theorem For DL-LiteA, EXIST is in PTime-complete. Upper bound intuition. Consider QAPs over CQs, general result for UCQs follows. Treat the body of the query as an ABox E and set O = O ∪ E. Replace each variable x in E with a variable representative ax. Use disjointness in O to enforce distinctness among constants. Thus,

  • nly variable representatives can be identified.

Check satisfiability of the resulting ontology O without the UNA.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 28 / 34

slide-37
SLIDE 37

Explaining Negative Answers

Complexity of ⊆-NEC

An assertion is ⊆-necessary iff it is necessary. Theorem For DL-LiteA, NEC is PTime-complete. Upper bound intuition. We want to decide whether A(a) is necessary for P = O, q, a. Check whether A(a) is a consequence of O. In case return no. Create P′ = O′, q, a by extending O as follows: T ∪ ¯ A ⊑ ¬A A ∪ { ¯ A(a)} Check that P′ does not admit solutions. If this is the case return yes.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 29 / 34

slide-38
SLIDE 38

Explaining Negative Answers

Complexity of ⊆-REL

Theorem For DL-LiteA, ⊆-REL is ΣP

2 -complete.

Upper bound intuition. We want to decide whether A(a) is ⊆-relevant for P = T , A, q, a. Guess a derivation of one rewriting r in PerfetctRef (q, T ). Guess a subset E of the atoms of r Guess an instantiation E of the atoms in E. Check that E is an explanation for P. (NP) Check that E is minimal (coNP)

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 30 / 34

slide-39
SLIDE 39

Explaining Negative Answers

Complexity of ⊆-REC

Theorem For DL-LiteA, ⊆-REC is DP-complete. Upper bound intuition. By definition of DP. A language L is in DP if there are two languages L1 and L2, resp. in NP and coNP such that: L = L1 ∩ L2 Thus L1 = {P, E | E ∈ expl(P)} L2 = {P, E | ¬∃E′ ∈ expl(P) such that E′ ⊂ E} ⊆-REC = L1 ∩ L2

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 31 / 34

slide-40
SLIDE 40

Conclusions

Outline

1

Foundations

2

Explaining Positive Answers

3

Explaining Negative Answers

4

Conclusions

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 32 / 34

slide-41
SLIDE 41

Conclusions

Conclusions

Provide an algorithmic solution to the problem of explaining positive answers. Contribute with a new formalization to the problem of explaining negative answers over ontologies as an abductive task. For DL-LiteA, we study the complexity of reasoning over QAPs under minimality conditions.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 33 / 34

slide-42
SLIDE 42

Conclusions

Publications

The Complexity of Conjunctive Query Abduction in DL-Lite. Diego Calvanese, Magdalena Ortiz, Mantas Simkus, and Giorgio Stefanoni

  • Proc. of the 24th Int. Workshop on Description Logics (DL 2011).

Volume 745 of CEUR Electronic Workshop Proceedings, http://ceur-ws.org/. 2011. The Complexity of Explaining Negative Query Answers in DL-Lite. Diego Calvanese, Magdalena Ortiz, Mantas Simkus, and Giorgio

  • Stefanoni. Accepted to KR2012.

Giorgio Stefanoni (Oxford) Explanation of Query Answers February 20, 2012 34 / 34