Motives associated to sums of graphs