Knowledge Graph Implementation Python