2

I am trying to do some searches and understanding SPARQL queries. I want to Restrict the query to include only bindings to ?capital that have a rdfs:label relation with the English language literals "Amsterdam" or "Berlin". How can i do do this?

   PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   PREFIX dbo: <http://dbpedia.org/ontology/>
   PREFIX dbpedia: <http://dbpedia.org/resource/>

   SELECT DISTINCT ?capital ?area 
   WHERE {  
      ?country dbo:capital ?capital.  
      ?capital dbo:areaTotal ?area .            
   }
user2989433
  • 53
  • 1
  • 6
  • 1
    This was asked so often here that I'm wondering why you did not found it...e.g. in http://stackoverflow.com/questions/18733225/extract-all-types-and-their-labels-in-english-from-dbpedia you find the answer. – UninformedUser Sep 16 '16 at 14:18
  • 1
    ...`rdfs:label ?label . filter(langMatches(lang(?label),"EN"))` – UninformedUser Sep 16 '16 at 14:20

0 Answers0