Project(Lateral(BGP( ?s ?o), Project(Extend(AggregationJoin(Aggregation(??agg1: ?sample, SAMPLE, {}, G1=Group((?sample), Project(Extend(Extend(BGP( ?s ?label), ?sample, sample(?s) ), ?label_count, count(?label) ), {?sample, ?label_count})))), ?sample, ??agg1), {?sample})), {?o, ?s, ?sample})