This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 0ebd920f374ac46012a25ddf463edeaf16192ad4 Author: Stephen Mallette <[email protected]> AuthorDate: Mon Nov 11 10:55:07 2024 -0500 Test reorganization, more tests for select and remove ordering enforcement CTR --- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 17 +- gremlin-go/driver/cucumber/gremlin.go | 17 +- .../gremlin-javascript/test/cucumber/gremlin.js | 17 +- gremlin-python/src/main/python/radish/gremlin.py | 17 +- .../gremlin/test/features/filter/Range.feature | 56 +----- .../gremlin/test/features/map/Select.feature | 187 ++++++++++++++++++++- 6 files changed, 236 insertions(+), 75 deletions(-) diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index 72780761d0..ad753654c1 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@ -329,13 +329,9 @@ namespace Gremlin.Net.IntegrationTest.Gherkin {"g_V_asXaX_in_asXbX_in_asXcX_selectXa_b_cX_byXnameX_limitXlocal_1X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("a").In().As("b").In().As("c").Select<object>("a","b","c").By("name").Limit<object>(Scope.Local,1)}}, {"g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_rangeXlocal_1_3X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("a").Out().As("b").Out().As("c").Select<object>("a","b","c").By("name").Range<object>(Scope.Local,1,3)}}, {"g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_rangeXlocal_1_2X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("a").Out().As("b").Out().As("c").Select<object>("a","b","c").By("name").Range<object>(Scope.Local,1,2)}}, - {"g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_3X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("a").Out().As("a").Out().As("a").Select<object>(Pop.Mixed,"a").By(__.Unfold<object>().Values<object>("name").Fold()).Range<object>(Scope.Local,1,3)}}, - {"g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_2X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("a").Out().As("a").Out().As("a").Select<object>(Pop.Mixed,"a").By(__.Unfold<object>().Values<object>("name").Fold()).Range<object>(Scope.Local,1,2)}}, {"g_V_hasLabelXpersonX_order_byXageX_skipX1X_valuesXnameX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Order().By("age").Skip<object>(1).Values<object>("name")}}, - {"g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_4_5X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("a").Out().As("a").Out().As("a").Select<object>(Pop.Mixed,"a").By(__.Unfold<object>().Values<object>("name").Fold()).Range<object>(Scope.Local,4,5)}}, + {"g_V_foldX_rangeXlocal_6_7X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Fold().Range<object>(Scope.Local,6,7)}}, {"g_V_outE_valuesXweightX_fold_orderXlocalX_skipXlocal_2X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().OutE().Values<object>("weight").Fold().Order(Scope.Local).Skip<object>(Scope.Local,2)}}, - {"g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_1X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("a").In().As("a").In().As("a").Select<object>(Pop.Mixed,"a").By(__.Unfold<object>().Values<object>("name").Fold()).Limit<object>(Scope.Local,1)}}, - {"g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_2X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("a").In().As("a").In().As("a").Select<object>(Pop.Mixed,"a").By(__.Unfold<object>().Values<object>("name").Fold()).Limit<object>(Scope.Local,2)}}, {"g_V_hasLabelXpersonX_order_byXageX_valuesXnameX_skipX1X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Order().By("age").Values<object>("name").Skip<object>(1)}}, {"g_VX1X_valuesXageX_rangeXlocal_20_30X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V(p["vid1"]).Values<object>("age").Range<object>(Scope.Local,20,30)}}, {"g_V_mapXin_hasIdX1XX_limitX2X_valuesXnameX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Map<object>(__.In().HasId(p["vid1"])).Limit<object>(2).Values<object>("name")}}, @@ -1170,6 +1166,17 @@ namespace Gremlin.Net.IntegrationTest.Gherkin {"g_withSideEffectXk_nullX_injectXxX_selectXkX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.WithSideEffect("k",null).Inject("x").Select<object>("k")}}, {"g_V_out_in_selectXall_a_a_aX_byXunfold_name_foldX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.AddV("A").Property("name","a1").As("a1").AddV("A").Property("name","a2").As("a2").AddV("A").Property("name","a3").As("a3").AddV("B").Property("name","b1").As("b1").AddV("B").Property("name","b2").As("b2").AddV("B").Property("name","b3").As("b3").AddE("ab").From("a1").To("b1").AddE("ab").From("a2").To("b2").AddE("ab").From("a3").To(" [...] {"g_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("label").Aggregate(Scope.Local,"x").Barrier().Select<object>("x").Select<object>("label")}}, + {"g_V_name_asXaX_selectXfirst_aX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Values<object>("name").As("a").Select<object>(Pop.First,"a")}}, + {"g_V_name_asXaX_selectXlast_aX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Values<object>("name").As("a").Select<object>(Pop.Last,"a")}}, + {"g_V_name_asXaX_selectXmixed_aX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Values<object>("name").As("a").Select<object>(Pop.Mixed,"a")}}, + {"g_V_name_asXaX_selectXall_aX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Values<object>("name").As("a").Select<object>(Pop.All,"a")}}, + {"g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXaX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Values<object>("name").As("a").Concat("X").As("a").Length().As("a").Select<object>("a")}}, + {"g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXfirst_aX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Values<object>("name").As("a").Concat("X").As("a").Length().As("a").Select<object>(Pop.First,"a")}}, + {"g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXlast_aX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Values<object>("name").As("a").Concat("X").As("a").Length().As("a").Select<object>(Pop.Last,"a")}}, + {"g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_concatXYZX_asXaX_selectXmixed_aX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Values<object>("name").As("a").Concat("X").As("a").Concat("YZ").As("a").Select<object>(Pop.Mixed,"a")}}, + {"g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_concatXYZX_asXaX_selectXall_aX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Values<object>("name").As("a").Concat("X").As("a").Concat("YZ").As("a").Select<object>(Pop.All,"a")}}, + {"g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("a").Out().As("a").Out().As("a").Select<object>(Pop.Mixed,"a").By(__.Unfold<object>().Values<object>("name").Fold())}}, + {"g_V_asXaX_out_asXaX_out_asXaX_selectXall_aX_byXunfold_valuesXnameX_foldX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().As("a").Out().As("a").Out().As("a").Select<object>(Pop.All,"a").By(__.Unfold<object>().Values<object>("name").Fold())}}, {"g_V_shortestPath", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Identity().ShortestPath()}}, {"g_V_both_dedup_shortestPath", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Both().Dedup().ShortestPath()}}, {"g_V_shortestPath_edgesIncluded", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Identity().ShortestPath().With("~tinkerpop.shortestPath.includeEdges")}}, diff --git a/gremlin-go/driver/cucumber/gremlin.go b/gremlin-go/driver/cucumber/gremlin.go index e68bddb1c8..d8b654885c 100644 --- a/gremlin-go/driver/cucumber/gremlin.go +++ b/gremlin-go/driver/cucumber/gremlin.go @@ -300,13 +300,9 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_asXaX_in_asXbX_in_asXcX_selectXa_b_cX_byXnameX_limitXlocal_1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").In().As("b").In().As("c").Select("a", "b", "c").By("name").Limit(gremlingo.Scope.Local, 1)}}, "g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_rangeXlocal_1_3X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").Out().As("b").Out().As("c").Select("a", "b", "c").By("name").Range(gremlingo.Scope.Local, 1, 3)}}, "g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_rangeXlocal_1_2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").Out().As("b").Out().As("c").Select("a", "b", "c").By("name").Range(gremlingo.Scope.Local, 1, 2)}}, - "g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_3X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").Out().As("a").Out().As("a").Select(gremlingo.Pop.Mixed, "a").By(gremlingo.T__.Unfold().Values("name").Fold()).Range(gremlingo.Scope.Local, 1, 3)}}, - "g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").Out().As("a").Out().As("a").Select(gremlingo.Pop.Mixed, "a").By(gremlingo.T__.Unfold().Values("name").Fold()).Range(gremlingo.Scope.Local, 1, 2)}}, "g_V_hasLabelXpersonX_order_byXageX_skipX1X_valuesXnameX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Order().By("age").Skip(1).Values("name")}}, - "g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_4_5X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").Out().As("a").Out().As("a").Select(gremlingo.Pop.Mixed, "a").By(gremlingo.T__.Unfold().Values("name").Fold()).Range(gremlingo.Scope.Local, 4, 5)}}, + "g_V_foldX_rangeXlocal_6_7X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Fold().Range(gremlingo.Scope.Local, 6, 7)}}, "g_V_outE_valuesXweightX_fold_orderXlocalX_skipXlocal_2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().OutE().Values("weight").Fold().Order(gremlingo.Scope.Local).Skip(gremlingo.Scope.Local, 2)}}, - "g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").In().As("a").In().As("a").Select(gremlingo.Pop.Mixed, "a").By(gremlingo.T__.Unfold().Values("name").Fold()).Limit(gremlingo.Scope.Local, 1)}}, - "g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").In().As("a").In().As("a").Select(gremlingo.Pop.Mixed, "a").By(gremlingo.T__.Unfold().Values("name").Fold()).Limit(gremlingo.Scope.Local, 2)}}, "g_V_hasLabelXpersonX_order_byXageX_valuesXnameX_skipX1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Order().By("age").Values("name").Skip(1)}}, "g_VX1X_valuesXageX_rangeXlocal_20_30X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Values("age").Range(gremlingo.Scope.Local, 20, 30)}}, "g_V_mapXin_hasIdX1XX_limitX2X_valuesXnameX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Map(gremlingo.T__.In().HasId(p["vid1"])).Limit(2).Values("name")}}, @@ -1141,6 +1137,17 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_withSideEffectXk_nullX_injectXxX_selectXkX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("k", nil).Inject("x").Select("k")}}, "g_V_out_in_selectXall_a_a_aX_byXunfold_name_foldX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("A").Property("name", "a1").As("a1").AddV("A").Property("name", "a2").As("a2").AddV("A").Property("name", "a3").As("a3").AddV("B").Property("name", "b1").As("b1").AddV("B").Property("name", "b2").As("b2").AddV("B").Property("name", "b3").As("b3").AddE("ab").From("a1").To("b1").AddE("ab").From("a2").To("b2").AddE("ab").From("a [...] "g_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("label").Aggregate(gremlingo.Scope.Local, "x").Barrier().Select("x").Select("label")}}, + "g_V_name_asXaX_selectXfirst_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("name").As("a").Select(gremlingo.Pop.First, "a")}}, + "g_V_name_asXaX_selectXlast_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("name").As("a").Select(gremlingo.Pop.Last, "a")}}, + "g_V_name_asXaX_selectXmixed_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("name").As("a").Select(gremlingo.Pop.Mixed, "a")}}, + "g_V_name_asXaX_selectXall_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("name").As("a").Select(gremlingo.Pop.All, "a")}}, + "g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Values("name").As("a").Concat("X").As("a").Length().As("a").Select("a")}}, + "g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXfirst_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Values("name").As("a").Concat("X").As("a").Length().As("a").Select(gremlingo.Pop.First, "a")}}, + "g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXlast_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Values("name").As("a").Concat("X").As("a").Length().As("a").Select(gremlingo.Pop.Last, "a")}}, + "g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_concatXYZX_asXaX_selectXmixed_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Values("name").As("a").Concat("X").As("a").Concat("YZ").As("a").Select(gremlingo.Pop.Mixed, "a")}}, + "g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_concatXYZX_asXaX_selectXall_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Values("name").As("a").Concat("X").As("a").Concat("YZ").As("a").Select(gremlingo.Pop.All, "a")}}, + "g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").Out().As("a").Out().As("a").Select(gremlingo.Pop.Mixed, "a").By(gremlingo.T__.Unfold().Values("name").Fold())}}, + "g_V_asXaX_out_asXaX_out_asXaX_selectXall_aX_byXunfold_valuesXnameX_foldX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").Out().As("a").Out().As("a").Select(gremlingo.Pop.All, "a").By(gremlingo.T__.Unfold().Values("name").Fold())}}, "g_V_shortestPath": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Identity().ShortestPath()}}, "g_V_both_dedup_shortestPath": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Both().Dedup().ShortestPath()}}, "g_V_shortestPath_edgesIncluded": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Identity().ShortestPath().With("~tinkerpop.shortestPath.includeEdges")}}, diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js index abbee0f7ef..2cc393c462 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js @@ -320,13 +320,9 @@ const gremlins = { g_V_asXaX_in_asXbX_in_asXcX_selectXa_b_cX_byXnameX_limitXlocal_1X: [function({g}) { return g.V().as("a").in_().as("b").in_().as("c").select("a","b","c").by("name").limit(Scope.local,1) }], g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_rangeXlocal_1_3X: [function({g}) { return g.V().as("a").out().as("b").out().as("c").select("a","b","c").by("name").range(Scope.local,1,3) }], g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_rangeXlocal_1_2X: [function({g}) { return g.V().as("a").out().as("b").out().as("c").select("a","b","c").by("name").range(Scope.local,1,2) }], - g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_3X: [function({g}) { return g.V().as("a").out().as("a").out().as("a").select(Pop.mixed,"a").by(__.unfold().values("name").fold()).range(Scope.local,1,3) }], - g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_2X: [function({g}) { return g.V().as("a").out().as("a").out().as("a").select(Pop.mixed,"a").by(__.unfold().values("name").fold()).range(Scope.local,1,2) }], g_V_hasLabelXpersonX_order_byXageX_skipX1X_valuesXnameX: [function({g}) { return g.V().hasLabel("person").order().by("age").skip(1).values("name") }], - g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_4_5X: [function({g}) { return g.V().as("a").out().as("a").out().as("a").select(Pop.mixed,"a").by(__.unfold().values("name").fold()).range(Scope.local,4,5) }], + g_V_foldX_rangeXlocal_6_7X: [function({g}) { return g.V().fold().range(Scope.local,6,7) }], g_V_outE_valuesXweightX_fold_orderXlocalX_skipXlocal_2X: [function({g}) { return g.V().outE().values("weight").fold().order(Scope.local).skip(Scope.local,2) }], - g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_1X: [function({g}) { return g.V().as("a").in_().as("a").in_().as("a").select(Pop.mixed,"a").by(__.unfold().values("name").fold()).limit(Scope.local,1) }], - g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_2X: [function({g}) { return g.V().as("a").in_().as("a").in_().as("a").select(Pop.mixed,"a").by(__.unfold().values("name").fold()).limit(Scope.local,2) }], g_V_hasLabelXpersonX_order_byXageX_valuesXnameX_skipX1X: [function({g}) { return g.V().hasLabel("person").order().by("age").values("name").skip(1) }], g_VX1X_valuesXageX_rangeXlocal_20_30X: [function({g, vid1}) { return g.V(vid1).values("age").range(Scope.local,20,30) }], g_V_mapXin_hasIdX1XX_limitX2X_valuesXnameX: [function({g, vid1}) { return g.V().map(__.in_().hasId(vid1)).limit(2).values("name") }], @@ -1161,6 +1157,17 @@ const gremlins = { g_withSideEffectXk_nullX_injectXxX_selectXkX: [function({g}) { return g.withSideEffect("k",null).inject("x").select("k") }], g_V_out_in_selectXall_a_a_aX_byXunfold_name_foldX: [function({g}) { return g.addV("A").property("name","a1").as("a1").addV("A").property("name","a2").as("a2").addV("A").property("name","a3").as("a3").addV("B").property("name","b1").as("b1").addV("B").property("name","b2").as("b2").addV("B").property("name","b3").as("b3").addE("ab").from_("a1").to("b1").addE("ab").from_("a2").to("b2").addE("ab").from_("a3").to("b3") }, function({g}) { return g.V().as("a").out().as("a").in_().as("a").s [...] g_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX: [function({g}) { return g.V().as("label").aggregate(Scope.local,"x").barrier().select("x").select("label") }], + g_V_name_asXaX_selectXfirst_aX: [function({g}) { return g.V().values("name").as("a").select(Pop.first,"a") }], + g_V_name_asXaX_selectXlast_aX: [function({g}) { return g.V().values("name").as("a").select(Pop.last,"a") }], + g_V_name_asXaX_selectXmixed_aX: [function({g}) { return g.V().values("name").as("a").select(Pop.mixed,"a") }], + g_V_name_asXaX_selectXall_aX: [function({g}) { return g.V().values("name").as("a").select(Pop.all,"a") }], + g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXaX: [function({g}) { return g.V().hasLabel("person").values("name").as("a").concat("X").as("a").length().as("a").select("a") }], + g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXfirst_aX: [function({g}) { return g.V().hasLabel("person").values("name").as("a").concat("X").as("a").length().as("a").select(Pop.first,"a") }], + g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXlast_aX: [function({g}) { return g.V().hasLabel("person").values("name").as("a").concat("X").as("a").length().as("a").select(Pop.last,"a") }], + g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_concatXYZX_asXaX_selectXmixed_aX: [function({g}) { return g.V().hasLabel("person").values("name").as("a").concat("X").as("a").concat("YZ").as("a").select(Pop.mixed,"a") }], + g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_concatXYZX_asXaX_selectXall_aX: [function({g}) { return g.V().hasLabel("person").values("name").as("a").concat("X").as("a").concat("YZ").as("a").select(Pop.all,"a") }], + g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX: [function({g}) { return g.V().as("a").out().as("a").out().as("a").select(Pop.mixed,"a").by(__.unfold().values("name").fold()) }], + g_V_asXaX_out_asXaX_out_asXaX_selectXall_aX_byXunfold_valuesXnameX_foldX: [function({g}) { return g.V().as("a").out().as("a").out().as("a").select(Pop.all,"a").by(__.unfold().values("name").fold()) }], g_V_shortestPath: [function({g}) { return g.V().identity().shortestPath() }], g_V_both_dedup_shortestPath: [function({g}) { return g.V().both().dedup().shortestPath() }], g_V_shortestPath_edgesIncluded: [function({g}) { return g.V().identity().shortestPath().with_("~tinkerpop.shortestPath.includeEdges") }], diff --git a/gremlin-python/src/main/python/radish/gremlin.py b/gremlin-python/src/main/python/radish/gremlin.py index 562e4ff6bd..30c4482394 100644 --- a/gremlin-python/src/main/python/radish/gremlin.py +++ b/gremlin-python/src/main/python/radish/gremlin.py @@ -302,13 +302,9 @@ world.gremlins = { 'g_V_asXaX_in_asXbX_in_asXcX_selectXa_b_cX_byXnameX_limitXlocal_1X': [(lambda g:g.V().as_('a').in_().as_('b').in_().as_('c').select('a','b','c').by('name').limit(Scope.local,1))], 'g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_rangeXlocal_1_3X': [(lambda g:g.V().as_('a').out().as_('b').out().as_('c').select('a','b','c').by('name').range_(Scope.local,1,3))], 'g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_rangeXlocal_1_2X': [(lambda g:g.V().as_('a').out().as_('b').out().as_('c').select('a','b','c').by('name').range_(Scope.local,1,2))], - 'g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_3X': [(lambda g:g.V().as_('a').out().as_('a').out().as_('a').select(Pop.mixed,'a').by(__.unfold().name.fold()).range_(Scope.local,1,3))], - 'g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_2X': [(lambda g:g.V().as_('a').out().as_('a').out().as_('a').select(Pop.mixed,'a').by(__.unfold().name.fold()).range_(Scope.local,1,2))], 'g_V_hasLabelXpersonX_order_byXageX_skipX1X_valuesXnameX': [(lambda g:g.V().hasLabel('person').order().by('age').skip(1).name)], - 'g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_4_5X': [(lambda g:g.V().as_('a').out().as_('a').out().as_('a').select(Pop.mixed,'a').by(__.unfold().name.fold()).range_(Scope.local,4,5))], + 'g_V_foldX_rangeXlocal_6_7X': [(lambda g:g.V().fold().range_(Scope.local,6,7))], 'g_V_outE_valuesXweightX_fold_orderXlocalX_skipXlocal_2X': [(lambda g:g.V().outE().weight.fold().order(Scope.local).skip(Scope.local,2))], - 'g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_1X': [(lambda g:g.V().as_('a').in_().as_('a').in_().as_('a').select(Pop.mixed,'a').by(__.unfold().name.fold()).limit(Scope.local,1))], - 'g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_2X': [(lambda g:g.V().as_('a').in_().as_('a').in_().as_('a').select(Pop.mixed,'a').by(__.unfold().name.fold()).limit(Scope.local,2))], 'g_V_hasLabelXpersonX_order_byXageX_valuesXnameX_skipX1X': [(lambda g:g.V().hasLabel('person').order().by('age').name.skip(1))], 'g_VX1X_valuesXageX_rangeXlocal_20_30X': [(lambda g, vid1=None:g.V(vid1).age.range_(Scope.local,20,30))], 'g_V_mapXin_hasIdX1XX_limitX2X_valuesXnameX': [(lambda g, vid1=None:g.V().map(__.in_().hasId(vid1))[0:2].name)], @@ -1143,6 +1139,17 @@ world.gremlins = { 'g_withSideEffectXk_nullX_injectXxX_selectXkX': [(lambda g:g.withSideEffect('k',None).inject('x').select('k'))], 'g_V_out_in_selectXall_a_a_aX_byXunfold_name_foldX': [(lambda g:g.addV('A').property('name','a1').as_('a1').addV('A').property('name','a2').as_('a2').addV('A').property('name','a3').as_('a3').addV('B').property('name','b1').as_('b1').addV('B').property('name','b2').as_('b2').addV('B').property('name','b3').as_('b3').addE('ab').from_('a1').to('b1').addE('ab').from_('a2').to('b2').addE('ab').from_('a3').to('b3')), (lambda g:g.V().as_('a').out().as_('a').in_().as_('a').select(Pop.all_,' [...] 'g_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX': [(lambda g:g.V().as_('label').aggregate(Scope.local,'x').barrier().select('x').select('label'))], + 'g_V_name_asXaX_selectXfirst_aX': [(lambda g:g.V().name.as_('a').select(Pop.first,'a'))], + 'g_V_name_asXaX_selectXlast_aX': [(lambda g:g.V().name.as_('a').select(Pop.last,'a'))], + 'g_V_name_asXaX_selectXmixed_aX': [(lambda g:g.V().name.as_('a').select(Pop.mixed,'a'))], + 'g_V_name_asXaX_selectXall_aX': [(lambda g:g.V().name.as_('a').select(Pop.all_,'a'))], + 'g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXaX': [(lambda g:g.V().hasLabel('person').name.as_('a').concat('X').as_('a').length().as_('a').select('a'))], + 'g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXfirst_aX': [(lambda g:g.V().hasLabel('person').name.as_('a').concat('X').as_('a').length().as_('a').select(Pop.first,'a'))], + 'g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXlast_aX': [(lambda g:g.V().hasLabel('person').name.as_('a').concat('X').as_('a').length().as_('a').select(Pop.last,'a'))], + 'g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_concatXYZX_asXaX_selectXmixed_aX': [(lambda g:g.V().hasLabel('person').name.as_('a').concat('X').as_('a').concat('YZ').as_('a').select(Pop.mixed,'a'))], + 'g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_concatXYZX_asXaX_selectXall_aX': [(lambda g:g.V().hasLabel('person').name.as_('a').concat('X').as_('a').concat('YZ').as_('a').select(Pop.all_,'a'))], + 'g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX': [(lambda g:g.V().as_('a').out().as_('a').out().as_('a').select(Pop.mixed,'a').by(__.unfold().name.fold()))], + 'g_V_asXaX_out_asXaX_out_asXaX_selectXall_aX_byXunfold_valuesXnameX_foldX': [(lambda g:g.V().as_('a').out().as_('a').out().as_('a').select(Pop.all_,'a').by(__.unfold().name.fold()))], 'g_V_shortestPath': [(lambda g:g.V().identity().shortestPath())], 'g_V_both_dedup_shortestPath': [(lambda g:g.V().both().dedup().shortestPath())], 'g_V_shortestPath_edgesIncluded': [(lambda g:g.V().identity().shortestPath().with_('~tinkerpop.shortestPath.includeEdges'))], diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Range.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Range.feature index 153e7b3ac9..d185d47f8e 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Range.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Range.feature @@ -171,32 +171,6 @@ Feature: Step - range() | m[{"b":"josh"}] | | m[{"b":"josh"}] | - @GraphComputerVerificationReferenceOnly - Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_3X - Given the modern graph - And the traversal of - """ - g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).range(Scope.local, 1, 3) - """ - When iterated to list - Then the result should be unordered - | result | - | l[josh,ripple] | - | l[josh,lop] | - - @GraphComputerVerificationReferenceOnly - Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_2X - Given the modern graph - And the traversal of - """ - g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).range(Scope.local, 1, 2) - """ - When iterated to list - Then the result should be unordered - | result | - | josh | - | josh | - Scenario: g_V_hasLabelXpersonX_order_byXageX_skipX1X_valuesXnameX Given the modern graph And the traversal of @@ -211,11 +185,11 @@ Feature: Step - range() | peter | @GraphComputerVerificationReferenceOnly - Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_4_5X + Scenario: g_V_foldX_rangeXlocal_6_7X Given the modern graph And the traversal of """ - g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).range(Scope.local, 4, 5) + g.V().fold().range(Scope.local, 6, 7) """ When iterated to list Then the result should be empty @@ -231,32 +205,6 @@ Feature: Step - range() | result | | l[d[0.4].d,d[0.5].d,d[1.0].d,d[1.0].d] | - @GraphComputerVerificationReferenceOnly - Scenario: g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_1X - Given the modern graph - And the traversal of - """ - g.V().as("a").in().as("a").in().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).limit(Scope.local, 1) - """ - When iterated to list - Then the result should be unordered - | result | - | lop | - | ripple | - - @GraphComputerVerificationReferenceOnly - Scenario: g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_2X - Given the modern graph - And the traversal of - """ - g.V().as("a").in().as("a").in().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).limit(Scope.local, 2) - """ - When iterated to list - Then the result should be unordered - | result | - | l[lop,josh] | - | l[ripple,josh] | - Scenario: g_V_hasLabelXpersonX_order_byXageX_valuesXnameX_skipX1X Given the modern graph And the traversal of diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Select.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Select.feature index 8478989d24..60b0ea8cd3 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Select.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Select.feature @@ -916,4 +916,189 @@ Feature: Step - select() | v[lop] | | v[josh] | | v[ripple] | - | v[peter] | \ No newline at end of file + | v[peter] | + + Scenario: g_V_name_asXaX_selectXfirst_aX + Given the modern graph + And the traversal of + """ + g.V().values("name").as("a").select(Pop.first, "a") + """ + When iterated to list + Then the result should be unordered + | result | + | marko | + | vadas | + | lop | + | josh | + | ripple | + | peter | + + Scenario: g_V_name_asXaX_selectXlast_aX + Given the modern graph + And the traversal of + """ + g.V().values("name").as("a").select(Pop.last, "a") + """ + When iterated to list + Then the result should be unordered + | result | + | marko | + | vadas | + | lop | + | josh | + | ripple | + | peter | + + Scenario: g_V_name_asXaX_selectXmixed_aX + Given the modern graph + And the traversal of + """ + g.V().values("name").as("a").select(Pop.mixed, "a") + """ + When iterated to list + Then the result should be unordered + | result | + | marko | + | vadas | + | lop | + | josh | + | ripple | + | peter | + + Scenario: g_V_name_asXaX_selectXall_aX + Given the modern graph + And the traversal of + """ + g.V().values("name").as("a").select(Pop.all, "a") + """ + When iterated to list + Then the result should be unordered + | result | + | l[marko] | + | l[vadas] | + | l[lop] | + | l[josh] | + | l[ripple] | + | l[peter] | + + Scenario: g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXaX + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").values("name").as("a").concat("X").as("a").length().as("a"). + select("a") + """ + When iterated to list + Then the result should be unordered + | result | + | d[6].i | + | d[6].i | + | d[5].i | + | d[6].i | + + Scenario: g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXfirst_aX + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").values("name").as("a").concat("X").as("a").length().as("a"). + select(Pop.first, "a") + """ + When iterated to list + Then the result should be unordered + | result | + | marko | + | vadas | + | josh | + | peter | + + Scenario: g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_length_asXaX_selectXlast_aX + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").values("name").as("a").concat("X").as("a").length().as("a"). + select(Pop.last, "a") + """ + When iterated to list + Then the result should be unordered + | result | + | d[6].i | + | d[6].i | + | d[5].i | + | d[6].i | + + Scenario: g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_concatXYZX_asXaX_selectXmixed_aX + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").values("name").as("a").concat("X").as("a").concat("YZ").as("a"). + select(Pop.mixed, "a") + """ + When iterated to list + Then the result should be unordered + | result | + | l[marko,markoX,markoXYZ] | + | l[vadas,vadasX,vadasXYZ] | + | l[josh,joshX,joshXYZ] | + | l[peter,peterX,peterXYZ] | + + Scenario: g_V_hasLabelXpersonX_name_asXaX_concatXXX_asXaX_concatXYZX_asXaX_selectXall_aX + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").values("name").as("a").concat("X").as("a").concat("YZ").as("a"). + select(Pop.all, "a") + """ + When iterated to list + Then the result should be unordered + | result | + | l[marko,markoX,markoXYZ] | + | l[vadas,vadasX,vadasXYZ] | + | l[josh,joshX,joshXYZ] | + | l[peter,peterX,peterXYZ] | + + @GraphComputerVerificationReferenceOnly + Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX + Given the modern graph + And the traversal of + """ + g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()) + """ + When iterated to list + Then the result should be of + | result | + | l[marko,josh,ripple] | + | l[marko,ripple,josh] | + | l[josh,marko,ripple] | + | l[josh,ripple,marko] | + | l[ripple,marko,josh] | + | l[ripple,josh,marko] | + | l[marko,josh,lop] | + | l[marko,lop,josh] | + | l[josh,marko,lop] | + | l[josh,lop,marko] | + | l[lop,marko,josh] | + | l[lop,josh,marko] | + + @GraphComputerVerificationReferenceOnly + Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXall_aX_byXunfold_valuesXnameX_foldX + Given the modern graph + And the traversal of + """ + g.V().as("a").out().as("a").out().as("a").select(Pop.all, "a").by(__.unfold().values("name").fold()) + """ + When iterated to list + Then the result should be of + | result | + | l[marko,josh,ripple] | + | l[marko,ripple,josh] | + | l[josh,marko,ripple] | + | l[josh,ripple,marko] | + | l[ripple,marko,josh] | + | l[ripple,josh,marko] | + | l[marko,josh,lop] | + | l[marko,lop,josh] | + | l[josh,marko,lop] | + | l[josh,lop,marko] | + | l[lop,marko,josh] | + | l[lop,josh,marko] | \ No newline at end of file
