@Test public void testEmptySubgraph() throws Exception { FlinkAsciiGraphLoader loader = getSocialNetworkLoader(); loader.appendToDatabaseFromString("expected:_DB[]"); LogicalGraph input = loader.getLogicalGraph(); LogicalGraph expected = loader.getLogicalGraphByVariable("expected"); LogicalGraph output = input.subgraph( v -> v.getLabel().equals("User"), e -> e.getLabel().equals("friendOf")); collectAndAssertTrue(output.equalsByData(expected)); }
public Subgraph(FilterFunction<V> vertexFilterFunction, FilterFunction<E> edgeFilterFunction, Strategy strategy) { if (strategy == BOTH && (vertexFilterFunction == null || edgeFilterFunction == null)) { throw new IllegalArgumentException("No vertex or no edge filter function was given."); } if (strategy == VERTEX_INDUCED && vertexFilterFunction == null) { throw new IllegalArgumentException("No vertex filter functions was given."); } if ((strategy == EDGE_INDUCED || strategy == EDGE_INDUCED_PROJECT_FIRST) && edgeFilterFunction == null) { throw new IllegalArgumentException("No vertex edge functions was given."); } this.strategy = strategy; this.vertexFilterFunction = vertexFilterFunction; this.edgeFilterFunction = edgeFilterFunction; }
Subgraph implements UnaryBaseGraphToBaseGraphOperator<LG> { public Subgraph(FilterFunction<V> vertexFilterFunction, FilterFunction<E> edgeFilterFunction, Strategy strategy) { if (strategy == BOTH && (vertexFilterFunction == null || edgeFilterFunction == null)) { throw new IllegalArgumentException("No vertex or no edge filter function was given."); } if (strategy == VERTEX_INDUCED && vertexFilterFunction == null) { throw new IllegalArgumentException("No vertex filter functions was given."); } if ((strategy == EDGE_INDUCED || strategy == EDGE_INDUCED_PROJECT_FIRST) && edgeFilterFunction == null) { throw new IllegalArgumentException("No vertex edge functions was given."); } this.strategy = strategy; this.vertexFilterFunction = vertexFilterFunction; this.edgeFilterFunction = edgeFilterFunction; } }
Subgraph implements UnaryBaseGraphToBaseGraphOperator<LG> { public Subgraph(FilterFunction<V> vertexFilterFunction, FilterFunction<E> edgeFilterFunction, Strategy strategy) { if (strategy == BOTH && (vertexFilterFunction == null || edgeFilterFunction == null)) { throw new IllegalArgumentException("No vertex or no edge filter function was given."); } if (strategy == VERTEX_INDUCED && vertexFilterFunction == null) { throw new IllegalArgumentException("No vertex filter functions was given."); } if ((strategy == EDGE_INDUCED || strategy == EDGE_INDUCED_PROJECT_FIRST) && edgeFilterFunction == null) { throw new IllegalArgumentException("No vertex edge functions was given."); } this.strategy = strategy; this.vertexFilterFunction = vertexFilterFunction; this.edgeFilterFunction = edgeFilterFunction; } Subgraph(FilterFunction<V> vertexFilterFunction,
    FilterFunction<E> edgeFilterFunction, Strategy strategy); }
Subgraph implements UnaryBaseGraphToBaseGraphOperator<LG> { public Subgraph(FilterFunction<V> vertexFilterFunction, FilterFunction<E> edgeFilterFunction, Strategy strategy) { if (strategy == BOTH && (vertexFilterFunction == null || edgeFilterFunction == null)) { throw new IllegalArgumentException("No vertex or no edge filter function was given."); } if (strategy == VERTEX_INDUCED && vertexFilterFunction == null) { throw new IllegalArgumentException("No vertex filter functions was given."); } if ((strategy == EDGE_INDUCED || strategy == EDGE_INDUCED_PROJECT_FIRST) && edgeFilterFunction == null) { throw new IllegalArgumentException("No vertex edge functions was given."); } this.strategy = strategy; this.vertexFilterFunction = vertexFilterFunction; this.edgeFilterFunction = edgeFilterFunction; } Subgraph(FilterFunction<V> vertexFilterFunction,
    FilterFunction<E> edgeFilterFunction, Strategy strategy); @Override LG execute(LG superGraph); }
Subgraph implements UnaryBaseGraphToBaseGraphOperator<LG> { public Subgraph(FilterFunction<V> vertexFilterFunction, FilterFunction<E> edgeFilterFunction, Strategy strategy) { if (strategy == BOTH && (vertexFilterFunction == null || edgeFilterFunction == null)) { throw new IllegalArgumentException("No vertex or no edge filter function was given."); } if (strategy == VERTEX_INDUCED && vertexFilterFunction == null) { throw new IllegalArgumentException("No vertex filter functions was given."); } if ((strategy == EDGE_INDUCED || strategy == EDGE_INDUCED_PROJECT_FIRST) && edgeFilterFunction == null) { throw new IllegalArgumentException("No vertex edge functions was given."); } this.strategy = strategy; this.vertexFilterFunction = vertexFilterFunction; this.edgeFilterFunction = edgeFilterFunction; } Subgraph(FilterFunction<V> vertexFilterFunction,
    FilterFunction<E> edgeFilterFunction, Strategy strategy); @Override LG execute(LG superGraph);  }