-
Notifications
You must be signed in to change notification settings - Fork 88
Filter Expressions
Timo edited this page Aug 14, 2019
·
2 revisions
Frequently used filter expressions are predefined in Gradoop. The following table gives an overview of them and defines whether they can be used as filters for graph heads (G), vertices (V) or edges (E).
Predefined Filter | Applicable for | Description |
---|---|---|
True<>() |
G,V,E | Filter function represents logical true. |
False<>() |
G,V,E | Filter function represents logical false. |
LabelIsIn<>(String... labels) |
G,V,E | Filter function to check if an element's label is in the defined white list. |
ByLabel<>(String label) |
G,V,E | Filter function to check if an element's label is equal to the defined one. |
BySameId<>(GradoopId id) |
G,V,E | Filters elements if their identifier is equal to the given identifier. |
ByDifferentId<>(GradoopId id) |
G,V,E | Filters elements if their identifier is not equal to the given identifier. |
ByTargetId<>(GradoopId id) |
E | Filters edges having the specified target vertex id. |
BySourceId<>(GradoopId id) |
E | Filters edges having the specified source vertex id. |
ByProperty<>(Property prop) ByProperty<>(String key) ByProperty<>(String key, PropertyValue value)
|
G,V,E | Filter function to check if an element has a property with the specified key or key value combination. |
IdInBroadcast<>() |
G,V,E | Filters a dataset of elements to those whose id is contained in an broadcasted id dataset. |
IdNotInBroadcast<>() |
G,V,E | Filters a dataset of elements to those whose id is not contained in an broadcasted id dataset. |
InNoGraph<>() |
V,E | This filter returns true, if the element has no graph ids. |
InGraph<>(GradoopId graphId) |
V,E | This filter returns true, if the element is contained in a graph specified by its id. |
InAnyGraph<>(GradoopIdSet graphIds) |
V,E | This filter returns true, if an element is contained in any of a set of given graphs. |
InAllGraphs<>(GradoopIdSet graphIds) |
V,E | This filter returns true, if an element is contained in all of a set of given graphs. |
RandomFilter<>(float sampleSize, long randomSeed) |
G,V,E | Creates a random value for each vertex and filters those that are below a given threshold. |
HasLabel<>(String label) HasVertexLabel<>(String label) HasEdgeLabel<>(String label)
|
G | This is a aggregation function and a filter. It can be used as a filter after aggregating a graph with it. It returns true, if the aggregation found any elements having the specified label. |
IsInstance<>(Class clazz) |
G,V,E | Checks, if a given object is instance of the specified class clazz. |
These filters (and other filters implementing the CombinableFilter
interface) may be combined using a logical and
/or
or inverted using a logical not
:
Filter Combination | Resulting Filter |
---|---|
filter.and(otherFilter) |
Filters filter and otherFilter combined using a logical and , returns a filter accepting objects accepted by both filters. |
filter.or(otherFilter) |
Filters filter and otherFilter combined using a logical or , returns a filter accepting objects accepted by at least one of the filters. |
filter.negate() |
Filter filter inverted using a logical not , returns a filter accepting objects not accepted by the original filter. |
new And<>(filter1, filter2, ...) |
Combine an arbitrary number of filters filter1 , filter2 , ... using a logical and . This is semantically equivalent to filter1.and(filter2).and(... . |
new Or<>(filter1, filter2, ...) |
Combine an arbitrary number of filters filter1 , filter2 , ... using a logical or . This is semantically equivalent to filter1.or(filter2).or(... . |