5

The following query throws Virtuoso 37000 Error SP030: SPARQL compiler, line 0: Bad character '%' (0x25) in SPARQL expression at '%'

PREFIX res: <http://dbpedia.org/resource/>
PREFIX yago: <http://dbpedia.org/class/yago/>
SELECT * WHERE {
  res:Reykjav%C3%ADk rdf:type yago:CapitalsInEurope ;
                     rdfs:label ?label ;
                     rdfs:comment ?abstract.
  FILTER (lang(?label) = "en" && lang(?abstract) = "en")
} 

While this (forgive the pun) semantically identical query does not

PREFIX yago: <http://dbpedia.org/class/yago/>
SELECT * WHERE {
  <http://dbpedia.org/resource/Reykjav%C3%ADk> rdf:type yago:CapitalsInEurope ;
                     rdfs:label ?label ;
                     rdfs:comment ?abstract.
  FILTER (lang(?label) = "en" && lang(?abstract) = "en")
} 

How come URL-escaped characters are not allowed in prefixed identifiers but are when giving the complete IRI?

unor
  • 92,415
  • 26
  • 211
  • 360
ThomasH
  • 830
  • 1
  • 8
  • 23
  • 4
    They are in SPARQL 1.1. Maybe the version you are using has not caught up yet - it was moderately done late in the spec cycle to align with Turtle in RDF 1.1. http://www.sparql.org/query-validator.html – AndyS Apr 05 '14 at 17:17
  • @AndyS I'm happily using SUM in some of my queries which, correct me if I'm wrong, was only implemented in SPARQL 1.1. Is there any way to find out the SPARQL version of an endpoint? – ThomasH Apr 05 '14 at 17:56
  • 4
    [SPARQL Service Description](http://www.w3.org/TR/sparql11-service-description/) provides a means to describe the functionality of an endpoint including stating which SPARQL version it supports. However just because an implementation claims it supports it doesn't necessarily mean it actually does, Virtuoso in particular is notorious for its poor compliance to the spec and love of non-standard extensions – RobV Apr 06 '14 at 13:26
  • 1
    @ThomasH Based on your queries, I wonder if you're running against the DBpedia endpoint? It's based on Virtuoso which, besides a number of bugs and nonstandard behaviors, is somewhere in between SPARQL 1.1 and the original SPARQL. – Joshua Taylor May 12 '15 at 22:46
  • @ThomasH, `res:Reykjavík` works. – Stanislav Kralin Aug 03 '17 at 06:07

0 Answers0