Active Inference and Epistemic Value in Graphical Models