Project(Join(Project(Extend(Extend(AggregationJoin(Aggregation(??agg1: ?s, SAMPLE, {}, G1=Group((?s), Slice(Project(BGP( ?s ?label), {?label, ?s}), 0, 2))), Aggregation(??agg2: ?label, COUNT, {}, G1)), ?s, ??agg1), ?label_count, ??agg2), {?s, ?label_count}), BGP( ?s ?o)), {?label_count, ?o, ?s})