I am using sparql to find a location of entity. I have urls from dbpedia-spootlight and want to find location for them. So the query I am using is:
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT DISTINCT *
WHERE { ?uri rdfs:label ?label .
OPTIONAL { ?uri geo:lat ?lat . ?uri geo:long ?long } .
OPTIONAL { ?uri dbpedia-owl:country ?dbpediaContry . ?dbpediaContry dbpprop:cctld ?ccTLD } .
FILTER (?uri = <URL> && lang(?label) = "en" ) }
and it was fine until I have got this url: http://dbpedia.org/resource/Valencia,_Spain . It has wikiPageRedirects to http://dbpedia.org/resource/Valencia and no other data. I have got lost how could i build query to check cases with redirects.
Can anybody help me?