cycle through model and create nodes and edges based on linked entitite