如何在 "category" 页面中查询 dbpedia.org 资源?

how to query dbpedia.org for resources in "category" pages?

这是在 dbpedia 中使用 sparql 的简单查询。

prefix dct:<http://purl.org/dc/terms/>

select   ?x   
where { ?x dct:subject <http://dbpedia.org/resource/Category:Cycle_racing_by_country>
  }

prefix dbc:<http://dbpedia.org/resource/Category:>
prefix dct:<http://purl.org/dc/terms/>


select   ?x   
where { ?x dct:subject dbc:Cycle_racing_by_country.
  }

它没有 return 任何值。

那么如何查询 http://dbpedia.org/page/Category:Cycle_racing_by_country 并获取它的数据?

正如 aksw 在评论中所说,none 的 DBpedia 实体由 IRIS 以 http://dbpedia.org/page/ 开头标识,而不是 http://dbpedia.org/resource/.

虽然很容易犯这个错误,因为如果您在网络浏览器中访问,例如 http://dbpedia.org/resource/Johnny_Cash,您将被重定向到一个包含 /page/ 的 URI。 DBpedia 的一个更好的解决方案是在浏览器请求资源页面时直接使用内容类型协商 return html 内容。