-
Notifications
You must be signed in to change notification settings - Fork 58
Vertex Query Graph Filters
Blueprints maintains the notion of a VertexQuery
(see details). In Blueprints, and the graph databases that support its implementation, a vertex’s edges can be filtered to using VertexQuery
in order to reduce the edge space that a traverser needs to search to solve its problem.
In Faunus, the same VertexQuery
notion exists, however, in the context of Faunus, it is used to filter the input graph to a subset of the full graph. For those graph sources that support push down predicates, this allows the graph source to only return the edges of the vertices that satisfy the contraints of the query. A Faunus graph configuration is provides the contraint. A few examples are provided below. Note that the configuration key is faunus.graph.input.vertex-query-filter
.
- Only vertices and their properties (no edges):
v.query().limit(0)
- Only edges with a weight greater than 0.5:
v.query().has('weight',0.5,Query.Compare.GREATER_THAN)
- Only edges with label
knows
:v.query().labels('knows')
For those graph sources that do not support such local querying, Faunus will process the vertex (dropping edges as specified by the VertexQuery
) before inserting them into the <NullWritable,FaunusVertex>
stream.