addV with existing ID doesn't throw error
I noticed when I call
addV(newLabel)
with an existing ID but a different label, it will add the newLabel
and the new properties defined to the existing vertex.
This is verrrry undesirable behavior, I would need to it throw a constrain violation.
Any thoughts?11 Replies
what graph system are you finding this happening with?
i would expect the following on any graph:
i think i recall you were using Neptune - is that right?
Solution
This works on Neptune b/c of the support for multiple labels. :/
interesting. i knew Neptune had multi-labels but wouldn't have expected
addV()
to trigger the multiple labels
no workarounds? i guess you'd just have to always validate with fold()/coalesce()/unfold()
?Yes, or use
mergeV()
once it is supported.Yea this was my problem the other day haha. I wrote a bunch of code that consolidates messy gremlin, locally against the gremlin-server @ 3.6.0 only to realize it’ll have to get stashed until Neptune supports that version
so you were trying out the new
mergeV()
and mergeE()
steps?Hmmm
ok
Thanks
Yes, I was trying it out locally against docker gremlin-server but, I’ll come back to it once gremlin 3.6.0 is supported by Neptune
do you happen to have any feedback/thoughts on the API that those new steps offer?
I think they’re great you all are amazing! I’d need to look at the internals I wasn’t sure if it is actually calling coalesce or if there is some more complicated conditional logic in there under the hood but, the abstraction is nice and intuitive and it does what I would expect.
it is not calling
coalesce()
it is a brand new natively executed step