Nigel Small
unread,Oct 12, 2012, 6:30:09 AM10/12/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Neo4J
Hi chaps
I've hit a small feature in REST batch submissions which I can't find a way around. REST batches obviously allow references to items created within the same batch so that payloads like the following can create a pair of nodes with a relationship between them:
[
{ "id": 0, "method": "POST", "to": "/node",
"body": {"name": "Alice"}
},
{ "id": 1, "method": "POST", "to": "/node",
"body": {"name": "Bob"}
},
{ "id": 2, "method": "POST", "to": "{0}/relationships",
"body": {"type": "KNOWS", "to": "{1}", "data": {"since" : "1999"}}
}
]
This is fine until I want the nodes to be uniquely indexed. I then try this instead...
[
{ "id": 0, "method": "POST", "to": "/index/node/People?unique",
"body": {"key": "name", "value": "Alice", "properties": {"name": "Alice"}}
},
{ "id": 1, "method": "POST", "to": "/index/node/People?unique",
"body": {"key": "name", "value": "Bob", "properties": {"name": "Bob"}}
},
{ "id": 2, "method": "POST", "to": "{0}/relationships",
"body": {"type": "KNOWS", "to": "{1}", "data": {"since" : "1999"}}
}
]
...and receive a BatchOperationFailedException with an empty message. I have tested the node creation jobs (ids 0 and 1) from this on their own and they work fine. This indicates that the issue is with the relationship creation. I'm guessing that the substitutions {0} and {1} are substituting the "indexed" URI instead of the "self" URI for each of the nodes and so the URIs generated behind the scenes are invalid. Not sure though, something else may be going on...
Incidentally, I'm using curl for these tests to make sure the problem isn't client side. I've also run against the latest milestone and snapshot builds with similar results.
Help appreciated... I'm kinda stuck with this one :-/
Cheers
Nige