Class GraphTraversalSource
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
BytecodeThe 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
Bytecodeconnection
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
IsSessionBound
public bool IsSessionBound { get; }
Property Value
TraversalStrategies
Gets or sets the traversal strategies associated with this graph traversal source.
public ICollection<ITraversalStrategy> TraversalStrategies { get; set; }
Property Value
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
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
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
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
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
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
stringt
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
stringm
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
stringm
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
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
Returns
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
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
Returns
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
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
With(string)
public GraphTraversalSource With(string key)
Parameters
key
string
Returns
With(string, object?)
public GraphTraversalSource With(string key, object? value)
Parameters
Returns
WithBindings(object?)
[Obsolete("Use the Bindings class instead.", false)]
public GraphTraversalSource WithBindings(object? bindings)
Parameters
bindings
object
Returns
WithBulk(bool)
public GraphTraversalSource WithBulk(bool useBulk)
Parameters
useBulk
bool
Returns
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
stringworkers
int?persist
stringresult
stringvertices
ITraversaledges
ITraversalconfiguration
Dictionary<string, object>
Returns
WithPath()
public GraphTraversalSource WithPath()
Returns
WithRemote(IRemoteConnection)
Configures the GraphTraversalSource as a "remote" to issue the GraphTraversal<TStart, TEnd> for execution elsewhere.
public GraphTraversalSource WithRemote(IRemoteConnection remoteConnection)
Parameters
remoteConnection
IRemoteConnectionThe 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
WithSack(ISupplier?, IBinaryOperator?)
public GraphTraversalSource WithSack(ISupplier? initialValue, IBinaryOperator? mergeOperator)
Parameters
initialValue
ISuppliermergeOperator
IBinaryOperator
Returns
WithSack(ISupplier?, IUnaryOperator?)
public GraphTraversalSource WithSack(ISupplier? initialValue, IUnaryOperator? splitOperator)
Parameters
initialValue
ISuppliersplitOperator
IUnaryOperator
Returns
WithSack(ISupplier?, IUnaryOperator?, IBinaryOperator?)
public GraphTraversalSource WithSack(ISupplier? initialValue, IUnaryOperator? splitOperator, IBinaryOperator? mergeOperator)
Parameters
initialValue
ISuppliersplitOperator
IUnaryOperatormergeOperator
IBinaryOperator
Returns
WithSack(object?)
public GraphTraversalSource WithSack(object? initialValue)
Parameters
initialValue
object
Returns
WithSack(object?, IBinaryOperator?)
public GraphTraversalSource WithSack(object? initialValue, IBinaryOperator? mergeOperator)
Parameters
initialValue
objectmergeOperator
IBinaryOperator
Returns
WithSack(object?, IUnaryOperator?)
public GraphTraversalSource WithSack(object? initialValue, IUnaryOperator? splitOperator)
Parameters
initialValue
objectsplitOperator
IUnaryOperator
Returns
WithSack(object?, IUnaryOperator?, IBinaryOperator?)
public GraphTraversalSource WithSack(object? initialValue, IUnaryOperator? splitOperator, IBinaryOperator? mergeOperator)
Parameters
initialValue
objectsplitOperator
IUnaryOperatormergeOperator
IBinaryOperator
Returns
WithSideEffect(string?, ISupplier?)
public GraphTraversalSource WithSideEffect(string? key, ISupplier? initialValue)
Parameters
Returns
WithSideEffect(string?, ISupplier?, IBinaryOperator?)
public GraphTraversalSource WithSideEffect(string? key, ISupplier? initialValue, IBinaryOperator? reducer)
Parameters
key
stringinitialValue
ISupplierreducer
IBinaryOperator
Returns
WithSideEffect(string?, object?)
public GraphTraversalSource WithSideEffect(string? key, object? initialValue)
Parameters
Returns
WithSideEffect(string?, object?, IBinaryOperator)
public GraphTraversalSource WithSideEffect(string? key, object? initialValue, IBinaryOperator reducer)
Parameters
key
stringinitialValue
objectreducer
IBinaryOperator
Returns
WithStrategies(params ITraversalStrategy[])
public GraphTraversalSource WithStrategies(params ITraversalStrategy[] traversalStrategies)
Parameters
traversalStrategies
ITraversalStrategy[]
Returns
WithoutStrategies(params Type?[])
public GraphTraversalSource WithoutStrategies(params Type?[] traversalStrategyClasses)
Parameters
traversalStrategyClasses
Type[]