作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想获取所有具有指定类别和指定键的页面。我的查询:
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX dcterms: <http://dublincore.org/2010/10/11/dcterms.rdf#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX grs: <http://www.georss.org/georss/point>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?page ?cat ?key ?value (lang(?value) as ?language) WHERE {
?page dcterms:subject ?cat .
?page ?key ?value .
FILTER(
regex(?cat, "category:Amusement_parks_in_the_Netherlands") &&
?key = foaf:depiction
)
}
最佳答案
您的查询有一些问题。首先,在比较 URI 时不要使用正则表达式。代替:
regex(?cat, "category:Amusement_parks_in_the_Netherlands")
?cat = <http://dbpedia.org/resource/category:Amusement_parks_in_the_Netherlands>
dcterms:subject
,在您的查询中,前缀
dcterms
映射到命名空间
http://dublincore.org/2010/10/11/dcterms.rdf#
.但是,DBPedia 中的实际属性是
http://purl.org/dc/terms/subject
,所以你的命名空间前缀应该映射到
http://purl.org/dc/terms/
反而。
关于sparql - DBPedia SPARQL 查询应返回结果但为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8953411/
我是一名优秀的程序员,十分优秀!