Closed inaimathi closed 6 years ago
Thanks. My only worry is that if the SPARQL contains a double-quoted literal, and that literal contains a single-quoted string, then it will get substituted. Is that right? We don't want that. Example:
(is (= "\"Leave this 'keyword' alone\""
(q/-substitute-single-quotes
(atom {:env {:labels {"keyword" {:curie "foo:bar" :iri "www.foo.com/bar"}}}})
"\"Leave this 'keyword' alone\"")))
SPARQL queries are never very big, so even though we found Instaparse to be slow, we could use it for this case. Eventually I would like to adapt this to Turtle files, which can be large, so it would be nice to keep it fast.
Added the above test case to this, and it passes with the revised regex (both here and locally).
Mergeable. Currently resolves https://github.com/knocean/knode/issues/53 and https://github.com/knocean/knode/issues/54. Realistically could use some minor refactoring around
result->edn
.