dewwrat
(Dewwrat)
October 7, 2020, 3:36am
1
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
chewxy
(chewxy)
October 7, 2020, 5:52am
2
Hey Dewwrat, welcome to the most awesome graph db community on the planet.
Can you post the full error message? thanks
1 Like
dewwrat
(Dewwrat)
October 7, 2020, 6:38am
4
{
"errors":[
{
"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 '<'",
"extensions":{
"code":"ErrorInvalidRequest"
}
}
]
}
chewxy
(chewxy)
October 7, 2020, 10:35pm
5
Hi @dewwrat can I have the first 5 lines of the RDF file please?
specifically the example should contain: # adding partner details
dmai
(Daniel Mai)
October 8, 2020, 1:36am
6
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" .
}
}
dewwrat
(Dewwrat)
October 8, 2020, 5:36am
8
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" .
MichelDiz
(Michel Diz)
October 8, 2020, 5:49am
10
Probably this is the issue. Try to prefix your Blank Node with _:
e.g
<_: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)