SPARQL query returning incomplete/inconsistent results

时光怂恿深爱的人放手 提交于 2019-12-12 01:47:12

问题


I am trying to run the following query to get all the properties of a resource:

select distinct ?property
where {
<http://dbpedia.org/resource/Bildøy> ?property ?value
}

on http://dbpedia.org/snorql/

However, I only get a few results, and not the ones I was expecting. Most of the properties on this page are missing http://dbpedia.org/page/Bild%C3%B8y

Could this be because of the ø-letter in the URI? The query seems to be working fine with other resources, but having the same problem with other resource with the ø-letter (Example: http://dbpedia.org/page/Rad%C3%B8y).

When I run the query in a PHP script I get the following results:

array (
  0 => 'dbpedia-owl:wikiPageInLinkCountCleaned',
  1 => 'dbpedia-owl:wikiPageRank',
  2 => 'dbpedia-owl:wikiHITS',
  3 => 'dbpedia-owl:wikiPageOutLinkCountCleaned',
)
array (
  0 => 'http://www.w3.org/2002/07/owl#sameAs',
)

回答1:


It was the ø-letter causing the problem. By using the PHP urlencode() function on the resource name (turning it into UTF8 hex?) before the query, it will return the properties. ø is translated to %C3%B8 and is also the value being used in the DBpedia URI http://dbpedia.org/page/Bild%C3%B8y.



来源:https://stackoverflow.com/questions/28435939/sparql-query-returning-incomplete-inconsistent-results

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