-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
RDF parser Bug with Unicode Character when Export. #3383
Comments
I'll take a look at this. It shouldn't be too hard to fix. |
BTW, the error only appears in export. If you query for the node the string will come correctly. I guess the JSON export could export correctly. I did not test because it is not ready. |
No the problem exists with JSON as well. Exported:
dgraph live:
|
Also, I don't think the problem is just with the export. Doing
in ratel will also give the same error. |
This error with \a is because you need to add the escape tho. When you export it will be fine The whole issue is solved if you escape as recommends JSON standard. So or we add a escape and unescape between the parser or we warn users that this task is theirs. |
I understand that using "\\a" works, but that's not doing the same thing. "\\a" is including the characters '\' (ASCII 92) and 'a' ASCII (97) into the string. "\u0007" (and "\a") is inserting the single character BEL (ASCII 7). That's why the "\u0007" is converted to just "\a" on export. |
Other very curious case related: see this (about this link, this tests are succeeded at all?)
If you send as Javascript Escape
All results:
The exported RDF
|
If you suspect this could be a bug, follow the template.
What version of Dgraph are you using?
1.0.14, v1.0.15-rc4 and Master
Have you tried reproducing the issue with latest release?
yes
What is the hardware spec (RAM, OS)?
32GB, Darwin.
Steps to reproduce the issue (command/config used to run Dgraph).
This happened due a import from Twitter dataset from flock. The load was canceled:
So to reproduce it, just do like:
Then export
http://localhost:8080/admin/export
and the bug happens
<0x1> <description> "\a"^^<xs:string> .
When you try to reimport the RDF you have a lexing error.
"while lexing <_:0x1> <description> \"\\a\"^^<xs:string> . at line 1 column 22: Invalid escape character : 'a' in literal"
To solve this in part we should force (auto)escape. Or recommend users to do it in application level.
If you escape the string, mutate and export you gonna have a desirable result:
RDF exported:
<0x1> <pred> "\\u0007"^^<xs:string> .
The text was updated successfully, but these errors were encountered: