Contextual directed acyclic graphs