Skip to main content

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

  • Chapter
  • First Online:
Transactions on Large-Scale Data- and Knowledge-Centered Systems XL

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    We refer to key-value stores, document stores and column family stores but leave out graph stores that generally come with a richer query expressiveness.

  2. 2.

    https://www.mongodb.org/.

  3. 3.

    https://github.com/agrueneberg/Sessel.

  4. 4.

    http://couchdb.apache.org/.

  5. 5.

    http://franz.com/agraph/support/documentation/4.7/mongo-interface.html.

  6. 6.

    http://goessner.net/articles/JsonPath/.

  7. 7.

    We adapt the triple pattern binding proposed by Unbehauen et al. in [38], and we assume that xR2RML mappings are normalized in the sense defined by [32], i.e. they contain exactly one predicate-object map with exactly one predicate map and one object map, and any rr:class property is replaced by an equivalent predicate-object map with a constant predicate rdf:type.

  8. 8.

    Note that for a self-join elimination to be safe, additional conditions must be met, that we do not detail here.

  9. 9.

    https://github.com/frmichel/morph-xr2rml/.

  10. 10.

    http://jena.apache.org/.

  11. 11.

    https://mongodb.github.io/mongo-java-driver/.

  12. 12.

    http://jongo.org/.

  13. 13.

    https://github.com/json-path/JsonPath.

  14. 14.

    https://taxref.mnhn.fr/taxref-web/api/doc.

  15. 15.

    xR2RML mapping graph for TAXREF v9: https://github.com/frmichel/morph-xr2rml/blob/master/morph-xr2rml-dist/example_taxref/xr2rml_taxref_v9.ttl.

  16. 16.

    Neo4J: https://neo4j.com/.

References

  1. Arenas, M., Bertails, A., Prud’hommeaux, E., Sequeda, J.: A Direct Mapping of Relational Data to RDF (2012)

    Google Scholar 

  2. Berners-Lee, T.: Linked Data, in Design Issues of the WWW (2006). http://www.w3.org/DesignIssues/LinkedData.html

  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). https://doi.org/10.1007/978-3-642-28977-4_12

    Chapter  Google Scholar 

  4. Bikakis, N., Tsinaraki, C., Stavrakantonakis, I., Gioldasis, N., Christodoulakis, S.: The SPARQL2XQuery interoperability framework. World Wide Web 18(2), 403–490 (2015)

    Article  Google Scholar 

  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. Bizer, C., Schultz, A.: The Berlin SPARQL benchmark. Int. J. Semant. Web Inf. Syst. 5(2), 1–24 (2009)

    Article  Google Scholar 

  7. Botoeva, E., Calvanese, D., Cogrel, B., Rezk, M., Xiao, G.: A formal presentation of MongoDB (extended version) (2016). https://arxiv.org/abs/1603.09291v1

  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. 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. Chebotko, A., Lu, S., Fotouhi, F.: Semantics preserving SPARQL-to-SQL translation. Data Knowl. Eng. 68(10), 973–1000 (2009)

    Article  Google Scholar 

  11. Cyganiak, R., Wood, D., Lanthaler, M.: RDF 1.1 Concepts and Abstract Syntax. W3C Recommendation (2014)

    Google Scholar 

  12. Das, S., Sundara, S., Cyganiak, R.: R2RML: RDB to RDF mapping language. W3C Recommendation (2012)

    Google Scholar 

  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. 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. Gargominy, P., et al.: TAXREF v9. 0, référentiel taxonomique pour la France: Méthodologie, mise en oeuvre et diffusion

    Google Scholar 

  16. Görlitz, O., Staab, S.: SPLENDID: SPARQL endpoint federation exploiting VOID descriptions. In: International Workshop on COLD (2011)

    Google Scholar 

  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. Harris, S., Seaborne, A.: SPARQL 1.1 Query Language. W3C Recommendation (2013)

    Google Scholar 

  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. Husson, A.: Une sémantique statique pour MongoDB. In: 25th Journées Francophones des Langages Applicatifs, pp. 77–92 (2014)

    Google Scholar 

  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. Michel, F.: Integrating Heterogeneous Data Sources in the Web of Data. Ph.d. thesis, Université Côte d’Azur, March 2017

    Google Scholar 

  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. 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). https://doi.org/10.1007/978-3-319-44406-2_6

    Chapter  Google Scholar 

  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). https://doi.org/10.1007/978-3-319-30996-5_14

    Chapter  Google Scholar 

  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. Pérez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. ACM Trans. Database Syst. 34(3), 1–45 (2009)

    Article  Google Scholar 

  28. Pollock, R., Tennison, J., Kellogg, G., Herman, I.: Metadata Vocabulary for Tabular Data. W3C Recommendation (2015)

    Google Scholar 

  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. 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. 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). https://doi.org/10.1007/978-3-642-41335-3_35

    Chapter  Google Scholar 

  32. Rodríguez-Muro, M., Rezk, M.: Efficient SPARQL-to-SQL with R2RML mappings. Web Semant. 33, 141–169 (2015)

    Article  Google Scholar 

  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). https://doi.org/10.1007/978-3-642-25073-6_38

    Chapter  Google Scholar 

  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)

    Article  Google Scholar 

  35. Sequeda, J.F., Miranker, D.P.: Ultrawrap: SPARQL execution on relational data. Web Semant. 22, 19–39 (2013)

    Article  Google Scholar 

  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. 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. 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). https://doi.org/10.1007/978-3-642-37996-3_5

    Chapter  Google Scholar 

  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. Verborgh, R., et al.: Triple pattern fragments: a low-cost knowledge graph interface for the web. Web Semant. 37–38, 184–206 (2016)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Franck Michel .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

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

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Michel, F., Faron-Zucker, C., Montagnat, J. (2019). Bridging the Semantic Web and NoSQL Worlds: Generic SPARQL Query Translation and Application to MongoDB. In: Hameurlain, A., Wagner, R., Morvan, F., Tamine, L. (eds) Transactions on Large-Scale Data- and Knowledge-Centered Systems XL. Lecture Notes in Computer Science(), vol 11360. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-58664-8_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-662-58664-8_5

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-662-58663-1

  • Online ISBN: 978-3-662-58664-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics