RDF/SPARQL is a RDF vocabulary for describing SPARQL queries. It can also be used as a syntax for SPARQL, and in particular, as a XML syntax using the RDF/XML serialisation of RDF. This way not only tools for manipulating RDF can be used on SPARQL queries, but also XML facilities like XSLT, XQuery, and so on. The main advantage of using RDF/SPARQL is for better query management. While some companies or institutes use and reuse RDF knowledge quite extensively, they often have to rewrite similar queries. With a query repository, indexed and described in RDF, they could retrieve, reuse, combine or modularise query management.
RDF/SPARQL can also be used to provide model queries within a RDF document, so that knowledge providers can not only expose their knowledge, but also the way this knowledge may be accessed.
In order to describe queries in SPARQL, we have designed an ontology. The ontology defines a vocabulary (classes, properties and instances), where most of the terms are taken from the original SPARQL grammar. For instance, provided that sparql: denotes SPARQL/RDF namespace (viz., http://exmo.inrialpes.fr/sparql), the concept sparql:SelectQuery denotes the class of all select queries. We will provide a detailed documentation for this ontology in the future. Here is the OWL/XML file for this ontology.
SPARQL/RDF can be written from scratch, but SPARQL queries can be automatically translated into a SPARQL/RDF with the tool below. The file SPARQL-RDF.jar can be executed in command like according to the following usage:
java - jar SPARQL-RDF.jar <input> <outputput> <input> is a file containing a standard SPARQL query. <output> is the file where the RDF/XML version of SPARQL/RDF will be written.
A file containing an XML serialisation of the translation of the query in SPARQL/RDF is produced. It currently cannot produce anything but RDF/XML. We will perhaps make extensions for N3, N-triples, Turtle.