Table of Contents

Class GraphTraversalSource

Namespace
Gremlin.Net.Process.Traversal
Assembly
Gremlin.Net.dll

A GraphTraversalSource is the primary DSL of the Gremlin traversal machine. It provides access to all the configurations and steps for Turing complete graph computing.

public class GraphTraversalSource
Inheritance
GraphTraversalSource
Inherited Members

Constructors

GraphTraversalSource()

Initializes a new instance of the GraphTraversalSource class.

public GraphTraversalSource()

GraphTraversalSource(ICollection<ITraversalStrategy>, Bytecode)

Initializes a new instance of the GraphTraversalSource class.

public GraphTraversalSource(ICollection<ITraversalStrategy> traversalStrategies, Bytecode bytecode)

Parameters

traversalStrategies ICollection<ITraversalStrategy>

The traversal strategies associated with this graph traversal source.

bytecode Bytecode

The Bytecode associated with the current state of this graph traversal source.

GraphTraversalSource(ICollection<ITraversalStrategy>, Bytecode, IRemoteConnection)

public GraphTraversalSource(ICollection<ITraversalStrategy> traversalStrategies, Bytecode bytecode, IRemoteConnection connection)

Parameters

traversalStrategies ICollection<ITraversalStrategy>
bytecode Bytecode
connection IRemoteConnection

Properties

Bytecode

Gets or sets the Bytecode associated with the current state of this graph traversal source.

public Bytecode Bytecode { get; set; }

Property Value

Bytecode

IsSessionBound

public bool IsSessionBound { get; }

Property Value

bool

TraversalStrategies

Gets or sets the traversal strategies associated with this graph traversal source.

public ICollection<ITraversalStrategy> TraversalStrategies { get; set; }

Property Value

ICollection<ITraversalStrategy>

Methods

AddE(ITraversal)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the addE step to that traversal.

public GraphTraversal<Edge, Edge> AddE(ITraversal edgeLabelTraversal)

Parameters

edgeLabelTraversal ITraversal

Returns

GraphTraversal<Edge, Edge>

AddE(string)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the addE step to that traversal.

public GraphTraversal<Edge, Edge> AddE(string label)

Parameters

label string

Returns

GraphTraversal<Edge, Edge>

AddV()

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the addV step to that traversal.

public GraphTraversal<Vertex, Vertex> AddV()

Returns

GraphTraversal<Vertex, Vertex>

AddV(ITraversal)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the addV step to that traversal.

public GraphTraversal<Vertex, Vertex> AddV(ITraversal vertexLabelTraversal)

Parameters

vertexLabelTraversal ITraversal

Returns

GraphTraversal<Vertex, Vertex>

AddV(string)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the addV step to that traversal.

public GraphTraversal<Vertex, Vertex> AddV(string label)

Parameters

label string

Returns

GraphTraversal<Vertex, Vertex>

Call<TStart>()

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the call step to that traversal.

public GraphTraversal<TStart, TStart> Call<TStart>()

Returns

GraphTraversal<TStart, TStart>

Type Parameters

TStart

Call<TStart>(string?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the call step to that traversal.

public GraphTraversal<TStart, TStart> Call<TStart>(string? service)

Parameters

service string

Returns

GraphTraversal<TStart, TStart>

Type Parameters

TStart

Call<TStart>(string?, ITraversal?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the call step to that traversal.

public GraphTraversal<TStart, TStart> Call<TStart>(string? service, ITraversal? t)

Parameters

service string
t ITraversal

Returns

GraphTraversal<TStart, TStart>

Type Parameters

TStart

Call<TStart>(string?, IDictionary<object, object>?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the call step to that traversal.

public GraphTraversal<TStart, TStart> Call<TStart>(string? service, IDictionary<object, object>? m)

Parameters

service string
m IDictionary<object, object>

Returns

GraphTraversal<TStart, TStart>

Type Parameters

TStart

Call<TStart>(string?, IDictionary<object, object>?, ITraversal?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the call step to that traversal.

public GraphTraversal<TStart, TStart> Call<TStart>(string? service, IDictionary<object, object>? m, ITraversal? t)

Parameters

service string
m IDictionary<object, object>
t ITraversal

Returns

GraphTraversal<TStart, TStart>

Type Parameters

TStart

E(params object?[]?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the E step to that traversal.

public GraphTraversal<Edge, Edge> E(params object?[]? edgesIds)

Parameters

edgesIds object[]

Returns

GraphTraversal<Edge, Edge>

Inject<TStart>(params TStart?[]?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the inject step to that traversal.

public GraphTraversal<TStart, TStart> Inject<TStart>(params TStart?[]? starts)

Parameters

starts TStart[]

Returns

GraphTraversal<TStart, TStart>

Type Parameters

TStart

Io<TStart>(string)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the io step to that traversal.

public GraphTraversal<TStart, TStart> Io<TStart>(string file)

Parameters

file string

Returns

GraphTraversal<TStart, TStart>

Type Parameters

TStart

MergeE(ITraversal?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the mergeE step to that traversal.

public GraphTraversal<Edge, Edge> MergeE(ITraversal? t)

Parameters

t ITraversal

Returns

GraphTraversal<Edge, Edge>

MergeE(IDictionary<object, object>?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the mergeE step to that traversal.

public GraphTraversal<Edge, Edge> MergeE(IDictionary<object, object>? m)

Parameters

m IDictionary<object, object>

Returns

GraphTraversal<Edge, Edge>

MergeV(ITraversal?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the mergeV step to that traversal.

public GraphTraversal<Vertex, Vertex> MergeV(ITraversal? t)

Parameters

t ITraversal

Returns

GraphTraversal<Vertex, Vertex>

MergeV(IDictionary<object, object>?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the mergeV step to that traversal.

public GraphTraversal<Vertex, Vertex> MergeV(IDictionary<object, object>? m)

Parameters

m IDictionary<object, object>

Returns

GraphTraversal<Vertex, Vertex>

Tx()

Spawns a new RemoteTransaction object that can then start and stop a transaction.

public RemoteTransaction Tx()

Returns

RemoteTransaction

The spawned transaction.

Exceptions

InvalidOperationException

Thrown if this traversal source is already bound to a session.

Union<TStart>(params ITraversal[])

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the union step to that traversal.

public GraphTraversal<TStart, TStart> Union<TStart>(params ITraversal[] unionTraversals)

Parameters

unionTraversals ITraversal[]

Returns

GraphTraversal<TStart, TStart>

Type Parameters

TStart

V(params object?[]?)

Spawns a GraphTraversal<TStart, TEnd> off this graph traversal source and adds the V step to that traversal.

public GraphTraversal<Vertex, Vertex> V(params object?[]? vertexIds)

Parameters

vertexIds object[]

Returns

GraphTraversal<Vertex, Vertex>

With(string)

public GraphTraversalSource With(string key)

Parameters

key string

Returns

GraphTraversalSource

With(string, object?)

public GraphTraversalSource With(string key, object? value)

Parameters

key string
value object

Returns

GraphTraversalSource

WithBindings(object?)

[Obsolete("Use the Bindings class instead.", false)]
public GraphTraversalSource WithBindings(object? bindings)

Parameters

bindings object

Returns

GraphTraversalSource

WithBulk(bool)

public GraphTraversalSource WithBulk(bool useBulk)

Parameters

useBulk bool

Returns

GraphTraversalSource

WithComputer(string?, int?, string?, string?, ITraversal?, ITraversal?, Dictionary<string, dynamic>?)

Add a GraphComputer class used to execute the traversal. This adds a VertexProgramStrategy to the strategies.

public GraphTraversalSource WithComputer(string? graphComputer = null, int? workers = null, string? persist = null, string? result = null, ITraversal? vertices = null, ITraversal? edges = null, Dictionary<string, dynamic>? configuration = null)

Parameters

graphComputer string
workers int?
persist string
result string
vertices ITraversal
edges ITraversal
configuration Dictionary<string, object>

Returns

GraphTraversalSource

WithPath()

public GraphTraversalSource WithPath()

Returns

GraphTraversalSource

WithRemote(IRemoteConnection)

Configures the GraphTraversalSource as a "remote" to issue the GraphTraversal<TStart, TEnd> for execution elsewhere.

public GraphTraversalSource WithRemote(IRemoteConnection remoteConnection)

Parameters

remoteConnection IRemoteConnection

The IRemoteConnection instance to use to submit the GraphTraversal<TStart, TEnd>.

Returns

GraphTraversalSource

A GraphTraversalSource configured to use the provided IRemoteConnection.

WithSack(ISupplier?)

public GraphTraversalSource WithSack(ISupplier? initialValue)

Parameters

initialValue ISupplier

Returns

GraphTraversalSource

WithSack(ISupplier?, IBinaryOperator?)

public GraphTraversalSource WithSack(ISupplier? initialValue, IBinaryOperator? mergeOperator)

Parameters

initialValue ISupplier
mergeOperator IBinaryOperator

Returns

GraphTraversalSource

WithSack(ISupplier?, IUnaryOperator?)

public GraphTraversalSource WithSack(ISupplier? initialValue, IUnaryOperator? splitOperator)

Parameters

initialValue ISupplier
splitOperator IUnaryOperator

Returns

GraphTraversalSource

WithSack(ISupplier?, IUnaryOperator?, IBinaryOperator?)

public GraphTraversalSource WithSack(ISupplier? initialValue, IUnaryOperator? splitOperator, IBinaryOperator? mergeOperator)

Parameters

initialValue ISupplier
splitOperator IUnaryOperator
mergeOperator IBinaryOperator

Returns

GraphTraversalSource

WithSack(object?)

public GraphTraversalSource WithSack(object? initialValue)

Parameters

initialValue object

Returns

GraphTraversalSource

WithSack(object?, IBinaryOperator?)

public GraphTraversalSource WithSack(object? initialValue, IBinaryOperator? mergeOperator)

Parameters

initialValue object
mergeOperator IBinaryOperator

Returns

GraphTraversalSource

WithSack(object?, IUnaryOperator?)

public GraphTraversalSource WithSack(object? initialValue, IUnaryOperator? splitOperator)

Parameters

initialValue object
splitOperator IUnaryOperator

Returns

GraphTraversalSource

WithSack(object?, IUnaryOperator?, IBinaryOperator?)

public GraphTraversalSource WithSack(object? initialValue, IUnaryOperator? splitOperator, IBinaryOperator? mergeOperator)

Parameters

initialValue object
splitOperator IUnaryOperator
mergeOperator IBinaryOperator

Returns

GraphTraversalSource

WithSideEffect(string?, ISupplier?)

public GraphTraversalSource WithSideEffect(string? key, ISupplier? initialValue)

Parameters

key string
initialValue ISupplier

Returns

GraphTraversalSource

WithSideEffect(string?, ISupplier?, IBinaryOperator?)

public GraphTraversalSource WithSideEffect(string? key, ISupplier? initialValue, IBinaryOperator? reducer)

Parameters

key string
initialValue ISupplier
reducer IBinaryOperator

Returns

GraphTraversalSource

WithSideEffect(string?, object?)

public GraphTraversalSource WithSideEffect(string? key, object? initialValue)

Parameters

key string
initialValue object

Returns

GraphTraversalSource

WithSideEffect(string?, object?, IBinaryOperator)

public GraphTraversalSource WithSideEffect(string? key, object? initialValue, IBinaryOperator reducer)

Parameters

key string
initialValue object
reducer IBinaryOperator

Returns

GraphTraversalSource

WithStrategies(params ITraversalStrategy[])

public GraphTraversalSource WithStrategies(params ITraversalStrategy[] traversalStrategies)

Parameters

traversalStrategies ITraversalStrategy[]

Returns

GraphTraversalSource

WithoutStrategies(params Type?[])

public GraphTraversalSource WithoutStrategies(params Type?[] traversalStrategyClasses)

Parameters

traversalStrategyClasses Type[]

Returns

GraphTraversalSource