cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Set building from a graph

Can we build a set out of each respective nodes, connecting nodes of which as set's elements. then if we can draw the venn diagrams too. Thanks.
I have already checked detection based on Jaccard similarity but not satisfied.

1 ACCEPTED SOLUTION

We can collect its connected nodes as a list, if that's what you mean:

MATCH (n:Node)-[:PARAMETER]->(x)
WHERE n.id = 12345
RETURN n, collect(x) as parameterNodes

From there you can do filtering or parameter extraction from that list.

If you have APOC Procedures then you can use a variety of collection functions, such as union, intersection, subtraction, toSet (to ensure distinct elements) and more.

As for visualizing these with Venn diagrams, we don't support that with the visualizer in the browser. You may want to google around to see if anyone else has implemented a visualizer which produces these diagrams, but I haven't personally looked around for these.

View solution in original post

3 REPLIES 3

Can you explain a bit more in detail, perhaps with an example?

sure, referring to the graph my doubt is if i can make mathematical set as set of central node. and all 18 connected nodes as its elements.!2X_5_58c16d3178c09681d9d9264b82943778909a87b1.png

We can collect its connected nodes as a list, if that's what you mean:

MATCH (n:Node)-[:PARAMETER]->(x)
WHERE n.id = 12345
RETURN n, collect(x) as parameterNodes

From there you can do filtering or parameter extraction from that list.

If you have APOC Procedures then you can use a variety of collection functions, such as union, intersection, subtraction, toSet (to ensure distinct elements) and more.

As for visualizing these with Venn diagrams, we don't support that with the visualizer in the browser. You may want to google around to see if anyone else has implemented a visualizer which produces these diagrams, but I haven't personally looked around for these.