Graphical Models for Recovering Probabilistic and Causal Queries from Missing Data