Issue with Load data to DB from rdf

I am trying to Load data using curl -H "Content-Type: application/rdf" "localhost:8080/mutate?commitNow=true" -XPOST --data-binary @/path/file_data.rdf

Getting an exception ErrorInvalidRequest due to
Comments added in the file like # adding partner details

Please suggest

Hey Dewwrat, welcome to the most awesome graph db community on the planet.

Can you post the full error message? thanks

1 Like
         "message":"while lexing  # adding partner details\n \n<1cef62c0-3ecc-42b3-8e18-50150264df44>  <partnerSugarId>  \"1cef62c0-3ecc-42b3-8e18-50150264df44\"  .\n<441b8e3d-cdc1-496a-959e-c7ab8eec44c1>  <partnerSugarId>  \"441b8e3d-cdc1-496a-959e-c7ab8eec44c1\" .\n<3363f7be-889e-4976-bb73-82e71c8dcf07>  <partnerSugarId>  \"3363f7be-889e-4976-bb73-82e71c8dcf07\" .\n<7096b1c3-1461-476e-8470-5b8ac147bc3b>  <partnerSugarId>  \"7096b1c3-1461-476e-8470-5b8ac147bc3b\" .\n\n at line 3 column 0: Unexpected character while identifying mutation block: U+003C '<'",

Hi @dewwrat can I have the first 5 lines of the RDF file please?

specifically the example should contain: # adding partner details

Via the HTTP API, you’ll need to wrap your RDFs in a set block. This is how you indicate it’s a set-mutation (insertion).

  set {
    <_:n1> <partnerSugarId> "123" .
    <_:n2> <partnerSugarId> "123" .
    <_:n3> <partnerSugarId> "123" .

adding partner details

<1cef62c0-3e2c-42b3-8e18-501503543f44>  <partnerSugarId>  "1cef62c0-3ee3-42b3-8e18-50150264df44"  .
<441b8e3d-cdc1-496a-8e3e-c7ab8eec44c1>  <partnerSugarId>  "441b8e3d-cdc1-f62a-959e-c7ab8eec44c1" .
<3363f7be-889e-4976-bb73-82e71c8dcf07>  <partnerSugarId>  "3363f7be-889e-e716-bb73-82e71c8dcf07" .
<7096b1c3-1461-476e-4770-5b8ac147bc3b>  <partnerSugarId>  "47b6b1c3-1461-476e-8470-5b8ac147bc3b" .
<ce2bec6d-f207-4b43-bcfe-4d6d8100d323>  <partnerSugarId>  "ce2bec6d-f6d8-4b43-bcfe-4d6d8100d323" .

Probably this is the issue. Try to prefix your Blank Node with _:


<_:1cef62c0-3e2c-42b3-8e18-501503543f44>  <partnerSugarId>  "1cef62c0-3ee3-42b3-8e18-50150264df44"  .

Or just

_:1cef62c0-3e2c-42b3-8e18-501503543f44  <partnerSugarId>  "1cef62c0-3ee3-42b3-8e18-50150264df44"  .

To go deeper and understand why, you can check Increase RDF compliance support (N-Triples)