st_graph: aggregate function