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:
...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 :-/
On Fri, Oct 12, 2012 at 12:30 PM, Nigel Small <ni...@nigelsmall.net> wrote:
> 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:
> ...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 :-/
My instinct is that it should carry on returning the indexed URI as
currently, not least because it would break existing code if changed, but
also the "indexed" URI is the only way to perform an index entry removal.
One way around it might be to allow the indexed URI to be used as an alias
for the node URI (for certain operations only maybe?) This way you could
have:
/index/node/People/name/Alice/1/relationships
as an alias for
/index/node/1/relationships
and that way all corresponding operations would be mapped.
WDYT? Not 100% sure about this one myself....
Nige
On 18 October 2012 16:17, kantube <mich...@mkanner.com> wrote:
On Thu, Oct 18, 2012 at 5:44 PM, Nigel Small <ni...@nigelsmall.net> wrote:
> My instinct is that it should carry on returning the indexed URI as
> currently, not least because it would break existing code if changed, but
> also the "indexed" URI is the only way to perform an index entry removal.
> One way around it might be to allow the indexed URI to be used as an alias
> for the node URI (for certain operations only maybe?) This way you could
> have:
> /index/node/People/name/Alice/1/relationships
> as an alias for
> /index/node/1/relationships
> and that way all corresponding operations would be mapped.
> WDYT? Not 100% sure about this one myself....
> Nige
> On 18 October 2012 16:17, kantube <mich...@mkanner.com> wrote:
>> peter,
>> shouldn't you always return the node uri? what is the pros/cons of each?
>> don't all batch commands need to reference the node not the index?