@Test public void testGetGraphCollection() throws Exception { FlinkAsciiGraphLoader loader = getSocialNetworkLoader(); GraphCollection collectionFromLoader = loader.getGraphCollectionByVariables("g0", "g1", "g2", "g3"); GraphCollection collectionFromDb = loader.getGraphCollection(); collectAndAssertTrue(collectionFromLoader.equalsByGraphIds(collectionFromDb)); collectAndAssertTrue(collectionFromLoader.equalsByGraphElementIds(collectionFromDb)); }
public GraphCollection getGraphCollection() { ExecutionEnvironment env = config.getExecutionEnvironment(); DataSet<EPGMVertex> newVertices = env.fromCollection(getVertices()) .filter(vertex -> vertex.getGraphCount() > 0); DataSet<EPGMEdge> newEdges = env.fromCollection(getEdges()) .filter(edge -> edge.getGraphCount() > 0); return config.getGraphCollectionFactory() .fromDataSets(env.fromCollection(getGraphHeads()), newVertices, newEdges); }
FlinkAsciiGraphLoader { public GraphCollection getGraphCollection() { ExecutionEnvironment env = config.getExecutionEnvironment(); DataSet<EPGMVertex> newVertices = env.fromCollection(getVertices()) .filter(vertex -> vertex.getGraphCount() > 0); DataSet<EPGMEdge> newEdges = env.fromCollection(getEdges()) .filter(edge -> edge.getGraphCount() > 0); return config.getGraphCollectionFactory() .fromDataSets(env.fromCollection(getGraphHeads()), newVertices, newEdges); } }
FlinkAsciiGraphLoader { public GraphCollection getGraphCollection() { ExecutionEnvironment env = config.getExecutionEnvironment(); DataSet<EPGMVertex> newVertices = env.fromCollection(getVertices()) .filter(vertex -> vertex.getGraphCount() > 0); DataSet<EPGMEdge> newEdges = env.fromCollection(getEdges()) .filter(edge -> edge.getGraphCount() > 0); return config.getGraphCollectionFactory() .fromDataSets(env.fromCollection(getGraphHeads()), newVertices, newEdges); } FlinkAsciiGraphLoader(GradoopFlinkConfig config); }
FlinkAsciiGraphLoader { public GraphCollection getGraphCollection() { ExecutionEnvironment env = config.getExecutionEnvironment(); DataSet<EPGMVertex> newVertices = env.fromCollection(getVertices()) .filter(vertex -> vertex.getGraphCount() > 0); DataSet<EPGMEdge> newEdges = env.fromCollection(getEdges()) .filter(edge -> edge.getGraphCount() > 0); return config.getGraphCollectionFactory() .fromDataSets(env.fromCollection(getGraphHeads()), newVertices, newEdges); } FlinkAsciiGraphLoader(GradoopFlinkConfig config); void initDatabaseFromString(String asciiGraphs); void initDatabaseFromStream(InputStream stream); void appendToDatabaseFromString(String asciiGraph); void initDatabaseFromFile(String fileName); LogicalGraph getLogicalGraph(); LogicalGraph getLogicalGraph(boolean withGraphContainment); LogicalGraph getLogicalGraphByVariable(String variable); GraphCollection getGraphCollection(); GraphCollection getGraphCollectionByVariables(String... variables); Collection<EPGMGraphHead> getGraphHeads(); EPGMGraphHead getGraphHeadByVariable(String variable); Collection<EPGMGraphHead> getGraphHeadsByVariables(String... variables); Collection<EPGMVertex> getVertices(); Collection<EPGMVertex> getVerticesByGraphVariables(String... variables); EPGMVertex getVertexByVariable(String variable); Collection<EPGMEdge> getEdges(); Collection<EPGMEdge> getEdgesByGraphVariables(String... variables); EPGMEdge getEdgeByVariable(String variable); }
FlinkAsciiGraphLoader { public GraphCollection getGraphCollection() { ExecutionEnvironment env = config.getExecutionEnvironment(); DataSet<EPGMVertex> newVertices = env.fromCollection(getVertices()) .filter(vertex -> vertex.getGraphCount() > 0); DataSet<EPGMEdge> newEdges = env.fromCollection(getEdges()) .filter(edge -> edge.getGraphCount() > 0); return config.getGraphCollectionFactory() .fromDataSets(env.fromCollection(getGraphHeads()), newVertices, newEdges); } FlinkAsciiGraphLoader(GradoopFlinkConfig config); void initDatabaseFromString(String asciiGraphs); void initDatabaseFromStream(InputStream stream); void appendToDatabaseFromString(String asciiGraph); void initDatabaseFromFile(String fileName); LogicalGraph getLogicalGraph(); LogicalGraph getLogicalGraph(boolean withGraphContainment); LogicalGraph getLogicalGraphByVariable(String variable); GraphCollection getGraphCollection(); GraphCollection getGraphCollectionByVariables(String... variables); Collection<EPGMGraphHead> getGraphHeads(); EPGMGraphHead getGraphHeadByVariable(String variable); Collection<EPGMGraphHead> getGraphHeadsByVariables(String... variables); Collection<EPGMVertex> getVertices(); Collection<EPGMVertex> getVerticesByGraphVariables(String... variables); EPGMVertex getVertexByVariable(String variable); Collection<EPGMEdge> getEdges(); Collection<EPGMEdge> getEdgesByGraphVariables(String... variables); EPGMEdge getEdgeByVariable(String variable);  }