Hi Tony,
all nodes are Bodies the weights are on the nodes. See picture and table of my database. Thats the first variant i asked for.
n.name |
n.weight |
r.type |
m.name |
m.weight |
"N1" |
1 |
force |
"N2" |
1 |
"N1" |
1 |
force |
"N3" |
1 |
"N2" |
1 |
force |
"N5" |
1 |
"N3" |
1 |
force |
"N4a" |
10 |
"N4a" |
10 |
alternative |
"N4b" |
8 |
"N4a" |
10 |
force |
"N5" |
1 |
"N4b" |
8 |
alternative |
"N4c" |
11 |
"N4b" |
8 |
force |
"N6" |
1 |
"N4c" |
11 |
force |
"N7" |
1 |
"N6" |
1 |
force |
"N5" |
1 |
"N7" |
1 |
force |
"N5" |
1 |
the graphs represents actualy an acyclic tree with paths
n1
n1-n2
n1-n2-n5
n1-n2-n3
n1-n2-n3-n4a
n1-n2-n3-n4a-n5
n1-n2-n3-n4a-n4b
n1-n2-n3-n4a-n4b-n6
n1-n2-n3-n4a-n4b-n6-n5
n1-n2-n3-n4a-n4b-n4c (alternative) n4b-n4c
n1-n2-n3-n4a-n4b-n4c-n7
n1-n2-n3-n4a-n4b-n4c-n7-n5
i want to get back
n1
n1-n2
n1-n2-n5
n1-n3
n1-n3-n4c
n1-n3-n4c-n7
n1-n3-n4c-n7-n5
remark this is the first model the relation n3-n4c does not exist persistantly
the second model replaces the n4a-n4b-n4c alternative chain by a star representation
with an option node N4_ and 3 Body nodes N4a,N4b,N4c
last remark for clarification. The example has only one node with alternatives, but other nodes could also have alternatives e.g N5_ N5a,N6b ...
I hope I got it nailed down now
create (n1:Body {name:"N1",weight:1}) ,
(n2:Body {name:"N2",weight:1}),
(n3:Body {name:"N3",weight:1}),
(n4:Body {name:"N4",weight:1}),
(n4a:Body {name:"N4a",weight:10}),
(n4b:Body {name:"N4b",weight:8}),
(n4c:Body {name:"N4c",weight:11}),
(n5:Body {name:"N5",weight:1}),
(n6:Body {name:"N6",weight:1}),
(n7:Body {name:"N7",weight:1}),
(n1)-[:force]->(n2),
(n2)-[:force]->(n5),
(n1)-[:force]->(n3),
(n3)-[:force]->(n4a),
(n4a)-[:alternative]->(n4b),
(n4b)-[:alternative]->(n4c),
(n4a)-[:force]->(n5),
(n4b)-[:force]->(n6),
(n6)-[:force]->(n5),
(n4c)-[:force]->(n7),
(n7)-[:force]->(n5) return n1,n2,n3,n4a,n4b,n4c,n5,n6,n7
And many thanks for your help
l!!!!