I'm performing entity linking from a Python script from babelfy endpoint. When it is performed, I have an entity with two, one or none entries to a knowledge base: babelnet and dbpedia.
Once I have this, I want to get the latitude and longitude coordinates of the entity place I have just received. What is the best way to achieve this?
I have been reading some options and I think that a solid way of having this done is doing a Python request to dbpedia sparql endpoint. However I'm completely new to SPARQL and I don't know how I could, by giving the place name or more easily the entity entry, get those lat and long coordinates.
For example, given this real output, how should be the SPARQL query to get the coordinates?
- Entity name: Madrid
- dbpedia entry: http://dbpedia.org/resource/Madrid
- babelnet entry: http://babelnet.org/rdf/s00015620n
select * { <http://dbpedia.org/resource/Madrid> geo:lat ?lat ; geo:long ?long }- so does this help you, what do you do if you need something else? - UninformedUserselect * { ?s rdfs:label "Madrid"@en ; geo:lat ?lat ; geo:long ?long }- main disadvantages: 1) it has to be exact match and more important 2) multiple entities can have the same label. That why with URIs you'd have a unique identifier of the entity - UninformedUser