CREATE QUERY CreateEdgesBetween2Vertices(/* Parameters here */) FOR GRAPH MyGraph {
MapAccum<STRING,VERTEX<a1>> @@mapV;
seed(a1) = {a1.*};
seed2(a2) ={a2.*};
S1 = SELECT s FROM seed:s ACCUM @@mapV += (a1.attr1->s);
S2 = SELECT tgt FROM seed2:tgt ACCUM
IF @@mapV.containsKey(tgt.attr1) THEN
INSERT INTO MY_EDGE (FROM, TO) VALUES (@@mapV.get(tgt.attr1), tgt)
END;
}