Thinned random measures for sparse graphs with overlapping communities