I'm using Cypher and I need to build a query like the one that follows
(A) ----e1----(B)
\ |
\ |
e3 e2
\ |
\ |
(C)
where A, B and C are nodes and e1,e2 and e3 relationships connecting respectively A and B, B and C and A and C.
What I'm interested in are nodes A and C. This pattern should match when e1,B and e2 exist (and respect some properties) or relationship e3 exists (and respects some properties) or both. My problem here is that I'm not able to convert this in Cypher language. In order to give a relationship an identifier, I need to specify it in the MATCH clause, like
MATCH (A)--[e1]--(B)--[e2]--(C), (A)--[e3]--(C)
but doing so I'm telling Neo4j I want both (e1 and e3) and e2 to exist, and that's not the case. But if I don't give those relationships some identifiers, I can't search for any of their properties.
How can I build this query?
Thanks.