问题
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