Hi, I am trying to return multiple vertices that are related in my results.
Basically I have Airport vertices, connected by a Schedule vertex. I want to find all connecting flights like this: Airport:a1-origin_edge-> Schedule:s1->dest_edge-> Airport:a2-origin_edge->Schedule:s2-dest_edge->Airport:a3.
In simple layman terms its just Airport1> Airport2> Airport3. I want to find all paths that are connected. Between each Airport, Airport1>Airport2, there is a schedule Vertex that contains flight details, so technically you will see Airport1> Schedule1>Airport2> Schedule2>Airport3. I want to return the details of the 2 Schedules. Any help is appreciated.
In this example, I want to find all paths from SIN>MNL>LAX AIRPORT
CREATE QUERY q2(/* Parameters here */) FOR GRAPH flightRoutes syntax v2{
/* Write query logic here */
TYPEDEF TUPLE <STRING origin, STRING dest, STRING name, INT blockMins, FLOAT km> conVertex;
SetAccum<conVertex> @firstGroupingSetAccum;
SetAccum<conVertex> @secondGroupingSetAccum;
airports = SELECT a1
FROM Airport:a1
WHERE a1.city == "MNL";
firstConnection = SELECT s1
FROM Schedule:s1-(dest_edge>:dest)-airports:a1
WHERE s1.orig == "SIN"
ACCUM a1.@firstGroupingSetAccum += s1;
secondConnection = SELECT s2
FROM airports:a1-(origin_edge>:orig)-Schedule:s2
WHERE s2.dest=="LAX"
ACCUM a1.@secondGroupingSetAccum += s1;
PRINT @firstGroupingSetAccum;
}