datalog based data access over ontology knowledge bases
play

Datalog-Based Data Access over Ontology Knowledge Bases Unit 4 - PowerPoint PPT Presentation

Datalog-Based Data Access over Ontology Knowledge Bases Unit 4 Systems Thomas Eiter Institut fr Informationsysteme, TU Wien ICCL Summer School 2013, August 29-30, 2013 Austrian Science Fund (FWF) grants P20841, P24090 1/36 Datalog over


  1. Datalog-Based Data Access over Ontology Knowledge Bases Unit 4 – Systems Thomas Eiter Institut für Informationsysteme, TU Wien ICCL Summer School 2013, August 29-30, 2013 Austrian Science Fund (FWF) grants P20841, P24090 1/36

  2. Datalog over Ontologies / Unit 4 1. Introduction Unit Outline 1. Introduction 2. Clipper 3. DReW – Datalog Rewriting System 4. Conclusion T. Eiter / TU Wien ICCL 2013 29/08/2013 2/36

  3. Datalog over Ontologies / Unit 4 1. Introduction Some Systems / Tools General queries can be reduced to Boolean queries: Q ( � X ) ❀ Q ( � c ) This is not much practical Systems handling non-ground queries, as in databases, are needed Predominant: rewriting to relational DBMS FO-Rewriting Systems Datalog-Rewriting Systems Q UONTO / P RESTO R EQUIEM / EL O WLGRES C LIPPER R EQUIEM / DL -Lite A SPIDE /OWL-2-DLVex, A SPIDE /R EQUIEM M OR ( dl -progs/ DL -Lite ) DReW ( dl -programs) T. Eiter / TU Wien ICCL 2013 29/08/2013 3/36

  4. Datalog over Ontologies / Unit 4 2. Clipper C LIPPER Reasoner C LIPPER is a reasoner for CQ answering over Horn- SHIQ ontologies Homepage: http://www.kr.tuwien.ac.at/research/systems/clipper at GitHub: https://github.com/ghxiao/clipper Based on Datalog rewriting (unit 3) Implemented in Java Ontology parser: OWL-API Datalog backend: DLV (inside C LIPPER ); Clingo may be used as well (compute rewriting, via command line) T. Eiter / TU Wien ICCL 2013 29/08/2013 4/36

  5. Datalog over Ontologies / Unit 4 2. Clipper Query Answering Algorithm Recall: three steps to construct Datalog program Algorithm Horn- SHIQ -CQ Input : normal Horn- SHIQ KB K = ( T , A ) , conjunctive query Q Output : query answers Ξ( T ) ← Saturate ( T ) ; rew T ( Q ) ← Rewrite ( Q , Ξ( T )) ; cr ( T ) ← CompletionRules ( T ) ; P ← A ∪ cr ( T ) ∪ rew T ( q ) ; u ) ∈ Datalog-eval ( P ) } ; ans ← { � u | q ( � ✄ call Datalog reasoner Note: recursive rules might occur in CR ( T ) predicate arities in P are bounded by 2. hence rewriting P is necessarily exponential in the worst case (unless E XP T IME = NP) T. Eiter / TU Wien ICCL 2013 29/08/2013 5/36

  6. Datalog over Ontologies / Unit 4 2. Clipper System Architecture ABox A P ← A ∪ cr ( T ) ∪ rew T ( q ) Ontology (2) Prepro- Saturation (4) O T Datalog cessing Engine P ans (3) (DLV, Query Clingo) w T ( Q ) Query Q (1) Q Prepro- e r Rewriting cessing (1) Conjunctive Query (3) Existential axioms in Ξ( T ) (2) Normalized TBox (4) Axioms cr T for ABox completion rules Version 0.1: CQs with simple roles only (no transitive roles) Use SPARQL syntax T. Eiter / TU Wien ICCL 2013 29/08/2013 6/36

  7. Datalog over Ontologies / Unit 4 2. Clipper Usage T. Eiter / TU Wien ICCL 2013 29/08/2013 7/36

  8. Datalog over Ontologies / Unit 4 2. Clipper Usage, cont’d T. Eiter / TU Wien ICCL 2013 29/08/2013 8/36

  9. Datalog over Ontologies / Unit 4 2. Clipper Properties Comparison with state-of-the-art systems P RESTO and R EQUIEM [E_ et al. 2012a,2012b] C LIPPER shows promising results Nice downscaling behavior, on less expressive ontologies (falling into DL -Lite ) Prototype with transitive roles may be available soon! Possible extensions (projected) • weakly DL-safe rules (algorithm developed, implementation pending) • other DLs, like regular EL ++ and Horn- SRIQ , datatypes • more expressive queries, like regular path queries Big issue: lack of realistic test cases! T. Eiter / TU Wien ICCL 2013 29/08/2013 9/36

  10. Datalog over Ontologies / Unit 4 3. DReW 3.1 Uniform Evaluation DReW System Loose Coupling - revisited Advantage: dl-atom 1 Ontology • clean semantics, can use legacy systems Rules • fairly easy to incorporate further knowledge formats dl-atom 2 Rule Ontology (e.g. RDF) Reasoner Reasoner Hybrid Reasoner • supportive to privacy, information hiding Drawback : impedance mismatch, performance • dl -program evaluation needs multiple calls of a dl -reasoner • Calls are expensive ∗ optimizations (caching, pruning ...) • exponentially many calls may be unavoidable • Even polynomially many calls might be too costly T. Eiter / TU Wien ICCL 2013 29/08/2013 10/36

  11. Datalog over Ontologies / Unit 4 3. DReW 3.1 Uniform Evaluation Uniform Evaluation Method Convert the evaluation problem into one for a single reasoning engine Logic L L -formulas Reasoner Transform dl-program Π into an (equivalent) knowledge base in formalism L for evaluation ( uniform evaluation ) • L = FO Logic (SQL): MOR ; acyclic Π over DL -Lite , using an RDBMS • L = Datalog ¬ : DReW ; Π over Datalog-rewritable ontologies Note: uniform evaluation is different from tight integration in a unifying logic T. Eiter / TU Wien ICCL 2013 29/08/2013 11/36

  12. Datalog over Ontologies / Unit 4 3. DReW 3.1 Uniform Evaluation Issues “Uniform Evaluation” raises some issues: 1) Cost of a transformation . E.g., • Reduction of CQs over DL-Lite ontologies to first-order (FO) Logic [Calvanese et al. , 2007] non-recursive Datalog [Gottlob and Schwentick, 2011], [Kontchakov et al. , 2010] • Reduction of SHIQ to D ATALOG ∨ [Hustadt et al. , 2007]. 2) Existence of a transformation (possibly under constraints) • Embedding of a formalism into another • Properties (e.g. modularity [Janhunen, 1999]) • Embedding of dl -programs e.g. into MKNF [Motik and Rosati, 2010], Equilibrium Logic [Fink and Pearce, 2010] 3) Complexity of the target formalism 4) Feasibility of transformations for practical concerns T. Eiter / TU Wien ICCL 2013 29/08/2013 12/36

  13. Datalog over Ontologies / Unit 4 3. DReW 3.2 Reasoning via Datalog Rewriting Uniform Datalog Evaluation of dl -Programs Idea: for Datalog-rewritable ontologies, we may replace dl -atoms c ) with Datalog programs evaluating the atoms DL [ λ ; Q ]( � the result is computed in an atom Q λ ( � c ) rewrite the dl -rules to ordinary rules, by replacing dl -atoms evaluate the resulting logic program using a Datalog engine / ASP solver Important: uniform query rewriting, must work for all λ Demonstrate the method on the Network example T. Eiter / TU Wien ICCL 2013 29/08/2013 13/36

  14. Datalog over Ontologies / Unit 4 3. DReW 3.2 Reasoning via Datalog Rewriting Network Example Ontology O : Π = ( O , P ) ≥ 1 . wired ⊑ Node ⊤ ⊑ ∀ wired . Node x 1 ? n 1 wired = wired − ; X n 5 n 1 � = n 2 � = n 3 � = n 4 � = n 5 n 2 wired ( n 1 , n 2 ) wired ( n 2 , n 3 ) wired ( n 2 , n 4 ) wired ( n 2 , n 5 ) wired ( n 3 , n 4 ) wired ( n 3 , n 5 ) . n 4 ≥ 4 . wired ⊑ HighTrafficNode n 3 x 2 ? newnode ( x 1 ) . newnode ( x 2 ) . Rules P overloaded ( X ) ← DL [ wired ⊎ connect ; HighTrafficNode ]( X ) . connect ( X , Y ) ← newnode ( X ) , DL [ Node ]( Y ) , not overloaded ( Y ) , not excl ( X , Y ) . excl ( X , Y ) ← connect ( X , Z ) , DL [ Node ]( Y ) , Y � = Z . excl ( X , Y ) ← connect ( Z , Y ) , newnode ( Z ) , newnode ( X ) , Z � = X . excl ( x 1 , n 4 ) . T. Eiter / TU Wien ICCL 2013 29/08/2013 14/36

  15. Datalog over Ontologies / Unit 4 3. DReW 3.2 Reasoning via Datalog Rewriting Network Example, cont’d 1. Rewriting the ontology The DL component O is in OWL 2 RL resp. LDL + , which is Datalog-rewritable (so are the dl -atoms). We transform O to the Datalog program Φ LDL + ( O ) : wired − ( Y , X ) ← wired ( X , Y ) wired ( Y , X ) ← wired − ( X , Y ) ⊤ ( X ) ← wired ( X , Y ) ⊤ ( Y ) ← wired ( X , Y ) ⊤ ( X ) ← wired − ( X , Y ) ⊤ ( Y ) ← wired − ( X , Y ) % axiom ≥ 1 . wired ⊑ Node Node ( Y ) ← wired ( X , Y ) % axiom ⊤ ⊑ ∀ wired . Node Node ( Y ) ← wired ( X , Y ) , ⊤ ( X ) % axiom ≥ 4 . wired ⊑ HighTrafficNode HighTrafficNode ( X ) ← wired ( X , Y 1 ) , wired ( X , Y 2 ) , wired ( X , Y 3 ) , wired ( X , Y 4 ) , Y 1 � = Y 2 , Y 1 � = Y 3 , . . . , Y 3 � = Y 4 . wired ( n 1 , n 2 ) wired ( n 2 , n 3 ) wired ( n 2 , n 4 ) , wired ( n 2 , n 5 ) . wired ( n 3 , n 4 ) . wired ( n 3 , n 5 ) . T. Eiter / TU Wien ICCL 2013 29/08/2013 15/36

  16. Datalog over Ontologies / Unit 4 3. DReW 3.2 Reasoning via Datalog Rewriting Network Example, cont’d 2. Duplicating for dl -inputs dl -atoms in Π : DL [ Node ]( Y ) , DL [ wired ⊎ connect ; HighTrafficNode ]( X ) the dl -queries in are just instance queries, so given by Node ( Y ) resp. HighTrafficNode ( X ) Each DL-atom sends up a different input λ to O and so entailments for the λ ’s might be different. To this purpose, we copy Φ LDL + ( O ) to new disjoint equivalent versions for each DL-input λ For the set Λ P = { λ 1 = ǫ, λ 2 = wired ⊎ connect } , we have • Φ LDL + ,λ 1 ( O ) = { Node λ 1 ( X ) ← wired λ 1 ( X , Y ) , . . . } and • Φ LDL + ,λ 2 ( O ) = { Node λ 2 ( X ) ← wired λ 2 ( X , Y ) , . . . } T. Eiter / TU Wien ICCL 2013 29/08/2013 16/36

  17. Datalog over Ontologies / Unit 4 3. DReW 3.2 Reasoning via Datalog Rewriting Network Example, cont’d 3. Rewriting dl -rules to ordinary rules To rewrite DL-rules P into ordinary rules P ord , we simply replace each DL-atom DL [ λ ; Q ]( t ) by a new atom Q λ ( t ) . � � P ord newnode ( x 1 ) . newnode ( x 2 ) . overloaded ( X ) ← HighTrafficNode λ 2 ( X ) . connect ( X , Y ) ← newnode ( X ) , Node λ 1 ( Y ) , not overloaded ( Y ) , not excl ( X , Y ) . excl ( X , Y ) ← connect ( X , Z ) , Node λ 1 ( Y ) , Y � = Z . excl ( X , Y ) ← connect ( Z , Y ) , newnode ( Z ) , newnode ( X ) , Z � = X . excl ( x 1 , n 4 ) . T. Eiter / TU Wien ICCL 2013 29/08/2013 17/36

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend