A Database Design for Graphical Models