4.11.3 Using a Complex Filter to Create a Subgraph

This example uses a slightly more complex filter. It uses the outDegree function, which calculates the number of outgoing edges for an identifier (source src or destination dst). The following filter expression matches all edges with a cost property value greater than 50 and a destination vertex (node) with an outDegree greater than 1.

dst.outDegree() > 1 && edge.cost > 50

One edge in the sample graph matches this filter expression, as shown in the following figure.

Figure 4-7 Edges Matching the outDegree Filter

Description of Figure 4-7 follows
Description of "Figure 4-7 Edges Matching the outDegree Filter"

The following figure shows the graph that results when the filter is applied. The filter excludes the edges associated with the vertices 99 and 1908, and so excludes those vertices also.

Figure 4-8 Graph Created by the outDegree Filter

Description of Figure 4-8 follows
Description of "Figure 4-8 Graph Created by the outDegree Filter"