Advertisement
Guest User

seed data

a guest
Oct 20th, 2020
72
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE CONSTRAINT unqPart ON (n:Part) ASSERT (n.partNumber, n.revision) IS NODE KEY;
  2. CREATE CONSTRAINT partNumMust ON (n:Part) ASSERT EXISTS (n.partNumber);
  3. CREATE CONSTRAINT partRevMust ON (n:Part) ASSERT EXISTS (n.revision);
  4.  
  5.  
  6. CREATE (:Part{partNumber:"100",partName:"Transport",revision:"A"});
  7. CREATE (:Part{partNumber:"101",partName:"Car",revision:"A"});
  8. CREATE (:Part{partNumber:"102",partName:"Bike",revision:"A"});
  9. CREATE (:Part{partNumber:"103",partName:"Train",revision:"A"});
  10. CREATE (:Part{partNumber:"104",partName:"Engine",revision:"A"});
  11. CREATE (:Part{partNumber:"105",partName:"Seat",revision:"A"});
  12. CREATE (:Part{partNumber:"106",partName:"Nut",revision:"A"});
  13. CREATE (:Part{partNumber:"107",partName:"Bolt",revision:"A"});
  14.  
  15.  
  16. MATCH (p:Part{partNumber:"100", revision:"A"})
  17. MATCH (c:Part{partNumber:"101", revision:"A"})
  18. CREATE (p) -[:HAS_BOM_PROPERTY]-> (:BomProperties{Qty:30}) -[:WITH_PART]-> (c);
  19. MATCH (p:Part{partNumber:"100", revision:"A"})
  20. MATCH (c:Part{partNumber:"103", revision:"A"})
  21. CREATE (p) -[:HAS_BOM_PROPERTY]-> (:BomProperties{Qty:60}) -[:WITH_PART]-> (c);
  22. MATCH (p:Part{partNumber:"100", revision:"A"})
  23. MATCH (c:Part{partNumber:"102", revision:"A"})
  24. CREATE (p) -[:HAS_BOM_PROPERTY]-> (:BomProperties{Qty:90}) -[:WITH_PART]-> (c);
  25. MATCH (p:Part{partNumber:"101", revision:"A"})
  26. MATCH (c:Part{partNumber:"104", revision:"A"})
  27. CREATE (p) -[:HAS_BOM_PROPERTY]-> (:BomProperties{Qty:5}) -[:WITH_PART]-> (c);
  28. MATCH (p:Part{partNumber:"104", revision:"A"})
  29. MATCH (c:Part{partNumber:"106", revision:"A"})
  30. CREATE (p) -[:HAS_BOM_PROPERTY]-> (:BomProperties{Qty:20}) -[:WITH_PART]-> (c);
  31. MATCH (p:Part{partNumber:"104", revision:"A"})
  32. MATCH (c:Part{partNumber:"107", revision:"A"})
  33. CREATE (p) -[:HAS_BOM_PROPERTY]-> (:BomProperties{Qty:10}) -[:WITH_PART]-> (c);
  34. MATCH (p:Part{partNumber:"103", revision:"A"})
  35. MATCH (c:Part{partNumber:"104", revision:"A"})
  36. CREATE (p) -[:HAS_BOM_PROPERTY]-> (:BomProperties{Qty:3}) -[:WITH_PART]-> (c);
  37. MATCH (p:Part{partNumber:"103", revision:"A"})
  38. MATCH (c:Part{partNumber:"105", revision:"A"})
  39. CREATE (p) -[:HAS_BOM_PROPERTY]-> (:BomProperties{Qty:100}) -[:WITH_PART]-> (c);
  40.  
  41.  
  42.  
Advertisement
RAW Paste Data Copied
Advertisement