Skip to content

Instantly share code, notes, and snippets.

@maxdemarzi maxdemarzi/bom.cypher

Last active Mar 11, 2020
Embed
What would you like to do?
Bill of Materials sample data
CREATE (f1:Family {id:'f1'})
CREATE (f2:Family {id:'f2'})
CREATE (f3:Family {id:'f3'})
CREATE (a1:Asset {id:'a1'})
CREATE (a2:Asset {id:'a2'})
CREATE (a3:Asset {id:'a3'})
CREATE (a4:Asset {id:'a4'})
CREATE (a5:Asset {id:'a5'})
CREATE (a6:Asset {id:'a6'})
CREATE (a7:Asset {id:'a7'})
CREATE (p1:Part {id:'p1'})
CREATE (p2:Part {id:'p2'})
CREATE (p3:Part {id:'p3'})
CREATE (p4:Part {id:'p4'})
CREATE (p5:Part {id:'p5'})
CREATE (p6:Part {id:'p6'})
CREATE (p7:Part {id:'p7'})
CREATE (p8:Part {id:'p8'})
CREATE (p9:Part {id:'p9'})
CREATE (p10:Part {id:'p10'})
CREATE (p11:Part {id:'p11'})
CREATE (p12:Part {id:'p12'})
CREATE (p13:Part {id:'p13'})
CREATE (p14:Part {id:'p14'})
CREATE (p15:Part {id:'p15'})
CREATE (f1)<-[:BELONGS_TO]-(a1)
CREATE (f1)<-[:BELONGS_TO]-(a2)
CREATE (f1)<-[:BELONGS_TO]-(a3)
CREATE (f2)<-[:BELONGS_TO]-(a4)
CREATE (f2)<-[:BELONGS_TO]-(a5)
CREATE (f3)<-[:BELONGS_TO]-(a6)
CREATE (f3)<-[:BELONGS_TO]-(a7)
CREATE (a1)<-[:BELONGS_TO]-(p1)
CREATE (a2)<-[:BELONGS_TO]-(p7)
CREATE (a3)<-[:BELONGS_TO]-(p13)
CREATE (a4)<-[:BELONGS_TO]-(p1)
CREATE (a5)<-[:BELONGS_TO]-(p2)
CREATE (a6)<-[:BELONGS_TO]-(p6)
CREATE (a7)<-[:BELONGS_TO]-(p8)
CREATE (p1)<-[:BELONGS_TO]-(p3)
CREATE (p1)<-[:BELONGS_TO]-(p5)
CREATE (p2)<-[:BELONGS_TO]-(p4)
CREATE (p3)<-[:BELONGS_TO]-(p9)
CREATE (p4)<-[:BELONGS_TO]-(p10)
CREATE (p5)<-[:BELONGS_TO]-(p14)
CREATE (p5)<-[:BELONGS_TO]-(p15)
CREATE (p6)<-[:BELONGS_TO]-(p4)
CREATE (p7)<-[:BELONGS_TO]-(p3)
CREATE (p8)<-[:BELONGS_TO]-(p4)
CREATE (p9)<-[:BELONGS_TO]-(p11)
CREATE (p10)<-[:BELONGS_TO]-(p12)
CREATE (p12)<-[:BELONGS_TO]-(p14)
CREATE (p13)<-[:BELONGS_TO]-(p5);
CREATE (a1:Part {id:"120-001", desc:"Trolley, 3 wheeled"})
CREATE (p1:Part {id:"110-001", desc:"Wheel Housing"})
CREATE (p2:Part {id:"100-001", cost: 5.30, desc:"MS Bolt, M10x70, Galv"})
CREATE (p3:Part {id:"100-002", cost: 2.20, desc:"M10, washer, Galv"})
CREATE (p4:Part {id:"100-003", cost: 1.50, desc:"M10, Nut, Galv"})
CREATE (p5:Part {id:"100-004", cost: 4.0, desc:"MS Bolt, M10x30, Galv"})
CREATE (p6:Part {id:"100-005", cost: 1.9, desc:"M10 Square Nut"})
CREATE (p7:Part {id:"102-108", cost: 15.0, desc:"Wheel, with tyre, 100mm"})
CREATE (p8:Part {id:"110-002", desc:"Top Piece"})
CREATE (p9:Part {id:"105-001", cost: 10.0, desc:"MS Flat 80x8"})
CREATE (p10:Part {id:"111-001", cost: 60.0 , desc:"Galvanising"})
CREATE (p11:Part {id:"130-001", cost: 45.0, desc:"Labor"})
CREATE (p12:Part {id:"110-003", desc:"Side Piece"})
CREATE (p13:Part {id:"112-001", desc:"Plywood Platform"})
CREATE (p14:Part {id:"106-001", cost: 75.0 , desc:"Plywood, 12mm, 2400x1200"})
CREATE (p15:Part {id:"110-006", cost: 10.0, desc:"Varnish, Semi Gloss"})
CREATE (a1)<-[:BELONGS_TO {qty:3.0, unit:"EA"}]-(p1)
CREATE (p1)<-[:BELONGS_TO {qty:1.0, unit:"EA"}]-(p2)
CREATE (p1)<-[:BELONGS_TO {qty:2.0, unit:"EA"}]-(p3)
CREATE (p1)<-[:BELONGS_TO {qty:3.0, unit:"EA"}]-(p4)
CREATE (p1)<-[:BELONGS_TO {qty:1.0, unit:"EA"}]-(p5)
CREATE (p1)<-[:BELONGS_TO {qty:1.0, unit:"EA"}]-(p6)
CREATE (p1)<-[:BELONGS_TO {qty:1.0, unit:"EA"}]-(p7)
CREATE (p1)<-[:BELONGS_TO {qty:1.0, unit:"EA"}]-(p8)
CREATE (p8)<-[:BELONGS_TO {qty:0.05, unit:"LG"}]-(p9)
CREATE (p8)<-[:BELONGS_TO {qty:0.0010, unit:"KG"}]-(p10)
CREATE (p8)<-[:BELONGS_TO {qty:0.5, unit:"HR"}]-(p11)
CREATE (p1)<-[:BELONGS_TO {qty:2.0, unit:"EA"}]-(p12)
CREATE (p12)<-[:BELONGS_TO {qty:0.1, unit:"LG"}]-(p9)
CREATE (p12)<-[:BELONGS_TO {qty:0.0010, unit:"KG"}]-(p10)
CREATE (p12)<-[:BELONGS_TO {qty:0.1, unit:"HR"}]-(p11)
CREATE (a1)<-[:BELONGS_TO {qty:1.0, unit:"EA"}]-(p13)
CREATE (p13)<-[:BELONGS_TO {qty:0.125, unit:"SH"}]-(p14)
CREATE (p13)<-[:BELONGS_TO {qty:0.05, unit:"I"}]-(p15)
CREATE (p13)<-[:BELONGS_TO {qty:0.65, unit:"HR"}]-(p11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.