Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be more specific with mime types in accept headers to sparql endpoints #345

Open
jaw111 opened this issue Jun 3, 2021 · 0 comments
Open

Comments

@jaw111
Copy link

jaw111 commented Jun 3, 2021

Related to #304 some of our users have begun to use the .csv extension on the request URLs to directly access the results in CSV format.

We are using Amazon Neptune and today observe that these requests suddenly start returning JSON results after upgrading the cluster to the new version 1.0.4.2 engine. On closer inspection it transpires that grlc makes those requests with header Accept: text/csv; q=1.0, */*; q=0.1 and the new Neptune version gives a JSON response for those.

To help avoid such nasty surprises, it would appear wise to be more specific in the accept headers that are sent in sparql protocol requests. My suggestion is to modify mimetypes as follows to be much more specific in the media types and extend support for additional (standard) formats:

Format Accept
csv text/csv; charset=utf-8
tsv text/tab-separated-values; charset=utf-8
json application/sparql-results+json
srj application/sparql-results+json
xml application/sparql-results+xml; charset=utf-8
srx application/sparql-results+xml; charset=utf-8
ttl text/turtle
nt application/n-triples
rdf application/rdf+xml; charset=utf-8
jsonld application/ld+json
html text/html

Note the use of charset parameter on those media types where the character set is not implied by the media type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant