XQuery/SPARQL interface

The following script provides, via a Joseki server at UWE, a query interface to RDF. Literal language and datatype are ignored in this representation. URIs link to the browse query and also directly to the resource.

A function converts the SPARQL XML Query result to a table, with links.

};

The SPARQL interface uses the configuration file to declare the namespaces.

Application
Query

The interface expands a query like select ?name ?job where { ?emp rdf:type f:emp. ?emp foaf:surname ?name. ?emp f:Job ?job. }

into:

prefix foaf:  prefix rdf:  prefix rdfs:  prefix f:  prefix xs:  select ?name ?job from  where {    ?emp rdf:type  f:emp.    ?emp foaf:surname ?name.    ?emp f:Job ?job.  }

and sends this to the Joseki service. The graph to query is actually passed as the default graph rather than in the from clause.

To do

 * handle language and datatype
 * local URIs as local names rather than full URIs#
 * better handling of default graph - should be able to reference the cached rdf defined in the config file