semagrow / semagrow

A SPARQL query federator of heterogeneous data sources

Home Page:https://semagrow.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add "Accept : application/sparql-results+xml" header to ASK queries

natancox opened this issue · comments

It is probably more robust to explicitly mention the Accept header you want.

If I go to http://data.vlaanderen.be/sparql endpoint it will always return me an HMTL page if I do not specify an accept header.

Try ASK query.

See also #13 where I analyzed a number of SPARQL endpoints.

Hi @natancox,

Thanks again for reporting your issues.

Indeed, if you want to check a SPARQL endpoint from an HTTP client you need to specify the accepted formats using the Accept HTTP header. Therefore, if you use, say cURL you need to explicitly set those headers.

Semagrow, on the other hand, uses the RDF4J client to access the individual SPARQL endpoints (both for ASKs and SELECTs). It seems from the corresponding code that RDF4J will correctly set the Accept header (cf, 1) so normally you should not have this kind of issue when using Semagrow.

Did you try ASKing a query to http://data.vlaanderen.be/sparql through Semagrow and still didn't work?

Yes. I did indeed. See my comment on the old issue.

You can try it yourself http://data.vlaanderen.be/sparql?query=PREFIX%20qb%3A%20%3Chttp%3A%2F%2Fpurl.org%2Flinked-data%2Fcube%23%3E%20%0AASK%20%7B%20%3Fx%20a%20qb%3AObservation.%20%7D returns the full HTML. Because the header is missing apparently.

It also contains the "false" response so if RDF4J would add the correct header I would expect it to not include this endpoint in my SPARQL query for Observations.