Bayesian inference for linked data