Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Literals with escaped characters loaded from N3 cannot be referenced with SPAR(Q|U)L #54

Open
bollwyvl opened this issue Sep 9, 2013 · 1 comment

Comments

@bollwyvl
Copy link

bollwyvl commented Sep 9, 2013

When literals get OIDs from being loaded from N3, they will be added to the literalsToOID hash with any escaped characters, \n``\t``"``\b``\r``\, de-referenced.

Consider this triple, stored in a text file:

<http://foo> <http://bar> "baz\nbaz" .

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(){})

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

store.execute('DELETE DATA {' + triple + '}', function(){})
">> Error unregistering quad"
">> Cannot read property '1' of undefined"
">> ERROR unregistering quad"

Whereas if the same triple is loaded via SPAR*L, it's fine:

store.execute('INSERT DATA {' + triple + '}', function(){})
store.execute('DELETE DATA {' + triple + '}', function(){})

My work around is to manually transform incoming n3 to SPAR*L. I am not supporting the python-like """ string format, but it is good enough, I guess, as I control how they are constructed, but this seems like a pretty tough thing to handle if you don't control both sides.

@bollwyvl
Copy link
Author

This is still a even after the upgrade to the n3 parser #61.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant