Hi,
I have a syntax error with this query in that foosFiltered is not being allowed in the FOREACH as a setBagExpr. The error is:
“A container type is required, while ‘foosFiltered’ is Vertex Set”
From the formal specification “The (set) operators are straightforward, when two operands are both sets, the result expression is a set.”
And
“forEachControl := (name | “(” name [, name]+ “)”) IN setBagExpr”
So, seeing as foosFiltered is a set of vertices, and seeing as FOREACH can take a setBagExpr, how is the syntax error occuring?
CREATE OR REPLACE QUERY searchSystem(VERTEX<bar> sys, INT sasquach, STRING term, SET<STRING> cat, INT lim) FOR GRAPH ty SYNTAX v2 {
INT at = 0;
SetAccum<vertex> @@foosFound;
SetAccum<vertex> @@toFilter;
Start={sys};
fooRes = SELECT s FROM
Start-(LIST_ON_BAR:lob)-list_:l-(FOO_IN_LIST:fil)-foo:s
WHERE (s.foo_title_sortkey LIKE term) AND
s.category IN cat
ACCUM @@foosFound +=s;
sozRet = SELECT filterFoos FROM
Start-(BAR_SASQUACH_ON_BAR)-bar_sasquach:sz-(FOO_ON_SASQUACH:soz)-foo:filterFoos
WHERE sz.sasquach == sasquach AND
(soz.removed == true OR soz.hidden == true)
ACCUM @@toFilter += filterFoos;
foosFiltered = @@foosFound MINUS @@toFilter;
FOREACH fooRet IN foosFiltered DO
PRINT fooRet;
at = at + 1;
IF at > lim THEN
BREAK;
END;
END;
}