Semantics Preserving SPARQL-to-SQL Query Translation for Optional Graph Patterns. Technical Report T

The Semantic Web has recently gained tremendous momentum due to its great potential for providing a common framework that allows data to be shared and reused across application, enterprise, and community boundaries. While Resource Description Framework (RDF) is a W3C recommended langauge for representing data over the Semantic Web, SPARQL is an emerging W3C query language for RDF data. Although several researchers have proposed to use RDBMSs to store and query RDF data, to our best knowledge, there is no published algorithm for translating a SPARQL query to an equivalent SQL counterpart in the presence of arbitrary complex optional graph patterns. In this paper, we propose: (i) a basic graph pattern translation algorithm, BGPtoSQL, that translates a basic graph pattern to its SQL equivalent; and based on BGPtoSQL, (ii) a semantics preserving SPARQL-to-SQL query translation algorithm, SPARQLtoSQL, for SPARQL queries that contain arbitrary complex optional graph patterns. Experimental results show that our algorithms are e‐cient and scalable.