if I do a SERVICE call to DBpedia, from a local virtuoso instance, I get encoding errors when the resource has special chars and it gets translated into a unicode escaped.
In our local triplestore we have triples about <http://it.dbpedia.org/resource/Cefalù>
but when using it in query it get encoded to:<http://it.dbpedia.org/resource/Cefal\u00F9>
error message:
Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://it.dbpedia.org/sparql', ...) returned Content-Type 'text/plain' status 'HTTP/1.1 400 Bad Request ' Virtuoso 37000 Error SP030: SPARQL compiler, line 0: Invalid character in SPARQL expression at '\' in sparql_to_sql_text:(BIF), <Top Level> SPARQL query: define output:format "HTTP+XML application/sparql-results+xml" define output:dict-format "HTTP+TTL text/rdf+n3" SELECT ?image WHERE { <http://it.dbpedia.org/resource/Cefal\u00F9> <http://xmlns.com/foaf/0.1/depiction> ?image . } SPARQL query: define sql:big-data-const 0 #output-format:text/html define sql:signal-void-variables 1 SELECT * WHERE { GRAPH <http://athena.pa.icar.cnr.it/eventiPCC2018-merged-nominatim>{ ?event <http://schema.org/location> ?place . ?place <http://www.w3.org/2002/07/owl#sameAs> ?sameAs } SERVICE <http://it.dbpedia.org/sparql> { ?sameAs <http://xmlns.com/foaf/0.1/depiction> ?image } }
Note, when importing the DBpedia data required for that call (foaf:depiction triples) the same query works well without SERVICE and by using just a GRAPH call.
If you are also running an older Virtuoso, an update is likewise recommended.
Now, starting to look at the query – I think you’ll find code-fences (three backticks before and after) work better when posting big query, code, and/or error blocks here. Else, it’s hard to tell where various HTML and other escaping happens, and we need to know the exact characters in your query, error, etc.
I think (with some adjusted whitespace) that this is the query you’re actually executing?
I would suggest that, after confirming your own Virtuoso is a recent version (at least 7.2.4 if not fully current), you try almost the identical query, changing only the SERVICE from <http://it.dbpedia.org/sparql> to <http://dbpedia.org/sparql>.
Any error message from that test should be quite informative.