openlink / virtuoso-opensource

Virtuoso is a high-performance and scalable Multi-Model RDBMS, Data Integration Middleware, Linked Data Deployment, and HTTP Application Server Platform
https://vos.openlinksw.com
Other
868 stars 210 forks source link

Character encoding issue in federated queries #232

Open roland-c opened 10 years ago

roland-c commented 10 years ago

When a federated query is issued involving IRI's with special characters these special characters get encoded wrong which corrupts the query. For example a resource with this IRI : http://nl.dbpedia.org/resource/Categorie:Nederlands-Brazilië gets escaped in a federated query like this: http://nl.dbpedia.org/resource/Categorie:Nederlands-Brazili\u00EB This is an example of a corrupted query: http://bit.ly/1ipPNmu (stable) http://bit.ly/1xEO5eo (may be away now and then)

roland-c commented 9 years ago

Hi, Any news on this issue? I ran into another situation: http://bit.ly/1jKWqIk

Thanks, Roland

HughWilliams commented 9 years ago

It still persists as I can recreate from local sparql endpoint against the dbpedia.org/sparql also ... so have report to development to look into, with steps to recreate locally ...

jberkel commented 8 years ago

Any updates on this? A simple query to replicate:

SELECT ?subject, ?concept
WHERE
{
   { 
      SELECT ?subject { VALUES ?subject { <http://fr.dbpedia.org/resource/États-Unis> } } 
   }
   SERVICE <http://fr.dbpedia.org/sparql> { ?subject a ?concept }
}

Error output is:

Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://fr.dbpedia.org/sparql', ...) returned Content-Type 'text/plain' status 'HTTP/1.1 400 Bad Request
'
Virtuoso 37000 Error SP030: SPARQL compiler, line 0: Bad character '\' (0x5c) in SPARQL expression at '\'

SPARQL query:
define sql:big-data-const 0  SELECT ?concept
 WHERE {  <http://fr.dbpedia.org/resource/\u00C9tats-Unis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?concept .
     FILTER (<http://fr.dbpedia.org/resource/\u00C9tats-Unis> =  <http://fr.dbpedia.org/resource/États-Unis>) }

SPARQL query:
define sql:big-data-const 0 
#output-format:text/html
define sql:signal-void-variables 1 SELECT ?subject, ?concept
WHERE
{
   { 
      SELECT ?subject { VALUES ?subject { <http://fr.dbpedia.org/resource/États-Unis> } } 
   }
   SERVICE <http://fr.dbpedia.org/sparql> { ?subject a ?concept }
}
HughWilliams commented 8 years ago

@jberkel: This is still to be looked into ... I have added this test case to the internal ticket that already exists ...

pasqLisena commented 6 years ago

Same issue, I give you my test case.

Endpoint: http://data.doremus.org/sparql

Query: (- result)

PREFIX dbp: <http://dbpedia.org/property>
PREFIX dbo: <http://dbpedia.org/ontology/>

SELECT * WHERE {
    ?id foaf:isPrimaryTopicOf ?wikipedia .

    SERVICE <http://dbpedia.org/sparql> {
        SELECT * WHERE {
          ?dbpedia foaf:isPrimaryTopicOf ?wikipedia.
          OPTIONAL { ?dbpedia dbo:wikiPageRedirects ?redirect . }
          OPTIONAL { ?dbpedia foaf:depiction ?picture. }
          OPTIONAL { ?dbpedia rdfs:comment ?comment. }
        }
    }
} LIMIT 10