LorenzBuehmann commented on issue #1259:
URL: https://github.com/apache/jena/issues/1259#issuecomment-1103643711

   Hi @afs 
   
   Yes, as I expected a limitation on the Wikidata backend or at least their 
server setup. I was just confused by the different behaviour of Jena 4.1.0 vs 
the latest versions, and then I remembered that you changed the used HTTP API. 
   
   See 
https://github.com/blazegraph/database/blob/master/bigdata-core/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/QueryServlet.java#L921
   
   ```java
    static private String getQueryString(final HttpServletRequest req)
               throws IOException {
           if (RESTServlet.hasMimeType(req, MIME_SPARQL_QUERY)) {
               // return the body of the POST, see trac 711
               return readFully(req.getReader());
           }
           return req.getParameter(ATTR_QUERY) != null ? req
                   .getParameter(ATTR_QUERY) : (String) req
                   .getAttribute(ATTR_QUERY);
       }
   ```
   
   Unfortunately they rely on the old HTTP API and the `HttpServletRequest` 
sticks to `ISO-8859-` by default if in the HTTP request no encoding is 
specified - and you can't change the default encoding afaik. The only fix would 
be to set the encoding on the request object, i.e.  
   ```java
   req.setCharacterEncoding("UTF-8");
   ```
   
   So not sure how to continue, we'll raise an issue on Blazegraph, but I don't 
think that fix will even make it to Wikidata setup as they would have to 
rebuild and redeploy Blazegraph.
   
   
   Regarding POST Form, via `curl` it works:
   
   ```bash
   curl -X POST --data "query=SELECT ?x { BIND('CuraƧao' As ?x) }" 
https://query.wikidata.org/sparql
   ```
   
   
   For Jena I guess we can close this issue here and at least have it for 
reference and documentation as a known limitation. Might affect other users as 
well.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to