OBDA: Query Rewriting or Materialization? In Practice, Both!

  • Juan F. Sequeda
  • Marcelo Arenas
  • Daniel P. Miranker
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8796)


Given a source relational database, a target OWL ontology and a mapping from the source database to the target ontology, Ontology-Based Data Access (OBDA) concerns answering queries over the target ontology using these three components. This paper presents the development of UltrawrapOBDA, an OBDA system comprising bidirectional evaluation; that is, a hybridization of query rewriting and materialization. We observe that by compiling the ontological entailments as mappings, implementing the mappings as SQL views and materializing a subset of the views, the underlying SQL optimizer is able to reduce the execution time of a SPARQL query by rewriting the query in terms of the views specified by the mappings. To the best of our knowledge, this is the first OBDA system supporting ontologies with transitivity by using SQL recursion. Our contributions include: (1) an efficient algorithm to compile ontological entailments as mappings; (2) a proof that every SPARQL query can be rewritten into a SQL query in the context of mappings; (3) a cost model to determine which views to materialize to attain the fastest execution time; and (4) an empirical evaluation comparing with a state-of-the-art OBDA system, which validates the cost model and demonstrates favorable execution times.


Execution Time Relational Database Inference Rule Cost Model SPARQL Query 
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.
    Allemang, D., Hendler, J.: Semantic Web for the Working Ontologist: Effective Modeling in RDFS and OWL. Morgan Kaufmann Publishers Inc. (2008)Google Scholar
  2. 2.
    Angles, R., Gutierrez, C.: The expressive power of sparql. In: Sheth, A.P., Staab, S., Dean, M., Paolucci, M., Maynard, D., Finin, T., Thirunarayan, K. (eds.) ISWC 2008. LNCS, vol. 5318, pp. 114–129. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  3. 3.
    Arenas, M., Barceló, P., Libkin, L., Murlak, F.: Foundations of Data Exchange. Cambridge University Press (2014)Google Scholar
  4. 4.
    Arenas, M., Bertails, A., Prud’hommeaux, E., Sequeda, J.: Direct mapping of relational data to RDF. W3C Recomendation (September 27, 2012)Google Scholar
  5. 5.
    Baader, F., Calvanese, D., McGuinness, D.L., Nardi, D., Patel-Schneider, P.F. (eds.): The Description Logic Handbook. Cambridge University Press (2003)Google Scholar
  6. 6.
    Bizer, C., Schultz, A.: The berlin sparql benchmark. Int. J. Semantic Web Inf. Syst. 5(2), 1–24 (2009)CrossRefGoogle Scholar
  7. 7.
    Brickley, D., Guha, R.: RDF vocabulary description language 1.0: RDF schema. W3C recommendation (February 2004)Google Scholar
  8. 8.
    Calvanese, D., De Giacomo, G., Lembo, D., Lenzerini, M., Rosati, R.: Data complexity of query answering in description logics. Artif. Intell. 195, 335–360 (2013)CrossRefzbMATHGoogle Scholar
  9. 9.
    Chebotko, A., Lu, S., Fotouhi, F.: Semantics preserving sparql-to-sql translation. Data Knowl. Eng. 68(10), 973–1000 (2009)CrossRefGoogle Scholar
  10. 10.
    Dantsin, E., Eiter, T., Gottlob, G., Voronkov, A.: Complexity and expressive power of logic programming. ACM Comput. Surv. 33(3), 374–425 (2001)CrossRefGoogle Scholar
  11. 11.
    Das, S., Sundara, S., Cyganiak, R.: R2RML: RDB to RDF mapping language. W3C Recomendation (September 27, 2012)Google Scholar
  12. 12.
    DeWitt, D.J.: The wisconsin benchmark: Past, present, and future. In: The Benchmark Handbook, pp. 119–165 (1991)Google Scholar
  13. 13.
    Gupta, A., Mumick, I.S.: Materialized Views: Techniques, Implementations, and Applications. MIT Press (1999)Google Scholar
  14. 14.
    Halevy, A.Y.: Answering queries using views: A survey. VLDB J. 10(4), 270–294 (2001)CrossRefzbMATHGoogle Scholar
  15. 15.
    Lenzerini, M.: Data integration: A theoretical perspective. In: PODS, pp. 233–246 (2002)Google Scholar
  16. 16.
    Lutz, C., Seylan, İ., Toman, D., Wolter, F.: The combined approach to OBDA: Taming role hierarchies using filters. In: Alani, H., et al. (eds.) ISWC 2013, Part I. LNCS, vol. 8218, pp. 314–330. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  17. 17.
    Motik, B., Grau, B.C., Horrocks, I., Wu, Z., amd Carsten Lutz, A.F.: OWL 2 web ontology language profiles, 2nd edn. W3C recommendation (December 2012)Google Scholar
  18. 18.
    Muñoz, S., Pérez, J., Gutierrez, C.: Simple and efficient minimal RDFS. J. Web Sem. 7(3), 220–234 (2009)Google Scholar
  19. 19.
    Ortiz, M., Šimkus, M.: Reasoning and query answering in description logics. In: Eiter, T., Krennwallner, T. (eds.) Reasoning Web 2012. LNCS, vol. 7487, pp. 1–53. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  20. 20.
    Pérez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. ACM Trans. Database Syst. 34(3) (2009)Google Scholar
  21. 21.
    Pinto, F.D., Lembo, D., Lenzerini, M., Mancini, R., Poggi, A., Rosati, R., Ruzzi, M., Savo, D.F.: Optimizing query rewriting in ontology-based data access. In: EDBT (2013)Google Scholar
  22. 22.
    Poggi, A., Lembo, D., Calvanese, D., Giacomo, G.D., Lenzerini, M., Rosati, R.: Linking data to ontologies. J. Data Semantics 10, 133–173 (2008)Google Scholar
  23. 23.
    Prud’hommeaux, E., Seaborne, A.: SPARQL query language for RDF. W3C Recommendation (January 15, 2008),
  24. 24.
    Rodríguez-Muro, M., Calvanese, D.: Dependencies: Making ontology based data access work in practice. In: AMW (2011)Google Scholar
  25. 25.
    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
  26. 26.
    Sequeda, J.F., Arenas, M., Miranker, D.P.: On directly mapping relational databases to RDF and OWL. In: WWW, pp. 649–658 (2012)Google Scholar
  27. 27.
    Sequeda, J.F., Miranker, D.P.: Ultrawrap: Sparql execution on relational data. J. Web Sem. 22, 19–39 (2013)CrossRefGoogle Scholar
  28. 28.
    Weaver, J., Hendler, J.A.: Parallel materialization of the finite rdfs closure for hundreds of millions of triples. In: Bernstein, A., Karger, D.R., Heath, T., Feigenbaum, L., Maynard, D., Motta, E., Thirunarayan, K. (eds.) ISWC 2009. LNCS, vol. 5823, pp. 682–697. Springer, Heidelberg (2009)CrossRefGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Juan F. Sequeda
    • 1
  • Marcelo Arenas
    • 2
  • Daniel P. Miranker
    • 1
  1. 1.Department of Computer ScienceThe University of Texas at AustinUSA
  2. 2.Department of Computer SciencePUC ChileChile

Personalised recommendations