This is an automated email from the ASF dual-hosted git repository. Cole-Greer pushed a commit to branch GValueFollowupTP4 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 8ab28eb502b10c5dbad19a09834fcb433b8ff36a Author: Cole Greer <[email protected]> AuthorDate: Fri Jun 5 09:50:59 2026 -0700 Add GValue overloads to .NET traversal steps for parity with Java The .NET GLV's strongly-typed traversal steps (e.g. AddV(string), MergeV(IDictionary), Limit(long), Range(long,long), Coin(double), HasLabel(string,...), Out(string...)) could not accept a GValue, so parameters could only be used with object-typed steps (V, Inject, etc.). Java's GraphTraversal/GraphTraversalSource/__ provide GValue<T> overloads for exactly these strongly-typed steps; this mirrors them in .NET. Adds GValue<T> overloads across GraphTraversal.cs (30), __.cs (24), and GraphTraversalSource.cs (6): constant, out/in/both/outE/inE/bothE/to/toE (labels), addV, addE, mergeV, mergeE, from, to, call, has(label,...), hasLabel, coin, range, limit, tail, skip, and the merge option modulator. Each overload passes the GValue through to GremlinLang, which renders it as a named parameter/binding. The label varargs overloads use a (GValue<string> first, params GValue<string>[] rest) shape to avoid zero-arg overload ambiguity with the existing string varargs; a bare null literal now requires a disambiguating cast (updated one such test call). --- .../Process/Traversal/GraphTraversal.cs | 306 +++++++++++++++++++++ .../Process/Traversal/GraphTraversalSource.cs | 67 +++++ .../src/Gremlin.Net/Process/Traversal/__.cs | 216 +++++++++++++++ .../GremlinLangGenerationTests.cs | 2 +- 4 files changed, 590 insertions(+), 1 deletion(-) diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs index de01df3367..cd6c0c4003 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs @@ -2515,6 +2515,312 @@ namespace Gremlin.Net.Process.Traversal } + /// <summary> + /// Adds the constant step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Constant<TNewEnd> (GValue<TNewEnd> e) + { + GremlinLang.AddStep("constant", e); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the to step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Vertex> To (Direction? direction, GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + if (otherEdgeLabels == null) throw new ArgumentNullException(nameof(otherEdgeLabels)); + + var args = new List<object?>(2 + otherEdgeLabels.Length) { direction, edgeLabel }; + args.AddRange(otherEdgeLabels); + GremlinLang.AddStep("to", args.ToArray()); + return Wrap<TStart, Vertex>(this); + } + + /// <summary> + /// Adds the out step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Vertex> Out (GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + if (otherEdgeLabels == null) throw new ArgumentNullException(nameof(otherEdgeLabels)); + + var args = new List<object?>(1 + otherEdgeLabels.Length) { edgeLabel }; + args.AddRange(otherEdgeLabels); + GremlinLang.AddStep("out", args.ToArray()); + return Wrap<TStart, Vertex>(this); + } + + /// <summary> + /// Adds the in step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Vertex> In (GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + if (otherEdgeLabels == null) throw new ArgumentNullException(nameof(otherEdgeLabels)); + + var args = new List<object?>(1 + otherEdgeLabels.Length) { edgeLabel }; + args.AddRange(otherEdgeLabels); + GremlinLang.AddStep("in", args.ToArray()); + return Wrap<TStart, Vertex>(this); + } + + /// <summary> + /// Adds the both step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Vertex> Both (GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + if (otherEdgeLabels == null) throw new ArgumentNullException(nameof(otherEdgeLabels)); + + var args = new List<object?>(1 + otherEdgeLabels.Length) { edgeLabel }; + args.AddRange(otherEdgeLabels); + GremlinLang.AddStep("both", args.ToArray()); + return Wrap<TStart, Vertex>(this); + } + + /// <summary> + /// Adds the outE step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Edge> OutE (GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + if (otherEdgeLabels == null) throw new ArgumentNullException(nameof(otherEdgeLabels)); + + var args = new List<object?>(1 + otherEdgeLabels.Length) { edgeLabel }; + args.AddRange(otherEdgeLabels); + GremlinLang.AddStep("outE", args.ToArray()); + return Wrap<TStart, Edge>(this); + } + + /// <summary> + /// Adds the inE step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Edge> InE (GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + if (otherEdgeLabels == null) throw new ArgumentNullException(nameof(otherEdgeLabels)); + + var args = new List<object?>(1 + otherEdgeLabels.Length) { edgeLabel }; + args.AddRange(otherEdgeLabels); + GremlinLang.AddStep("inE", args.ToArray()); + return Wrap<TStart, Edge>(this); + } + + /// <summary> + /// Adds the bothE step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Edge> BothE (GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + if (otherEdgeLabels == null) throw new ArgumentNullException(nameof(otherEdgeLabels)); + + var args = new List<object?>(1 + otherEdgeLabels.Length) { edgeLabel }; + args.AddRange(otherEdgeLabels); + GremlinLang.AddStep("bothE", args.ToArray()); + return Wrap<TStart, Edge>(this); + } + + /// <summary> + /// Adds the toE step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Edge> ToE (Direction? direction, GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + if (otherEdgeLabels == null) throw new ArgumentNullException(nameof(otherEdgeLabels)); + + var args = new List<object?>(2 + otherEdgeLabels.Length) { direction, edgeLabel }; + args.AddRange(otherEdgeLabels); + GremlinLang.AddStep("toE", args.ToArray()); + return Wrap<TStart, Edge>(this); + } + + /// <summary> + /// Adds the addV step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Vertex> AddV (GValue<string> vertexLabel) + { + GremlinLang.AddStep("addV", vertexLabel); + return Wrap<TStart, Vertex>(this); + } + + /// <summary> + /// Adds the mergeV step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Vertex> MergeV (GValue<IDictionary<object,object>> m) + { + GremlinLang.AddStep("mergeV", m); + return Wrap<TStart, Vertex>(this); + } + + /// <summary> + /// Adds the mergeE step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Edge> MergeE (GValue<IDictionary<object,object>> m) + { + GremlinLang.AddStep("mergeE", m); + return Wrap<TStart, Edge>(this); + } + + /// <summary> + /// Adds the addE step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, Edge> AddE (GValue<string> edgeLabel) + { + GremlinLang.AddStep("addE", edgeLabel); + return Wrap<TStart, Edge>(this); + } + + /// <summary> + /// Adds the from step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TEnd> From (GValue<object> fromVertex) + { + GremlinLang.AddStep("from", fromVertex); + return Wrap<TStart, TEnd>(this); + } + + /// <summary> + /// Adds the to step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TEnd> To (GValue<object> toVertex) + { + GremlinLang.AddStep("to", toVertex); + return Wrap<TStart, TEnd>(this); + } + + /// <summary> + /// Adds the call step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Call<TNewEnd> (string? service, GValue<IDictionary<object,object>> m) + { + GremlinLang.AddStep("call", service, m); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the call step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Call<TNewEnd> (string? service, GValue<IDictionary<object,object>> m, ITraversal childTraversal) + { + GremlinLang.AddStep("call", service, m, childTraversal); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TEnd> Has (GValue<string> label, string? propertyKey, object? value) + { + GremlinLang.AddStep("has", label, propertyKey, value); + return Wrap<TStart, TEnd>(this); + } + + /// <summary> + /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TEnd> Has (GValue<string> label, string? propertyKey, P? predicate) + { + GremlinLang.AddStep("has", label, propertyKey, predicate); + return Wrap<TStart, TEnd>(this); + } + + /// <summary> + /// Adds the hasLabel step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TEnd> HasLabel (GValue<string> label, params GValue<string>[] otherLabels) + { + if (otherLabels == null) throw new ArgumentNullException(nameof(otherLabels)); + + var args = new List<object?>(1 + otherLabels.Length) { label }; + args.AddRange(otherLabels); + GremlinLang.AddStep("hasLabel", args.ToArray()); + return Wrap<TStart, TEnd>(this); + } + + /// <summary> + /// Adds the coin step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TEnd> Coin (GValue<double> probability) + { + GremlinLang.AddStep("coin", probability); + return Wrap<TStart, TEnd>(this); + } + + /// <summary> + /// Adds the range step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Range<TNewEnd> (GValue<long> low, GValue<long> high) + { + GremlinLang.AddStep("range", low, high); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the range step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Range<TNewEnd> (Scope scope, GValue<long> low, GValue<long> high) + { + GremlinLang.AddStep("range", scope, low, high); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the limit step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Limit<TNewEnd> (GValue<long> limit) + { + GremlinLang.AddStep("limit", limit); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the limit step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Limit<TNewEnd> (Scope scope, GValue<long> limit) + { + GremlinLang.AddStep("limit", scope, limit); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the tail step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Tail<TNewEnd> (GValue<long> limit) + { + GremlinLang.AddStep("tail", limit); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the tail step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Tail<TNewEnd> (Scope scope, GValue<long> limit) + { + GremlinLang.AddStep("tail", scope, limit); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the skip step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Skip<TNewEnd> (GValue<long> skip) + { + GremlinLang.AddStep("skip", skip); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the skip step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TNewEnd> Skip<TNewEnd> (Scope scope, GValue<long> skip) + { + GremlinLang.AddStep("skip", scope, skip); + return Wrap<TStart, TNewEnd>(this); + } + + /// <summary> + /// Adds the option step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal<TStart, TEnd> Option (object pickToken, GValue<IDictionary<object,object>> m) + { + GremlinLang.AddStep("option", pickToken, m); + return Wrap<TStart, TEnd>(this); + } + /// <summary> /// Make a copy of a traversal that is reset for iteration. /// </summary> diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs index 581882f490..4e5f17661c 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs @@ -352,6 +352,17 @@ namespace Gremlin.Net.Process.Traversal return traversal; } + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the addE step to that + /// traversal. + /// </summary> + public GraphTraversal<Edge, Edge> AddE(GValue<string> label) + { + var traversal = new GraphTraversal<Edge, Edge>(TraversalStrategies, GremlinLang.Clone()); + traversal.GremlinLang.AddStep("addE", label); + return traversal; + } + /// <summary> /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the addE step to that /// traversal. @@ -380,6 +391,17 @@ namespace Gremlin.Net.Process.Traversal return traversal; } + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the mergeE step to that + /// traversal. + /// </summary> + public GraphTraversal<Edge, Edge> MergeE(GValue<IDictionary<object, object>> searchCreate) + { + var traversal = new GraphTraversal<Edge, Edge>(TraversalStrategies, GremlinLang.Clone()); + traversal.GremlinLang.AddStep("mergeE", searchCreate); + return traversal; + } + /// <summary> /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the mergeE step to that /// traversal. @@ -413,6 +435,17 @@ namespace Gremlin.Net.Process.Traversal return traversal; } + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the addV step to that + /// traversal. + /// </summary> + public GraphTraversal<Vertex, Vertex> AddV(GValue<string> vertexLabel) + { + var traversal = new GraphTraversal<Vertex, Vertex>(TraversalStrategies, GremlinLang.Clone()); + traversal.GremlinLang.AddStep("addV", vertexLabel); + return traversal; + } + /// <summary> /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the addV step to that /// traversal. @@ -435,6 +468,17 @@ namespace Gremlin.Net.Process.Traversal return traversal; } + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the mergeV step to that + /// traversal. + /// </summary> + public GraphTraversal<Vertex, Vertex> MergeV(GValue<IDictionary<object, object>> searchCreate) + { + var traversal = new GraphTraversal<Vertex, Vertex>(TraversalStrategies, GremlinLang.Clone()); + traversal.GremlinLang.AddStep("mergeV", searchCreate); + return traversal; + } + /// <summary> /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the mergeV step to that /// traversal. @@ -536,6 +580,29 @@ namespace Gremlin.Net.Process.Traversal return traversal; } + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the call step to that + /// traversal. + /// </summary> + public GraphTraversal<TStart, TStart> Call<TStart>(string service, GValue<IDictionary<object, object>> m) + { + var traversal = new GraphTraversal<TStart, TStart>(TraversalStrategies, GremlinLang.Clone()); + traversal.GremlinLang.AddStep("call", service, m); + return traversal; + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the call step to that + /// traversal. + /// </summary> + public GraphTraversal<TStart, TStart> Call<TStart>(string service, GValue<IDictionary<object, object>> m, + ITraversal childTraversal) + { + var traversal = new GraphTraversal<TStart, TStart>(TraversalStrategies, GremlinLang.Clone()); + traversal.GremlinLang.AddStep("call", service, m, childTraversal); + return traversal; + } + /// <summary> /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the union step to that /// traversal. diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs index b16732a61b..870006e28b 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs @@ -1760,5 +1760,221 @@ namespace Gremlin.Net.Process.Traversal return new GraphTraversal<object, object>().Where(whereTraversal); } + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the constant step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Constant<E2>(GValue<E2> a) + { + return new GraphTraversal<object, E2>().Constant(a); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the to step to that traversal. + /// </summary> + public static GraphTraversal<object, Vertex> To(Direction? direction, GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + return new GraphTraversal<object, Vertex>().To(direction, edgeLabel, otherEdgeLabels); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the out step to that traversal. + /// </summary> + public static GraphTraversal<object, Vertex> Out(GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + return new GraphTraversal<object, Vertex>().Out(edgeLabel, otherEdgeLabels); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the in step to that traversal. + /// </summary> + public static GraphTraversal<object, Vertex> In(GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + return new GraphTraversal<object, Vertex>().In(edgeLabel, otherEdgeLabels); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the both step to that traversal. + /// </summary> + public static GraphTraversal<object, Vertex> Both(GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + return new GraphTraversal<object, Vertex>().Both(edgeLabel, otherEdgeLabels); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the toE step to that traversal. + /// </summary> + public static GraphTraversal<object, Edge> ToE(Direction? direction, GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + return new GraphTraversal<object, Edge>().ToE(direction, edgeLabel, otherEdgeLabels); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the outE step to that traversal. + /// </summary> + public static GraphTraversal<object, Edge> OutE(GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + return new GraphTraversal<object, Edge>().OutE(edgeLabel, otherEdgeLabels); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the inE step to that traversal. + /// </summary> + public static GraphTraversal<object, Edge> InE(GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + return new GraphTraversal<object, Edge>().InE(edgeLabel, otherEdgeLabels); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the bothE step to that traversal. + /// </summary> + public static GraphTraversal<object, Edge> BothE(GValue<string> edgeLabel, params GValue<string>[] otherEdgeLabels) + { + return new GraphTraversal<object, Edge>().BothE(edgeLabel, otherEdgeLabels); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the addV step to that traversal. + /// </summary> + public static GraphTraversal<object, Vertex> AddV(GValue<string> vertexLabel) + { + return new GraphTraversal<object, Vertex>().AddV(vertexLabel); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the mergeV step to that traversal. + /// </summary> + public static GraphTraversal<object, Vertex> MergeV(GValue<IDictionary<object, object>> m) + { + return new GraphTraversal<object, Vertex>().MergeV(m); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the addE step to that traversal. + /// </summary> + public static GraphTraversal<object, Edge> AddE(GValue<string> edgeLabel) + { + return new GraphTraversal<object, Edge>().AddE(edgeLabel); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the mergeE step to that traversal. + /// </summary> + public static GraphTraversal<object, Edge> MergeE(GValue<IDictionary<object, object>> m) + { + return new GraphTraversal<object, Edge>().MergeE(m); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the has step to that traversal. + /// </summary> + public static GraphTraversal<object, object> Has(GValue<string> label, string propertyKey, P predicate) + { + return new GraphTraversal<object, object>().Has(label, propertyKey, predicate); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the has step to that traversal. + /// </summary> + public static GraphTraversal<object, object> Has(GValue<string> label, string propertyKey, object value) + { + return new GraphTraversal<object, object>().Has(label, propertyKey, value); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the hasLabel step to that traversal. + /// </summary> + public static GraphTraversal<object, object> HasLabel(GValue<string> label, params GValue<string>[] otherLabels) + { + return new GraphTraversal<object, object>().HasLabel(label, otherLabels); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the coin step to that traversal. + /// </summary> + public static GraphTraversal<object, object> Coin(GValue<double> probability) + { + return new GraphTraversal<object, object>().Coin(probability); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the range step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Range<E2>(GValue<long> low, GValue<long> high) + { + return new GraphTraversal<object, E2>().Range<E2>(low, high); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the range step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Range<E2>(Scope scope, GValue<long> low, GValue<long> high) + { + return new GraphTraversal<object, E2>().Range<E2>(scope, low, high); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the limit step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Limit<E2>(GValue<long> limit) + { + return new GraphTraversal<object, E2>().Limit<E2>(limit); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the limit step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Limit<E2>(Scope scope, GValue<long> limit) + { + return new GraphTraversal<object, E2>().Limit<E2>(scope, limit); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the skip step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Skip<E2>(GValue<long> skip) + { + return new GraphTraversal<object, E2>().Skip<E2>(skip); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the skip step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Skip<E2>(Scope scope, GValue<long> skip) + { + return new GraphTraversal<object, E2>().Skip<E2>(scope, skip); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the tail step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Tail<E2>(GValue<long> limit) + { + return new GraphTraversal<object, E2>().Tail<E2>(limit); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the tail step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Tail<E2>(Scope scope, GValue<long> limit) + { + return new GraphTraversal<object, E2>().Tail<E2>(scope, limit); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the call step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Call<E2>(string service, GValue<IDictionary<object, object>> m) + { + return new GraphTraversal<object, E2>().Call<E2>(service, m); + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the call step to that traversal. + /// </summary> + public static GraphTraversal<object, E2> Call<E2>(string service, GValue<IDictionary<object, object>> m, ITraversal childTraversal) + { + return new GraphTraversal<object, E2>().Call<E2>(service, m, childTraversal); + } + } } \ No newline at end of file diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/GremlinLangGeneration/GremlinLangGenerationTests.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/GremlinLangGeneration/GremlinLangGenerationTests.cs index e1c01a9ef2..4deeda136c 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/GremlinLangGeneration/GremlinLangGenerationTests.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/GremlinLangGeneration/GremlinLangGenerationTests.cs @@ -88,7 +88,7 @@ namespace Gremlin.Net.IntegrationTest.Process.Traversal.GremlinLangGeneration [Fact] public void AnonymousTraversal_OutXnullX() { - Assert.Throws<ArgumentNullException>(() => __.Out(null!)); + Assert.Throws<ArgumentNullException>(() => __.Out((string)null!)); } } }
