6 CONCLUSION AND
PERSPECTIVES
The method proposed in this paper aims at fostering
the development of SPARQL interfaces to heteroge-
neous databases, as we believe this is a key to the ad-
vent of the Web of Data.
Leveraging R2RML-based SPARQL-to-SQL
works, we have defined a method to translate a
SPARQL query into a pivot abstract query, utilizing
xR2RML to describe the mapping of a target database
to RDF. The method determines a reduced set of
mappings matching each SPARQL triple pattern,
and takes into account join constraints and SPARQL
filters. Lastly, several query optimizations are ap-
plied to the abstract query in order to facilitate the
subsequent translation into the target query language.
At this stage, our method has some limitations
that we may address in the future. Firstly, SPARQL
named graphs and solution modifiers (DISTINCT,
OFFSET, LIMIT, ORDER BY, HAVING) are not con-
sidered. Besides, like in most SPARQL rewriting ap-
proaches so far, SPARQL 1.1 is not fully supported, in
particular with respect to property paths and negation
operators (NOT EXISTS, MINUS). In the translation
of a triple pattern, the management of SPARQL fil-
ters is postponed to the translation into a target query
using the sparqlFilter condition. Yet, further works
shall try to raise filters at the abstract query level. For
instance SPARQL operators BIND or VALUES may be
turned into equivalent equals conditions, and BOUND
into isNotNull conditions. Secondly, thanks to the ex-
ample of MongoDB, we have shown that bridging the
gap between the expressiveness of SPARQL and that
of the target query language may entail the genera-
tion of multiple independent target database queries,
delegating several steps to the query processing en-
gine, e.g. joins or complex filtering. Therefore, some
classical query optimization questions shall arise dur-
ing the development of the query processing engine,
such as what is the most efficient order to compute IN-
NER JOINs of intermediate queries. In this regard, the
query processing engine may need to embark query
plan optimization logics such as the bind join (Haas
et al., 1997) to inject intermediary results into a sub-
sequent query, and the join re-ordering based on the
number of results that queries shall retrieve, very sim-
ilarly to the methods applied in distributed SPARQL
query engines (Schwarte et al., 2011; G
¨
orlitz and
Staab, 2011).
We are currently developing a prototype imple-
mentation of our method. In the short-term we in-
tend to run performance evaluations. Beyond this, we
envisage two real-life use cases. Firstly, in the con-
text of the Zoomathia research project
3
, a taxonomic
reference designed to support studies in Conservation
Biology was translated into a SKOS
4
thesaurus (Cal-
lou et al., 2015). The taxonomic reference is stored in
a MongoDB database, and the RDF graph is material-
ized at once. Our perspective is to provide a dynamic
access to the SKOS thesaurus using our SPARQL-to-
MongoDB prototype. Secondly, we are having dis-
cussions with researchers who intend to explore the
added value of Semantic Web technologies to sup-
port ecology and agronomic studies. They maintain
a large MongoDB database of phenotype information
about thousands of plants, that they wish to access us-
ing SPARQL. This context would be a significant and
realistic use case of our method.
REFERENCES
Bikakis, N., Tsinaraki, C., Stavrakantonakis, I., Gi-
oldasis, N., and Christodoulakis, S. (2015). The
SPARQL2XQuery interoperability framework. World
Wide Web, 18(2):403–490.
Bischof, S., Decker, S., Krennwallner, T., Lopes, N., and
Polleres, A. (2012). Mapping between RDF and XML
with XSPARQL. J. Data Semantics, 1(3):147–185.
Bizer, C. and Cyganiak, R. (2006). D2R server - Publishing
Relational Databases on the Semantic Web. In ISWC.
Callou, C., Michel, F., Faron-Zucker, C., Martin, C., and
Montagnat, J. (2015). Towards a Shared Reference
Thesaurus for Studies on History of Zoology, Ar-
chaeozoology and Conservation Biology. In SW For
Scientific Heritage, ESWC.
Chebotko, A., Lu, S., and Fotouhi, F. (2009). Seman-
tics preserving SPARQL-to-SQL translation. Data &
Knowledge Engineering, 68(10):973–1000.
Das, S., Sundara, S., and Cyganiak, R. (2012). R2RML:
RDB to RDF mapping language.
Dimou, A., Vander Sande, M., Colpaert, P., Verborgh, R.,
Mannens, E., and Van de Walle, R. (2014). RML:
A generic language for integrated RDF mappings of
heterogeneous data. In LDOW.
Elliott, B., Cheng, E., Thomas-Ogbuji, C., and Ozsoyoglu,
Z. M. (2009). A complete translation from SPARQL
into efficient SQL. In IDEAS’09, pages 31–42. ACM.
G
¨
orlitz, O. and Staab, S. (2011). SPLENDID: SPARQL
Endpoint Federation Exploiting VOID Descriptions.
In Intl. Ws. COLD.
Haas, L., Kossmann, D., Wimmers, E., and Yang, J. (1997).
Optimizing Queries across Diverse Data Sources. In
VLDB, pages 276–285.
Michel, F., Djimenou, L., Faron-Zucker, C., and Montag-
nat, J. (2015a). Translation of Relational and Non-
Relational Databases into RDF with xR2RML. In We-
bIST, pages 443–454.
3
http://www.cepam.cnrs.fr/zoomathia
4
http://www.w3.org/2009/08/skos-reference/skos.html
A Generic Mapping-based Query Translation from SPARQL to Various Target Database Query Languages
157