private StarGraphGryoSerializer(final Direction edgeDirectionToSerialize) { this(edgeDirectionToSerialize, new GraphFilter()); }
@Override public String toString() { return StringFactory.stepString(this, this.clusterProperty, new GraphFilter(this.computer)); }
@Override public String toString() { return StringFactory.stepString(this, new GraphFilter(this.computer)); }
@Override public String toString() { return StringFactory.stepString(this, this.toStringOfVertexProgram, new GraphFilter(this.computer)); } }
@Override public String toString() { return StringFactory.stepString(this, this.edgeTraversal.get(), this.pageRankProperty, this.times, new GraphFilter(this.computer)); }
@Override public String toString() { return StringFactory.stepString(this, this.computerTraversal.get(), new GraphFilter(this.computer)); }
@Override public String toString() { return StringFactory.stepString(this, this.edgeTraversal.get(), this.clusterProperty, this.times, new GraphFilter(this.computer)); }
@Override public String toString() { return StringFactory.stepString(this, this.targetVertexFilter.get(), this.edgeTraversal.get(), this.distanceTraversal.get(), this.maxDistance, this.includeEdges, new GraphFilter(this.computer)); }
private StarGraphGryoSerializer(final Direction edgeDirectionToSerialize) { this(edgeDirectionToSerialize, new GraphFilter()); }
@Override public String toString() { return StringFactory.stepString(this, this.toStringOfVertexProgram, new GraphFilter(this.computer)); } }
@Override public String toString() { return StringFactory.stepString(this, new GraphFilter(this.computer)); }
@Override public String toString() { return StringFactory.stepString(this, this.clusterProperty, new GraphFilter(this.computer)); }
@Override public String toString() { return StringFactory.stepString(this, this.edgeTraversal.get(), this.pageRankProperty, this.times, new GraphFilter(this.computer)); }
@Override public String toString() { return StringFactory.stepString(this, this.computerTraversal.get(), new GraphFilter(this.computer)); }
@Override public String toString() { return StringFactory.stepString(this, this.edgeTraversal.get(), this.clusterProperty, this.times, new GraphFilter(this.computer)); }
@Test @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES) @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY) @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES) @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_PROPERTY) public void shouldHandleBothEdgesGraphFilterOnSelfLoop() { assertEquals(0l, IteratorUtils.count(graph.vertices())); assertEquals(0l, IteratorUtils.count(graph.edges())); // these vertex label, edge label, and property names/values were copied from existing tests StarGraph starGraph = StarGraph.open(); Vertex vertex = starGraph.addVertex(T.label, "person", "name", "furnace"); Edge edge = vertex.addEdge("self", vertex); edge.property("acl", "private"); // traversing a self-loop should yield the edge once for inE/outE // and the edge twice for bothE (one edge emitted two times, not two edges) assertEquals(1L, IteratorUtils.count(starGraph.traversal().V().inE())); assertEquals(1L, IteratorUtils.count(starGraph.traversal().V().outE())); assertEquals(2L, IteratorUtils.count(starGraph.traversal().V().bothE())); // Try a filter that retains BOTH GraphFilter graphFilter = new GraphFilter(); graphFilter.setEdgeFilter(__.bothE("self")); starGraph = starGraph.applyGraphFilter(graphFilter).get(); // Retest traversal counts after filtering assertEquals(1L, IteratorUtils.count(starGraph.traversal().V().inE())); assertEquals(1L, IteratorUtils.count(starGraph.traversal().V().outE())); assertEquals(2L, IteratorUtils.count(starGraph.traversal().V().bothE())); }
@Override public String toString() { return StringFactory.stepString(this, this.targetVertexFilter.get(), this.edgeTraversal.get(), this.distanceTraversal.get(), this.maxDistance, this.includeEdges, new GraphFilter(this.computer)); }
add(GryoTypeReg.of(ReferencePath.class, 85)); add(GryoTypeReg.of(StarGraph.class, 86, new StarGraphSerializer(Direction.BOTH, new GraphFilter())));
add(GryoTypeReg.of(ReferencePath.class, 85)); add(GryoTypeReg.of(StarGraph.class, 86, new StarGraphSerializer(Direction.BOTH, new GraphFilter())));
@Test @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES) @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY) @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES) @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_PROPERTY) public void shouldHandleBothEdgesGraphFilterOnSelfLoop() { assertEquals(0l, IteratorUtils.count(graph.vertices())); assertEquals(0l, IteratorUtils.count(graph.edges())); // these vertex label, edge label, and property names/values were copied from existing tests StarGraph starGraph = StarGraph.open(); Vertex vertex = starGraph.addVertex(T.label, "person", "name", "furnace"); Edge edge = vertex.addEdge("self", vertex); edge.property("acl", "private"); // traversing a self-loop should yield the edge once for inE/outE // and the edge twice for bothE (one edge emitted two times, not two edges) assertEquals(1L, IteratorUtils.count(starGraph.traversal().V().inE())); assertEquals(1L, IteratorUtils.count(starGraph.traversal().V().outE())); assertEquals(2L, IteratorUtils.count(starGraph.traversal().V().bothE())); // Try a filter that retains BOTH GraphFilter graphFilter = new GraphFilter(); graphFilter.setEdgeFilter(__.bothE("self")); starGraph = starGraph.applyGraphFilter(graphFilter).get(); // Retest traversal counts after filtering assertEquals(1L, IteratorUtils.count(starGraph.traversal().V().inE())); assertEquals(1L, IteratorUtils.count(starGraph.traversal().V().outE())); assertEquals(2L, IteratorUtils.count(starGraph.traversal().V().bothE())); }