OK the actual syntax I think you would like is this:
match(var().isa("edge").rel("x").rel("y"), var("x").isa("person").has("firstname", "Andrea"))
To explain why the syntax looks like this I will write the equivalent Graql query
match ($x, $y); $x isa person has firstname "Andrea";
The brackets represent a relation which has the syntax
var().rel().rel() where the first var is the relation concept itself. We will review the syntax as there might be a better way to express this.
Let me know if this works for you.