25
Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio Alferes CENTRIA, Faculdade de Ciências e Tecnologia/Universidade Nova de Lisboa CENTRIA October 26, 2011

Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Embed Size (px)

Citation preview

Page 1: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Querying OWL 2 QL andNon-monotonic Rules

Matthias Knorr and José Júlio Alferes

CENTRIA, Faculdade de Ciências e Tecnologia/Universidade Nova de Lisboa

CENTRIA

October 26, 2011

Page 2: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Motivating Example

Professor v ∃TeachesTo Student v ∃HasTutor∃TeachesTo− v Student ∃HasTutor− v Professor

Professor v ¬Student HasTutor− v TeachesTo

Student(Paul) HasTutor(Jane, Mary) TeachesTo(Mary, Bill)

hasKnownTutor(x)← Student(x), HasTutor(x, y)hasUnknownTutor(x)← Student(x),not HasTutor(x, y)

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 2/14

Page 3: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Motivating Example

Professor v ∃TeachesTo Student v ∃HasTutor∃TeachesTo− v Student ∃HasTutor− v Professor

Professor v ¬Student HasTutor− v TeachesTo

Student(Paul) HasTutor(Jane, Mary) TeachesTo(Mary, Bill)

hasKnownTutor(x)← Student(x), HasTutor(x, y)hasUnknownTutor(x)← Student(x),not HasTutor(x, y)

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 2/14

Page 4: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Motivating Example

Professor v ∃TeachesTo Student v ∃HasTutor∃TeachesTo− v Student ∃HasTutor− v Professor

Professor v ¬Student HasTutor− v TeachesTo

Student(Paul) HasTutor(Jane, Mary) TeachesTo(Mary, Bill)

hasKnownTutor(x)← Student(x), HasTutor(x, y)hasUnknownTutor(x)← Student(x),not HasTutor(x, y)

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 2/14

Page 5: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Goals

1 Combine different KR formalisms (unknown individuals vs.default negation – akin to OWL vs. non-monotonic RIF)

2 Seamless integration, e.g., in the example, the facts mightbe rules or even derived from more complex rules thatagain use information from the ontology

3 Query efficiently for information in large knowledge baseswithout having to compute the entire model

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 3/14

Page 6: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Goals

1 Combine different KR formalisms (unknown individuals vs.default negation – akin to OWL vs. non-monotonic RIF)

2 Seamless integration, e.g., in the example, the facts mightbe rules or even derived from more complex rules thatagain use information from the ontology

3 Query efficiently for information in large knowledge baseswithout having to compute the entire model

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 3/14

Page 7: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Goals

1 Combine different KR formalisms (unknown individuals vs.default negation – akin to OWL vs. non-monotonic RIF)

2 Seamless integration, e.g., in the example, the facts mightbe rules or even derived from more complex rules thatagain use information from the ontology

3 Query efficiently for information in large knowledge baseswithout having to compute the entire model

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 3/14

Page 8: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Ingredients: 1. OWL 2 QL

• One of the tractable OWL 2 profiles• Underlying Description Logic DL-LiteR• Syntax: GCIs C v D, RIs R v E, and assertions C(a) andR(a, b) where

C −→ A | ∃R R −→ P | P− D −→ C | ¬C E −→ R | ¬R

• Standard reasoning in PTIME (TBox) and LOGSPACE (ABox)• Designed for answering queries efficiently

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 4/14

Page 9: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Ingredients: 2. Hybrid MKNF KBs

• DL KB O + a finite set of rules, P, of the form

H ← A1, . . . , An,notB1, . . . ,notBm

where H, Ai, and Bj are first-order atoms• Decidability ensured by DL-safety (application of rules

restricted to known individuals)• Well-founded MKNF semantics applied:

• Data complexity PTIME with tractable DL• Admits top-down querying→ SLG(O)

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 5/14

Page 10: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Ingredients: 3. SLG(O)

• Extension of SLG Resolution with Tabling (XSB) with anOracle for O

C v D E u F v D

Query for D(a): O returns C(a) and E(a), F (a)• Limited to ground queries to the DL Oracle• Computational complexity of well-founded MKNF

maintained if the returned answers of O are bounded• General procedure for arbitrary DL

→ Concrete procedure for DL-LiteR is missing

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 6/14

Page 11: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Ingredients: 3. SLG(O)

• Extension of SLG Resolution with Tabling (XSB) with anOracle for O

C v D E u F v D

Query for D(a): O returns C(a) and E(a), F (a)• Limited to ground queries to the DL Oracle• Computational complexity of well-founded MKNF

maintained if the returned answers of O are bounded• General procedure for arbitrary DL

→ Concrete procedure for DL-LiteR is missing

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 6/14

Page 12: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Contribution

1 Concrete oracle for DL-LiteR2 Paraconsistent approximation on SLG(O) for efficiency3 Oracle may return non-ground answers; improvement on

SLG(O) efficiency4 Returned answers are bounded by a polynomial5 Data complexity for (DL-safe) querying in PTIME

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 7/14

Page 13: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Intuitive Idea - Example

Professor v ∃TeachesTo Student v ∃HasTutor∃TeachesTo− v Student ∃HasTutor− v Professor

Professor v ¬Student HasTutor− v TeachesTo

Student(Paul)← HasTutor(Jane, Mary)←TeachesTo(Mary, Bill)←

hasKnownTutor(x)← o(x), o(y), Student(x), HasTutor(x, y)hasUnknownTutor(x)← o(x), o(y), Student(x),not HasTutor(x, y)

DL-safety ensured by facts o(i)← for all i in the KB

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 8/14

Page 14: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Query hasKnownTutor(x)

• Atoms o(i) ground the DL-atoms• Query for, e.g., Student(Bill) to the DL-LiteR Oracle

→ Oracle computation starts

1 Satisfiability check for DL part and stop with fail in case offailure

2 Otherwise: A(Bill) and A v ¬Student added for newpredicate A

1 Satisfiability check for augmented KB and stop withsuccess in case of failure (successful instance check forStudent(Bill))

2 Otherwise: Resolve and return answers

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 9/14

Page 15: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Query hasKnownTutor(x)

• Atoms o(i) ground the DL-atoms• Query for, e.g., Student(Bill) to the DL-LiteR Oracle

→ Oracle computation starts1 Satisfiability check for DL part and stop with fail in case of

failure

2 Otherwise: A(Bill) and A v ¬Student added for newpredicate A

1 Satisfiability check for augmented KB and stop withsuccess in case of failure (successful instance check forStudent(Bill))

2 Otherwise: Resolve and return answers

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 9/14

Page 16: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Query hasKnownTutor(x)

• Atoms o(i) ground the DL-atoms• Query for, e.g., Student(Bill) to the DL-LiteR Oracle

→ Oracle computation starts1 Satisfiability check for DL part and stop with fail in case of

failure2 Otherwise: A(Bill) and A v ¬Student added for new

predicate A

1 Satisfiability check for augmented KB and stop withsuccess in case of failure (successful instance check forStudent(Bill))

2 Otherwise: Resolve and return answers

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 9/14

Page 17: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Query hasKnownTutor(x)

• Atoms o(i) ground the DL-atoms• Query for, e.g., Student(Bill) to the DL-LiteR Oracle

→ Oracle computation starts1 Satisfiability check for DL part and stop with fail in case of

failure2 Otherwise: A(Bill) and A v ¬Student added for new

predicate A1 Satisfiability check for augmented KB and stop with

success in case of failure (successful instance check forStudent(Bill))

2 Otherwise: Resolve and return answers

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 9/14

Page 18: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Query hasKnownTutor(x)

• Atoms o(i) ground the DL-atoms• Query for, e.g., Student(Bill) to the DL-LiteR Oracle

→ Oracle computation starts1 Satisfiability check for DL part and stop with fail in case of

failure2 Otherwise: A(Bill) and A v ¬Student added for new

predicate A1 Satisfiability check for augmented KB and stop with

success in case of failure (successful instance check forStudent(Bill))

2 Otherwise: Resolve and return answers

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 9/14

Page 19: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

1.Compute negative closureClosure of negative inclusions - all implicit and explicitinclusions with ¬ on the right hand side

Professor v ¬Student∃HasTutor− v ¬Student∃TeachesTo− v ¬Professor∃TeachesTo v ¬Student∃HasTutor v ¬Professor

A v ¬Student∃TeachesTo− v ¬A∃HasTutor v ¬A

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 10/14

Page 20: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

2. Translate negative closureDisjunction of formulas derived used for (un)satisfiability check:

δ(Professor v ¬Student) = ∃x.(Professor(x) ∧ Student(x))

∃x.((∃y.HasTutor(y, x)) ∧ Student(x))∃x.((∃y.TeachesTo(y, x)) ∧ Professor(x))∃x.((∃y.TeachesTo(x, y)) ∧ Student(x))∃x.((∃y.HasTutor(x, y)) ∧ Professor(x))

∃x.(A(x) ∧ Student(x))∃x.((∃y.TeachesTo(y, x)) ∧ A(x))∃x.((∃y.HasTutor(x, y)) ∧ A(x))

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 11/14

Page 21: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

2. Translate negative closureDisjunction of formulas derived used for (un)satisfiability check:

δ(Professor v ¬Student) = ∃x.(Professor(x) ∧ Student(x))

∃x.((∃y.HasTutor(y, x)) ∧ Student(x))∃x.((∃y.TeachesTo(y, x)) ∧ Professor(x))∃x.((∃y.TeachesTo(x, y)) ∧ Student(x))∃x.((∃y.HasTutor(x, y)) ∧ Professor(x))

∃x.(A(x) ∧ Student(x))∃x.((∃y.TeachesTo(y, x)) ∧ A(x))∃x.((∃y.HasTutor(x, y)) ∧ A(x))

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 11/14

Page 22: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

3. Derive Meaningful Answers

Resolve A(Bill) with

∃x.(A(x) ∧ Student(x))∃x.((∃y.TeachesTo(y, x)) ∧ A(x))∃x.((∃y.HasTutor(x, y)) ∧ A(x))

and obtain

Student(Bill) TeachesTo(y, Bill) HasTutor(Bill, y)

Match found with TeachesTo(Mary, Bill)←.Since we also can derive HasTutor(Bill, Mary), we obtainhasKnownTutor(Bill).

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 12/14

Page 23: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

3. Derive Meaningful Answers

Resolve A(Bill) with

∃x.(A(x) ∧ Student(x))∃x.((∃y.TeachesTo(y, x)) ∧ A(x))∃x.((∃y.HasTutor(x, y)) ∧ A(x))

and obtain

Student(Bill) TeachesTo(y, Bill) HasTutor(Bill, y)

Match found with TeachesTo(Mary, Bill)←.Since we also can derive HasTutor(Bill, Mary), we obtainhasKnownTutor(Bill).

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 12/14

Page 24: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Properties

• Generalization of Oracles that now may return non-groundatoms

• Derivations using, e.g., ∃x.(Professor(x) ∧ Student(x))avoided for efficiency

• Well-founded MKNF semantics correspondence forconsistent KBs, otherwise paraconsistent approximation

• Tractable data complexity

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 13/14

Page 25: Querying OWL 2 QL and Non-monotonic Rulestranslectures.videolectures.net/.../iswc2011_knorr_rules_01.pdf · Querying OWL 2 QL and Non-monotonic Rules Matthias Knorr and José Júlio

Conclusions

• Tractable querying for seamless integration of DL-LiteRand non-monotonic rules

• Future work:• Implementation building on XSB and QuOnto/Mastro• Consider true conjunctive queries in our paraconsistent

setting

Matthias Knorr and José J. Alferes - CENTRIA, FCT/UNL Querying OWL 2 QL and Non-monotonic Rules 14/14