Loading strings with double quotes (")

I Want to Do

Load data into Dgraph, with strings that contain double quotes (").

What I Did

I have the data in RDF format as follows;

<_:id/0053C9-E> <name> "Toys \"R\" Us" .

as this was the way to escape double quotes I found. However, when retrieving this data from Dgraph, the escape characters are returned as well (Toys \"R\" US instead of the desired Toys "R" US)

Dgraph Metadata

Dgraph version   : v20.11.0
Dgraph codename  : tchalla
Dgraph SHA-256   : 8acb886b24556691d7d74929817a4ac7d9db76bb8b77de00f44650931a16b6ac
Commit SHA-1     : c4245ad55
Commit timestamp : 2020-12-16 15:55:40 +0530
Branch           : HEAD
Go version       : go1.15.5
jemalloc enabled : true
1 Like

That’s right. Dgraph doesn’t escape and unescape. So you need to escape and unescape on your end.

Some time ago I thought about having a directive to escape and unescape on the fly. Not sure if I have opened a feature request for this. If not, feel free to ask it.

I think that would come in handy, yes!