Rdf sparql如何在标签上搜索';不带语言指示器的s值
我有这样一个问题:Rdf sparql如何在标签上搜索';不带语言指示器的s值,rdf,sparql,semantic-web,owl,rdfs,Rdf,Sparql,Semantic Web,Owl,Rdfs,我有这样一个问题: SELECT ?uri (STR($labelString) as $label) WHERE {?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.isep.org/desco/2015/RealEstate> . ?uri <http://www.w3.org/2000/01/rdf-schema#label> $labelString .
SELECT ?uri (STR($labelString) as $label)
WHERE {?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.isep.org/desco/2015/RealEstate>
. ?uri <http://www.w3.org/2000/01/rdf-schema#label> $labelString .
?uri <http://www.isep.org/desco/2015/isNearTo> ?placeOfInterest .
?placeOfInterest <http://www.w3.org/2000/01/rdf-schema#label> "Parque Nacional da Peneda-Gerês" }
SELECT?uri(STR($labelString)作为$label)
{?uri在哪里
.?uri$labelString。
?uri?兴趣的位置。
“国家公园”利益所在地
如您所见,我正在搜索一个特定的标签,它没有工作,因为我没有指定语言
当我这样指定语言时
SELECT ?uri (STR($labelString) as $label)
WHERE {?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.isep.org/desco/2015/RealEstate>
. ?uri <http://www.w3.org/2000/01/rdf-schema#label> $labelString .
?uri <http://www.isep.org/desco/2015/isNearTo> ?placeOfInterest .
?placeOfInterest <http://www.w3.org/2000/01/rdf-schema#label> "Parque Nacional da Peneda-Gerês"@pt }
SELECT?uri(STR($labelString)作为$label)
{?uri在哪里
.?uri$labelString。
?uri?兴趣的位置。
“国家公园”利益所在地@pt}
一切正常,但问题是我不知道标签是用什么语言写的。我可以在不指定语言的情况下进行搜索吗
我确实在谷歌上搜索过,它似乎连接到了过滤器,但实际上我自己找不到
非常感谢您的帮助您只需使用
str
筛选标签即可。所以在DBpedia上试试这个:
select distinct *
where {
?x a ?o.
?x rdfs:label ?label
filter(str(?label)="1918 in China")
} LIMIT 100
因此,基于此,您的查询需要:
SELECT ?uri (STR($labelString) as $label)
WHERE {?uri a <http://www.isep.org/desco/2015/RealEstate>.
?uri <http://www.w3.org/2000/01/rdf-schema#label> $labelString .
?uri <http://www.isep.org/desco/2015/isNearTo> ?placeOfInterest .
?placeOfInterest rdfs:label ?label
filter(str(?label)="Parque Nacional da Peneda-Gerês")
}
SELECT?uri(STR($labelString)作为$label)
在哪里{uria。
?uri$labelString。
?uri?兴趣的位置。
?感兴趣的RDF位置:标签?标签
过滤器(str(?标签)=“佩内达国家公园”)
}
使用过滤器会对性能产生副作用,但它可以解决您的问题<代码>“foo”与“foo”@en
的RDF文本不同。你正在寻找的“过滤器”线程:一定要阅读对问题的评论;在回答这个问题45分钟前,有一条评论贴了一个链接,链接使用了相同的(正确的)方法。