antoniogarrote / rdfstore-js

JS RDF store with SPARQL support
MIT License
564 stars 109 forks source link

More robust quote escaping #60

Closed l00mi closed 9 years ago

l00mi commented 10 years ago

This changes are quite deep in rdfstore-js. I had some problems with doublequotes in literal strings not going through directly.

First there is a change in RDFInterface which does create escaped Literals as of http://www.w3.org/TR/2012/WD-turtle-20120710/#turtle-literals if calling .toString() / .toNT()

Which makes it possible to simplify the ._nodeToQuery() which passes the change through.

And last we did change the sparql_parser.js to accept triple double quote (""") and triple single quote (''') strings with double or respectively single quotes in them. (Here I got the problem that sparql_query_case.pegs is not in sync with the actual sparql_parser.js ... but no regression found so far. Tests are all working.)