cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

SDN/RX labels are removed on node save

Hi,

Is there option do not remove old labels when node is saved(merged) ?

Example:
We create specific node with DynamicLabels

@Node("property")
@Getter
@Setter
@Builder
public class DaeDomainPropertyNode {
    @Id
    @Property("DaeId")
    private String name;

    @DynamicLabels
    private Set<String> labels;
}

Which is used as relationship node for other nodes
Such as

@Node("column")
@Getter
@Setter
@Builder
public class DaeDomainColumnNode {
    .....

    @Relationship(type = "Has")
    private Map<DaeDomainPropertyNode, DaeDomainPropertyRelationship> properties;

    ......
}    
@Node("environment")
@Getter
@Setter
@Builder
public class DaeDomainEnvironmentNode {
    .....

    @Relationship(type = "Has")
    private Map<DaeDomainPropertyNode, DaeDomainPropertyRelationship> properties;

    ......
}    

The DaeDomainEnvironmentNode and DaeDomainColumnNode nodes mark the property node (DaeDomainPropertyNode) with their labels in order to organize the graph traversal in the future by their labels.
If we save the DaeDomainColumnNode, then this save removes the DaeDomainEnvironmentNode labels (in case the properties intersect) and vice versa DaeDomainEnvironmentNode removes DaeDomainColumnNode properties.

P.S.
The code of the DynamicLabels#apply method does not inspire optimism that this is possible in the current version of SDN/RX, but... might it be possible to make configurability in future versions ?

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online