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') }
}
svick
  • 236,525
  • 50
  • 385
  • 514
RobMor
  • 57
  • 10
  • Did you run this against http://it.dbpedia.org/sparql ? It works for me. – Joe Nov 17 '15 at 11:10
  • Possible duplicate of [dbpedia fetch entitites in language other than english](http://stackoverflow.com/questions/29069479/dbpedia-fetch-entitites-in-language-other-than-english) – Joe Nov 17 '15 at 11:13
  • 1
    which one? the first, the second or both? First query returns no results if run in http://dbpedia.org/snorql/. If run in it.dbpedia.org/sparql , as you suggest, it works..... – RobMor Nov 17 '15 at 11:23
  • @Joe I'm not sure it's a duplicate anymore. When I look at the Horse entry on DBpedia, I only see one rdfs:label, now. When I pull down the corresponding NTriples, I *do* get all the labels, but I don't seem them on dbpedia.org/sparql when I query for rdfs:label. – Joshua Taylor Nov 17 '15 at 13:20
  • 1
    @JoshuaTaylor When I run the query [click](http://bit.ly/1S4zD5v) I get all labels from dbpedia.org/sparql . – UninformedUser Nov 18 '15 at 18:15
  • @AKSW Yup, it's definitely there. I'm pretty sure it wasn't showing up when I did that search, but maybe I had a typo or something. – Joshua Taylor Nov 18 '15 at 18:55

1 Answers1

1

I think this wasn't working when I first mentioned that it didn't in a comment, but, as AKSW points out, this seems to be working now. The rdfs:label property has the article titles in various languages, not the foaf:name, so you can do this to get the types of Horse:

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

SPARQL results

Community
  • 1
  • 1
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • yes it works the problem is in the endpoint you query: In: dbpedia.org/snorql it doesn't In: it.dbpedia.org/sparql it does! – RobMor Nov 19 '15 at 13:57