Hi,

I'm running a query against some dbPedia data relating to latitude and
longitudes of cities. Some cities have multiple entries for latitude and
longitude. Is there any way that I can manage this within the SPARQL query,
for example picking the first occurrence of the city or calculating the
average of the latitude and longitudes, so that the resultant list consists
of at most one occurrence of the cities?

SELECT DISTINCT ?place ?lat ?long WHERE {
?place <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat.
?place <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long.
}

?place  ?lat    ?long   ?population
<http://dbpedia.org/resource/Sheffield> 
"53.3836"^^<http://www.w3.org/2001/XMLSchema#float>     
"-1.46694"^^<http://www.w3.org/2001/XMLSchema#float>
<http://dbpedia.org/resource/Sheffield> 
"53.3836"^^<http://www.w3.org/2001/XMLSchema#float>     
"-1.46667"^^<http://www.w3.org/2001/XMLSchema#float>

Many Thanks.

Regards.

Reply via email to