You definitely want to do this with some kind of programming language. But here is a little cypher example so you can start to experiment. I recently did something similar. One thing to be aware of that is since you are creating new versions of the same of objects with the essentially the same data you have some limitations with uniqueness constraints. In your case with BOM you probably have many uniques keys to choose from though. My data was a little fuzzier. I ended up creating a new label for each new version and i added a uniqueness constraint on name
for every label
version. Then I indexed name
across the database. That suggestion was courtesy of Michael Hunger
// match 2 specific nodes of a particular version and their relationship
MATCH (a:Node)-[r1:ASSEMBLED_WITH]-(b:Node)
WHERE a.name = 'Node 1'
AND a.version = 1
AND b.name = 'Node 2'
AND b.version = 1
// create copies of the nodes and change the relationship
CREATE (c:Node)
SET c = a, c.version = 3
CREATE (d:Node)
SET d = b, d.version = 3
//create a copy of the relationship and change the version of it
CREATE (c)-[r2:ASSEMBLED_WITH]->(d)
SET r2 = r1, r2.version = 3