SPARQL parser cannot handle escaped backslashes #55

bollwyvl opened this Issue Sep 9, 2013 · 1 comment


None yet

2 participants

bollwyvl commented Sep 9, 2013

After figuring out my workaround for #54, I encountered new problems with string escaping.

Consider this triple, stored in a text file:

<http://foo> <http://bar> "b\\a\\z" .

loaded like this:

var triple;
$.get("sample.n3", function(txt){ triple = txt });

then added to a store like this:

store.load('text/turtle', triple, function(){})

and can be retrieved like this:.

  'SELECT * WHERE {<http://foo> <http://bar> ?o}',
  function(e, rows){console.log(rows[0].o.value)}
">> b\a\z"

There is no way whatsoever to delete this data with SPAR*L:

store.execute('DELETE DATA {' + triple + '}', function(){})
// SyntaxError: Expected [2] Query or [30] Update but "D" found."

I currently have no workaround for this, other than replacing all of the users' \ with /, which is not really acceptable, but good enough to to go forward with.

l00mi commented Sep 10, 2013

Experiencing the same, even if using store.delete(graph) only with rdfstore-js generated SPARQL queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment