// Assert that the result and the expected result are the same
correctConvertedResult:=`WITH partijenLET n0 = (FOR x IN kamerleden FILTER x.partij == "GL" RETURN x)LET r0 = (FOR x IN n0 FOR v, e, p IN 1..1 OUTBOUND x lid_van OPTIONS { uniqueEdges: "path" }FILTER v.zetels > 6 LIMIT 5000 RETURN DISTINCT p )LET nodes = first(RETURN UNION_DISTINCT(flatten(r0[**].vertices),[],[]))LET edges = first(RETURN UNION_DISTINCT(flatten(r0[**].edges),[],[]))RETURN {"vertices":nodes, "edges":edges }`
correctConvertedResult:=`LET e0 = (FOR x IN kamerledenRETURN x)LET e1 = (FOR x IN partijenRETURN x)LET f0 = (FOR x IN e0FILTER x.partij == GLRETURN x)LET f1 = (FOR x IN e1FILTER x.zetels > 6RETURN x)LET r0 = (FOR x IN lid_vanFOR y in f0FOR z in f1FILTER x._from == y._id AND x._to == z._idLET nodes = APPEND([], [y, z])RETURN DISTINCT {"edges": x,"vertices": nodes})LET nodes = first(RETURN UNION_DISTINCT(flatten(r0[**].vertices),[],[]))LET edges = first(RETURN UNION_DISTINCT(flatten(r0[**].edges),[],[]))RETURN {"vertices":nodes, "edges":edges }`