Rules and Ontology Based Data Access

  • Guohui Xiao
  • Martin Rezk
  • Mariano Rodríguez-Muro
  • Diego Calvanese
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8741)


In OBDA an ontology defines a high level global vocabulary for user queries, and such vocabulary is mapped to (typically relational) databases. Extending this paradigm with rules, e.g., expressed in SWRL or RIF, boosts the expressivity of the model and the reasoning ability to take into account features such as recursion and n-ary predicates. We consider evaluation of SPARQL queries under rules with linear recursion, which in principle is carried out by a 2-phase translation to SQL: (1) The SPARQL query, together with the RIF/SWRL rules, and the mappings is translated to a Datalog program, possibly with linear recursion; (2) The Datalog program is converted to SQL by using recursive common table expressions. Since a naive implementation of this translation generates inefficient SQL code, we propose several optimisations to make the approach scalable. We implement and evaluate the techniques presented here in the Ontop system. To the best of our knowledge, this results in the first system supporting all of the following W3C standards: the OWL 2 QL ontology language, R2RML mappings, SWRL rules with linear recursion, and SPARQL queries. The preliminary but encouraging experimental results on the NPD benchmark show that our approach is scalable, provided optimisations are applied.


Resource Description Framework SPARQL Query Triple Pattern Resource Description Framework Graph Datalog Program 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aho, A.V., Ullman, J.D.: The universality of data retrieval languages. In: Proc. of the 6th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages (POPL 1979), pp. 110–120 (1979)Google Scholar
  2. 2.
    Artale, A., Calvanese, D., Kontchakov, R., Zakharyaschev, M.: The DL-Lite family and relations. J. of Artificial Intelligence Research 36, 1–69 (2009)zbMATHMathSciNetGoogle Scholar
  3. 3.
    Bienvenu, M., Ortiz, M., Simkus, M., Xiao, G.: Tractable queries for lightweight description logics. In: Proc. of the 23rd Int. Joint Conf. on Artificial Intelligence (IJCAI 2013). IJCAI/AAAI (2013)Google Scholar
  4. 4.
    Boley, H., Kifer, M.: A guide to the basic logic dialect for rule interchange on the Web. IEEE Trans. on Knowledge and Data Engineering 22(11), 1593–1608 (2010)CrossRefGoogle Scholar
  5. 5.
    Calvanese, D., De Giacomo, G., Lembo, D., Lenzerini, M., Poggi, A., Rodriguez-Muro, M., Rosati, R.: Ontologies and databases: The DL-Lite approach. In: Tessaris, S., Franconi, E., Eiter, T., Gutierrez, C., Handschuh, S., Rousset, M.-C., Schmidt, R.A. (eds.) Reasoning Web. LNCS, vol. 5689, pp. 255–356. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  6. 6.
    Calvanese, D., De Giacomo, G., Lembo, D., Lenzerini, M., Rosati, R.: Tractable reasoning and efficient query answering in description logics: The DL-Lite family. J. of Automated Reasoning 39(3), 385–429 (2007)CrossRefzbMATHGoogle Scholar
  7. 7.
    Calvanese, D., Lanti, D., Rezk, M., Slusnys, M., Xiao, G.: Data generation for OBDA systems benchmarks. In: Proc. of The 3rd OWL Reasoner Evaluation Workshop (ORE 2014). (2014)Google Scholar
  8. 8.
    Das, S., Sundara, S., Cyganiak, R.: R2RML: RDB to RDF mapping language. W3C Recommendation, World Wide Web Consortium (September 2012),
  9. 9.
    Eiter, T., Ortiz, M., Simkus, M., Tran, T.K., Xiao, G.: Query rewriting for Horn-SHIQ plus rules. In: Proc. of the 26th AAAI Conf. on Artificial Intelligence (AAAI 2012). AAAI Press (2012)Google Scholar
  10. 10.
    Glimm, B., Ogbuji, C.: SPARQL 1.1 Entailment Regimes. W3C Recommendation, World Wide Web Consortium (March 2013),
  11. 11.
    Harris, S., Seaborne, A.: SPARQL 1.1 Query Language. W3C Recommendation, World Wide Web Consortium (March 2013),
  12. 12.
    Kifer, M., Boley, H.: RIF Overview (Second Edition). W3C working group note 5 February 2013, World Wide Web Consortium (2013),
  13. 13.
    Kontchakov, R., Lutz, C., Toman, D., Wolter, F., Zakharyaschev, M.: The combined approach to ontology-based data access. In: Proc. of the 22nd Int. Joint Conf. on Artificial Intelligence (IJCAI 2011), pp. 2656–2661 (2011)Google Scholar
  14. 14.
    Lloyd, J.W.: Foundations of Logic Programming, 2nd Extended edn. Springer, Heidelberg (1987)Google Scholar
  15. 15.
    Manola, F., Mille, E.: RDF primer. W3C Recommendation, World Wide Web Consortium (February 2004),
  16. 16.
    Pérez-Urbina, H., Motik, B., Horrocks, I.: Tractable query answering and rewriting under description logic constraints. J. of Applied Logic 8(2), 186–209 (2010)CrossRefzbMATHGoogle Scholar
  17. 17.
    Poggi, A., Lembo, D., Calvanese, D., De Giacomo, G., Lenzerini, M., Rosati, R.: Linking data to ontologies. J. on Data Semantics X, 133–173 (2008)Google Scholar
  18. 18.
    Polleres, A.: From SPARQL to rules (and back). In: Proc. of the 16th Int. World Wide Web Conf. (WWW 2007), pp. 787–796 (2007)Google Scholar
  19. 19.
    Polleres, A., Wallner, J.P.: On the relation between SPARQL 1.1 and Answer Set Programming. J. of Applied Non-Classical Logics 23(1-2), 159–212 (2013)CrossRefMathSciNetGoogle Scholar
  20. 20.
    Rodríguez-Muro, M., Calvanese, D.: Dependencies: Making ontology based data access work in practice. In: Proc. of the 5th Alberto Mendelzon Int. Workshop on Foundations of Data Management (AMW 2011). CEUR Electronic Workshop Proceedings, vol. 749 (2011),
  21. 21.
    Rodriguez-Muro, M., Calvanese, D.: High performance query answering over DL-Lite ontologies. In: Proc. of the 13th Int. Conf. on the Principles of Knowledge Representation and Reasoning (KR 2012), pp. 308–318 (2012)Google Scholar
  22. 22.
    Rodríguez-Muro, M., Kontchakov, R., Zakharyaschev, M.: Ontology-based data access: Ontop of databases. In: Alani, H., et al. (eds.) ISWC 2013, Part I. LNCS, vol. 8218, pp. 558–573. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  23. 23.
    Rodriguez-Muro, M., Rezk, M.: Efficient SPARQL-to-SQL with R2RML mappings. Tech. rep., Free University of Bozen-Bolzano (January 2014),

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Guohui Xiao
    • 1
  • Martin Rezk
    • 1
  • Mariano Rodríguez-Muro
    • 2
  • Diego Calvanese
    • 1
  1. 1.Faculty of Computer ScienceFree University of Bozen-BolzanoItaly
  2. 2.IBM Watson Research CenterUSA

Personalised recommendations