Hello,
I try to get some data about a city using Sparql query on DBpedia. The problem is I can't get the query to work.
Currently I do something like this:
SELECT ?title,?name,?abs WHERE {
?title skos:subject
<http://dbpedia.org/resource/Category:Cities%2C_towns_and_villages_in_Slovenia>.
?title dbpprop:officialName ?name.
?title dbpprop:abstract ?abs
}
I get all the towns, villages from Slovenia with all the data. The problem is, I would like to get the data (officialName and/or abstract) only for one town, for example Ljubljana. So I tried some things like this:
SELECT ?name WHERE {
?name dbpprop:officialName
<http://dbpedia.org/resource/Ljubljana>.
}
Of course it does not work. I don't exactly know why, though :), but I've been experimenting a bit and noticed some things like if I put
?name skos:subject <http://dbpedia.org/resource/Category:Ljubljana>.
I get some results (which are not relevant to me, but anyway), but if I put
?name skos:subject <http://dbpedia.org/resource/Ljubljana>.
there are no results for anything though element skos:subject exists on the page http://dbpedia.org/resource/Ljubljana.
Could someone please explain why the second example does not work and how to get the result I would like to have?
Thanks, Ablak
Thanks