SparqlProxy

Description: 
A TWC LOGD service that help users to proxy SPARQL endpoint access, cache SPARQL query results, and convert SPARQL query results into many different formats.

Source Code and Resources

SparqlProxy is a TWC LOGD service:

RESTful Service Interface Description

Parameter Status Description
service-uri stable URI of SPARQL service.
query stable SPARQL query string
query-uri stable URI of SPARQL query. Note you can only use one of "query-uri" and "query" because they are mutually exclusive.
output stable (optional) the output format. Default is xml. All values a listed as below:
  • xml => SPARQL/XML
  • sparqljson => SPARQL/JSON
  • exhibit => EXHIBIT/JSON
  • gvds => GoogleViz/JSON
  • csv => CSV
  • html => HTML
  • tablerow => Table(Row)
  • tablecol => Table(Col)
To keep backward comparability, both "sparqljosn" and "sparql" can be used to output SPARQL/JOSN format.
callback experimental (optional) callback function name. This param is only applicable to two output formats: exhibit, sparqljson
tqx experimental (optional) for google visluziation api only. e.g. version:0.6;reqId:1;responseHandler:myQueryHandler
refresh-cache experimental (optional) SparqlProxy use a cache by default. User may opt out (avoid caching) by setting "refresh-cache=on" in service request
textoutput experimental (optional) set "text/plain" as content-type in HTTP response header, so users can view the result in browser. To enable it, add "textoutput=yes" in service request
ui-option experimental (optional) SparqlProxy allow users to show the query of SPARQL query result. To enable it, add "ui-option=query" in service request

Example Usage

The following example uses DBpedia SPARQL endpoint and the following SPARQL query (listing 10 triples, also published at http://logd.tw.rpi.edu/query/stat_ten_triples.sparql)
http://dbpedia.org/sparql
http://logd.tw.rpi.edu/query/stat_list_ten_triples.sparql
SELECT ?s ?p ?o WHERE {?s ?p ?o} limit 10

Discussion

Q: Why use cache in sparqlproxy.
A: The use of cache in LOGD sparql endpoint has historical reasons. The cache capability is used specifically reduce load on repetitive queries over LOGD server (e.g. load dynamically generated web pages). The cache will automatically expire, or you may use "refresh-cache=on" option in RESTful request to bypass the cache.
Q: Why two sparqlproxy instances?
A: We maintain two sparqlproxy instances on LOGD server: http://logd.tw.rpi.edu/sparql dedicates to the LOGD sparql endpoint, and http://logd.tw.rpi.edu/ws/sparqlproxy.php allows users to access other sparql endpoints. Users may download the sparqlproxy code and install an instance on their own computer, allowing external users to access their internal triplestores.

Demos that use this technology