I have following query running in neo4j (community 3.5)
match(a:master_node:PERF:Application)-[r1]->(n:master_node:PERF)-[r:AFFINITY]->(m:master_node:PERF)&