[xquery-talk] Re: talk Digest, Vol 72, Issue 12

Jim Melton jim.melton at acm.org
Thu Apr 30 11:46:49 PDT 2009

On Tue, Apr 28, 2009 at 9:34 PM, McBeath, Darin W (ELS-STL) 
<D.McBeath at elsevier.com> wrote:

> > I'm curious if anyone has investigated or developed a transformation which
> > takes a query expressed in SPARQL syntax to one roughly expressed in an
> > equivalent XQuery syntax.  I realize that there will likely not always be a
> > direct 1 to 1 mapping, will be dependencies on the underlying XML document
> > structure,  and that some of the queries could become quite complex.

I have not actually done the work to transform SPARQL into XQuery, 
but I have done considerable work (with considerable help!) on 
transforming SPARQL into SQL and have demonstrated (if not actually 
*proved*) that SPARQL and SQL are isomorphic.  By that, I mean that, 
given a suitable SQL tabular representation of RDF (such as, but 
necessarily, a single table of three columns), it is possible to 
rewrite a SPARQL query into an SQL query on that representation of 
the RDF that produces the same result that the SPARQL query would 
have produced when run on a "native" RDF store.

My company has also done very considerable work on transforming 
XQuery into SQL and have (for all practical purposes, although not 
mathematically) proven that XQuery and SQL are also isomorphic, given 
some suitable tabular representation of XML data.

I assert with some confidence that if XQuery and SQL are isomorphic, 
and SQL and SPARQL are isomorphic, then XQuery and SPARQL are also isomorphic.

I should point out that the SQL generated by the transformation 
process I and my colleagues devised was exceedingly ugly, complex, 
and visually inefficient; however, any reasonably competent SQL 
optimizer would be able to optimize away most, if not all, of the 
inefficiencies, provided the table(s) was(were) provided with 
suitable indexes.  I would expect something similar from any 
transformation from SPARQL to XQuery.

Hope this helps,

Jim Melton --- Editor of ISO/IEC 9075-* (SQL)     Phone: +1.801.942.0144
   Chair, W3C XML Query WG; XQX (etc.) editor       Fax : +1.801.942.3345
Oracle Corporation        Oracle Email: jim dot melton at oracle dot com
1930 Viscounti Drive      Standards email: jim dot melton at acm dot org
Sandy, UT 84093-1063 USA          Personal email: jim at melton dot name
=  Facts are facts.   But any opinions expressed are the opinions      =
=  only of myself and may or may not reflect the opinions of anybody   =
=  else with whom I may or may not have discussed the issues at hand.  =

More information about the talk mailing list