特別な経度と緯度からすべての POI を取得しようとしています。
より良い結果を得るためのヒントを教えてもらえますか? 結果セットに:Germany
やのような件名が表示されるようになりました。:M-Bahn
ここに私のJavaコードがあります:
public class DBPedia_SparqSql {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
float YOUR_LONG = 13.380834f;
float YOUR_LAT = 52.516388f;
float radius = 0.01f;
String sparqlQueryString1= "PREFIX owl: <http://www.w3.org/2002/07/owl#> "+
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> "+
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> "+
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "+
"PREFIX foaf: <http://xmlns.com/foaf/0.1/> "+
"PREFIX dc: <http://purl.org/dc/elements/1.1/> "+
"PREFIX : <http://dbpedia.org/resource/> "+
"PREFIX dbpedia2: <http://dbpedia.org/property/> "+
"PREFIX dbpedia: <http://dbpedia.org/> "+
"PREFIX skos: <http://www.w3.org/2004/02/skos/core#> "+
"PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> "+
"PREFIX onto: <http://dbpedia.org/ontology/> " +
"PREFIX dcterms: <http://purl.org/dc/terms/> "+
"SELECT DISTINCT ?s ?sub ?long ?lat WHERE {"+
"?s a onto:Place . "+
"?s geo:lat ?lat . "+
"?s geo:long ?long . " +
"?s dcterms:subject ?sub "+
" FILTER ( ?long > "+(YOUR_LONG-radius)+"&& ?long < "+(YOUR_LONG+radius)+" && ?lat > "+(YOUR_LAT-radius)+" && ?lat < "+(YOUR_LAT+radius)+")}"+
"LIMIT 200";
System.out.println(sparqlQueryString1);
Query query = QueryFactory.create(sparqlQueryString1);
QueryExecution qexec = QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql", query);
ResultSet results = qexec.execSelect();
ResultSetFormatter.out(System.out, results, query);
qexec.close() ;
}
}