OrderBy(Project(Extend(Extend(AggregationJoin(Aggregation(??agg1: ?type, SAMPLE, {}, G1=Group((?type), BGP( ?s ?type))), Aggregation(??agg2: ?s, COUNT, {}, G1)), ?type, ??agg1), ?count, ??agg2), {?type, ?count}), (desc (?count)))