SetAccum<Vertex> @@target;
SetAccum<Vertex> @@source;
source (Any) = @@source;
frontier = SELECT u
FROM source:u - (shareholder_of:e) -> :v
WHERE v in @@target
ACCUM xx;
This was really interesting, as it demonstrates an enhancement in 2.6 that I missed, but it really makes some things much more elegant.
You can apply a vertex set as the target now. If you use the global accumulator as-is, then it assumes it is a list of strings defining a set of types (which was an enhancement so we could parameterise the types for our standard algorithms).
But, if you convert the accumulator to a vertex set using the curly-bracket syntax, then you can use it directly. This fragment is legal syntax:
SetAccum<Vertex> @@target;
SetAccum<Vertex> @@source;
source_vset = {@@source};
target_vset = {@@target};
frontier = SELECT u
FROM source_vset:u-()-target_vset:t;