@Test public void testMtxDataSource() throws Exception { final long vertexcount = 5; final long edgecount = 5; String filePath = getFilePath("/data/mtx/testdata.mtx"); DataSource ds = new MtxDataSource(filePath, getConfig()); LogicalGraph graph = ds.getLogicalGraph(); List<EPGMVertex> vertices = graph.getVertices().collect(); List<EPGMEdge> edges = graph.getEdges().collect(); long selfEdgesCount = graph.getEdges().filter((e) -> e.getSourceId().equals(e.getTargetId())).count(); long distinctEdges = graph.getEdges().distinct("sourceId", "targetId").count(); long vertexIds = graph.getVertices().distinct("id").count(); long edgeIds = graph.getEdges().distinct("id").count(); long nonOrphanSourceIds = graph.getEdges().join(graph.getVertices()).where("sourceId").equalTo("id").count(); long nonOrphanTargetIds = graph.getEdges().join(graph.getVertices()).where("targetId").equalTo("id").count(); Assert.assertEquals(vertexcount, vertices.size()); Assert.assertEquals(edgecount, edges.size()); Assert.assertEquals(0, selfEdgesCount); Assert.assertEquals(edgecount, distinctEdges); Assert.assertEquals(vertexcount, vertexIds); Assert.assertEquals(edgecount, edgeIds); Assert.assertEquals(nonOrphanSourceIds, edgecount); Assert.assertEquals(nonOrphanTargetIds, edgecount); }
public MtxDataSource(String path, GradoopFlinkConfig config) { this(path, config, false); }
MtxDataSource implements DataSource { public MtxDataSource(String path, GradoopFlinkConfig config) { this(path, config, false); } }
MtxDataSource implements DataSource { public MtxDataSource(String path, GradoopFlinkConfig config) { this(path, config, false); } MtxDataSource(String path, GradoopFlinkConfig config);  MtxDataSource(String path, GradoopFlinkConfig config, boolean skipPreprocessing); }
MtxDataSource implements DataSource { public MtxDataSource(String path, GradoopFlinkConfig config) { this(path, config, false); } MtxDataSource(String path, GradoopFlinkConfig config);  MtxDataSource(String path, GradoopFlinkConfig config, boolean skipPreprocessing); @Override LogicalGraph getLogicalGraph(); @Override GraphCollection getGraphCollection(); static boolean isComment(String line); static String getSplitCharacter(String text); static GradoopId generateId(String text); }
MtxDataSource implements DataSource { public MtxDataSource(String path, GradoopFlinkConfig config) { this(path, config, false); } MtxDataSource(String path, GradoopFlinkConfig config);  MtxDataSource(String path, GradoopFlinkConfig config, boolean skipPreprocessing); @Override LogicalGraph getLogicalGraph(); @Override GraphCollection getGraphCollection(); static boolean isComment(String line); static String getSplitCharacter(String text); static GradoopId generateId(String text);  }