gpt4 book ai didi

sparql - DBPedia SPARQL 查询应返回结果但为空

转载 作者:行者123 更新时间:2023-12-05 00:35:48 27 4
gpt4 key购买 nike

我想获取所有具有指定类别和指定键的页面。我的查询:

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
)

}

但它返回零结果。看这里: SNORQL query

至少应该返回这个页面: http://dbpedia.org/page/Duinrell (因为它符合条件)。

有任何想法吗?

最佳答案

您的查询有一些问题。首先,在比较 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com