Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
on 12-06-2019 08:45 AM
Hi,
I have the following graph.
CREATE (p1:Patient {name:'p1'})
CREATE (p2:Patient {name:'p2'})
CREATE (p3:Patient {name:'p3'})
CREATE (p4:Patient {name:'p4'})
CREATE (p5:Patient {name:'p5'})
CREATE (A1_1:Event_01 {name:'A'})
CREATE (A1_2:Event_01 {name:'A'})
CREATE (B1:Event_01 {name:'B'})
CREATE (C1:Event_01 {name:'C'})
CREATE (C1_1:Event_01 {name:'C'})
CREATE (D2_1:Event_02 {name:'D'})
CREATE (D2_2:Event_02 {name:'D'})
CREATE (A2:Event_02 {name:'A'})
CREATE (D2_3:Event_02 {name:'D'})
CREATE (E3_1:Event_03 {name:'E'})
CREATE (C3:Event_03 {name:'C'})
CREATE (E3_2:Event_03 {name:'E'})
CREATE
(p1)-[:NEXT]->(A1_1), (A1_1)-[:NEXT]->(D2_1), (D2_1)-[:NEXT]->(E3_1),
(p2)-[:NEXT]->(A1_2), (A1_2)-[:NEXT]->(D2_2), (D2_2)-[:NEXT]->(C3),
(p3)-[:NEXT]->(B1), (B1)-[:NEXT]->(A2),
(p4)-[:NEXT]->(C1),
(p5)-[:NEXT]->(C1_1), (C1_1)-[:NEXT]->(D2_3), (D2_3)-[:NEXT]->(E3_2)
;
When I group the graph using call apoc.nodes.group(['Patient', 'Event_01','Event_02', 'Event_03'], ['name']);
, I get the following.
What I would like is something slightly different, as shown below, i.e. the paths A-->D--C and A-->D--E need to be shown separately because the path before D is different.
Thanks.