I'm progressing nicely with my project in RoR, but I'm having a bit of trouble to fine tune the query needed to retrieve information about a specific city or town. I'm relying on DBPedia, and the two test cases are Manchester (in the UK) and OsnaBrück (in Germany)
The idea is to make the query as generic as possible, because it's constructred through Ruby on Rails, so I need to be able to replace the search values later on through variables. The Query i'm trying to tune is this one:
The idea behind the query is the following:
I want to select any location that:
If I use the values 'Manchester' and <http://dbpedia.org/resource/United_Kingdom> I'm able to select the City of Manchester in the United Kingdom, but when I use the values 'Osnabrück' and <http://dbpedia.org/resource/Germany> I'm not able to select the town of Osnabrück, despite it having a page in dbpedia.
Could someone point out what I'm missing in my SPARQL query?
Think I found it:
Seems to do exactly what I want