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
SELECT ?s ?p ?o WHERE {?s ?p ?o} limit 10


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: dedicates to the LOGD sparql endpoint, and 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

Warning: Table './drupal/watchdog' is marked as crashed and last (automatic?) repair failed query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:333:\"Table './drupal/accesslog' is marked as crashed and last (automatic?) repair failed\nquery: INSERT INTO accesslog (title, path, url, hostname, uid, sid, timer, timestamp) values('SparqlProxy', 'node/162', '', '', 0, 'v5eo53lbiuq1b1qs9ghtvaenj0', 28, 1618678308)\";s:5:\"%file\";s:58:\"/data/www/html/drupal/modules/statistics/statistics.module\";s:5:\"%line\";i:63;}', 3, '', '', '', in /data/www/html/drupal/includes/ on line 134