An algebraic framework for the transformation of attributed graphs