12

I'm querying dbpedia.org for a description of Big Ben with this SPARQL query:

select ?desc 
where {
<http://dbpedia.org/resource/Big_Ben> <http://www.w3.org/2000/01/rdf-schema#comment> ?desc
}

This returns a list of descriptions in at least 10 different languages. How do I specify that I only want the English language description?

Ben Companjen
  • 1,417
  • 10
  • 24
siamii
  • 23,374
  • 28
  • 93
  • 143

1 Answers1

21

The keys you need to know are that str() and lang() pull apart the text and language of the value, so you can do this:

select str(?desc) 
where {
  <http://dbpedia.org/resource/Big_Ben> <http://www.w3.org/2000/01/rdf-schema#comment> ?desc
  FILTER (langMatches(lang(?desc),"en"))
}
glenn mcdonald
  • 15,290
  • 3
  • 35
  • 40