ウィキデータ照会するため、私は、次のコードを使用しますが、私はエンドポイントが返されるエラーメッセージ」を持って、イエナ(3.0.1)を使用してこのサイトを照会したいと思いますContent-Type:現在SELECTクエリでサポートされていないtext/html "それを解決する方法はありますか?同じコードがdbpediaでうまく動作します。おかげ使用イエナ現在、ウィキデータは「<a href="https://query.wikidata.org/" rel="nofollow">https://query.wikidata.org/</a>を」SPARQLエンドポイントを持っている
queryString = "PREFIX bd: <http://www.bigdata.com/rdf#>\n" +
"PREFIX wikibase: <http://wikiba.se/ontology#>\n" +
"PREFIX wdt: <http://www.wikidata.org/prop/direct/>\n" +
"PREFIX wd: <http://www.wikidata.org/entity/>\n" +
"SELECT DISTINCT ?country ?countryLabel\n" +
"WHERE\n" +
"{\n" +
"\t?country wdt:P31 wd:Q3624078 .\n" +
" ?country wdt:P1622 wd:Q13196750.\n" +
" ?country wdt:P30 wd:Q15\n" +
"\tFILTER NOT EXISTS {?country wdt:P31 wd:Q3024240}\n" +
"\tSERVICE wikibase:label { bd:serviceParam wikibase:language \"en\" }\n" +
"}\n" +
"ORDER BY ?countryLabel";
query = QueryFactory.create(queryString);
qexec = QueryExecutionFactory.sparqlService("https://query.wikidata.org/", queryString);
try {
ResultSet results = qexec.execSelect();
ResultSetFormatter.out(System.out, results, query);
} catch (Exception ex) {
System.out.println(ex.getMessage());
} finally {
qexec.close();
}
ご協力ありがとうございます。URLを「https://query.wikidata.org/sparql」に変更すると問題が解決しました。 –