Search code examples
sparqldbpedia

DBpedia SPARQL Query with Unicode


The following resource has an Unicode character in the name: http://dbpedia.org/page/Marit_Bj%C3%B8rgen

The following query works for resource names without Unicode character but using name above it returns nothing:

select ?label { 
 dbpedia:Marit_Bjørgen
   dbpedia-owl:birthPlace
     [ a dbpedia-owl:Country ;
      rdfs:label ?label ]
  filter langMatches(lang(?label),"en")
 }

I have also tried various escaping:

dbpedia:Marit_Bj%C3%B8rgen

But this returns error. Anyone that knows how to do this?


Solution

  • Remember that a QName like dbpedia:whatever is just an abbreviation for a complete URI. This works:

    select ?label { 
      <http://dbpedia.org/resource/Marit_Bj%C3%B8rgen>
        dbpedia-owl:birthPlace
          [ a dbpedia-owl:Country ;
            rdfs:label ?label ]
      filter langMatches(lang(?label),"en")
    }