Cypher: Condition direction for some relationship types

I am trying to traverse the graph and follow the direction for one kind of relationships.
Example. I have relationships of type A,B,C,D and nodes. For relationships of type A i want only to retrieve those who points at my start node, or are incoming to other nodes in my query. So if i have 3rd node from n0 i want to retrieve the patsh with incoming relationship of type A to 3rd node.
This is my start query.

MATCH p=(n0 {id:1})<-[*0..4]-(n)

I have tried several approaches without luck. I either get only those who are one hop away or all but for all directions of A.

This is an example path i want

(n0)<-[:B]-(n1)<-[:C]-(n2)<-[:B]-(n3)<-[:A]-(n4)
(n0)<-[:A]-(n1)<-[:C]-(n2)<-[:B]-(n3)<-[:A]-(n4)

This is an example path i DO not want

(n0)<-[:B]-(n1)<-[:C]-(n2)<-[:B]-(n3)**-[:A]->**(n4)
(n0)**-[:A]->**(n1)<-[:C]-(n2)<-[:B]-(n3)<-[:A]-(n4)

This syntax MATCH p=(n0 {id:1})<-[*0..4]-(n) will look for paths that have zero to four hops that all point to the left.

Can you provide some examples?

Hi I have tried several approaches without success.

MATCH path = (n0 {id:1}-[*0..4]-(n)
WHERE all(rel in relationships(path) 
          WHERE type(rel) <> 'A' OR startNode(rel) IN nodes(path)[1..])
RETURN path

Is one of the examples without success.

hi @torodinekle ,

What exactly you are trying to do is not very clear to me, but you might find some useful ideas in this article that discusses pattern along relation directions Tic Tac Toe Challenge in Cypher - Graph Database & Analytics

QPP Concepts - Cypher Manual might indeed be useful in your case, but we need more details about what exactly you are trying to do. Can you give a create query with example nodes/rel and the result you are expecting on them?