-
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 a native implementation (e.g. Titan), a vertex’s edges can be filtered at the database level prior to being pulled into memory. This technique can greatly reduce the search space of a traverser.
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 prior to pulling the data into Hadoop. 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. The Faunus graph configuration that specifies the vertex query constraint is faunus.graph.input.vertex-query-filter
. A few examples are itemized below.
- 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')
- Only outgoing edges:
v.query().direction(OUT)
For those graph sources that do not support remote filtering, Faunus will process the vertex (dropping edges as specified by the VertexQuery
) before inserting them into the <NullWritable,FaunusVertex>
stream.
Bröcheler, M., Rodriguez, M.A., A Solution to the Supernode Problem, Aurelius Blog, 2012.