Example #1
0
  public Graph putGraph(Graph graph, QueryParameters digQueryParams) {
    graph = super.putGraph(graph, digQueryParams);
    graph.commitIndex();

    Graph resultGraph = new Graph();

    for (AbstractEdge edge : graph.edgeSet()) {
      if (edge != null && edge.getSourceVertex() != null && edge.getDestinationVertex() != null) {
        AbstractEdge newEdge = createNewWithoutAnnotations(edge);
        replaceAnnotations(newEdge.getAnnotations(), provTC2OpmMapping);
        replaceAnnotations(newEdge.getSourceVertex().getAnnotations(), provTC2OpmMapping);
        replaceAnnotations(newEdge.getDestinationVertex().getAnnotations(), provTC2OpmMapping);
        resultGraph.putVertex(newEdge.getSourceVertex());
        resultGraph.putVertex(newEdge.getDestinationVertex());
        resultGraph.putEdge(newEdge);
      }
    }

    return resultGraph;
  }