Hi all,
I am using the Jena Java framework for querying DBpedia end point using
SPARQL, to get the type for all points of interest in German cities. I am
facing no issue for places that have English DBpedia entries. But, when it
comes to place names with utf encoding (German entry - umlaut, sharp S),
this query returns no result. This seems to be an issue with the German
DBpedia end point, as mentioned over here (
http://mail-archives.apache.org/mod_mbox/jena-users/201110.mbox/%3c4e877c8a.4050...@apache.org%3E).
Even after referring to this, I am unable to solve the problem. I don't
know how to work with QueryEngineHTTP. I am adding two code snippets - one
that works (first one - query for Allianz Arena : which has an English
entry in DBpedia) and one that doesn't work (second one - for Schloß
Nymphenburg, that has a German entry). This might be a very trivial issue,
but I am unable to solve it. Any pointers to a solution would be very very
helpful. Thanks a lot! Code 1 - working :
String service = "http://dbpedia.org/sparql";final
ParameterizedSparqlString query = new ParameterizedSparqlString(
"PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>" +
"PREFIX dbo: <http://dbpedia.org/ontology/>" +
"PREFIX dcterms: <http://purl.org/dc/terms/>" +
"SELECT * WHERE {" +
"?s geo:lat ?lat ." +
"?s geo:long ?long ." +
"?s dcterms:subject ?sub}");
query.setIri("?s",
"http://dbpedia.org/resource/Allianz_Arena");QueryExecution qe =
QueryExecutionFactory.sparqlService(service,
query.toString());ResultSet results =
qe.execSelect();ResultSetFormatter.out(System.out, results);
Code 2 - not working :
String service = "http://dbpedia.org/sparql";final
ParameterizedSparqlString query = new ParameterizedSparqlString(
"PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>" +
"PREFIX dbo: <http://dbpedia.org/ontology/>" +
"PREFIX dcterms: <http://purl.org/dc/terms/>" +
"SELECT * WHERE {" +
"?s geo:lat ?lat ." +
"?s geo:long ?long ." +
"?s dcterms:subject ?sub}");
query.setIri("?s",
"http://de.dbpedia.org/resource/Schloß_Nymphenburg");QueryExecution qe
= QueryExecutionFactory.sparqlService(service,
query.toString());ResultSet results =
qe.execSelect();ResultSetFormatter.out(System.out, results);
Cheers,
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion