devli2009 / data-gov-wiki

Automatically exported from code.google.com/p/data-gov-wiki
0 stars 0 forks source link

add support for JSON result format application/sparql-results+json #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, SparqlProxy doesn't (AFAIK) take advantage of content negotiation of 
SPARQL results -- that is, by specifying a preferred results format in the 
Accept header when it makes a request to an endpoint.  AllegroGraph (for one) 
will serve up results in either the application/sparql-results+xml or 
application/sparql-results+json format (or in a third, nonstandard JSON-based 
format), depending on the value of the Accept header.  For instance, here are 
some reasonable request headers for getting SPARQL results in the JSON format:

    Accept: application/sparql-results+json
    Accept-Encoding gzip,deflate
    Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    Content-Type:   application/x-www-form-urlencoded

Only the Accept header is essential.  So far, there don't appear to be any 
recommended best practices for requesting and serving SPARQL results in 
different formats.  However, content negotiation is the most obvious solution.  
According to its documentation, Virtuoso also does conneg on results formats:

http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VOSSparqlProtocol

Original issue reported on code.google.com by parc...@gmail.com on 2 Oct 2010 at 6:37

GoogleCodeExporter commented 8 years ago
potential solutions
1. add content negotiation capability
2. add an xslt that translate SPARQL/XML to SPARQL/JSON

Original comment by liding...@gmail.com on 2 Oct 2010 at 6:40

GoogleCodeExporter commented 8 years ago

Original comment by liding...@gmail.com on 2 Oct 2010 at 6:41