sparqlendpoint

Jena-Fuseki: Endpoint returned Content-Type: text/html which is not recognized for SELECT queries


I'm trying to make this SPARQL query using Jena-Fuseki Version 5.1.0 (SPARQL Endpoint: /ds/sparql | Content type (SELECT): JSON | Content type (GRAPH): Turtle), but gives me an error.


PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX nobel: <http://data.nobelprize.org/terms/>

SELECT DISTINCT ?name ?year ?prizeName
WHERE{
    SERVICE <https://data.nobelprize.org/sparql>{
        ?person rdf:type nobel:Laureate;
            rdfs:label ?name;
            nobel:nobelPrize ?prize.
        ?prize rdfs:label ?prizeName;
            nobel:year ?year.
        FILTER (lang(?prizeName) = 'en' && ?year = 1901)
    }
}

And the error is:

Endpoint returned Content-Type: text/html which is not recognized for SELECT queries. Status code 200 OK, Method GET, Request Headers: {Accept=[application/sparql-results+json, application/sparql-results+xml;q=0.9, text/tab-separated-values;q=0.7, text/csv;q=0.5,application/json;q=0.2,application/xml;q=0.2,/;q=0.1]}

I've searched for nobelprize.org's endpoint and I only find these two:

https://data.nobelprize.org/sparql

https://data.nobelprize.org/snorql

The problem is that both still return the same error. Does anybody know if there's another one?

What I-m trying to do is to retrieve a list of laureates and, then, do a federated query to wikidata, but I-m having problems with nobelprize.org response.

I've also tried to add 'force=true' as a URL parameter (see JENA: Endpoint returned Content-Type: text/html) but I don't know how to do it (I've added it directly to the endpoint - as ~/sparql?force=true - but it still fails).

When doing the same query in nobelprize's sparql page, deleting the line where it says SERVICE (and the corresponding closing curly brace), it works.

IMPORTANT: I need to do the query using Jena-Fuseki (or similar) because I must do a federated query to wikidata and if I do it from nobelprize's sparql page, it fails. The opposite (doing a federated query from wikidata) also fails (it says it is not allowed).


Solution

  • RobV's answer is correct. The endpoint is: https://data.nobelprize.org/store/sparql

    AndyS is right and the query (correcting the quotes) curl --data-urlencode "query=SELECT * { ?s ?p ?o } LIMIT 1" https://data.nobelprize.org/store/sparql works

    With respect to UninformedUser's answer Setting QuerySendMode to asPost in Jena also fails, setting QuerySendMode to asPostForm does work., I didn't know how to do it so I posted another question Jena-Fuseki: Set per-query execution context