reader.readGraph(stream, g);
}
final Graph ng = TinkerGraph.open();
g.V().sideEffect(ov -> {
final Vertex v = ov.get();
if (v.label().equals("song"))
ng.addVertex(T.id, Integer.parseInt(v.id().toString()), T.label, "song", "name", v.value("name"), "performances", v.property("performances").orElse(0), "songType", v.property("songType").orElse(""));
else if (v.label().equals("artist"))
ng.addVertex(T.id, Integer.parseInt(v.id().toString()), T.label, "artist", "name", v.value("name"));
else
throw new RuntimeException("damn");
}).iterate();
g.E().sideEffect(oe -> {
final Edge e = oe.get();
final Vertex v2 = ng.v(Integer.parseInt(e.inV().next().id().toString()));
final Vertex v1 = ng.v(Integer.parseInt(e.outV().next().id().toString()));
if (e.label().equals("followedBy"))
v1.addEdge("followedBy", v2, T.id, Integer.parseInt(e.id().toString()), "weight", e.value("weight"));
else if (e.label().equals("sungBy"))
v1.addEdge("sungBy", v2, T.id, Integer.parseInt(e.id().toString()));
else if (e.label().equals("writtenBy"))
v1.addEdge("writtenBy", v2, T.id, Integer.parseInt(e.id().toString()));
else
throw new RuntimeException("bah");
}).iterate();