/** * Add plays edges to a var, given a type * @param var var to be modified * @param type type from which metadata extracted * @return var with appropriate plays edges */ private static VarPattern plays(VarPattern var, Type type) { for(Role role:type.playing().collect(Collectors.toSet())){ var = var.plays(Graql.label(role.label())); } return var; }
@Override public UnaryOperator<VarPattern> visitPlays(GraqlParser.PlaysContext ctx) { return var -> var.plays(visitVariable(ctx.variable())); }