@Test public void execute() throws Exception { GraphCollection collection = getTestCollection(); String propertyKey = "count"; GraphHeadReduceFunction<EPGMGraphHead> countFunc = new CountGraphHeads<>(propertyKey); collection = collection.groupByIsomorphism(countFunc); List<EPGMGraphHead> graphHeads = collection.getGraphHeads().collect(); assertEquals(3, graphHeads.size()); for (EPGMGraphHead graphHead : graphHeads) { assertTrue(graphHead.hasProperty(propertyKey)); int count = graphHead.getPropertyValue(propertyKey).getInt(); String label = graphHead.getLabel(); if (label.equals("G")) { assertEquals(1, count); } else { assertEquals(2, count); } } }
@Override public GC execute(GC collection) { DataSet<G> graphHeads = getCanonicalLabels(collection) .join(collection.getGraphHeads()) .where(0).equalTo(new Id<>()) .with(new GraphHeadGroup<>()) .groupBy(0) .reduceGroup(function); return selectVerticesAndEdges(collection, graphHeads); }
GroupByIsomorphism extends SelectionBase<G, V, E, LG, GC> { @Override public GC execute(GC collection) { DataSet<G> graphHeads = getCanonicalLabels(collection) .join(collection.getGraphHeads()) .where(0).equalTo(new Id<>()) .with(new GraphHeadGroup<>()) .groupBy(0) .reduceGroup(function); return selectVerticesAndEdges(collection, graphHeads); } }
GroupByIsomorphism extends SelectionBase<G, V, E, LG, GC> { @Override public GC execute(GC collection) { DataSet<G> graphHeads = getCanonicalLabels(collection) .join(collection.getGraphHeads()) .where(0).equalTo(new Id<>()) .with(new GraphHeadGroup<>()) .groupBy(0) .reduceGroup(function); return selectVerticesAndEdges(collection, graphHeads); } GroupByIsomorphism(GraphHeadReduceFunction<G> function); }
GroupByIsomorphism extends SelectionBase<G, V, E, LG, GC> { @Override public GC execute(GC collection) { DataSet<G> graphHeads = getCanonicalLabels(collection) .join(collection.getGraphHeads()) .where(0).equalTo(new Id<>()) .with(new GraphHeadGroup<>()) .groupBy(0) .reduceGroup(function); return selectVerticesAndEdges(collection, graphHeads); } GroupByIsomorphism(GraphHeadReduceFunction<G> function); @Override GC execute(GC collection); }
GroupByIsomorphism extends SelectionBase<G, V, E, LG, GC> { @Override public GC execute(GC collection) { DataSet<G> graphHeads = getCanonicalLabels(collection) .join(collection.getGraphHeads()) .where(0).equalTo(new Id<>()) .with(new GraphHeadGroup<>()) .groupBy(0) .reduceGroup(function); return selectVerticesAndEdges(collection, graphHeads); } GroupByIsomorphism(GraphHeadReduceFunction<G> function); @Override GC execute(GC collection);  }