Knowledge representation and inference in similarity networks and Bayesian multinets