Using the TBox to Optimise SPARQL Queries
description
Transcript of Using the TBox to Optimise SPARQL Queries
![Page 1: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/1.jpg)
Using the TBox to Optimise SPARQL Queries
Birte GlimmYevgeny Kazakov
Ilianna Kolliaand Giorgos Stamou
CS 848 Paper CritiqueVishnu Prathish
![Page 2: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/2.jpg)
Preliminaries
• Description Logic SHIQ • Notations:
• A concept atom is an expression A(x) and a role atom is an expression r(x, y)
• Concept axiom templates and role axiom templates
![Page 3: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/3.jpg)
Conjunctive Instance and Complex Queries
• A conjunctive instance query q is a non-empty set of (concept or role) atoms.
• concept templates - set of SHIQ concepts, where a concept variable can be used in place of a concept name, and a role variable in place of a role name.
• Axiom templates – – role axiom template where – Concept axiom template has the form with c, d concept templates.
• A finite set of role axiom templates, concept axiom templates, and (concept or role) atoms is called a complex query
• Var(q) - set of variables in q. and |Var(q)| is called the arity of q.
![Page 4: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/4.jpg)
Key Contributions
• An optimization that is applicable to conjunctive instance queries. We show that one can compute an equivalent query qˆ for a given query q by replacing the variables in q with fresh individual names. Then perform realization.
• Query optimization exploiting the polarity of variable occurrences in the query and the concept and role hierarchies.
![Page 5: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/5.jpg)
Mapping functions and answers to query
Mapping function:
A mapping function is a certain answer for q if,
denotes all the set of certain answers of q
![Page 6: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/6.jpg)
Query Answering Via Approximate Instance retrieval
• Using approximate reasoning algorithms to answer query
• Either Sound and incomplete or Incomplete and Sound
• Rewrite the KB into a simpler logic and run query over it to obtain desired level of approximation
![Page 7: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/7.jpg)
Approximate Instance Retrieval and Query answering algorithms
![Page 8: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/8.jpg)
Example
![Page 9: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/9.jpg)
intersecQans
![Page 10: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/10.jpg)
intersecQans Algorithm
![Page 11: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/11.jpg)
Restricting atomsA query atom restricts restricts a query if,
Eg: B(x) in the example explained.
• To preserve certain answers, we should use restricting atoms that do not change the answers of q.
• Can be used to prune set of possible answers of query
![Page 12: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/12.jpg)
Query Extension
• Find a way of computing restricting atoms• Based on chase technique in relational database
theory• Basic Idea:– For a Abox ,Query and a bijective function, – Compute(rewrite) an extended ABox and Query (using
chase )– Using approx. inst. retrieval algo., check if any atom of the
new query restricts the initial query – Reduce the set of possible answers using query restriction
![Page 13: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/13.jpg)
Polarity Based optimization
• Choose the next binding to test by traversing the concept hierarchy top down
• Based on the polarity of concept variable in the query the concept hierarchy can be safely pruned.
• Can not be used when a variable occurs both positively and negatively
![Page 14: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/14.jpg)
Algorithm to get possible concept variable mapping
![Page 15: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/15.jpg)
Evaluation
• On custom set of queries based on GALEN (Biomedical KB – SHIF expressivity) FBbt_XP ontology (SHI)
• Sys Config: Mac OS X Lion machine with a 2.53 GHz Intel Core i7 processor and Java 1.6 allowing 1GB of Java heap space.
![Page 16: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/16.jpg)
Results GALEN Queries
![Page 17: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/17.jpg)
Results FBbt XP Queries
![Page 18: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/18.jpg)
Conclusion
• A TBOX based optimization of SPARQL queries• Equivalent queries which can be exploited to
produce reduce the set of mapping for conjunctive queries
• Polarity based pruning for queries that go beyond conjunctive queries
• Evaluation which shows that this optimization can reduce key evaluation times upto two orders of magnitude.
![Page 19: Using the TBox to Optimise SPARQL Queries](https://reader036.fdocuments.us/reader036/viewer/2022062521/56816881550346895ddef9ff/html5/thumbnails/19.jpg)
Thank you!