  We show that any two homogeneous affine semigroups can be glued by embedding
them suitably in a higher dimensional space. As a consequence, we show that the
sum of their homogeneous toric ideals is again a homogeneous toric ideal, and
that the minimal graded free resolution of the associated semigroup ring is the
tensor product of the minimal resolutions of the two smaller parts. We apply
our results to toric ideals associated to graphs to show how two of them can be
a splitting of a toric ideal associated to a graph or an hypergraph.
