age
age copied to clipboard
Implement remove label from an entity
Is your feature request related to a problem? Please describe. Currently Cypher query cannot remove a label from a vertex\edge.
Describe the solution you'd like
It can be achieved by implementing the remove clause:
REMOVE a:Label
Describe alternatives you've considered N/A
Additional context N/A
According to the Apache AGE documentation, which can be found here, edges are required to have a label. Therefore, it would only be possible to rename an edge label
@WendelLana In AGE, renaming is the process of migrating a vertex or edge from one label to another and possibly having to create the new label and remove the old label. Additionally, we're trying to bring labels in AGE more in line with labels in openCypher. That means, multiple labels. In that additional context, that means being able to remove labels from vertices or edges.
Indeed, Cypher currently does not have a built-in clause for removing labels from vertices and edges. This can be inconvenient in situations where you need to update the label of a node or edge.
Your proposed solution of using the REMOVE clause to remove a label would be a great addition to the language. It would make it more flexible and allow for easier updating of graph data.
As an alternative, you can use the SET clause to update the label of a node or edge. For example, to change the label of a node from "Label1" to "Label2", you can use the following query:
MATCH (a:Label1)
SET a:Label2
REMOVE a:Label1
This would add the "Label2" label to the node and remove the "Label1" label.
However, this approach can become cumbersome if you have a large number of labels to update, so having a built-in REMOVE clause would definitely be useful.
I hope this helps!
This issue is stale because it has been open 45 days with no activity. Remove "Abondoned" label or comment or this will be closed in 7 days.