A group by an abstract projection