XTech 2006 news

Newsletter sign-up


RSS and Atom feed icon News feeds

SQL, XQuery, and SPARQL: What's Wrong With This Picture?

Jim Melton (Oracle Corporation)
Core technologies St. John 1

The W3C has recently published specifications for a new query language, SPARQL. SPARQL is designed for querying information expressed in RDF and is intended to provide the ability to interrogate the Semantic Web. RDF is a “framework for representing information in the Web”, doing so in the form of collections of triples (3-tuples). RDF triples may be interconnected in many ways, forming a general graph structure. RDF is defined in terms of an abstract data model, of which one instantiation is XML, and SPARQL is defined to operate on the abstract data model and not on any specific physical medium.

The design and development of the W3C’s XML Query Language, XQuery, preceded the development of SPARQL. XQuery is carefully designed to operate on an abstract XML data model (that is, a data model based on trees). The XQuery 1.0 and XPath 2.0 Data Model is the result of several years of research and development work by a large community of data management practitioners. XQuery, with its underlying Data Model, is a very powerful declarative, functional language for querying and transforming XML.

SQL is arguably the most widely used query language in the information management community. It is based on the relational model of data, a data model designed in terms of collections (“relations”, “tables”) of tuples (“rows”) of data. SQL has been standardized for more than 20 years and has a great many implementations, many of them “industrial-strength” in terms of robustness, manageability, performance, scalability, etc.

Many, but not all, observers asked whether SPARQL is necessary, either because its purpose can be satisfied by XQuery (when applied to the XML form of RDF) or by SQL (when applied to the more abstract tuple structure of RDF). Do those observers have a point? Is there really a need for Yet Another Query Language just for use on RDF? Does SPARQL have unique characteristics that justify its proposal as a new standard query language?

The presentation will examine the design centers of each of these languages: SQL and the relational model of data, XQuery and its associated XML “stack”, and SPARQL and its associated RDF “stack”. Attendees will leave the session with a better understanding of the relative positioning and value of the three languages, particularly as they apply to the concepts of the Semantic Web.

The talk was first given at XML 2005 and has been updated with additional research results, XQuery examples, and more realistic RDF/OWL data.

Chair: Eric Prud'hommeaux