I have re format the case for better understanding :
GRAPH :
India > hasRegion > East > hasCity > Kolkatta
India > hasRegion > West > hasCity > Pune
India > hasRegion > West > hasCity > Mumbai
India > hasRegion > West > hasCity > Nagpur
India > hasRegion > RegionWest > hasCity > Nagpur
RegionWest > hasPivotNode > West
Cases :
Case1 : Cities of region RegionWest :
RegionWest > hasPivotNode > (Found) West > hasCity ?
Expected Result :- Pune, Mumbai, Nagpur
Case2 : Cities of region East :
East > hasPivotNode > (Not Found) East > hasCity ?
Expected Result :- Kolkatta
I need single conditional query for both of the above cases.
Note : I don’t have any scope to re model the graph.
