Let's say my graph is a series of steps, which connect to one another in a procedure. Is there a best/recommended way to model this in a graph?
I can think of two different approaches:
Number one:
CREATE [s1:Step]-[r1:step { procedure: "Foo" }]->[s2:Step]
In this method, I need to examine properties of the step
relationship to reconstitute an entire procedure. Just follow all the relationships labeled procedure: Foo.
Number two:
CREATE (p:Procedure {name: "Foo"}),
(s1:Step), (s2:Step),
p-[:step { sequence: 0 }]->s1,
p-[:step { sequence: 1 }]->s2;
This creates an actual first-class procedure "node" but buys me the problem of having to specify the sequence number so I know which order the steps should be in.
This problem must have been solved a dozen times before though. Is there a better/best pattern for modeling this as a graph?