问题
I'm trying to write a SPARQL query to obtain the relationship between the United Kingdom and England with no success: no result is returned, as you can see here:
SELECT ?property
WHERE {
<http://dbpedia.org/resource/England> ?property <http://dbpedia.org/resource/United_Kingdom>
}
Any suggestion? Is there any mistake between in the SPARQL query? How can I find through DBpedia that England is in the UK?
回答1:
Your query is correct. If you get no results, there is no such relationship.
DBpedia is derived from available structured data on Wikipedia. http://en.wikipedia.org/wiki/England shows no property in the Infobox on the right that links England to the UK. If you look up a resource in your browser, e.g. http://dbpedia.org/resource/England, you get all information known about the resource.
回答2:
On the specific question of a relationship between DBPedia's England and United Kingdom, it might be best to look at them the other way around:
SELECT *
WHERE {
{
<http://dbpedia.org/resource/United_Kingdom> ?property <http://dbpedia.org/resource/England>
}
...and find that ?property gets bound to rdfs:seeAlso.
There is also the Category:
resources in DBPedia, which use SKOS-based broader and narrower relationships, see for example:
SELECT ?property ?object
WHERE {
<http://dbpedia.org/resource/Category:England> ?property ?object .
}
来源:https://stackoverflow.com/questions/15650341/how-to-get-the-relationship-between-united-kingdom-and-england-from-dbpedia