Fixed bug with SPARQL query encoding