Hello
I want to access remote sparql endpoint throuth JENA API. My program and error
is below. I don't know how to deal with this problem.
Can you give me some advice? Thank you very very much !
Exception in thread "main" com.hp.hpl.jena.query.QueryException: Endpoint
returned Content-Type: text/html which is not currently supported for SELECT
queries
at
com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execSelect(QueryEngineHTTP.java:334)
at Dbpedia.GetFromSparql.SearchSparql(GetFromSparql.java:53)
at Dbpedia.GetFromSparql.main(GetFromSparql.java:71)
***************************************************************************************
public static void SearchSparql(){
String query=
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>" +
"other PRERIX...... " +
"SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10";
Query query1 = QueryFactory.create(query);
QueryExecution qexec =
QueryExecutionFactory.sparqlService("http://dbtune.org/musicbrainz/snorql/",
query1);
try
{
ResultSet results = qexec.execSelect();
}
catch (QueryExceptionHTTP e) {
e.getResponseMessage();
}
finally {
qexec.close();
}
}
―BoCai
----------------------------------------------------------------------