Accumulate edges while using kleene pattern

Hi Team,

I would like to accumulate edges for the given query. But it says kleene pattern can’t have aliases.

CREATE QUERY kleene_test(string systemname) FOR GRAPH tigergraph syntax v2{
SetAccum @@edges;
sys = select sy from system:sy -(_*…2:r)-:other where sy.Name == systemname accum
@@edges += r

Please let me know the other way to accumulate edges if alias is not supported.

It seems that GSQL purposefully limits this kind of behavior, because it is impossible to pinpoint which single edge your generic alias refers to in particular.

You could try experimenting with sy.edgeAttribute(“edgeType”, “attrName”) but it would probably not work as intended for your use case since edge hops after the first one may not be captured.

What I would really recommend (if your edges are directed) is splitting this Syntax v2 statement into multiple v1 ones that feed into each other (vertex set output of one statement is the input of the next) and accumulating edge attributes as you take each potential single hop.

Shorter hop-chains will not be caught by the later SELECT statements because there will be no directed edge to proceed further down the chain (only back up).