Bridging the Semantic Web and NoSQL Worlds: Generic SPARQL Query Translation and Application to MongoDB

  • Franck MichelEmail author
  • Catherine Faron-Zucker
  • Johan Montagnat
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11360)


RDF-based data integration is often hampered by the lack of methods to translate data locked in heterogeneous silos into RDF representations. In this paper, we tackle the challenge of bridging the gap between the Semantic Web and NoSQL worlds, by fostering the development of SPARQL interfaces to heterogeneous databases. To avoid defining yet another SPARQL translation method for each and every database, we propose a two-phase method. Firstly, a SPARQL query is translated into a pivot abstract query. This phase achieves as much of the translation process as possible regardless of the database. We show how optimizations at this abstract level can save subsequent work at the level of a target database query language. Secondly, the abstract query is translated into the query language of a target database, taking into account the specific database capabilities and constraints. We demonstrate the effectiveness of our method with the MongoDB NoSQL document store, such that arbitrary MongoDB documents can be aligned on existing domain ontologies and accessed with SPARQL. Finally, we draw on a real-world use case to report experimental results with respect to the effectiveness and performance of our approach.


Query rewriting SPARQL RDF NoSQL xR2RML Linked data 


  1. 1.
    Arenas, M., Bertails, A., Prud’hommeaux, E., Sequeda, J.: A Direct Mapping of Relational Data to RDF (2012)Google Scholar
  2. 2.
    Berners-Lee, T.: Linked Data, in Design Issues of the WWW (2006).
  3. 3.
    Bikakis, N., Tsinaraki, C., Gioldasis, N., Stavrakantonakis, I., Christodoulakis, S.: The XML and Semantic Web Worlds: Technologies, Interoperability and Integration: a Survey of the State of the Art. In: Anagnostopoulos, I., Bieliková, M., Mylonas, P., Tsapatsoulis, N. (eds.) Semantic Hyper/Multimedia Adaptation. SCI, pp. 319–360. Springer, Heidelberg (2013). Scholar
  4. 4.
    Bikakis, N., Tsinaraki, C., Stavrakantonakis, I., Gioldasis, N., Christodoulakis, S.: The SPARQL2XQuery interoperability framework. World Wide Web 18(2), 403–490 (2015)CrossRefGoogle Scholar
  5. 5.
    Bizer, C., Cyganiak, R.: D2R server - publishing relational databases on the semantic web. In: Proceeding of the 5th International Semantic Web Conference (ISWC) (2006)Google Scholar
  6. 6.
    Bizer, C., Schultz, A.: The Berlin SPARQL benchmark. Int. J. Semant. Web Inf. Syst. 5(2), 1–24 (2009)CrossRefGoogle Scholar
  7. 7.
    Botoeva, E., Calvanese, D., Cogrel, B., Rezk, M., Xiao, G.: A formal presentation of MongoDB (extended version) (2016).
  8. 8.
    Botoeva, E., Calvanese, D., Cogrel, B., Rezk, M., Xiao, G.: OBDA beyond relational DBs: a study for MongoDB. In: Proceedings of the 29th International Workshop on Description Logics (2016)Google Scholar
  9. 9.
    Callou, C., Michel, F., Faron-Zucker, C., Martin, C., Montagnat, J.: Towards a shared reference thesaurus for studies on history of zoology, archaeozoology and conservation biology. In: Semantic Web For Scientific Heritage (SW4SH), ESWC Workshops (2015)Google Scholar
  10. 10.
    Chebotko, A., Lu, S., Fotouhi, F.: Semantics preserving SPARQL-to-SQL translation. Data Knowl. Eng. 68(10), 973–1000 (2009)CrossRefGoogle Scholar
  11. 11.
    Cyganiak, R., Wood, D., Lanthaler, M.: RDF 1.1 Concepts and Abstract Syntax. W3C Recommendation (2014)Google Scholar
  12. 12.
    Das, S., Sundara, S., Cyganiak, R.: R2RML: RDB to RDF mapping language. W3C Recommendation (2012)Google Scholar
  13. 13.
    Dimou, A., Vander Sande, M., Colpaert, P., Verborgh, R., Mannens, E., Van de Walle, R.: RML: a generic language for integrated RDF mappings of heterogeneous data. In: Proceedings of the 7th Workshop on Linked Data on the Web (2014)Google Scholar
  14. 14.
    Elliott, B., Cheng, E., Thomas-Ogbuji, C., Ozsoyoglu, Z.M.: A complete translation from SPARQL into efficient SQL. In: Proceedings of the International Database Engineering and Applications Symposium, pp. 31–42. ACM (2009)Google Scholar
  15. 15.
    Gargominy, P., et al.: TAXREF v9. 0, référentiel taxonomique pour la France: Méthodologie, mise en oeuvre et diffusionGoogle Scholar
  16. 16.
    Görlitz, O., Staab, S.: SPLENDID: SPARQL endpoint federation exploiting VOID descriptions. In: International Workshop on COLD (2011)Google Scholar
  17. 17.
    Haas, L., Kossmann, D., Wimmers, E., Yang, J.: Optimizing queries across diverse data sources. In: Proceedings of the 23rd International Conference on Very Large Data Bases (VLDB 1997), pp. 276–285 (1997)Google Scholar
  18. 18.
    Harris, S., Seaborne, A.: SPARQL 1.1 Query Language. W3C Recommendation (2013)Google Scholar
  19. 19.
    Heath, T., Bizer, C.: Linked Data: Evolving the Web into a Global Data Space, 1st edn. Morgan & Claypool, San Rafael (2011)Google Scholar
  20. 20.
    Husson, A.: Une sémantique statique pour MongoDB. In: 25th Journées Francophones des Langages Applicatifs, pp. 77–92 (2014)Google Scholar
  21. 21.
    Macina, A., Montagnat, J., Corby, O.: Optimising SPARQL query processing in distributed knowledge graphs. In: Actes de la Conférence Gestion de Données - Principes, Technologies et Applications (BDA). Poitiers, France (2016)Google Scholar
  22. 22.
    Michel, F.: Integrating Heterogeneous Data Sources in the Web of Data. Ph.d. thesis, Université Côte d’Azur, March 2017Google Scholar
  23. 23.
    Michel, F., Faron-Zucker, C., Montagnat, J.: A generic mapping-based query translation from SPARQL to various target database query languages. In: Proceeding of the 12th International Conference on Web Information Systems and Technologies (WebIST), vol. 2, pp. 147–158 (2016)Google Scholar
  24. 24.
    Michel, F., Faron-Zucker, C., Montagnat, J.: A mapping-based method to query MongoDB documents with SPARQL. In: Hartmann, S., Ma, H. (eds.) DEXA 2016. LNCS, vol. 9828, pp. 52–67. Springer, Cham (2016). Scholar
  25. 25.
    Michel, F., Djimenou, L., Faron-Zucker, C., Montagnat, J.: Translation of heterogeneous databases into RDF, and application to the construction of a SKOS taxonomical reference. In: Monfort, V., Krempels, K.-H., Majchrzak, T.A., Turk, Ž. (eds.) WEBIST 2015. LNBIP, vol. 246, pp. 275–296. Springer, Cham (2016). Scholar
  26. 26.
    Mugnier, M.L., Rousset, M.C., Ulliana, F.: Ontology-mediated queries for NOSQL databases. In: Proceedings of the 30th Conference on Artificial Intelligence. Phoenix, Arizona (2016)Google Scholar
  27. 27.
    Pérez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. ACM Trans. Database Syst. 34(3), 1–45 (2009)CrossRefGoogle Scholar
  28. 28.
    Pollock, R., Tennison, J., Kellogg, G., Herman, I.: Metadata Vocabulary for Tabular Data. W3C Recommendation (2015)Google Scholar
  29. 29.
    Priyatna, F., Corcho, O., Sequeda, J.: Formalisation and experiences of R2RML-based SPARQL to SQL query translation using Morph. In: Proceeding of the World Wide Web Conference (WWW) (2014)Google Scholar
  30. 30.
    Rodríguez-Muro, M., Calvanese, D.: High performance query answering over DL-Lite ontologies. In: Proceedings of the 13th International Conference on Principles of Knowledge Representation and Reasoning (KR 2012) (2012)Google Scholar
  31. 31.
    Rodríguez-Muro, M., Kontchakov, R., Zakharyaschev, M.: Ontology-based data access: Ontop of databases. In: Alani, H., et al. (eds.) ISWC 2013. LNCS, vol. 8218, pp. 558–573. Springer, Heidelberg (2013). Scholar
  32. 32.
    Rodríguez-Muro, M., Rezk, M.: Efficient SPARQL-to-SQL with R2RML mappings. Web Semant. 33, 141–169 (2015)CrossRefGoogle Scholar
  33. 33.
    Schwarte, A., Haase, P., Hose, K., Schenkel, R., Schmidt, M.: FedX: optimization techniques for federated query processing on linked data. In: Aroyo, L., et al. (eds.) ISWC 2011. LNCS, vol. 7031, pp. 601–616. Springer, Heidelberg (2011). Scholar
  34. 34.
    Sequeda, J., Tirmizi, S.H., Corcho, O., Miranker, D.P.: Survey of directly mapping SQL databases to the semantic web. Knowl. Eng. Rev. 26(4), 445–486 (2011)CrossRefGoogle Scholar
  35. 35.
    Sequeda, J.F., Miranker, D.P.: Ultrawrap: SPARQL execution on relational data. Web Semant. 22, 19–39 (2013)CrossRefGoogle Scholar
  36. 36.
    Spanos, D.E., Stavrou, P., Mitrou, N.: Bringing relational databases into the semantic web: a survey. Semant. Web J. 3(2), 169–209 (2012)Google Scholar
  37. 37.
    Tomaszuk, D.: Document-oriented triplestore based on RDF/JSON. In: Logic, Philosophy and Computer Science, pp. 125–140. University of Bialystok (2010)Google Scholar
  38. 38.
    Unbehauen, J., Stadler, C., Auer, S.: Accessing relational data on the web with SparqlMap. In: Takeda, H., Qu, Y., Mizoguchi, R., Kitamura, Y. (eds.) JIST 2012. LNCS, vol. 7774, pp. 65–80. Springer, Heidelberg (2013). Scholar
  39. 39.
    Unbehauen, J., Stadler, C., Auer, S.: Optimizing SPARQL-to-SQL rewriting. In: Proceedings of Information Integration and Web-based Applications & Services (iiWAS 2013), p. 324. ACM (2013)Google Scholar
  40. 40.
    Verborgh, R., et al.: Triple pattern fragments: a low-cost knowledge graph interface for the web. Web Semant. 37–38, 184–206 (2016)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag GmbH Germany, part of Springer Nature 2019

Authors and Affiliations

  1. 1.Université Côte d’Azur, Inria, CNRS, I3SSophia AntipolisFrance

Personalised recommendations