@Test public void testFromGraphsMethod() throws Exception { LogicalGraph graph1 = loader.getLogicalGraphByVariable("g1"); LogicalGraph graph2 = loader.getLogicalGraphByVariable("g2"); GraphCollection expected = loader.getGraphCollectionByVariables("g1", "g2"); GraphCollection result = factory.fromGraphs(graph1, graph2); collectAndAssertTrue(result.equalsByGraphElementData(expected)); }
@Override public GraphCollection fromGraphs( LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge>... logicalGraphLayouts) { if (logicalGraphLayouts.length != 0) { DataSet<EPGMGraphHead> graphHeads = null; DataSet<EPGMVertex> vertices = null; DataSet<EPGMEdge> edges = null; if (logicalGraphLayouts.length == 1) { return fromGraph(logicalGraphLayouts[0]); } for (LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge> logicalGraph : logicalGraphLayouts) { graphHeads = (graphHeads == null) ? logicalGraph.getGraphHead() : graphHeads.union(logicalGraph.getGraphHead()); vertices = (vertices == null) ? logicalGraph.getVertices() : vertices.union(logicalGraph.getVertices()); edges = (edges == null) ? logicalGraph.getEdges() : edges.union(logicalGraph.getEdges()); } return fromDataSets( graphHeads.distinct(new Id<>()), vertices.distinct(new Id<>()), edges.distinct(new Id<>())); } return createEmptyCollection(); }
GraphCollectionFactory implements
  BaseGraphCollectionFactory<EPGMGraphHead, EPGMVertex, EPGMEdge, LogicalGraph, GraphCollection> { @Override public GraphCollection fromGraphs( LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge>... logicalGraphLayouts) { if (logicalGraphLayouts.length != 0) { DataSet<EPGMGraphHead> graphHeads = null; DataSet<EPGMVertex> vertices = null; DataSet<EPGMEdge> edges = null; if (logicalGraphLayouts.length == 1) { return fromGraph(logicalGraphLayouts[0]); } for (LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge> logicalGraph : logicalGraphLayouts) { graphHeads = (graphHeads == null) ? logicalGraph.getGraphHead() : graphHeads.union(logicalGraph.getGraphHead()); vertices = (vertices == null) ? logicalGraph.getVertices() : vertices.union(logicalGraph.getVertices()); edges = (edges == null) ? logicalGraph.getEdges() : edges.union(logicalGraph.getEdges()); } return fromDataSets( graphHeads.distinct(new Id<>()), vertices.distinct(new Id<>()), edges.distinct(new Id<>())); } return createEmptyCollection(); } }
GraphCollectionFactory implements
  BaseGraphCollectionFactory<EPGMGraphHead, EPGMVertex, EPGMEdge, LogicalGraph, GraphCollection> { @Override public GraphCollection fromGraphs( LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge>... logicalGraphLayouts) { if (logicalGraphLayouts.length != 0) { DataSet<EPGMGraphHead> graphHeads = null; DataSet<EPGMVertex> vertices = null; DataSet<EPGMEdge> edges = null; if (logicalGraphLayouts.length == 1) { return fromGraph(logicalGraphLayouts[0]); } for (LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge> logicalGraph : logicalGraphLayouts) { graphHeads = (graphHeads == null) ? logicalGraph.getGraphHead() : graphHeads.union(logicalGraph.getGraphHead()); vertices = (vertices == null) ? logicalGraph.getVertices() : vertices.union(logicalGraph.getVertices()); edges = (edges == null) ? logicalGraph.getEdges() : edges.union(logicalGraph.getEdges()); } return fromDataSets( graphHeads.distinct(new Id<>()), vertices.distinct(new Id<>()), edges.distinct(new Id<>())); } return createEmptyCollection(); } GraphCollectionFactory(GradoopFlinkConfig config); }
GraphCollectionFactory implements
  BaseGraphCollectionFactory<EPGMGraphHead, EPGMVertex, EPGMEdge, LogicalGraph, GraphCollection> { @Override public GraphCollection fromGraphs( LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge>... logicalGraphLayouts) { if (logicalGraphLayouts.length != 0) { DataSet<EPGMGraphHead> graphHeads = null; DataSet<EPGMVertex> vertices = null; DataSet<EPGMEdge> edges = null; if (logicalGraphLayouts.length == 1) { return fromGraph(logicalGraphLayouts[0]); } for (LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge> logicalGraph : logicalGraphLayouts) { graphHeads = (graphHeads == null) ? logicalGraph.getGraphHead() : graphHeads.union(logicalGraph.getGraphHead()); vertices = (vertices == null) ? logicalGraph.getVertices() : vertices.union(logicalGraph.getVertices()); edges = (edges == null) ? logicalGraph.getEdges() : edges.union(logicalGraph.getEdges()); } return fromDataSets( graphHeads.distinct(new Id<>()), vertices.distinct(new Id<>()), edges.distinct(new Id<>())); } return createEmptyCollection(); } GraphCollectionFactory(GradoopFlinkConfig config); @Override GraphCollectionLayoutFactory<EPGMGraphHead, EPGMVertex, EPGMEdge> getLayoutFactory(); @Override void setLayoutFactory(
    GraphCollectionLayoutFactory<EPGMGraphHead, EPGMVertex, EPGMEdge> layoutFactory); @Override GraphHeadFactory<EPGMGraphHead> getGraphHeadFactory(); @Override VertexFactory<EPGMVertex> getVertexFactory(); @Override EdgeFactory<EPGMEdge> getEdgeFactory(); @Override GraphCollection fromDataSets(DataSet<EPGMGraphHead> graphHeads,
    DataSet<EPGMVertex> vertices); @Override GraphCollection fromDataSets(DataSet<EPGMGraphHead> graphHeads, DataSet<EPGMVertex> vertices,
    DataSet<EPGMEdge> edges); @Override GraphCollection fromIndexedDataSets(Map<String, DataSet<EPGMGraphHead>> graphHeads,
    Map<String, DataSet<EPGMVertex>> vertices, Map<String, DataSet<EPGMEdge>> edges); @Override GraphCollection fromCollections(Collection<EPGMGraphHead> graphHeads,
    Collection<EPGMVertex> vertices, Collection<EPGMEdge> edges); @Override GraphCollection fromGraph(
    LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge> logicalGraphLayout); @Override GraphCollection fromGraphs(
  LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge>... logicalGraphLayouts); @Override GraphCollection fromTransactions(DataSet<GraphTransaction> transactions); @Override GraphCollection fromTransactions(DataSet<GraphTransaction> transactions,
    GroupReduceFunction<EPGMVertex, EPGMVertex> vertexMergeReducer,
    GroupReduceFunction<EPGMEdge, EPGMEdge> edgeMergeReducer); @Override GraphCollection createEmptyCollection(); }
GraphCollectionFactory implements
  BaseGraphCollectionFactory<EPGMGraphHead, EPGMVertex, EPGMEdge, LogicalGraph, GraphCollection> { @Override public GraphCollection fromGraphs( LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge>... logicalGraphLayouts) { if (logicalGraphLayouts.length != 0) { DataSet<EPGMGraphHead> graphHeads = null; DataSet<EPGMVertex> vertices = null; DataSet<EPGMEdge> edges = null; if (logicalGraphLayouts.length == 1) { return fromGraph(logicalGraphLayouts[0]); } for (LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge> logicalGraph : logicalGraphLayouts) { graphHeads = (graphHeads == null) ? logicalGraph.getGraphHead() : graphHeads.union(logicalGraph.getGraphHead()); vertices = (vertices == null) ? logicalGraph.getVertices() : vertices.union(logicalGraph.getVertices()); edges = (edges == null) ? logicalGraph.getEdges() : edges.union(logicalGraph.getEdges()); } return fromDataSets( graphHeads.distinct(new Id<>()), vertices.distinct(new Id<>()), edges.distinct(new Id<>())); } return createEmptyCollection(); } GraphCollectionFactory(GradoopFlinkConfig config); @Override GraphCollectionLayoutFactory<EPGMGraphHead, EPGMVertex, EPGMEdge> getLayoutFactory(); @Override void setLayoutFactory(
    GraphCollectionLayoutFactory<EPGMGraphHead, EPGMVertex, EPGMEdge> layoutFactory); @Override GraphHeadFactory<EPGMGraphHead> getGraphHeadFactory(); @Override VertexFactory<EPGMVertex> getVertexFactory(); @Override EdgeFactory<EPGMEdge> getEdgeFactory(); @Override GraphCollection fromDataSets(DataSet<EPGMGraphHead> graphHeads,
    DataSet<EPGMVertex> vertices); @Override GraphCollection fromDataSets(DataSet<EPGMGraphHead> graphHeads, DataSet<EPGMVertex> vertices,
    DataSet<EPGMEdge> edges); @Override GraphCollection fromIndexedDataSets(Map<String, DataSet<EPGMGraphHead>> graphHeads,
    Map<String, DataSet<EPGMVertex>> vertices, Map<String, DataSet<EPGMEdge>> edges); @Override GraphCollection fromCollections(Collection<EPGMGraphHead> graphHeads,
    Collection<EPGMVertex> vertices, Collection<EPGMEdge> edges); @Override GraphCollection fromGraph(
    LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge> logicalGraphLayout); @Override GraphCollection fromGraphs(
  LogicalGraphLayout<EPGMGraphHead, EPGMVertex, EPGMEdge>... logicalGraphLayouts); @Override GraphCollection fromTransactions(DataSet<GraphTransaction> transactions); @Override GraphCollection fromTransactions(DataSet<GraphTransaction> transactions,
    GroupReduceFunction<EPGMVertex, EPGMVertex> vertexMergeReducer,
    GroupReduceFunction<EPGMEdge, EPGMEdge> edgeMergeReducer); @Override GraphCollection createEmptyCollection();  }