Swirrl / drafter

A clojure service and a client to it for exposing data management operations to PMD
Other
0 stars 0 forks source link

Support format parameter via URL when making SPARQL requests #625

Closed RicSwirrl closed 2 years ago

RicSwirrl commented 2 years ago

Add a query parameter to the sparql endpoints, which will let users request different formats of request via the URL, without having to pass accept headers. e.g. to get CSV results.

e.g. curl -X GET "https://idp-beta-drafter.publishmydata.com/v1/sparql/live?query=foo&format=csv

Some other comments via slack:

It looks like that’s all handled in sparql-protocol/sparql-negotiation-handler so would just need to look in the params as well as the accept header.

The RDFFormat objects all contain information on extensions via .getFileExtensions ; so we could easily just build a reverse mapping from ext -> rdfformat. That would let folk set things like ?format=csv|nt|ttl|xml etc