Algebraic aggregation theory