How to get the relationship between United Kingdom and England from DBpedia?

我是研究僧i 提交于 2019-12-12 20:23:32

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!