skip to main content
research-article

Query Rewriting and Optimization for Ontological Databases

Published:07 October 2014Publication History
Skip Abstract Section

Abstract

Ontological queries are evaluated against a knowledge base consisting of an extensional database and an ontology (i.e., a set of logical assertions and constraints that derive new intensional knowledge from the extensional database), rather than directly on the extensional database. The evaluation and optimization of such queries is an intriguing new problem for database research. In this article, we discuss two important aspects of this problem: query rewriting and query optimization. Query rewriting consists of the compilation of an ontological query into an equivalent first-order query against the underlying extensional database. We present a novel query rewriting algorithm for rather general types of ontological constraints that is well suited for practical implementations. In particular, we show how a conjunctive query against a knowledge base, expressed using linear and sticky existential rules, that is, members of the recently introduced Datalog± family of ontology languages, can be compiled into a union of conjunctive queries (UCQ) against the underlying database. Ontological query optimization, in this context, attempts to improve this rewriting process soas to produce possibly small and cost-effective UCQ rewritings for an input query.

Skip Supplemental Material Section

Supplemental Material

References

  1. Serge Abiteboul, Richard Hull, and Victor Vianu. 1995. Foundations of Databases. Addison-Wesley. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Andrea Acciarri, Diego Calvanese, Giuseppe De Giacomo, Domenico Lembo, Maurizio Lenzerini, Mattia Palmieri, and Riccardo Rosati. 2005. QuOnto: Querying ontologies. In Proceedings of the 20th National Conference on Artificial Intelligence and the 17th Innovative Applications of Artificial Intelligence Conference. 1670--1671. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Miklos Ajtai and Yuri Gurevich. 1989. Datalog vs. first-order logic. In Proceedings of the 30th Annual Symposium on Foundations of Computer Science. 142--147. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Hajnal Andreka, Johan van Benthem, and Istvan Nemeti. 1998. Modal languages and bounded fragments of predicate logic. J. Philos. Logic 27, 217--274.Google ScholarGoogle ScholarCross RefCross Ref
  5. Franz Baader. 2003. Least common subsumers and most specific concepts in a description logic with existential restrictions and terminological cycles. In Proceedings of the 18th International Joint Conference on Artificial Intelligence. 319--324. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Franz Baader, Diego Calvanese, Deborah L. McGuinness, Daniele Nardi, and Peter F. Patel-Schneider, Eds. 2003. The Description Logic Handbook: Theory, Implementation, and Applications. Cambridge University Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Jean-Francois Baget, Michel Leclere, Marie-Laure Mugnier, and Eric Salvat. 2011. On rules with existential variables: Walking the decidability line. Artif. Intell. 175, 9--10, 1620--1654. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Catriel Beeri and Moshe Y. Vardi. 1981. The implication problem for data dependencies. In Proceedings of the 8th International Colloquium on Automata, Languages and Programming. 73--85. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Michael Benedikt, Balder Ten Cate, and Efthymia Tsamoura. 2014. Generating low-cost plans from proofs. In Proceedings of the 33rd ACM Symposium on Principles of Database Systems. 200--211. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Barry Bishop and Florian Fischer. 2008. IRIS - Integrated rule inference system. In Proceedings of the International Workshop on Advancing Reasoning on the Web: Scalability and Commonsense.Google ScholarGoogle Scholar
  11. Philip Bohannon, Eiman Elnahrawy, Wenfei Fan, and Michael Flaster. 2006. Putting context into schema matching. In Proceedings of the 32nd International Conference on Very Large Data Bases. 307--318. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Loreto Bravo, Wenfei Fan, and Shuai Ma. 2007. Extending dependencies with conditions. In Proceedings of the 33rd International Conference on Very Large Data Bases. 243--254. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Andrea Cali, Domenico Lembo, and Riccardo Rosati. 2003. Decidability and complexity of query answering over incosistent and incomplete databases. In Proceedings of the 22nd ACM Symposium on Principles of Database Systems. 260--271. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Andrea Cali, Georg Gottlob, and Michael Kifer. 2008. Taming the infinite chase: Query answering under expressive relational constraints. In Proceedings of the 11th International Conference on Principles of Knowledge Representation and Reasoning. 70--80.Google ScholarGoogle Scholar
  15. Andrea Cali, Georg Gottlob, Thomas Lukasiewicz, and Andreas Pieris. 2011. A logical toolbox for ontological reasoning. SIGMOD Rec. 40, 3, 5--14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Andrea Cali, Georg Gottlob, and Thomas Lukasiewicz. 2012a. A general Datalog-based framework for tractable query answering over ontologies. J. Web Semant. 14, 57--83. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Andrea Cali, Georg Gottlob, and Andreas Pieris. 2012b. Towards more expressive ontology languages: The query answering problem. Artif. Intell. 193, 87--128. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Andrea Cali, Georg Gottlob, and Michael Kifer. 2013. Taming the infinite chase: Query answering under expressive relational constraints. J. Artif. Intell. Res. 48, 115--174. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Diego Calvanese, Giuseppe De Giacomo, Domenico Lembo, Maurizio Lenzerini, and Riccardo Rosati. 2007. Tractable reasoning and efficient query answering in description logics: The DL-Lite family. J. Autom. Reason. 39, 3, 385--429. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Diego Calvanese, Giuseppe De Giacomo, Domenico Lembo, Maurizio Lenzerini, and Riccardo Rosati. 2013a. Data complexity of query answering in description logics. Artif. Intell. 195, 335--360. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Diego Calvanese, Giuseppe De Giacomo, Domenico Lembo, Maurizio Lenzerini, and Riccardo Rosati. 2013b. Data complexity of query answering in description logics. Artif. Intell. 195, 335--360. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Ashok K. Chandra and Philip M. Merlin. 1977. Optimal implementation of conjunctive queries in relational data bases. In Proceedings of the 9th Annual ACM Symposium on Theory of Computing. 77--90. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Ashok K. Chandra and Moshe Y. Vardi. 1985. The implication problem for functional and inclusion dependencies. SIAM J. Comput. 14, 671--677.Google ScholarGoogle ScholarCross RefCross Ref
  24. Chandra Chekuri and Anand Rajaraman. 2000. Conjunctive query containment revisited. Theor. Comput. Sci. 239, 2, 211--229. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Alexandros Chortaras, Despoina Trivela, and Giorgos B. Stamou. 2011. Optimized query rewriting for owl 2 ql. In Proceedings of the 23rd International Conference on Automated Deduction. 192--206. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Carlo Curino, Hyun Jin Moon, Alin Deutsch, and Carlo Zaniolo. 2013. Automating the database schema evolution process. VLDB J. 22, 1, 73--98. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Alin Deutsch, Alan Nash, and Jeff B. Remmel. 2008. The chase revisisted. In Proceedings of the 27th ACM Symposium on Principles of Database Systems. 149--158. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Alin Deutsch, Lucian Popa, and Val Tannen. 1999. Physical data independence, constraints, and optimization with universal plans. In Proceedings of the 25th International Conference on Very Large Data Bases. 459--470. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Alin Deutsch and Val Tannen. 2003. MARS: A system for publishing xml from mixed and redundant storage. In Proceedings of the 29th International Conference on Very Large Data Bases. 201--212. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Ronald Fagin, Phokion G. Kolaitis, Renee J. Miller, and Lucian Popa. 2005. Data exchange: Semantics and query answering. Theor. Comput. Sci. 336, 1, 89--124. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Haim Gaifman, Harry G. Mairson, Yehoshua Sagiv, and Moshe Y. Vardi. 1993. Undecidable optimization problems for database logic programs. J. ACM 40, 3, 683--713. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Georg Gottlob, Stanislav Kikot, Roman Kontchakov, Vladimir Podolskii, Thomas Schwentick, and Michael Zakharyaschev. 2014. The price of query rewriting in ontology-based data access. Artif. Intell. 213, 42--59.Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Georg Gottlob, Nicola Leone, and Francesco Scarcello. 2002. Hypertree decompositions and tractable queries. J. Comput. Syst. Sci. 64, 3, 579--627. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Georg Gottlob, Giorgio Orsi, and Andreas Pieris. 2011. Ontological queries: Rewriting and optimization. In Proceedings of the 27th International Conference on Data Engineering. 2--13. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Georg Gottlob and Thomas Schwentick. 2012. Rewriting ontological queries into small nonrecursive datalog programs. In Proceedings of the 13th International Conference on Principles of Knowledge Representation and Reasoning.Google ScholarGoogle Scholar
  36. Alon Y. Halevy. 2001. Answering queries using views: A survey. VLDB J. 10, 4, 270--294. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Martha Imprialou, Giorgos Stoilos, and Bernardo Cuenca Grau. 2012. Benchmarking ontology-based query rewriting systems. In Proceedings of the 26th AAAI Conference on Artificial Intelligence. 779--785.Google ScholarGoogle Scholar
  38. David S. Johnson and Anthony C. Klug. 1984. Testing containment of conjunctive queries under functional and inclusion dependencies. J. Comput. Syst. Sci. 28, 1, 167--189.Google ScholarGoogle ScholarCross RefCross Ref
  39. Stanislav Kikot, Roman Kontchakov, and Michael Zakharyaschev. 2012a. Conjunctive query answering with OWL 2 QL. In Proceedings of the 13th International Conference on Principles of Knowledge Representation and Reasoning.Google ScholarGoogle Scholar
  40. Stanislav Kikot, Roman Kontchakov, Vladimir V. Podolskii, and Michael Zakharyaschev. 2012b. Exponential lower bounds and separation for query rewriting. In Proceedings of the 39th International Colloquium on Automata, Languages and Programming. 263--274. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Melanie Konig, Michel LeClere, Marie-Laure Mugnier, and Michael Thomazo. 2012. A sound and complete backward chaining algorithm for existential rules. In Proceedings of the 6th International Conference on Web Reasoning and Rule Systems. 122--138. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Melanie Konig, Michel LeClere, Marie-Laure Mugnier, and Michael Thomazo. 2013. On the exploration of the query rewriting space with existential rules. In Proceedings of the 7th International Conference on Web Reasoning and Rule Systems. 123--137. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Markus Krotzsch and Sebastian Rudolph. 2011. Extending decidable existential rules by joining acyclicity and guardedness. In Proceedings of the 22nd International Joint Conference on Artificial Intelligence. 963--968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. David Maier, Alberto O. Mendelzon, and Yehoshua Sagiv. 1979. Testing implications of data dependencies. ACM Trans. Database Syst. 4, 4, 455--469. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Giorgio Orsi and Andreas Pieris. 2011. Optimizing query answering under ontological constraints. Proc. VLDB Endow. 4, 11, 1004--1015.Google ScholarGoogle Scholar
  46. Christos. H. Papadimitriou. 1994. Computational Complexity. Addison-Wesley.Google ScholarGoogle Scholar
  47. Hector Perez-Urbina, Boris Motik, and Ian Horrocks. 2010. Tractable query answering and rewriting under description logic constraints. J. Appl. Logic 8, 2, 186--209.Google ScholarGoogle ScholarCross RefCross Ref
  48. Antonella Poggi, Domenico Lembo, Diego Calvanese, Giuseppe De Giacomo, Maurizio Lenzerini, and Riccardo Rosati. 2008. Linking data to ontologies. J. Data Semant. 10, 133--173. Google ScholarGoogle ScholarCross RefCross Ref
  49. Mariano Rodriguez-Muro and Diego Calvanese. 2012. Quest, an OWL 2 QL reasoner for ontology-based data access. In Proceedings of the OWL: Experiences and Directions Workshop.Google ScholarGoogle Scholar
  50. Riccardo Rosati and Alessandro Almatelli. 2010. Improving query answering over dl-lite ontologies. In Proceedings of the 12th International Conference on Principles of Knowledge Representation and Reasoning.Google ScholarGoogle Scholar
  51. Sebastian Rudolph, Markus Krotzsch, and Pascal Hitzler. 2008. All elephants are bigger than all mice. In Proceedings of the 21st International Workshop on Description Logics.Google ScholarGoogle Scholar
  52. Balder Ten Cate and Phokion G. Kolaitis. 2009. Structural characterizations of schema-mapping languages. In Proceedings of the 12th International Conference on Database Theory. 63--72. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Michael Thomazo. 2013. Compact rewritings for existential rules. In Proceedings of the 23rd International Joint Conference on Artificial Intelligence. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Moshe Y. Vardi. 1995. On the complexity of bounded-variable queries. In Proceedings of the 14th ACM Symposium on Principles of Database Systems. 266--276. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Tassos Venetis, Giorgos Stoilos, and Giorgos Stamou. 2013. Query extensions and incremental query rewriting for OWL 2 QL ontologies. J. Data Semant. 3, 1, 1--23.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Query Rewriting and Optimization for Ontological Databases

                  Recommendations

                  Comments

                  Login options

                  Check if you have access through your login credentials or your institution to get full access on this article.

                  Sign in

                  Full Access

                  • Published in

                    cover image ACM Transactions on Database Systems
                    ACM Transactions on Database Systems  Volume 39, Issue 3
                    September 2014
                    264 pages
                    ISSN:0362-5915
                    EISSN:1557-4644
                    DOI:10.1145/2676651
                    Issue’s Table of Contents

                    Copyright © 2014 ACM

                    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                    Publisher

                    Association for Computing Machinery

                    New York, NY, United States

                    Publication History

                    • Published: 7 October 2014
                    • Accepted: 1 June 2014
                    • Revised: 1 April 2014
                    • Received: 1 October 2013
                    Published in tods Volume 39, Issue 3

                    Permissions

                    Request permissions about this article.

                    Request Permissions

                    Check for updates

                    Qualifiers

                    • research-article
                    • Research
                    • Refereed

                  PDF Format

                  View or Download as a PDF file.

                  PDF

                  eReader

                  View online with eReader.

                  eReader