cypher - Create duplicate node and relationship to handle versioning in Neo4j -


i've seen previous topic duplicates, here use case bit different. i'm managing part assemblies bill of material. each node should verionnable. want handle versioning duplicating node , every relationship node. create lot of nodes, , relationships that's way manage think. easiest way run cypher?

i've seen how create node, need duplicate relationships.

you want kind of programming language. here little cypher example can start experiment. did similar. 1 thing aware of since creating new versions of same of objects same data have limitations uniqueness constraints. in case bom have many uniques keys choose though. data little fuzzier. ended creating new label each new version , added uniqueness constraint on name every label version. indexed name across database. that suggestion courtesy of michael hunger

// match 2 specific nodes of particular version , relationship match (a:node)-[r1:assembled_with]-(b:node)  a.name = 'node 1' , a.version = 1    , b.name = 'node 2' , b.version = 1 // create copies of nodes , change relationship create (c:node) set c = a, c.version = 3  create (d:node) set d = b, d.version = 3 //create copy of relationship , change version of create (c)-[r2:assembled_with]->(d) set r2 = r1, r2.version = 3 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -