我只是想上运行DBpedia中,本身的工作原理查询小查询,看到它在这里 ,但我不知道为什么它的归国与耶拿这样做的时候,我得到空。
String service = "http://dbpedia.org/sparql";
String queryString = "";
queryString = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?label" +
"WHERE {" +
"<http://dbpedia.org/resource/Quatre_Bornes> <http://dbpedia.org/ontology/country> ?y ."+
"?y rdfs:label ?label ."+
"FILTER (LANG(?label) = 'en')"+
"}";
Query query = QueryFactory.create(queryString);
QueryEngineHTTP qexec = QueryExecutionFactory.createServiceRequest(service, query);
ResultSet results = qexec.execSelect();
for ( ; results.hasNext() ; ) {
QuerySolution soln = results.nextSolution() ;
System.out.println(soln.getLiteral("label"));
}
任何建议?