コード例 #1
0
 // TODO unit test that
 static boolean removeEdge(Graph graph, Relationship relationship) {
   Edge edge = graph.getEdge(relationship.getId());
   if (null != edge) {
     graph.removeEdge(edge);
     return true;
   } else {
     return false;
   }
 }
コード例 #2
0
  private void cleanupGraphStore(Graph graph) {
    for (Edge edge : graph.getEdges()) {
      graph.removeEdge(edge);
    }

    for (Vertex vertex : graph.getVertices()) {
      graph.removeVertex(vertex);
    }

    graph.shutdown();
  }