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



这是在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.
  }

它不返回任何值。

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

正如aksw在评论中所说,IRIS没有一个DBpedia实体以http://dbpedia.org/page/开头,而是以http://dbpedia.org/resource/开头

。但是,犯

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

最新更新