I have a situation where I need to match a variable length path for either one type of relationship A or another type of relationship B. However, the relationship type A is bidirectional, whereas the relationship type B is unidirectional.
e.g. If both relationship types were bidirectional, I could use the following match statement:
MATCH (:Something {property: "value"}) -[:A|B*]- (n:Something)
But since the relationship type B is unidirectional, I would need something like this:
MATCH (:Something {property: "value"}) (-[:A]- OR <-[:B]-)* (n:Something)
One solution I could use is to create the reverse relationship type for all A as INVERSE_A and then use:
MATCH (:Something {property: "value"}) <-[:A|INVERSE_A|B*]- (n:Something)
But then I would need to create INVERSE_A for every A relationship, and that would make things messy for this one query.
Is there a cleaner way to combine both a unidirectional and bidirectional relationship into a single match statement?