Hi,
I have Graph like this below.
A-[:x]->B-[:y]->C-[:z]->D
Assume I dont know what relation exists between A and D, but I know A and D are related. I want to write a dynamic query which can detect A.name connected to d.name="XXX" without writing the relations between A to D.
I tried something like this but it is not giving correct results. I am expecting A nodes whcih are related to d,name="HEN" but I am getting all A nodes related to D nodes.
MATCH (a:A),(d:D {name:"HEN"}), p = shortestPath((a)-[ * ]-(d))
RETURN distinct a,p,d
Can you let me know how can I achieve this. I want to identify the relation between two nodes first and using that relation between two nodes I want to find out result.
Thanks in Advance