Class InlineFilterStrategy

  • All Implemented Interfaces:
    Serializable, Comparable<Class<? extends TraversalStrategy>>, TraversalStrategy<TraversalStrategy.OptimizationStrategy>, TraversalStrategy.OptimizationStrategy

    public final class InlineFilterStrategy
    extends AbstractTraversalStrategy<TraversalStrategy.OptimizationStrategy>
    implements TraversalStrategy.OptimizationStrategy
    This strategy analyzes filter-steps with child traversals that themselves are pure filters. If the child traversals are pure filters then the wrapping parent filter is not needed and thus, the children can be "inlined." Normalizing pure filters with inlining reduces the number of variations of a filter that a graph provider may need to reason about when writing their own strategies. As a result, this strategy helps increase the likelihood that a provider's filtering optimization will succeed at re-writing the traversal.
    Author:
    Marko A. Rodriguez (http://markorodriguez.com)
    See Also:
    Serialized Form
    Example:
     __.outE().hasLabel(eq("knows").or(eq("created"))).inV()       // is replaced by __.outE("knows", "created").inV()
     __.filter(has("name","marko"))                                // is replaced by __.has("name","marko")
     __.and(has("name"),has("age"))                                // is replaced by __.has("name").has("age")
     __.and(filter(has("name","marko").has("age")),hasNot("blah")) // is replaced by __.has("name","marko").has("age").hasNot("blah")
     __.match(as('a').has(key,value),...)                          // is replaced by __.as('a').has(key,value).match(...)