Abstract. We prove a general theorem on semigroup functions that implies characterizations of graph partition functions in terms of the positive semidefiniteness (`reflection positivity') and rank of certain derived matrices. The theorem applies to undirected and directed graphs and to hypergraphs.