0

That following resource http://dbpedia.org/page/Ulugh_Beg has a "foaf:name" field which has two values:

  • Beg, Ulugh
  • Ulugh Beg

Why then does this query return no results on http://dbpedia.org/sparql?

select ?article
where 
{
  ?article foaf:name "Ulugh Beg"
}
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286

1 Answers1

2

The value you see on http://dbpedia.org/page/Ulugh_Beg is an HTML rendering, and it doesn't always perfectly reflect the underlying RDF data. If you scroll to the bottom of that page, there are some Raw Data links where you can browse the data in actual RDF formats. For instance, if you grab the N3/Turtle version, you'll see

dbpedia:Ulugh_Beg
  dc:description "Timurid ruler"@en , "Timurid ruler" ;
  foaf:givenName "Ulugh"@en ;
  foaf:name "Beg, Ulugh"@en , "Ulugh Beg"@en .

The name has the language tag en. If you want to query by name like this, you'll need to include that. For instance:

select ?person where {
  ?person foaf:name "Ulugh Beg"@en
}

SPARQL results

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Yay. I couldn't get _any_ sample query I tried to work, before that. – Topological Sort Oct 15 '14 at 20:37
  • @WillBriggs yes, that was from an earlier version of the answer. There's no mention of `some-language` anymore. I'm confused, though; are you the same as Chris, the asker? – Joshua Taylor Oct 15 '14 at 20:37
  • @WillBriggs Ah, OK. Just the way it was phrased, it sounded like you'd been waiting for an answer to this 2-hour old question. Glad to hear it helped though; there's lots of data available in DBpedia, and it can be a very useful source, especially with a very flexible query language like SPARQL. – Joshua Taylor Oct 15 '14 at 20:47