Basically I have the following query, and it works in all the online SPARQL testers without a problem, but when using Java and Jena 2.6.4, I never get any results. I've written the values into the query for demonstration purposes.
PREFIX g: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX onto: <http://dbpedia.org/ontology/>
SELECT ?subject ?stadium ?lat ?long
WHERE
{ ?subject g:lat ?lat .
?subject g:long ?long .
?subject <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> onto:Stadium .
?subject rdfs:label ?stadium
FILTER ( ( ( ( ( ?lat >= 52.4814 ) && ( ?lat <= 57.4814 ) ) && ( ?long >= -1.89358 ) ) && ( ?long <= 3.10642 ) ) && ( lang(?stadium) = "en" ) )
}
LIMIT 5
Some Java, note I've tried accessing this a few different ways, however I'm using SPARQL throughout the project and have no problems.
Query query = QueryFactory.create(s2); //s2 = the query above
QueryExecution qExe = QueryExecutionFactory.create(query, model);
ResultSet resultsRes = qExe.execSelect();
try {
while (resultsRes.hasNext()) {
QuerySolution soln = resultsRes.nextSolution();
//never any results
}
} catch (Exception ex) {
System.out.println(ex);
}