Geographical queries

Hi friends,
I need to develop a query in DBpedia that extracts location information (latitude and longitude) of a place, depending on context about that particular place.
For example given two entities: “Jersey”, " subway". The query needs to retrieve the coordinates of Jersey from the United States and not from the island, since there are no subways in the last Jersey.

So far I’ve develop a query able to filter by cities for example:
‘’’ PREFIX dbo:

                SELECT DISTINCT ?place ?label ?lat ?lng
                WHERE { 
                  ?place a dbo:Place .
                  ?place rdfs:label ?label 
                     VALUES ?label { "Madrid"@en} .
                  ?place geo:lat ?lat .
                  ?place geo:long ?lng .

But I don’t know how to incorporate the context information. Could you help me with that?.
Thank you.


Is the context always same, e.g. location of subways? or?
How often the context is “changing”?


The context depends on tweets. For example, if the tweet is taking about the “Battery Park” I should be able to return the latitude and longitude of it, I know how to extract the entities already. If I don’t return this, at least I should return something close by, like the statue of liberty in NY.

Currently what I’m doing is to search for these coordinates in the geopy.geocoders Nominatim. But I’d like to involve DBpedia, to see if I can have better results.


I don’t exactly understand.

  1. do you want/need to retrieve a the latitude/longitude for a given entity?


  1. you want to retrieve “anything important/related” for the given entity?

Do you want perform 2) as fallback of 1)?

…need to understand better your use ase before I give you ann exact tip/recommendation.