You may also note the aggregate functions MIN for geolong and geloat. I added this because in some cases, for the same city multiple points were defined, and in this case I only want one. That is why I group the results by title and obtain the minimum lon lat values (I used min, I could use max.. nothing really scientific here)

That would do it!. But there’s a little problem involved. Try to query it for France , you get a beautiful Bandwidth Limit Exceeded URI = '/!sparql/'. This endpoint is a public and limited. What to do?

In this case I add the keywords OFFSET and LIMIT. The first one defines the offset where the result listing should start, the second one limits the number of results to show. The script will query by parts until it finds a query that returns zero values:

7 responses to “Europe Countries – DbPedia+SPARQL+Python”

Indeed, there are points on the Czech Republic Try here. Actually around 5000 points!

It seems that the dbpedia resource for the Czech Republic does not have the rdf:type yago:EuropeanCountries, that is why is not listed as one of my input Countries. I should try with another predicate, like dcterms:subject category:Member_states_of_the_European_Union