Reputation: 21
When I try to send a sparql query to some endpoint, for example:
QueryExecution qe = QueryExecutionFactory.sparqlService("http://data.open.ac.uk/sparql",
getStringForQuery());
ResultSet results = qe.execSelect();
I get
Exception in thread "main" org.apache.jena.query.QueryException: Endpoint returned Content-Type: text/html which is not currently supported for SELECT queries
at org.apache.jena.sparql.engine.http.QueryEngineHTTP.execResultSetInner(QueryEngineHTTP.java:372)
at org.apache.jena.sparql.engine.http.QueryEngineHTTP.execSelect(QueryEngineHTTP.java:334)
And this is not the only one endpoint, to which I can't send query,
What should I do to get results in other content-type? I try to google it, but I found that it can happen if I send query to bad html (not sparql endpoint), but http://data.open.ac.uk/sparql is good endpoint, I send sparql query to it via python and everything was good.
Upvotes: 2
Views: 1206
Reputation: 8465
I don't know what kind of backend they use, but for whatever reason, you have to use an additional HTTP parameter force=true
when using the SPARQL endpoint from external services:
http://data.open.ac.uk/sparql?force=true
According to Andy Seaborne from the Apache Jena development team, this is supposed to be a bug in the redirect in Jena 3.1.1. In version 3.1.0 the redirect to ?force=true
works as expected. In addition, the backend is Fuseki 2.3.1.
Upvotes: 2