Graph schemas as abstractions for transfer learning, inference, and planning