Special Characters in values

i understand what you said. And you should be clear than in dgraph-ratel, it can not accept you doing this. but you can try mutate data with interface defined in api.proto.
and the result return should be like this:

"data": {
    "query": [
      {
        "uid": "0x3",
        "name": "1) On the manifest details page add a search option to find:\na) Major Client\nb) Consignee\nc) Forwarder\nd) Mfst#\ne) Arrival Date\nf) Invoice\ng) HBL"
      }
    ]
  },

As Jerry Y. says, this is not a Dgraph error. The RDF standard does not allow this use. And not even with JSON. Because it is a Literal String. It is not an HTML text field. What you can do is to use escapes as Jerry mentions and then use some parse in your application to translate the string with correct spaces. You could set html literal in the string and then use an HTML converter in your application who knows.

But you could do it here too.

{
set{
<_:addrs> <correspondence_address> "1) On the manifest details page add a search option to find:" .
<_:addrs> <correspondence_address_options> <_:Options_a> .
<_:addrs> <correspondence_address_options> <_:Options_b> .
<_:addrs> <correspondence_address_options> <_:Options_c> .
<_:addrs> <correspondence_address_options> <_:Options_d> .
<_:addrs> <correspondence_address_options> <_:Options_e> .
<_:addrs> <correspondence_address_options> <_:Options_f> .
<_:Options_a> <option> "a) Major Client" .
<_:Options_b> <option> "b) Consignee" .
<_:Options_c> <option> "c) Forwarder" .
<_:Options_d> <option> "d) Mfst#" .
<_:Options_e> <option> "e) Arrival Date" .
<_:Options_f> <option> "f) Invoice" .
<_:Options_g> <option> "g) HBL" .
}}
1 Like

i find:

i have a predicate with value: sdcsd\u0000dsfdsfdsf

and then i exported database from dgraph into RDF, the value changed to:

“<_:uidcea> “sdcsd\x00dsfdsfdsf”^^xs:string .”

the problem is that: i can not use bulk loader to import this, it has a error:

while lexing <_:uidcea> <name> "sdcsd\\x00dsfdsfdsf"^^<xs:string> .: Invalid escape character : 'x' in literal while parsing line "<_:uidcea> <name> \"sdcsd\\x00dsfdsfdsf"^^<xs:string> ."

it seems that it can not parse this special value : \u0000 , how should i do?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.