Project(Extend(Extend(AggregationJoin(Aggregation(??agg1: ?s, SAMPLE, {}, G1=Group((?s), Union(BGP( ?s ?o), Union(BGP( ?s ?o), BGP( ?s ?o))))), Aggregation(??agg2: ?o, MAX, {}, G1)), ?s, ??agg1), ?max, ??agg2), {?s, ?max})