I want to write a neo4j query, that finds a 'knitting' pattern. With that I basically mean a set of four nodes with three special edges between them. And continuing these four, there can be a next set of four nodes, that are connected by three other edges, like this (in some Cypher-like syntax with vertical edges.
(n1)-[:e1]-(n2)-[:e2]-(n3)-[:e3]-(n4)
| | | |
[:ew] [:ex] [:ey] [:ez]
| | | |
(n5)-[:e1]-(n6)-[:e2]-(n7)-[:e3]-(n8)
| | | |
[:ew] [:ex] [:ey] [:ez]
| | | |
(n?)-[:e3]-(n!)-[:e3]-(n&)-[:e3]-(n$)
. . . .
: : : :
I can write a query for exactly 8, 12 or 16... nodes, that are connected in this way. But I would like to write it more general to get the longest connected components, that are knitted like this.
Can you give me a hint, how to go along with that, because I'm totally new to neo4j?