Interface GraphTraversal<S,​E>

    • Method Detail

      • map

        default <E2> GraphTraversal<S,​E2> map​(Traversal<?,​E2> mapTraversal)
        Map a Traverser referencing an object of type E to an object of type E2.
        Parameters:
        mapTraversal - the traversal expression that does the functional mapping
        Returns:
        the traversal with an appended LambdaMapStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - General Steps
      • flatMap

        default <E2> GraphTraversal<S,​E2> flatMap​(Function<Traverser<E>,​Iterator<E2>> function)
        Map a Traverser referencing an object of type E to an iterator of objects of type E2. The resultant iterator is drained one-by-one before a new E object is pulled in for processing.
        Type Parameters:
        E2 - the type of the returned iterator objects
        Parameters:
        function - the lambda expression that does the functional mapping
        Returns:
        the traversal with an appended LambdaFlatMapStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - General Steps
      • flatMap

        default <E2> GraphTraversal<S,​E2> flatMap​(Traversal<?,​E2> flatMapTraversal)
        Map a Traverser referencing an object of type E to an iterator of objects of type E2. The internal traversal is drained one-by-one before a new E object is pulled in for processing.
        Type Parameters:
        E2 - the end type of the internal traversal
        Parameters:
        flatMapTraversal - the traversal generating objects of type E2
        Returns:
        the traversal with an appended TraversalFlatMapStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - General Steps
      • identity

        default GraphTraversal<S,​E> identity()
        Map the E object to itself. In other words, a "no op."
        Returns:
        the traversal with an appended IdentityStep.
        Since:
        3.0.0-incubating
      • V

        default GraphTraversal<S,​Vertex> V​(Object... vertexIdsOrElements)
        A V step is usually used to start a traversal but it may also be used mid-traversal.
        Parameters:
        vertexIdsOrElements - vertices to inject into the traversal
        Returns:
        the traversal with an appended GraphStep
        Since:
        3.1.0-incubating
        See Also:
        Reference Documentation - Graph Step
      • E

        default GraphTraversal<S,​Edge> E​(Object... edgeIdsOrElements)
        A E step is usually used to start a traversal but it may also be used mid-traversal.
        Parameters:
        edgeIdsOrElements - edges to inject into the traversal
        Returns:
        the traversal with an appended GraphStep
        Since:
        3.7.0
        See Also:
        Reference Documentation - E Step
      • to

        default GraphTraversal<S,​Vertex> to​(Direction direction,
                                                  String... edgeLabels)
        Map the Vertex to its adjacent vertices given a direction and edge labels.
        Parameters:
        direction - the direction to traverse from the current vertex
        edgeLabels - the edge labels to traverse
        Returns:
        the traversal with an appended VertexStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Vertex Step
      • toE

        default GraphTraversal<S,​Edge> toE​(Direction direction,
                                                 String... edgeLabels)
        Map the Vertex to its incident edges given the direction and edge labels.
        Parameters:
        direction - the direction to traverse from the current vertex
        edgeLabels - the edge labels to traverse
        Returns:
        the traversal with an appended VertexStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Vertex Step
      • order

        default GraphTraversal<S,​E> order()
        Order all the objects in the traversal up to this point and then emit them one-by-one in their ordered sequence.
        Returns:
        the traversal with an appended OrderGlobalStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Order Step
      • order

        default GraphTraversal<S,​E> order​(Scope scope)
        Order either the Scope.local object (e.g. a list, map, etc.) or the entire Scope.global traversal stream.
        Parameters:
        scope - whether the ordering is the current local object or the entire global stream.
        Returns:
        the traversal with an appended OrderGlobalStep or OrderLocalStep depending on the scope.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Order Step
      • properties

        default <E2> GraphTraversal<S,​? extends Property<E2>> properties​(String... propertyKeys)
        Map the Element to its associated properties given the provide property keys. If no property keys are provided, then all properties are emitted.
        Type Parameters:
        E2 - the value type of the returned properties
        Parameters:
        propertyKeys - the properties to retrieve
        Returns:
        the traversal with an appended PropertiesStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Properties Step
      • values

        default <E2> GraphTraversal<S,​E2> values​(String... propertyKeys)
        Map the Element to the values of the associated properties given the provide property keys. If no property keys are provided, then all property values are emitted.
        Type Parameters:
        E2 - the value type of the properties
        Parameters:
        propertyKeys - the properties to retrieve their value from
        Returns:
        the traversal with an appended PropertiesStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Values Step
      • propertyMap

        default <E2> GraphTraversal<S,​Map<String,​E2>> propertyMap​(String... propertyKeys)
        Map the Element to a Map of the properties key'd according to their Property.key(). If no property keys are provided, then all properties are retrieved.
        Type Parameters:
        E2 - the value type of the returned properties
        Parameters:
        propertyKeys - the properties to retrieve
        Returns:
        the traversal with an appended PropertyMapStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - PropertyMap Step
      • elementMap

        default <E2> GraphTraversal<S,​Map<Object,​E2>> elementMap​(String... propertyKeys)
        Map the Element to a Map of the property values key'd according to their Property.key(). If no property keys are provided, then all property values are retrieved. For vertices, the Map will be returned with the assumption of single property values along with T.id and T.label. Prefer valueMap(String...) if multi-property processing is required. For edges, keys will include additional related edge structure of Direction.IN and Direction.OUT which themselves are Map instances of the particular Vertex represented by T.id and T.label.
        Type Parameters:
        E2 - the value type of the returned properties
        Parameters:
        propertyKeys - the properties to retrieve
        Returns:
        the traversal with an appended ElementMapStep.
        Since:
        3.4.4
        See Also:
        Reference Documentation - ElementMap Step
      • valueMap

        default <E2> GraphTraversal<S,​Map<Object,​E2>> valueMap​(String... propertyKeys)
        Map the Element to a Map of the property values key'd according to their Property.key(). If no property keys are provided, then all property values are retrieved.
        Type Parameters:
        E2 - the value type of the returned properties
        Parameters:
        propertyKeys - the properties to retrieve
        Returns:
        the traversal with an appended PropertyMapStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - ValueMap Step
      • match

        default <E2> GraphTraversal<S,​Map<String,​E2>> match​(Traversal<?,​?>... matchTraversals)
        Map the Traverser to a Map of bindings as specified by the provided match traversals.
        Type Parameters:
        E2 - the type of the objects bound in the variables
        Parameters:
        matchTraversals - the traversal that maintain variables which must hold for the life of the traverser
        Returns:
        the traversal with an appended MatchStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Match Step
      • select

        default <E2> GraphTraversal<S,​Map<String,​E2>> select​(Pop pop,
                                                                         String selectKey1,
                                                                         String selectKey2,
                                                                         String... otherSelectKeys)
        Map the Traverser to a Map projection of sideEffect values, map values, and/or path values.
        Type Parameters:
        E2 - the type of the objects projected
        Parameters:
        pop - if there are multiple objects referenced in the path, the Pop to use.
        selectKey1 - the first key to project
        selectKey2 - the second key to project
        otherSelectKeys - the third+ keys to project
        Returns:
        the traversal with an appended SelectStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Select Step
      • select

        default <E2> GraphTraversal<S,​Map<String,​E2>> select​(String selectKey1,
                                                                         String selectKey2,
                                                                         String... otherSelectKeys)
        Map the Traverser to a Map projection of sideEffect values, map values, and/or path values.
        Type Parameters:
        E2 - the type of the objects projected
        Parameters:
        selectKey1 - the first key to project
        selectKey2 - the second key to project
        otherSelectKeys - the third+ keys to project
        Returns:
        the traversal with an appended SelectStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Select Step
      • select

        default <E2> GraphTraversal<S,​E2> select​(String selectKey)
        Map the Traverser to the object specified by the selectKey. Note that unlike other uses of select where there are multiple keys, this use of select with a single key does not produce a Map.
        Parameters:
        selectKey - the key to project
        Returns:
        the traversal with an appended SelectStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Select Step
      • select

        default <E2> GraphTraversal<S,​E2> select​(Pop pop,
                                                       Traversal<S,​E2> keyTraversal)
        Map the Traverser to the object specified by the key returned by the keyTraversal and apply the Pop operation to it.
        Parameters:
        keyTraversal - the traversal expression that selects the key to project
        Returns:
        the traversal with an appended SelectStep.
        Since:
        3.3.3
        See Also:
        Reference Documentation - Select Step
      • select

        default <E2> GraphTraversal<S,​E2> select​(Traversal<S,​E2> keyTraversal)
        Map the Traverser to the object specified by the key returned by the keyTraversal. Note that unlike other uses of select where there are multiple keys, this use of select with a traversal does not produce a Map.
        Parameters:
        keyTraversal - the traversal expression that selects the key to project
        Returns:
        the traversal with an appended TraversalSelectStep.
        Since:
        3.3.3
        See Also:
        Reference Documentation - Select Step
      • unfold

        default <E2> GraphTraversal<S,​E2> unfold()
        Unrolls a Iterator, Iterable or Map into a linear form or simply emits the object if it is not one of those types.
        Returns:
        the traversal with an appended UnfoldStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Unfold Step
      • fold

        default <E2> GraphTraversal<S,​E2> fold​(E2 seed,
                                                     BiFunction<E2,​E,​E2> foldFunction)
        Rolls up objects in the stream into an aggregate value as defined by a seed and BiFunction.
        Parameters:
        seed - the value to provide as the first argument to the foldFunction
        foldFunction - the function to fold by where the first argument is the seed or the value returned from subsequent class and the second argument is the value from the stream
        Returns:
        the traversal with an appended FoldStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Fold Step
      • group

        default <K,​V> GraphTraversal<S,​Map<K,​V>> group()
        Organize objects in the stream into a Map. Calls to group() are typically accompanied with by() modulators which help specify how the grouping should occur.
        Returns:
        the traversal with an appended GroupStep.
        Since:
        3.1.0-incubating
        See Also:
        Reference Documentation - Group Step
      • groupCount

        default <K> GraphTraversal<S,​Map<K,​Long>> groupCount()
        Counts the number of times a particular objects has been part of a traversal, returning a Map where the object is the key and the value is the count.
        Returns:
        the traversal with an appended GroupCountStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - GroupCount Step
      • tree

        default GraphTraversal<S,​org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree> tree()
        Aggregates the emanating paths into a Tree data structure.
        Returns:
        the traversal with an appended TreeStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Tree Step
      • mergeV

        default GraphTraversal<S,​Vertex> mergeV()
        Performs a merge (i.e. upsert) style operation for an Vertex using the incoming Map traverser as an argument. The Map represents search criteria and will match each of the supplied key/value pairs where the keys may be String property values or a value of T. If a match is not made it will use that search criteria to create the new Vertex.
        Since:
        3.6.0
      • mergeV

        default GraphTraversal<S,​Vertex> mergeV​(Map<Object,​Object> searchCreate)
        Performs a merge (i.e. upsert) style operation for an Vertex using a Map as an argument. The Map represents search criteria and will match each of the supplied key/value pairs where the keys may be String property values or a value of T. If a match is not made it will use that search criteria to create the new Vertex.
        Parameters:
        searchCreate - This Map can have a key of T or a String.
        Since:
        3.6.0
      • mergeV

        default GraphTraversal<S,​Vertex> mergeV​(Traversal<?,​Map<Object,​Object>> searchCreate)
        Performs a merge (i.e. upsert) style operation for an Vertex using a Map as an argument. The Map represents search criteria and will match each of the supplied key/value pairs where the keys may be String property values or a value of T. If a match is not made it will use that search criteria to create the new Vertex.
        Parameters:
        searchCreate - This anonymous Traversal must produce a Map that may have a keys of T or a String.
        Since:
        3.6.0
      • mergeE

        default GraphTraversal<S,​Edge> mergeE()
        Spawns a GraphTraversal by doing a merge (i.e. upsert) style operation for an Edge using an incoming Map as an argument.
        Since:
        3.6.0
      • to

        default GraphTraversal<S,​E> to​(String toStepLabel)
        Provide to()-modulation to respective steps.
        Parameters:
        toStepLabel - the step label to modulate to.
        Returns:
        the traversal with the modified FromToModulating step.
        Since:
        3.1.0-incubating
        See Also:
        Reference Documentation - To Step
      • from

        default GraphTraversal<S,​E> from​(String fromStepLabel)
        Provide from()-modulation to respective steps.
        Parameters:
        fromStepLabel - the step label to modulate to.
        Returns:
        the traversal with the modified FromToModulating step.
        Since:
        3.1.0-incubating
        See Also:
        Reference Documentation - From Step
      • to

        default GraphTraversal<S,​E> to​(Traversal<?,​Vertex> toVertex)
        When used as a modifier to addE(String) this method specifies the traversal to use for selecting the incoming vertex of the newly added Edge.
        Parameters:
        toVertex - the traversal for selecting the incoming vertex
        Returns:
        the traversal with the modified AddEdgeStep
        Since:
        3.1.0-incubating
        See Also:
        Reference Documentation - From Step
      • from

        default GraphTraversal<S,​E> from​(Traversal<?,​Vertex> fromVertex)
        When used as a modifier to addE(String) this method specifies the traversal to use for selecting the outgoing vertex of the newly added Edge.
        Parameters:
        fromVertex - the traversal for selecting the outgoing vertex
        Returns:
        the traversal with the modified AddEdgeStep
        Since:
        3.1.0-incubating
        See Also:
        Reference Documentation - From Step
      • to

        default GraphTraversal<S,​E> to​(Vertex toVertex)
        When used as a modifier to addE(String) this method specifies the traversal to use for selecting the incoming vertex of the newly added Edge.
        Parameters:
        toVertex - the vertex for selecting the incoming vertex
        Returns:
        the traversal with the modified AddEdgeStep
        Since:
        3.3.0
        See Also:
        Reference Documentation - From Step
      • from

        default GraphTraversal<S,​E> from​(Vertex fromVertex)
        When used as a modifier to addE(String) this method specifies the traversal to use for selecting the outgoing vertex of the newly added Edge.
        Parameters:
        fromVertex - the vertex for selecting the outgoing vertex
        Returns:
        the traversal with the modified AddEdgeStep
        Since:
        3.3.0
        See Also:
        Reference Documentation - From Step
      • math

        default GraphTraversal<S,​Double> math​(String expression)
        Map the Traverser to a Double according to the mathematical expression provided in the argument.
        Parameters:
        expression - the mathematical expression with variables refering to scope variables.
        Returns:
        the traversal with the MathStep added.
        Since:
        3.3.1
      • call

        default <E> GraphTraversal<S,​E> call​(String service)
        Perform the specified service call with no parameters.
        Parameters:
        service - the name of the service call
        Returns:
        the traversal with an appended CallStep.
        Since:
        3.6.0
        See Also:
        Reference Documentation - Call Step
      • call

        default <E> GraphTraversal<S,​E> call​(String service,
                                                   Map params)
        Perform the specified service call with the specified static parameters.
        Parameters:
        service - the name of the service call
        params - static parameter map (no nested traversals)
        Returns:
        the traversal with an appended CallStep.
        Since:
        3.6.0
        See Also:
        Reference Documentation - Call Step
      • call

        default <E> GraphTraversal<S,​E> call​(String service,
                                                   Traversal<?,​Map<?,​?>> childTraversal)
        Perform the specified service call with dynamic parameters produced by the specified child traversal.
        Parameters:
        service - the name of the service call
        childTraversal - a traversal that will produce a Map of parameters for the service call when invoked.
        Returns:
        the traversal with an appended CallStep.
        Since:
        3.6.0
        See Also:
        Reference Documentation - Call Step
      • call

        default <E> GraphTraversal<S,​E> call​(String service,
                                                   Map params,
                                                   Traversal<?,​Map<?,​?>> childTraversal)
        Perform the specified service call with both static and dynamic parameters produced by the specified child traversal. These parameters will be merged at execution time per the provider implementation. Reference implementation merges dynamic into static (dynamic will overwrite static).
        Parameters:
        service - the name of the service call
        params - static parameter map (no nested traversals)
        childTraversal - a traversal that will produce a Map of parameters for the service call when invoked.
        Returns:
        the traversal with an appended CallStep.
        Since:
        3.6.0
        See Also:
        Reference Documentation - Call Step
      • concat

        default GraphTraversal<S,​String> concat​(Traversal<?,​String> concatTraversal,
                                                      Traversal<?,​String>... otherConcatTraversals)
        Concatenate values of an arbitrary number of string traversals to the incoming traverser.
        Parameters:
        concatTraversal - the traversal to concatenate.
        otherConcatTraversals - additional traversals to concatenate.
        Returns:
        the traversal with an appended ConcatStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Concat Step
      • concat

        default GraphTraversal<S,​String> concat​(String... concatStrings)
        Concatenate an arbitrary number of strings to the incoming traverser.
        Parameters:
        concatStrings - the String values to concatenate.
        Returns:
        the traversal with an appended ConcatStep.
        Since:
        3.7.0
        See Also:
        Reference Documentation - Concat Step
      • asString

        default <E2> GraphTraversal<S,​E2> asString​(Scope scope)
        Returns the value of incoming traverser as strings. Null values are returned as a string value "null".
        Parameters:
        scope - local will operate on individual strings within incoming lists, global will operate on current traversal as a single object.
        Returns:
        the traversal with an appended AsStringGlobalStep or AsStringLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - AsString Step
      • length

        default GraphTraversal<S,​Integer> length()
        Returns the length incoming string traverser. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Returns:
        the traversal with an appended LengthGlobalStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Length Step
      • length

        default <E2> GraphTraversal<S,​E2> length​(Scope scope)
        Returns the length incoming string or list. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        scope - local will operate on individual strings within lists, global will operate on current traversal as a single object.
        Returns:
        the traversal with an appended LengthGlobalStep or LengthLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Length Step
      • toLower

        default GraphTraversal<S,​String> toLower()
        Returns the lowercase representation of incoming string traverser. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Returns:
        the traversal with an appended ToLowerGlobalStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - ToLower Step
      • toLower

        default <E2> GraphTraversal<S,​E2> toLower​(Scope scope)
        Returns the lowercase representation of incoming string or list of strings. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        scope - local will accept lists of string and operate on individual strings within the list, global will only accept string objects.
        Returns:
        the traversal with an appended ToLowerGlobalStep or ToLowerLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - ToLower Step
      • toUpper

        default GraphTraversal<S,​String> toUpper()
        Returns the uppercase representation of incoming string traverser. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Returns:
        the traversal with an appended ToUpperGlobalStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - ToUpper Step
      • toUpper

        default <E2> GraphTraversal<S,​E2> toUpper​(Scope scope)
        Returns the uppercase representation of incoming string or list of strings. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        scope - local will accept lists of string and operate on individual strings within the list, global will only accept string objects.
        Returns:
        the traversal with an appended ToUpperGlobalStep or ToUpperLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - ToUpper Step
      • trim

        default GraphTraversal<S,​String> trim()
        Returns a string with leading and trailing whitespace removed. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Returns:
        the traversal with an appended TrimGlobalStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Trim Step
      • trim

        default <E2> GraphTraversal<S,​E2> trim​(Scope scope)
        Returns a string with leading and trailing whitespace removed. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        scope - local will operate on individual strings within incoming lists, global will operate on current traversal as a single object.
        Returns:
        the traversal with an appended TrimGlobalStep or TrimLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Trim Step
      • lTrim

        default GraphTraversal<S,​String> lTrim()
        Returns a string with leading whitespace removed. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Returns:
        the traversal with an appended LTrimGlobalStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - LTrim Step
      • lTrim

        default <E2> GraphTraversal<S,​E2> lTrim​(Scope scope)
        Returns a string with leading whitespace removed. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        scope - local will operate on individual strings within incoming lists, global will operate on current traversal as a single object.
        Returns:
        the traversal with an appended LTrimGlobalStep or LTrimLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - LTrim Step
      • rTrim

        default GraphTraversal<S,​String> rTrim()
        Returns a string with trailing whitespace removed. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Returns:
        the traversal with an appended RTrimGlobalStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - RTrim Step
      • rTrim

        default <E2> GraphTraversal<S,​E2> rTrim​(Scope scope)
        Returns a string with trailing whitespace removed. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        scope - local will operate on individual strings within incoming lists, global will operate on current traversal as a single object.
        Returns:
        the traversal with an appended RTrimGlobalStep or RTrimLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - RTrim Step
      • reverse

        default <E2> GraphTraversal<S,​E2> reverse()
        Returns the reverse of the incoming traverser. Null values are not processed and remain as null when returned.
        Returns:
        the traversal with an appended ReverseStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Reverse Step
      • replace

        default GraphTraversal<S,​String> replace​(String oldChar,
                                                       String newChar)
        Returns a string with the specified characters in the original string replaced with the new characters. Any null arguments will be a no-op and the original string is returned. Null values from incoming traversers are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        newChar - the character to replace.
        oldChar - the character to be replaced.
        Returns:
        the traversal with an appended ReplaceGlobalStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Replace Step
      • replace

        default <E2> GraphTraversal<S,​E2> replace​(Scope scope,
                                                        String oldChar,
                                                        String newChar)
        Returns a string with the specified characters in the original string replaced with the new characters. Any null arguments will be a no-op and the original string is returned. Null values from incoming traversers are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        scope - local will operate on individual strings within incoming lists, global will operate on current traversal as a single object.
        newChar - the character to replace.
        oldChar - the character to be replaced.
        Returns:
        the traversal with an appended ReplaceGlobalStep or ReplaceLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Replace Step
      • split

        default GraphTraversal<S,​List<String>> split​(String separator)
        Returns a list of strings created by splitting the incoming string traverser around the matches of the given separator. A null separator will split the string by whitespaces. Null values from incoming traversers are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        separator - the character to split the string on.
        Returns:
        the traversal with an appended SplitGlobalStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Split Step
      • split

        default <E2> GraphTraversal<S,​List<E2>> split​(Scope scope,
                                                            String separator)
        Returns a list of strings created by splitting the incoming string traverser around the matches of the given separator. A null separator will split the string by whitespaces. Null values from incoming traversers are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        scope - local will operate on individual strings within incoming lists, global will operate on current traversal as a single object.
        separator - the character to split the string on.
        Returns:
        the traversal with an appended SplitGlobalStep or SplitLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Split Step
      • substring

        default GraphTraversal<S,​String> substring​(int startIndex)
        Returns a substring of the incoming string traverser with a 0-based start index (inclusive) specified, to the end of the string. If the start index is negative then it will begin at the specified index counted from the end of the string, or 0 if exceeding the string length. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        startIndex - the start index of the substring, inclusive.
        Returns:
        the traversal with an appended SubstringGlobalStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Substring Step
      • substring

        default <E2> GraphTraversal<S,​E2> substring​(Scope scope,
                                                          int startIndex)
        Returns a substring of the incoming string traverser with a 0-based start index (inclusive) specified, to the end of the string. If the start index is negative then it will begin at the specified index counted from the end of the string, or 0 if exceeding the string length. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        scope - local will operate on individual strings within incoming lists, global will operate on current traversal as a single object.
        startIndex - the start index of the substring, inclusive.
        Returns:
        the traversal with an appended SubstringGlobalStep or SubstringLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Substring Step
      • substring

        default GraphTraversal<S,​String> substring​(int startIndex,
                                                         int endIndex)
        Returns a substring of the incoming string traverser with a 0-based start index (inclusive) and end index (exclusive). If the start index is negative then it will begin at the specified index counted from the end of the string, or 0 if exceeding the string length. If the end index is negative then it will end at the specified index counted from the end, or at the end of the string if exceeding the string length. End index <= start index will return the empty string. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        startIndex - the start index of the substring, inclusive.
        endIndex - the end index of the substring, exclusive.
        Returns:
        the traversal with an appended SubstringGlobalStep.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Substring Step
      • substring

        default <E2> GraphTraversal<S,​E2> substring​(Scope scope,
                                                          int startIndex,
                                                          int endIndex)
        Returns a substring of the incoming string traverser with a 0-based start index (inclusive) and end index (exclusive). If the start index is negative then it will begin at the specified index counted from the end of the string, or 0 if exceeding the string length. If the end index is negative then it will end at the specified index counted from the end, or at the end of the string if exceeding the string length. End index <= start index will return the empty string. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
        Parameters:
        scope - local will operate on individual strings within incoming lists, global will operate on current traversal as a single object.
        startIndex - the start index of the substring, inclusive.
        endIndex - the end index of the substring, exclusive.
        Returns:
        the traversal with an appended SubstringGlobalStep or SubstringLocalStep depending on the Scope.
        Since:
        3.7.1
        See Also:
        Reference Documentation - Substring Step
      • filter

        default GraphTraversal<S,​E> filter​(Traversal<?,​?> filterTraversal)
        Map the Traverser to either true or false, where false will not pass the traverser to the next step.
        Parameters:
        filterTraversal - the filter traversal to apply
        Returns:
        the traversal with the TraversalFilterStep added
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - General Steps
      • none

        default GraphTraversal<S,​E> none()
        Filter all traversers in the traversal. This step has narrow use cases and is primarily intended for use as a signal to remote servers that iterate() was called. While it may be directly used, it is often a sign that a traversal should be re-written in another form.
        Specified by:
        none in interface Traversal<S,​E>
        Returns:
        the updated traversal with respective NoneStep.
      • or

        default GraphTraversal<S,​E> or​(Traversal<?,​?>... orTraversals)
        Ensures that at least one of the provided traversals yield a result.
        Parameters:
        orTraversals - filter traversals where at least one must be satisfied
        Returns:
        the traversal with an appended OrStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Or Step
      • and

        default GraphTraversal<S,​E> and​(Traversal<?,​?>... andTraversals)
        Ensures that all of the provided traversals yield a result.
        Parameters:
        andTraversals - filter traversals that must be satisfied
        Returns:
        the traversal with an appended AndStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - And Step
      • inject

        default GraphTraversal<S,​E> inject​(E... injections)
        Provides a way to add arbitrary objects to a traversal stream.
        Parameters:
        injections - the objects to add to the stream
        Returns:
        the traversal with an appended InjectStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Inject Step
      • dedup

        default GraphTraversal<S,​E> dedup​(Scope scope,
                                                String... dedupLabels)
        Remove all duplicates in the traversal stream up to this point.
        Parameters:
        scope - whether the deduplication is on the stream (global) or the current object (local).
        dedupLabels - if labels are provided, then the scope labels determine de-duplication. No labels implies current object.
        Returns:
        the traversal with an appended DedupGlobalStep or DedupLocalStep depending on scope
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Dedup Step
      • dedup

        default GraphTraversal<S,​E> dedup​(String... dedupLabels)
        Remove all duplicates in the traversal stream up to this point.
        Parameters:
        dedupLabels - if labels are provided, then the scoped object's labels determine de-duplication. No labels implies current object.
        Returns:
        the traversal with an appended DedupGlobalStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Dedup Step
      • has

        default GraphTraversal<S,​E> has​(String propertyKey,
                                              P<?> predicate)
        Filters vertices, edges and vertex properties based on their properties.
        Parameters:
        propertyKey - the key of the property to filter on
        predicate - the filter to apply to the key's value
        Returns:
        the traversal with an appended HasStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Has Step
      • has

        default GraphTraversal<S,​E> has​(T accessor,
                                              P<?> predicate)
        Filters vertices, edges and vertex properties based on their properties.
        Parameters:
        accessor - the T accessor of the property to filter on
        predicate - the filter to apply to the key's value
        Returns:
        the traversal with an appended HasStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Has Step
      • has

        default GraphTraversal<S,​E> has​(String propertyKey,
                                              Object value)
        Filters vertices, edges and vertex properties based on their properties.
        Parameters:
        propertyKey - the key of the property to filter on
        value - the value to compare the property value to for equality
        Returns:
        the traversal with an appended HasStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Has Step
      • has

        default GraphTraversal<S,​E> has​(T accessor,
                                              Object value)
        Filters vertices, edges and vertex properties based on their properties.
        Parameters:
        accessor - the T accessor of the property to filter on
        value - the value to compare the accessor value to for equality
        Returns:
        the traversal with an appended HasStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Has Step
      • has

        default GraphTraversal<S,​E> has​(String label,
                                              String propertyKey,
                                              P<?> predicate)
        Filters vertices, edges and vertex properties based on their properties.
        Parameters:
        label - the label of the Element
        propertyKey - the key of the property to filter on
        predicate - the filter to apply to the key's value
        Returns:
        the traversal with an appended HasStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Has Step
      • has

        default GraphTraversal<S,​E> has​(String label,
                                              String propertyKey,
                                              Object value)
        Filters vertices, edges and vertex properties based on their properties.
        Parameters:
        label - the label of the Element
        propertyKey - the key of the property to filter on
        value - the value to compare the accessor value to for equality
        Returns:
        the traversal with an appended HasStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Has Step
      • has

        default GraphTraversal<S,​E> has​(T accessor,
                                              Traversal<?,​?> propertyTraversal)
        Filters vertices, edges and vertex properties based on their value of T where only T.id and T.label are supported.
        Parameters:
        accessor - the T accessor of the property to filter on
        propertyTraversal - the traversal to filter the accessor value by
        Returns:
        the traversal with an appended HasStep
        Since:
        3.1.0-incubating
        See Also:
        Reference Documentation - Has Step
      • has

        default GraphTraversal<S,​E> has​(String propertyKey,
                                              Traversal<?,​?> propertyTraversal)
        Filters vertices, edges and vertex properties based on the value of the specified property key.
        Parameters:
        propertyKey - the key of the property to filter on
        propertyTraversal - the traversal to filter the property value by
        Returns:
        the traversal with an appended HasStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Has Step
      • has

        default GraphTraversal<S,​E> has​(String propertyKey)
        Filters vertices, edges and vertex properties based on the existence of properties.
        Parameters:
        propertyKey - the key of the property to filter on for existence
        Returns:
        the traversal with an appended HasStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Has Step
      • hasNot

        default GraphTraversal<S,​E> hasNot​(String propertyKey)
        Filters vertices, edges and vertex properties based on the non-existence of properties.
        Parameters:
        propertyKey - the key of the property to filter on for existence
        Returns:
        the traversal with an appended HasStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Has Step
      • hasId

        default GraphTraversal<S,​E> hasId​(P<Object> predicate)
        Filters vertices, edges and vertex properties based on their identifier. Calling this step with a null value will result in effectively calling hasId(Object, Object...) wit a single null identifier and therefore filter all results since a T.id cannot be null.
        Parameters:
        predicate - the filter to apply to the identifier of the Element
        Returns:
        the traversal with an appended HasStep
        Since:
        3.2.4
        See Also:
        Reference Documentation - Has Step
      • is

        default GraphTraversal<S,​E> is​(P<E> predicate)
        Filters E object values given the provided predicate.
        Parameters:
        predicate - the filter to apply
        Returns:
        the traversal with an appended IsStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Is Step
      • not

        default GraphTraversal<S,​E> not​(Traversal<?,​?> notTraversal)
        Removes objects from the traversal stream when the traversal provided as an argument returns any objects.
        Parameters:
        notTraversal - the traversal to filter by.
        Returns:
        the traversal with an appended NotStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Not Step
      • coin

        default GraphTraversal<S,​E> coin​(double probability)
        Filter the E object given a biased coin toss.
        Parameters:
        probability - the probability that the object will pass through
        Returns:
        the traversal with an appended CoinStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Coin Step
      • range

        default GraphTraversal<S,​E> range​(long low,
                                                long high)
        Filter the objects in the traversal by the number of them to pass through the stream. Those before the value of low do not pass through and those that exceed the value of high will end the iteration.
        Parameters:
        low - the number at which to start allowing objects through the stream
        high - the number at which to end the stream - use -1 to emit all remaining objects
        Returns:
        the traversal with an appended RangeGlobalStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Range Step
      • range

        default <E2> GraphTraversal<S,​E2> range​(Scope scope,
                                                      long low,
                                                      long high)
        Filter the objects in the traversal by the number of them to pass through the stream as constrained by the Scope. Those before the value of low do not pass through and those that exceed the value of high will end the iteration.
        Parameters:
        scope - the scope of how to apply the range
        low - the number at which to start allowing objects through the stream
        high - the number at which to end the stream - use -1 to emit all remaining objects
        Returns:
        the traversal with an appended RangeGlobalStep or RangeLocalStep depending on scope
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Range Step
      • limit

        default GraphTraversal<S,​E> limit​(long limit)
        Filter the objects in the traversal by the number of them to pass through the stream, where only the first n objects are allowed as defined by the limit argument.
        Parameters:
        limit - the number at which to end the stream
        Returns:
        the traversal with an appended RangeGlobalStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Limit Step
      • limit

        default <E2> GraphTraversal<S,​E2> limit​(Scope scope,
                                                      long limit)
        Filter the objects in the traversal by the number of them to pass through the stream given the Scope, where only the first n objects are allowed as defined by the limit argument.
        Parameters:
        scope - the scope of how to apply the limit
        limit - the number at which to end the stream
        Returns:
        the traversal with an appended RangeGlobalStep or RangeLocalStep depending on scope
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Limit Step
      • tail

        default GraphTraversal<S,​E> tail()
        Filters the objects in the traversal emitted as being last objects in the stream. In this case, only the last object will be returned.
        Returns:
        the traversal with an appended TailGlobalStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Tail Step
      • tail

        default GraphTraversal<S,​E> tail​(long limit)
        Filters the objects in the traversal emitted as being last objects in the stream. In this case, only the last n objects will be returned as defined by the limit.
        Parameters:
        limit - the number at which to end the stream
        Returns:
        the traversal with an appended TailGlobalStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Tail Step
      • tail

        default <E2> GraphTraversal<S,​E2> tail​(Scope scope)
        Filters the objects in the traversal emitted as being last objects in the stream given the Scope. In this case, only the last object in the stream will be returned.
        Parameters:
        scope - the scope of how to apply the tail
        Returns:
        the traversal with an appended TailGlobalStep or TailLocalStep depending on scope
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Tail Step
      • tail

        default <E2> GraphTraversal<S,​E2> tail​(Scope scope,
                                                     long limit)
        Filters the objects in the traversal emitted as being last objects in the stream given the Scope. In this case, only the last n objects will be returned as defined by the limit.
        Parameters:
        scope - the scope of how to apply the tail
        limit - the number at which to end the stream
        Returns:
        the traversal with an appended TailGlobalStep or TailLocalStep depending on scope
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Tail Step
      • skip

        default GraphTraversal<S,​E> skip​(long skip)
        Filters out the first n objects in the traversal.
        Parameters:
        skip - the number of objects to skip
        Returns:
        the traversal with an appended RangeGlobalStep
        Since:
        3.3.0
        See Also:
        Reference Documentation - Skip Step
      • skip

        default <E2> GraphTraversal<S,​E2> skip​(Scope scope,
                                                     long skip)
        Filters out the first n objects in the traversal.
        Parameters:
        scope - the scope of how to apply the tail
        skip - the number of objects to skip
        Returns:
        the traversal with an appended RangeGlobalStep or RangeLocalStep depending on scope
        Since:
        3.3.0
        See Also:
        Reference Documentation - Skip Step
      • timeLimit

        default GraphTraversal<S,​E> timeLimit​(long timeLimit)
        Once the first Traverser hits this step, a count down is started. Once the time limit is up, all remaining traversers are filtered out.
        Parameters:
        timeLimit - the count down time
        Returns:
        the traversal with an appended TimeLimitStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - TimeLimit Step
      • sample

        default GraphTraversal<S,​E> sample​(int amountToSample)
        Allow some specified number of objects to pass through the stream.
        Parameters:
        amountToSample - the number of objects to allow
        Returns:
        the traversal with an appended SampleGlobalStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Sample Step
      • sample

        default GraphTraversal<S,​E> sample​(Scope scope,
                                                 int amountToSample)
        Allow some specified number of objects to pass through the stream.
        Parameters:
        scope - the scope of how to apply the sample
        amountToSample - the number of objects to allow
        Returns:
        the traversal with an appended SampleGlobalStep or SampleLocalStep depending on the scope
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Sample Step
      • drop

        default GraphTraversal<S,​E> drop()
        Removes elements and properties from the graph. This step is not a terminating, in the sense that it does not automatically iterate the traversal. It is therefore necessary to do some form of iteration for the removal to actually take place. In most cases, iteration is best accomplished with g.V().drop().iterate().
        Returns:
        the traversal with the DropStep added
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Drop Step
      • all

        default <S2> GraphTraversal<S,​E> all​(P<S2> predicate)
        Filters E lists given the provided predicate.
        Parameters:
        predicate - the filter to apply
        Returns:
        the traversal with an appended AllStep
        Since:
        3.7.1
        See Also:
        Reference Documentation - All Step
      • any

        default <S2> GraphTraversal<S,​E> any​(P<S2> predicate)
        Filters E lists given the provided predicate.
        Parameters:
        predicate - the filter to apply
        Returns:
        the traversal with an appended AnyStep
        Since:
        3.7.1
        See Also:
        Reference Documentation - Any Step
      • sideEffect

        default GraphTraversal<S,​E> sideEffect​(Traversal<?,​?> sideEffectTraversal)
        Perform some operation on the Traverser and pass it to the next step unmodified.
        Parameters:
        sideEffectTraversal - the operation to perform at this step in relation to the Traverser
        Returns:
        the traversal with an appended TraversalSideEffectStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - General Steps
      • cap

        default <E2> GraphTraversal<S,​E2> cap​(String sideEffectKey,
                                                    String... sideEffectKeys)
        Iterates the traversal up to the itself and emits the side-effect referenced by the key. If multiple keys are supplied then the side-effects are emitted as a Map.
        Parameters:
        sideEffectKey - the side-effect to emit
        sideEffectKeys - other side-effects to emit
        Returns:
        the traversal with an appended SideEffectCapStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Cap Step
      • subgraph

        default GraphTraversal<S,​Edge> subgraph​(String sideEffectKey)
        Extracts a portion of the graph being traversed into a Graph object held in the specified side-effect key.
        Parameters:
        sideEffectKey - the name of the side-effect key that will hold the subgraph
        Returns:
        the traversal with an appended SubgraphStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Subgraph Step
      • group

        default GraphTraversal<S,​E> group​(String sideEffectKey)
        Organize objects in the stream into a Map. Calls to group() are typically accompanied with by() modulators which help specify how the grouping should occur.
        Parameters:
        sideEffectKey - the name of the side-effect key that will hold the aggregated grouping
        Returns:
        the traversal with an appended GroupStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Group Step
      • groupCount

        default GraphTraversal<S,​E> groupCount​(String sideEffectKey)
        Counts the number of times a particular objects has been part of a traversal, returning a Map where the object is the key and the value is the count.
        Parameters:
        sideEffectKey - the name of the side-effect key that will hold the aggregated grouping
        Returns:
        the traversal with an appended GroupCountStep.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - GroupCount Step
      • fail

        default GraphTraversal<S,​E> fail()
        When triggered, immediately throws a RuntimeException which implements the Failure interface. The traversal will be terminated as a result.
        Returns:
        the traversal with an appended FailStep.
        Since:
        3.6.0
        See Also:
        Reference Documentation - Fail Step
      • fail

        default GraphTraversal<S,​E> fail​(String message)
        When triggered, immediately throws a RuntimeException which implements the Failure interface. The traversal will be terminated as a result.
        Parameters:
        message - the error message to include in the exception
        Returns:
        the traversal with an appended FailStep.
        Since:
        3.6.0
        See Also:
        Reference Documentation - Fail Step
      • tree

        default GraphTraversal<S,​E> tree​(String sideEffectKey)
        Aggregates the emanating paths into a Tree data structure.
        Parameters:
        sideEffectKey - the name of the side-effect key that will hold the tree
        Returns:
        the traversal with an appended TreeStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Tree Step
      • profile

        default GraphTraversal<S,​E> profile​(String sideEffectKey)
        Allows developers to examine statistical information about a traversal providing data like execution times, counts, etc.
        Parameters:
        sideEffectKey - the name of the side-effect key within which to hold the profile object
        Returns:
        the traversal with an appended ProfileSideEffectStep
        Since:
        3.2.0-incubating
        See Also:
        Reference Documentation - Profile Step
      • profile

        default GraphTraversal<S,​org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics> profile()
        Allows developers to examine statistical information about a traversal providing data like execution times, counts, etc.
        Specified by:
        profile in interface Traversal<S,​E>
        Returns:
        the traversal with an appended ProfileSideEffectStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Profile Step
      • property

        default GraphTraversal<S,​E> property​(VertexProperty.Cardinality cardinality,
                                                   Object key,
                                                   Object value,
                                                   Object... keyValues)
        Sets a Property value and related meta properties if supplied, if supported by the Graph and if the Element is a VertexProperty. This method is the long-hand version of property(Object, Object, Object...) with the difference that the VertexProperty.Cardinality can be supplied.

        * Generally speaking, this method will append an AddPropertyStep to the Traversal but when possible, this method will attempt to fold key/value pairs into an AddVertexStep, AddEdgeStep or AddVertexStartStep. This potential optimization can only happen if cardinality is not supplied and when meta-properties are not included.

        Parameters:
        cardinality - the specified cardinality of the property where null will allow the Graph to use its default settings
        key - the key for the property
        value - the value for the property which may not be null if the key is of type T
        keyValues - any meta properties to be assigned to this property
        Returns:
        the traversal with the last step modified to add a property
        Since:
        3.0.0-incubating
        See Also:
        AddProperty Step
      • choose

        default <E2> GraphTraversal<S,​E2> choose​(Traversal<?,​?> traversalPredicate,
                                                       Traversal<?,​E2> trueChoice,
                                                       Traversal<?,​E2> falseChoice)
        Routes the current traverser to a particular traversal branch option which allows the creation of if-then-else like semantics within a traversal.
        Parameters:
        traversalPredicate - the traversal used to determine the "if" portion of the if-then-else
        trueChoice - the traversal to execute in the event the traversalPredicate returns true
        falseChoice - the traversal to execute in the event the traversalPredicate returns false
        Returns:
        the traversal with the appended ChooseStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Choose Step
      • choose

        default <E2> GraphTraversal<S,​E2> choose​(Traversal<?,​?> traversalPredicate,
                                                       Traversal<?,​E2> trueChoice)
        Routes the current traverser to a particular traversal branch option which allows the creation of if-then like semantics within a traversal.
        Parameters:
        traversalPredicate - the traversal used to determine the "if" portion of the if-then-else
        trueChoice - the traversal to execute in the event the traversalPredicate returns true
        Returns:
        the traversal with the appended ChooseStep
        Since:
        3.2.4
        See Also:
        Reference Documentation - Choose Step
      • choose

        default <E2> GraphTraversal<S,​E2> choose​(Predicate<E> choosePredicate,
                                                       Traversal<?,​E2> trueChoice,
                                                       Traversal<?,​E2> falseChoice)
        Routes the current traverser to a particular traversal branch option which allows the creation of if-then-else like semantics within a traversal.
        Parameters:
        choosePredicate - the function used to determine the "if" portion of the if-then-else
        trueChoice - the traversal to execute in the event the traversalPredicate returns true
        falseChoice - the traversal to execute in the event the traversalPredicate returns false
        Returns:
        the traversal with the appended ChooseStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Choose Step
      • choose

        default <E2> GraphTraversal<S,​E2> choose​(Predicate<E> choosePredicate,
                                                       Traversal<?,​E2> trueChoice)
        Routes the current traverser to a particular traversal branch option which allows the creation of if-then like semantics within a traversal.
        Parameters:
        choosePredicate - the function used to determine the "if" portion of the if-then-else
        trueChoice - the traversal to execute in the event the traversalPredicate returns true
        Returns:
        the traversal with the appended ChooseStep
        Since:
        3.2.4
        See Also:
        Reference Documentation - Choose Step
      • optional

        default <E2> GraphTraversal<S,​E2> optional​(Traversal<?,​E2> optionalTraversal)
        Returns the result of the specified traversal if it yields a result, otherwise it returns the calling element.
        Parameters:
        optionalTraversal - the traversal to execute for a potential result
        Returns:
        the traversal with the appended ChooseStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Optional Step
      • union

        default <E2> GraphTraversal<S,​E2> union​(Traversal<?,​E2>... unionTraversals)
        Merges the results of an arbitrary number of traversals.
        Parameters:
        unionTraversals - the traversals to merge
        Returns:
        the traversal with the appended UnionStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Union Step
      • coalesce

        default <E2> GraphTraversal<S,​E2> coalesce​(Traversal<?,​E2>... coalesceTraversals)
        Evaluates the provided traversals and returns the result of the first traversal to emit at least one object.
        Parameters:
        coalesceTraversals - the traversals to coalesce
        Returns:
        the traversal with the appended CoalesceStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Coalesce Step
      • repeat

        default GraphTraversal<S,​E> repeat​(Traversal<?,​E> repeatTraversal)
        This step is used for looping over a traversal given some break predicate.
        Parameters:
        repeatTraversal - the traversal to repeat over
        Returns:
        the traversal with the appended RepeatStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Repeat Step
      • repeat

        default GraphTraversal<S,​E> repeat​(String loopName,
                                                 Traversal<?,​E> repeatTraversal)
        This step is used for looping over a traversal given some break predicate and with a specified loop name.
        Parameters:
        repeatTraversal - the traversal to repeat over
        loopName - The name given to the loop
        Returns:
        the traversal with the appended RepeatStep
        Since:
        3.4.0
        See Also:
        Reference Documentation - Repeat Step
      • local

        default <E2> GraphTraversal<S,​E2> local​(Traversal<?,​E2> localTraversal)
        Provides a execute a specified traversal on a single element within a stream.
        Parameters:
        localTraversal - the traversal to execute locally
        Returns:
        the traversal with the appended LocalStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Local Step
      • as

        default GraphTraversal<S,​E> as​(String stepLabel,
                                             String... stepLabels)
        A step modulator that provides a label to the step that can be accessed later in the traversal by other steps.
        Parameters:
        stepLabel - the name of the step
        stepLabels - additional names for the label
        Returns:
        the traversal with the modified end step
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - As Step
      • barrier

        default GraphTraversal<S,​E> barrier()
        Turns the lazy traversal pipeline into a bulk-synchronous pipeline which basically iterates that traversal to the size of the barrier. In this case, it iterates the entire thing as the default barrier size is set to Integer.MAX_VALUE.
        Returns:
        the traversal with an appended NoOpBarrierStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Barrier Step
      • barrier

        default GraphTraversal<S,​E> barrier​(int maxBarrierSize)
        Turns the lazy traversal pipeline into a bulk-synchronous pipeline which basically iterates that traversal to the size of the barrier.
        Parameters:
        maxBarrierSize - the size of the barrier
        Returns:
        the traversal with an appended NoOpBarrierStep
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - Barrier Step
      • index

        default <E2> GraphTraversal<S,​E2> index()
        Indexes all items of the current collection. The indexing format can be configured using the with(String, Object) and WithOptions.indexer. Indexed as list: ["a","b","c"] => [["a",0],["b",1],["c",2]] Indexed as map: ["a","b","c"] => {0:"a",1:"b",2:"c"} If the current object is not a collection, this step will map the object to a single item collection/map: Indexed as list: "a" => ["a",0] Indexed as map: "a" => {0:"a"}
        Returns:
        the traversal with an appended IndexStep
        Since:
        3.4.0
        See Also:
        Reference Documentation - Index Step
      • barrier

        default GraphTraversal<S,​E> barrier​(Consumer<org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet<Object>> barrierConsumer)
        Turns the lazy traversal pipeline into a bulk-synchronous pipeline which basically iterates that traversal to the size of the barrier. In this case, it iterates the entire thing as the default barrier size is set to Integer.MAX_VALUE.
        Parameters:
        barrierConsumer - a consumer function that is applied to the objects aggregated to the barrier
        Returns:
        the traversal with an appended NoOpBarrierStep
        Since:
        3.2.0-incubating
        See Also:
        Reference Documentation - Barrier Step
      • with

        default GraphTraversal<S,​E> with​(String key)
        Provides a configuration to a step in the form of a key which is the same as with(key, true). The key of the configuration must be step specific and therefore a configuration could be supplied that is not known to be valid until execution.
        Parameters:
        key - the key of the configuration to apply to a step
        Returns:
        the traversal with a modulated step
        Since:
        3.4.0
        See Also:
        Reference Documentation - With Step
      • with

        default GraphTraversal<S,​E> with​(String key,
                                               Object value)
        Provides a configuration to a step in the form of a key and value pair. The key of the configuration must be step specific and therefore a configuration could be supplied that is not known to be valid until execution.
        Parameters:
        key - the key of the configuration to apply to a step
        value - the value of the configuration to apply to a step
        Returns:
        the traversal with a modulated step
        Since:
        3.4.0
        See Also:
        Reference Documentation - With Step
      • by

        default GraphTraversal<S,​E> by​(Traversal<?,​?> traversal)
        The by() can be applied to a number of different step to alter their behaviors. Modifies the previous step with the specified traversal.
        Parameters:
        traversal - the traversal to apply
        Returns:
        the traversal with a modulated step.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - By Step
      • by

        default GraphTraversal<S,​E> by​(T token)
        The by() can be applied to a number of different step to alter their behaviors. Modifies the previous step with the specified token of T.
        Parameters:
        token - the token to apply
        Returns:
        the traversal with a modulated step.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - By Step
      • by

        default GraphTraversal<S,​E> by​(String key)
        The by() can be applied to a number of different step to alter their behaviors. Modifies the previous step with the specified key.
        Parameters:
        key - the key to apply
        Returns:
        the traversal with a modulated step.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - By Step
      • by

        default <V> GraphTraversal<S,​E> by​(Function<V,​Object> function)
        The by() can be applied to a number of different step to alter their behaviors. Modifies the previous step with the specified function.
        Parameters:
        function - the function to apply
        Returns:
        the traversal with a modulated step.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - By Step
      • by

        default <V> GraphTraversal<S,​E> by​(Traversal<?,​?> traversal,
                                                 Comparator<V> comparator)
        The by() can be applied to a number of different step to alter their behaviors. Modifies the previous step with the specified function.
        Parameters:
        traversal - the traversal to apply
        comparator - the comparator to apply typically for some order()
        Returns:
        the traversal with a modulated step.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - By Step
      • by

        default GraphTraversal<S,​E> by​(Comparator<E> comparator)
        The by() can be applied to a number of different step to alter their behaviors. Modifies the previous step with the specified function.
        Parameters:
        comparator - the comparator to apply typically for some order()
        Returns:
        the traversal with a modulated step.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - By Step
      • by

        default GraphTraversal<S,​E> by​(Order order)
        The by() can be applied to a number of different step to alter their behaviors. Modifies the previous step with the specified function.
        Parameters:
        order - the comparator to apply typically for some order()
        Returns:
        the traversal with a modulated step.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - By Step
      • by

        default <V> GraphTraversal<S,​E> by​(String key,
                                                 Comparator<V> comparator)
        The by() can be applied to a number of different step to alter their behaviors. Modifies the previous step with the specified function.
        Parameters:
        key - the key to apply traversal
        comparator - the comparator to apply typically for some order()
        Returns:
        the traversal with a modulated step.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - By Step
      • by

        default <U> GraphTraversal<S,​E> by​(Function<U,​Object> function,
                                                 Comparator comparator)
        The by() can be applied to a number of different step to alter their behaviors. Modifies the previous step with the specified function.
        Parameters:
        function - the function to apply
        comparator - the comparator to apply typically for some order()
        Returns:
        the traversal with a modulated step.
        Since:
        3.0.0-incubating
        See Also:
        Reference Documentation - By Step
      • option

        default <M,​E2> GraphTraversal<S,​E> option​(M token,
                                                              Map<Object,​Object> m)
        This is a step modulator to a TraversalOptionParent like choose() or mergeV() where the provided argument associated to the token is applied according to the semantics of the step. Please see the documentation of such steps to understand the usage context.
        Parameters:
        m - Provides a Map as the option which is the same as doing constant(m).
        Returns:
        the traversal with the modulated step
        Since:
        3.6.0
        See Also:
        Reference Documentation - MergeV Step, Reference Documentation - MergeE Step
      • iterate

        default GraphTraversal<S,​E> iterate()
        Iterates the traversal presumably for the generation of side-effects.
        Specified by:
        iterate in interface Traversal<S,​E>
        Returns:
        the fully drained traversal