Neptune - multiple labels
Hey,
For some reason we had a few objects that had multiple labels. This was done via a huge script and we couldn't find anything that caused it.
Now that the vertices have multiple labels, one of which is correct, is there a way to remove the other labels, or do we have to remove them and recreate the vertices?
From what I could find, the only way to have multiple labels in Neptune is
Please advise.
For some reason we had a few objects that had multiple labels. This was done via a huge script and we couldn't find anything that caused it.
Now that the vertices have multiple labels, one of which is correct, is there a way to remove the other labels, or do we have to remove them and recreate the vertices?
From what I could find, the only way to have multiple labels in Neptune is
g.addV('label1'::'label2') but I'm certain my script never did that. Is there another way in which it's possible?Please advise.
Solution
Gremlin will not allow for you to remove labels. However, since Neptune supports both Gremlin and openCypher on the same data, you could use the openCypher support to remove the unwanted label(s):
For a vertex created with Gremlin using:
You could remove the
One possible way that you could end up with multiple labels is if you ran a bulk load job that had multiple rows with different labels per the same vertex ID:
For a vertex created with Gremlin using:
You could remove the
test2 label using:One possible way that you could end up with multiple labels is if you ran a bulk load job that had multiple rows with different labels per the same vertex ID: