move term and partOf out of the graph, fix some issues