Why is dbpedia-owl:wikiPageRedirects not returning the full set of redirect links? (Sparql)

匿名 (未验证) 提交于 2019-12-03 02:11:02

问题:

I am using the following query :

select ?value where { <http://dbpedia.org/resource/Paris>  dbpedia-owl:wikiPageRedirects* ?value }  

in order to retrieve the wikiPageRedirects property of Paris.


Based on dbpedia Paris has more than 20 redirect links. Why am I only retrieving the first one?


回答1:

Your direction was wrong.

select distinct * where {    ?x dbpedia-owl:wikiPageRedirects <http://dbpedia.org/resource/Paris> }  


回答2:

Artemis's answer is right; the "direction" in the query is wrong. It's worth explaining that a bit more, though. On the DBpedia "page", you'll see lots of data like:

dbpedia-owl:area      105400000.000000 (xsd:double)   dbpedia-owl:country   dbpedia:France   dbpedia-owl:inseeCode 75056 (xsd:integer)   dbpedia-owl:mayor     dbpedia:Anne_Hidalgo 

These mean that DBpedia contains triples where these are the predicates and objects. That is, DBpedia contains a triple:

dbpedia:Paris dbpedia-owl:country dbpedia:France 

On other hand, you'll also see things like "is … of":

is dbpedia-owl:beatifiedPlace of dbpedia:Daniel_Brottier is dbpedia-owl:billed         of dbpedia:René_Duprée 

These mean that dbpedia:Paris the object of triples with these subjects and predicates. E.g., DBpedia contains the triple

dbpedia:René_Duprée dbpedia-owl:billed dbpedia:Paris 

The redirects properties that you're seeing are like this:

is dbpedia-owl:wikiPageRedirects of dbpedia:City_of_Love_(city)                                     dbpedia:Département_de_Paris                                     dbpedia:Departement_de_Paris                                     dbpedia:FRPAR 

That means that there are a bunch of triples of the form:

?something dbpedia-owl:wikiPageRedirects dbpedia:Paris 

and that means that your query needs to be

select ?resource where {   ?resource dbpedia-owl:wikiPageRedirects dbpedia:Paris } 

SPARQL results



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