Edges attribution in Accum in syntax v2

Hi All,
I am facing problems with accessing edges attributions when using syntax v2.

More specifically. I have a graph with nothing but company vertex and link edges.
link edges has “date” attribution with a DateTime.

the following query needs to print (in the future return) the edge date in case it exists.
I am getting “the alias can not be determined” for some reason.

Does anyone know what to do?

The code:

CREATE QUERY get_link_values(VERTEX c1, VERTEX c2) FOR GRAPH test_graph syntax v2{
ListAccum @@dt;
src = {c1};
tgt = {c2};

Res = SELECT s
FROM src:s-((LINK>):e)-tgt
ACCUM
@@dt += e.date
;

PRINT Res;
}

  • I tries variables rather than accum and it didn’t change a thing
  • I tried using e.getattr() function, that didn’t work either
1 Like

So, I played around with your query and the problem seems to be that you are trying to specify vertex sets for both the source and target side of your SELECT statement. As far as I know, you can only specify an exact vertex set for the source segment (not target).

Your query can be fixed by not specifying the target side with tgt, and also declaring your ListAccum with the proper type (which would be ListAccum< DATETIME >). If you want to restrict the target side of the hop, you can add a WHERE clause as such:

CREATE QUERY get_link_values(VERTEX c1, VERTEX c2) FOR GRAPH test_graph syntax v2{
    ListAccum<DATETIME> @@dt;
    src = {c1};
    tgt = {c2};

    Res = SELECT s
    FROM src:s - ((LINK>):e) - :t
    WHERE t == c2
    ACCUM @@dt += e.date;

    PRINT Res;
}
3 Likes

Thanks!

it worked!!!

1 Like