A Bayesian Matrix Model for Relational Data