Discriminative Gaifman Models