redefined TypedGraph as a morphism