I am looking to programatically access the attributes of an edge between two defined vertex sets.
I can do the following traversal and accum absolutely fine (assuming two vertex types called Day
and Week
and an edge type contained
with an integer attribute num
):
SumAccum<INT> @@total;
__ = SELECT d FROM Day:d -(contained:c)- Week:w
ACCUM @@total += c.getAttr("num", "INT");
If I pass a specific Week
vertex into my query and convert it to a vertex set
CREATE QUERY test(VERTEX<Week> week)...
week_vvs = {week};
I get the error no consensus type for term c.getAttr("num", "INT")
when running basically the same traversal:
SumAccum<INT> @@total;
__ = SELECT d FROM Day:d -(contained:c)- week_vvs:w
ACCUM @@total += c.getAttr("num", "INT");
Is this the expected behaviour? I can access the attribute num
by doing c.num perfectly fine, its just the getAttr
that causes the problem. I’m unsure as to why it works for the generic node type, but not for a vertex set of that node type.