DBPedia:dbo:region属性出现问题



我正试图使用SPARQL查询从DBPedia收集所有活跃在美国的音乐家。我尝试了以下查询,但它返回一个空列表:

PREFIX dbp: <http://dbpedia.org/property/>
SELECT distinct ?person where {?person a dbo:MusicalArtist . ?person dbp:region "United States"} LIMIT 100

我不确定这里出了什么问题。我尝试过在foaf:name等其他属性上匹配字符串值,但没有遇到任何问题,所以我不确定"region"属性为什么不起作用。

已解决!感谢@UniinformedUser在上面的评论。

我们只需要指定字符串匹配的文字类型。

PREFIX dbp: <http://dbpedia.org/property/> 
SELECT distinct ?person where {?person a dbo:MusicalArtist . ?person dbp:region "United States"^^rdf:langString} LIMIT 100

对我来说,这段代码有效-

PREFIX dbp: <http://dbpedia.org/property/> 
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT distinct ?person where 
{
    ?person a dbo:MusicalArtist . 
    ?person dbp:region "United States"@en .
} 
LIMIT 100

最新更新