0

Trying to execute some queries but when searching for foaf:name resultset is empty. Here's my code:

SELECT DISTINCT ?uri ?string 
WHERE {
    ?uri rdf:type ?x.       
        ?uri foaf:name 'Cavallo domestico'@it   .
        OPTIONAL { ?uri rdfs:label ?string . FILTER (lang(?string) = 'it') }
}

page exist http://it.dbpedia.org/resource/Equus_caballus/html

Apparently seems it's not related with languages different than english but with foaf:name request. If I execute following, retrieving generic foaf:givenName, it works:

SELECT DISTINCT ?uri ?string 
WHERE {
    ?uri rdf:type ?x.       
        ?uri foaf:givenName 'Jimmy'@en   .
        OPTIONAL { ?uri rdfs:label ?string . FILTER (lang(?string) = 'en') }
}
4

1 回答 1

1

当我第一次在评论中提到它没有出现时,我认为这不起作用,但是,正如 AKSW 指出的那样,这似乎现在起作用了。rdfs:label 属性具有各种语言的文章标题,而不是 foaf:name,因此您可以这样做来获取 Horse 的类型:

select ?x ?type {
  ?x a ?type ;
     rdfs:label "Equus caballus"@it
}

SPARQL 结果

于 2015-11-18T18:58:28.070 回答