(tinkerpop) branch 3.7-dev updated (34870d47dc -> 0e371060eb)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 34870d47dc Fixed typo in mimetype for io docs CTR add 193d47c696 Include /build for gremlin-javascript in .gitignore from 4.x CTR add 0e371060eb Merge branch '3.6-dev' into 3.7-dev No new revisions were added by this update. Summary of changes: gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
(tinkerpop) 02/03: Merge branch '3.6-dev' into 3.7-dev
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 0e371060ebc9438d9d7627acac25f98d52e01de7 Merge: 34870d47dc 193d47c696 Author: Stephen Mallette AuthorDate: Fri Apr 26 08:04:56 2024 -0400 Merge branch '3.6-dev' into 3.7-dev gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
(tinkerpop) 01/03: Include /build for gremlin-javascript in .gitignore from 4.x CTR
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 193d47c696387e93e9b7d53db9457ff4e64bdad3 Author: Stephen Mallette AuthorDate: Fri Apr 26 08:01:25 2024 -0400 Include /build for gremlin-javascript in .gitignore from 4.x CTR --- gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore b/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore index 5e83b29c57..4a67f551e6 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore @@ -3,4 +3,5 @@ node_modules/ npm-debug.log # maven plugin com.github.eirslett frontend-maven-plugin installs node.js runtime in "node" folder node/ -doc/ \ No newline at end of file +doc/ +build/ \ No newline at end of file
(tinkerpop) branch 3.6-dev updated (16441ee37e -> 193d47c696)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.6-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 16441ee37e Merge branch 'dependabot/nuget/gremlin-dotnet/3.6-dev/xunit-2.7.1' into 3.6-dev add 193d47c696 Include /build for gremlin-javascript in .gitignore from 4.x CTR No new revisions were added by this update. Summary of changes: gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
(tinkerpop) branch master updated (d841b8c25d -> e3ced38b21)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from d841b8c25d Merge branch '3.7-dev' new 193d47c696 Include /build for gremlin-javascript in .gitignore from 4.x CTR new 0e371060eb Merge branch '3.6-dev' into 3.7-dev new e3ced38b21 Merge branch '3.7-dev' The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes:
(tinkerpop) 03/03: Merge branch '3.7-dev'
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 e3ced38b2108f3edb29f11fbfa4f6950427bcbd9 Merge: d841b8c25d 0e371060eb Author: Stephen Mallette AuthorDate: Fri Apr 26 08:05:10 2024 -0400 Merge branch '3.7-dev'
(tinkerpop) branch master updated: Fixed typo in mimetype for io docs CTR
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 The following commit(s) were added to refs/heads/master by this push: new 34870d47dc Fixed typo in mimetype for io docs CTR new d841b8c25d Merge branch '3.7-dev' 34870d47dc is described below commit 34870d47dc0781cde0da9568af6869d525db1c72 Author: Stephen Mallette AuthorDate: Fri Apr 26 07:48:57 2024 -0400 Fixed typo in mimetype for io docs CTR --- docs/src/dev/io/graphson.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/dev/io/graphson.asciidoc b/docs/src/dev/io/graphson.asciidoc index 3faea20628..4b2f89a20e 100644 --- a/docs/src/dev/io/graphson.asciidoc +++ b/docs/src/dev/io/graphson.asciidoc @@ -3512,7 +3512,7 @@ The following example is a `ZoneOffset` of three hours, six minutes, and nine se [[graphson-3d0]] == Version 3.0 -Version 3.0 of GraphSON was first introduced on TinkerPop 3.3.0 and is represented by the `application/vnd.graphbinary-v3.0` +Version 3.0 of GraphSON was first introduced on TinkerPop 3.3.0 and is represented by the `application/vnd.gremlin-v3.0+json` mime type. It was introduced as only having embedded types. It is quite similar to GraphSON 2.0 with embedded types and in most cases will appear compatible to the eye, however there are some critical differences. GraphSON 2.0 relied on JSON data types for collections like `Map` and `List`. In GraphSON 3.0, there is explicit typed support for `Map`, @@ -3522,7 +3522,7 @@ two and for `Map` it was necessary to have the ability to return `Map` instances (e.g. `g.V().out().groupCount()`). As of TinkerPop 3.7.0, GraphSON 3.0 also has a typeless representation referenced by the -`application/vnd.graphbinary-v3.0;types=false`. This format matches the format developed for 1.0. +`application/vnd.gremlin-v3.0+json;types=false`. This format matches the format developed for 1.0. === Core
(tinkerpop) branch 3.7-dev updated (3a9fb8eef6 -> 34870d47dc)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 3a9fb8eef6 Merge branch '3.6-dev' into 3.7-dev add 34870d47dc Fixed typo in mimetype for io docs CTR No new revisions were added by this update. Summary of changes: docs/src/dev/io/graphson.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
(tinkerpop) branch TINKERPOP-3028 updated (afdf357543 -> 22352da3e9)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git discard afdf357543 rebased discard 9afe7a4fdf Refactored after rebase of withoutStrategies addition discard 564b2a2437 Removed breaking change on SeedStrategy and tucked in some javadoc discard 0e8acbb02e update golang translation discard ba47795442 wip for Go discard d6836cb483 .NET discard 23bcd96000 groovy discard 5269740a97 TINKERPOP-3028 Translators using grammar add dd7cb24669 CTR touchup docs and comments add e39ef4fcce Merge branch '3.6-dev' into 3.7-dev add 2dbdd31039 Merge branch '3.7-dev' add 7776458585 Allow aliased client to pass along options (#2524) add 0b8b7ec4c5 Temporary fix to failing JDK8 test (#2529) add c5c9baa86b Merge branch '3.6-dev' into 3.7-dev add 8b51edae3f Merge branch '3.7-dev' add 5030f68d64 feat: TypeScript integration (#2515) add 07c1c3ea61 Enabled withoutStrategies grammar tests CTR add 7619c535fe CTR js and go runtime upgrade with minor doc fixes add 34eb10bb66 Merge branch '3.6-dev' into 3.7-dev add 4c3d048977 Merge branch '3.7-dev' add b0c4a7d57f Disable LazyBarrierStrategy for failing JDK8 test (#2536) add d9da293cec [TINKERPOP-3068] Make serviceName and mergedParams public for provider usage in CallStep add d577767208 CTR add public access for checks on PartitionStrategy use in Merge add 70027dcea9 Merge branch '3.6-dev' into 3.7-dev add 72e825ddb1 Merge branch '3.7-dev' add 948e4abf5b CTR update copyright year for NOTICE to 2024 add 21da9a820b Merge branch '3.6-dev' into 3.7-dev add f5dc7e8824 CTR netty version update in NOTICE add d174572f3f Merge branch '3.7-dev' add 495c3e28cf TinkerPop 3.6.7 release add ae2860de69 Merge branch '3.6-dev' into 3.7-dev add 8c6998159e Merge branch '3.7-dev' add 22db8cf08c Parallel Authentication Fix (#2551) add 802ed4fe6a CTR reference doc corrections add 1d1efb9872 Merge branch '3.7-dev' add d6e942d7c8 CTR js test fix new 9d2744955e TINKERPOP-3028 Translators using grammar new fc6e1b7e78 groovy new 982eec9008 .NET new e3c28d743d wip for Go new 7584faca37 update golang translation new d32e63b6eb Removed breaking change on SeedStrategy and tucked in some javadoc new 03959a62db Refactored after rebase of withoutStrategies addition new 941a57d124 rebased new 22352da3e9 rebase This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (afdf357543) \ N -- N -- N refs/heads/TINKERPOP-3028 (22352da3e9) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 9 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .github/workflows/build-test.yml |2 +- CHANGELOG.asciidoc | 30 +- NOTICE |2 +- .../dev/developer/development-environment.asciidoc |2 +- docs/src/reference/the-traversal.asciidoc |5 +- docs/src/upgrade/release-3.5.x.asciidoc|2 +- docs/src/upgrade/release-3.6.x.asciidoc|6 +- gremlin-console/src/main/static/NOTICE |4 +- .../traversal/dsl/graph/GraphTraversal.java|2 +- .../process/traversal/step/map/CallStep.java |6 +- .../process/traversal/step/map/MergeStep.java |6 +- gremlin-dotnet/NOTICE |2 +- .../Gherkin/GherkinTestRunner.cs |3 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs |2 +- .../apache/tinkerpop/gremlin/driver/Client.java|5 +- .../tinkerpop/gremlin/driver/RequestOptions.java | 30 + .../driver/remote/DriverRemoteConnection.java | 27 +- .../gremlin/driver/simple/AbstractClient.java | 14 +- gremlin-driver/src/main/static/NOTICE |4 +- .../driver/remote/DriverRemoteConnectionTest.java |5 +- gremlin-go/NOTICE |2 +- gremlin-go/README.md |2 +- gremlin-go/build/generate.groovy
(tinkerpop) 09/09: rebase
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 22352da3e997b0080af6b02aeefe895ee430b977 Author: Stephen Mallette AuthorDate: Tue Apr 9 18:39:27 2024 -0400 rebase --- .../test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs| 2 +- gremlin-go/build/generate.groovy | 1 + gremlin-go/driver/cucumber/gremlin.go | 2 +- .../javascript/gremlin-javascript/test/cucumber/gremlin.js | 10 +- gremlin-python/src/main/python/radish/gremlin.py | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index a3204a3111..fe52fe46fb 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@ -1181,7 +1181,7 @@ namespace Gremlin.Net.IntegrationTest.Gherkin {"g_withStrategiesXProductiveByStrategyX_V_asXaX_selectXaX_byXageX", new List, ITraversal>> {(g,p) =>g.WithStrategies(new ProductiveByStrategy()).V().As("a").Select("a").By("age")}}, {"g_withSideEffectXk_nullX_injectXxX_selectXkX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("k", null).Inject("x").Select("k")}}, {"g_V_out_in_selectXall_a_a_aX_byXunfold_name_foldX", new List, 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" [...] - {"g_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX", new List, ITraversal>> {(g,p) =>g.V().As("label").Aggregate(Scope.Local, "x").Select("x").Select("label")}}, + {"g_withoutStrategiesXLazyBarrierStrategyX_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX", new List, ITraversal>> {(g,p) =>g.WithoutStrategies(typeof(LazyBarrierStrategy)).V().As("label").Aggregate(Scope.Local, "x").Select("x").Select("label")}}, {"g_V_shortestPath", new List, ITraversal>> {(g,p) =>g.V().ShortestPath()}}, {"g_V_both_dedup_shortestPath", new List, ITraversal>> {(g,p) =>g.V().Both().Dedup().ShortestPath()}}, {"g_V_shortestPath_edgesIncluded", new List, ITraversal>> {(g,p) =>g.V().ShortestPath().With("~tinkerpop.shortestPath.includeEdges")}}, diff --git a/gremlin-go/build/generate.groovy b/gremlin-go/build/generate.groovy index 74e7927d82..760c959839 100644 --- a/gremlin-go/build/generate.groovy +++ b/gremlin-go/build/generate.groovy @@ -75,6 +75,7 @@ radishGremlinFile.withWriter('UTF-8') { Writer writer -> // solution may become necessary as testing of nulls expands. def staticTranslate = [ g_withoutStrategiesXCountStrategyX_V_count: " \"g_withoutStrategiesXCountStrategyX_V_count\": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(6)}}, ", // syntax is all bad for withoutStrategies and who knows what else is causing failures - just do a dummy translation + g_withoutStrategiesXLazyBarrierStrategyX_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX: " \"g_withoutStrategiesXLazyBarrierStrategyX_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX\": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V()}}, ", g_injectXnull_nullX: " \"g_injectXnull_nullX\": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(nil, nil)}}, ", g_VX1X_valuesXageX_injectXnull_nullX: " \"g_VX1X_valuesXageX_injectXnull_nullX\": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p[\"xx1\"]).Values(\"age\").Inject(nil, n
(tinkerpop) 05/09: update golang translation
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 7584faca374e00585726fa36cb507084045fb825 Author: Valentyn Kahamlyk AuthorDate: Thu Jan 25 16:55:18 2024 -0800 update golang translation --- .../translator/DotNetTranslateVisitor.java | 2 +- .../language/translator/GoTranslateVisitor.java| 19 + .../language/translator/JavaTranslateVisitor.java | 2 +- .../language/translator/GremlinTranslatorTest.java | 13 ++- gremlin-go/driver/cucumber/gremlin.go | 94 +++--- gremlin-go/driver/strategies.go| 6 +- gremlin-go/driver/traversal.go | 19 + gremlin-go/go.mod | 1 - 8 files changed, 102 insertions(+), 54 deletions(-) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java index 273008e9e8..fc027ab3be 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java @@ -191,7 +191,7 @@ public class DotNetTranslateVisitor extends AbstractTranslateVisitor { public Void visitStringLiteralList(final GremlinParser.StringLiteralListContext ctx) { sb.append("new List { "); for (int ix = 0; ix < ctx.getChild(1).getChildCount(); ix++) { -if (ctx.getChild(ix).getChild(ix) instanceof TerminalNode) +if (ctx.getChild(1).getChild(ix) instanceof TerminalNode) continue; visit(ctx.getChild(1).getChild(ix)); if (ix < ctx.getChild(1).getChildCount() - 1) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java index 0835643099..12f60296f9 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java @@ -195,6 +195,23 @@ public class GoTranslateVisitor extends AbstractTranslateVisitor { return null; } +@Override +public Void visitTraversalStrategyArgs_PartitionStrategy(final GremlinParser.TraversalStrategyArgs_PartitionStrategyContext ctx) { +appendStrategyArguments(ctx); + +if (ctx.getChild(0).getText().equals("readPartitions")) { +final int ix = sb.lastIndexOf("ReadPartitions: ["); +if (ix > 0) { +final int endIx = sb.indexOf("\"]", ix); +sb.replace(endIx, endIx + 2, "\")"); +sb.replace(ix, ix + 17, "ReadPartitions: gremlingo.NewSimpleSet("); +} + +} + +return null; +} + @Override public Void visitTraversalCardinality(final GremlinParser.TraversalCardinalityContext ctx) { // handle the enum style of cardinality if there is one child, otherwise it's the function call style @@ -251,6 +268,8 @@ public class GoTranslateVisitor extends AbstractTranslateVisitor { TO_GO_MAP.put("OUT", "Out"); TO_GO_MAP.put("IN", "In"); TO_GO_MAP.put("BOTH", "Both"); +TO_GO_MAP.put("WithOptions", GO_PACKAGE_NAME + "WithOptions"); +TO_GO_MAP.put("IO", GO_PACKAGE_NAME + "IO"); TO_GO_MAP.put("__", GO_PACKAGE_NAME + "T__"); TO_GO_MAP.forEach((k, v) -> FROM_GO_MAP.put(v, k)); } diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java index 2fd5a349fb..480a1b5fa3 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java @@ -227,7 +227,7 @@ public class JavaTranslateVisitor extends AbstractTranslateVisitor { public Void visitStringLiteralList(final GremlinParser.StringLiteralListContext ctx) { sb.append("new ArrayList() {{ "); for (int ix = 0; ix < ctx.getChild(1).getChildCount(); ix++) { -if (ctx.getChild(ix).getChild(ix) instanceof TerminalNode) +if (ctx.getChild(1).getChild(ix) instance
(tinkerpop) 06/09: Removed breaking change on SeedStrategy and tucked in some javadoc
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit d32e63b6ebdc3d330e4a609e964de70c8f39f31e Author: Stephen Mallette AuthorDate: Fri Jan 26 08:00:20 2024 -0500 Removed breaking change on SeedStrategy and tucked in some javadoc --- CHANGELOG.asciidoc | 3 +-- .../language/translator/TranslateVisitor.java | 1 - .../gremlin/language/translator/Translator.java| 2 +- .../language/translator/TranslatorException.java | 3 +++ .../strategy/decoration/SeedStrategy.java | 13 +++- gremlin-go/driver/cucumber/gremlin.go | 24 +++--- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 16bdd94878..8b0d1d79e2 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,8 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 4.0.0 (NOT OFFICIALLY RELEASED YET) * Added support for deserialization of `Set` for `gremlin-javascript`. -* Made `SeedStrategy` construction consistent with the builder pattern and removed the public constructor. -* Added grammar-based `Translator`. +* Added grammar-based `Translator` for all languages including explicit ones for Java and anonymization. * Added integer overflow checks for `sum()`. * Gremlin Server only supports instantiation of `authentication.authenticationHandler` with three-arg constructor. * Removed previously deprecated two-arg constructors for `authentication.authenticationHandler` implementations. diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java index 41d0849dd3..27e68d818f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java @@ -49,7 +49,6 @@ import java.util.Set; * Makes anonymous traversals explicit with double underscore * Makes enums explicit with their proper name * - * */ public class TranslateVisitor extends AbstractParseTreeVisitor implements GremlinVisitor { diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java index fdf6d35073..0712599835 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java @@ -64,7 +64,7 @@ public enum Translator { * Translates to gremlin-python. */ PYTHON("Python", PythonTranslateVisitor::new), -//GROOVY("Groovy", "org.apache.tinkerpop.gremlin.language.translator.GroovyTranslateVisitor"), + ; private final String name; diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java index da59614876..524aa8a81a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java @@ -18,6 +18,9 @@ */ package org.apache.tinkerpop.gremlin.language.translator; +/** + * Exception produced by the {@link Translator} when it encounters an error. + */ public class TranslatorException extends RuntimeException { public TranslatorException(final String message) { super(message); diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java index 15f6f3c7e5..3584cc69c0 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java @@ -44,7 +44,11 @@ public class SeedStrategy extends AbstractTraversalStrategy
(tinkerpop) 08/09: rebased
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 941a57d124cf095d9909aeca11d5c30d55ca3fc0 Author: Stephen Mallette AuthorDate: Fri Mar 22 13:39:01 2024 -0400 rebased --- .../test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 9 +++-- gremlin-go/driver/cucumber/gremlin.go| 9 +++-- .../main/javascript/gremlin-javascript/test/cucumber/gremlin.js | 9 +++-- gremlin-python/src/main/python/radish/gremlin.py | 9 +++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index 1ee5f5052f..a3204a3111 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@ -929,8 +929,10 @@ namespace Gremlin.Net.IntegrationTest.Gherkin {"g_mergeV_mergeE_combination_new_vertices", new List, ITraversal>> {(g,p) =>g.MergeV((IDictionary) p["xx1"]).As("outV").MergeV((IDictionary) p["xx2"]).As("inV").MergeE((IDictionary) p["xx3"]).Option(Merge.OutV, (ITraversal) __.Select("outV")).Option(Merge.InV, (ITraversal) __.Select("inV")), (g,p) =>g.V(), (g,p) =>g.E(), (g,p) =>g.V().Has("name", "marko") [...] {"g_mergeV_mergeE_combination_existing_vertices", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").AddV("person").Property("name", "vadas"), (g,p) =>g.MergeV((IDictionary) p["xx1"]).As("outV").MergeV((IDictionary) p["xx2"]).As("inV").MergeE((IDictionary) p["xx3"]).Option(Merge.OutV, (ITraversal) __.Select("outV")).Option(Merge.InV, (ITrav [...] {"g_V_asXvX_mergeEXxx1X_optionXMerge_onMatch_xx2X_optionXMerge_outV_selectXvXX_optionXMerge_inV_selectXvXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29), (g,p) =>g.V().As("v").MergeE((IDictionary) p["xx1"]).Option(Merge.OnMatch, (IDictionary) p["xx2"]).Option(Merge.OutV, (ITraversal) __.Select("v")).Option(Merge.InV, (ITraversal) [...] - {"g_V_mergeEXlabel_knows_out_marko_in_vadasX_optionXonMatch_sideEffectXpropertyXweight_0XX_constantXemptyXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").As("a").AddV("person").Property("name", "vadas").As("b").AddE("knows").Property("weight", 1).From("a").To("b"), (g,p) =>g.V().MergeE((IDictionary) p["xx1"]).Option(Merge.OnMatch, (ITraversal) __.SideEffect(__.Property("we [...] + {"g_V_mergeEXlabel_knows_out_marko_in_vadasX_optionXonMatch_sideEffectXpropertyXweight_0XX_constantXemptyXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").As("a").AddV("person").Property("name", "vadas").As("b").AddE("knows").Property("weight", 1).From("a").To("b"), (g,p) =>g.V().MergeE((IDictionary) p["xx1"]).Option(Merge.OnMatch, (ITraversal) __.SideEffect(__.Property("we [...] {"g_mergeEXlabel_knows_out_marko_in_vadasX_optionXonMatch_sideEffectXpropertyXweight_0XX_constantXemptyXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").As("a").AddV("person").Property("name", "vadas").As("b").AddE("knows").Property("weight", 1).From("a").To("b"), (g,p) =>g.MergeE((IDictionary) p["xx1"]).Option(Merge.OnMatch, (ITraversal) __.SideEffect(__.Property("weight", [...] + {"g_injectXlist1_list2X_mergeEXlimitXlocal_1XX_optionXonCreate_rangeXlocal_1_2XX_optionXonMatch_tailXlocalXX_to_match", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").
(tinkerpop) 02/09: groovy
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit fc6e1b7e78fe418a64b0bd32c24e1bd5e9970fbb Author: Stephen Mallette AuthorDate: Wed Jan 3 08:32:02 2024 -0500 groovy --- .../translator/GroovyTranslateVisitor.java | 116 +++ .../language/translator/JavaTranslateVisitor.java | 2 + .../translator/JavascriptTranslateVisitor.java | 10 ++ .../translator/PythonTranslateVisitor.java | 1 + .../language/translator/TranslateVisitor.java | 5 +- .../gremlin/language/translator/Translator.java| 5 + .../language/translator/GremlinTranslatorTest.java | 128 +++-- .../tinkerpop/gremlin/features/StepDefinition.java | 8 +- 8 files changed, 262 insertions(+), 13 deletions(-) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java new file mode 100644 index 00..44e7d2d56f --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java @@ -0,0 +1,116 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tinkerpop.gremlin.language.translator; + +import org.apache.tinkerpop.gremlin.language.grammar.GremlinParser; + +/** + * Converts a Gremlin traversal string into a Groovy source code representation of that traversal with an aim at + * sacrificing some formatting for the ability to compile correctly. The translations may require use of TinkerPop's + * sugar syntax and therefore requires use of the {@code GremlinLoader} in the gremlin-groovy module unless you are + * specifically certain that your translations will not result in the use of that syntax. If in doubt, prefer the + * {@link JavaTranslateVisitor} instead. + * + * Normalize numeric suffixes to lower case + * If floats are not suffixed they will translate as BigDecimal + * Makes anonymous traversals explicit with double underscore + * Makes enums explicit with their proper name + * + */ +public class GroovyTranslateVisitor extends TranslateVisitor { +public GroovyTranslateVisitor() { +this("g"); +} + +public GroovyTranslateVisitor(final String graphTraversalSourceName) { +super(graphTraversalSourceName); +} + +@Override +public Void visitStructureVertex(final GremlinParser.StructureVertexContext ctx) { +sb.append("new DetachedVertex("); +visit(ctx.getChild(3)); // id +sb.append(", "); +visit(ctx.getChild(5)); // label +sb.append(")"); +return null; +} + +@Override +public Void visitIntegerLiteral(final GremlinParser.IntegerLiteralContext ctx) { +final String integerLiteral = ctx.getText().toLowerCase(); + +// check suffix +final int lastCharIndex = integerLiteral.length() - 1; +final char lastCharacter = integerLiteral.charAt(lastCharIndex); +switch (lastCharacter) { +case 'b': +// parse B/b as byte +sb.append("new Byte("); +sb.append(integerLiteral, 0, lastCharIndex); +sb.append(")"); +break; +case 's': +// parse S/s as short +sb.append("new Short("); +sb.append(integerLiteral, 0, lastCharIndex); +sb.append(")"); +break; +case 'i': +case 'l': +// parse I/i and L/l as Integer and Long respectively +sb.append(integerLiteral, 0, lastCharIndex).append(lastCharacter); +break; +case 'n': +// parse N/n as BigInteger which for groovy is "g" shorthand +sb.append(integerLiteral, 0, lastCharIndex).append("g"); +break; +default: +
(tinkerpop) branch master updated: Enabled withoutStrategies grammar tests CTR
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 The following commit(s) were added to refs/heads/master by this push: new 07c1c3ea61 Enabled withoutStrategies grammar tests CTR 07c1c3ea61 is described below commit 07c1c3ea612ac26d3dd0a7e16efbdb02aa5fe3d7 Author: Stephen Mallette AuthorDate: Mon Apr 1 15:54:20 2024 -0400 Enabled withoutStrategies grammar tests CTR --- .../apache/tinkerpop/gremlin/language/grammar/ReferenceGrammarTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/gremlin-language/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/ReferenceGrammarTest.java b/gremlin-language/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/ReferenceGrammarTest.java index 35d2c789cc..d74ac439ca 100644 --- a/gremlin-language/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/ReferenceGrammarTest.java +++ b/gremlin-language/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/ReferenceGrammarTest.java @@ -108,7 +108,6 @@ public class ReferenceGrammarTest extends AbstractGrammarTest { assumeThat("withComputer() step is not supported", query.startsWith("g.withComputer("), is(false)); assumeThat("Edge instances are not supported", edgePattern.matcher(query).matches(), is(false)); assumeThat("fill() terminator is not supported", query.contains("fill("), is(false)); -assumeThat("withoutStrategies() is not supported", query.contains("withoutStrategies("), is(false)); assumeThat("program() is not supported", query.contains("program("), is(false)); assumeThat("Casts are not supported", query.contains("(Map)"), is(false));
(tinkerpop) 02/08: groovy
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 23bcd9600015af0071991d6e7dcc151b1afe6224 Author: Stephen Mallette AuthorDate: Wed Jan 3 08:32:02 2024 -0500 groovy --- .../translator/GroovyTranslateVisitor.java | 116 +++ .../language/translator/JavaTranslateVisitor.java | 2 + .../translator/JavascriptTranslateVisitor.java | 10 ++ .../translator/PythonTranslateVisitor.java | 1 + .../language/translator/TranslateVisitor.java | 5 +- .../gremlin/language/translator/Translator.java| 5 + .../language/translator/GremlinTranslatorTest.java | 128 +++-- .../tinkerpop/gremlin/features/StepDefinition.java | 8 +- 8 files changed, 262 insertions(+), 13 deletions(-) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java new file mode 100644 index 00..44e7d2d56f --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java @@ -0,0 +1,116 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tinkerpop.gremlin.language.translator; + +import org.apache.tinkerpop.gremlin.language.grammar.GremlinParser; + +/** + * Converts a Gremlin traversal string into a Groovy source code representation of that traversal with an aim at + * sacrificing some formatting for the ability to compile correctly. The translations may require use of TinkerPop's + * sugar syntax and therefore requires use of the {@code GremlinLoader} in the gremlin-groovy module unless you are + * specifically certain that your translations will not result in the use of that syntax. If in doubt, prefer the + * {@link JavaTranslateVisitor} instead. + * + * Normalize numeric suffixes to lower case + * If floats are not suffixed they will translate as BigDecimal + * Makes anonymous traversals explicit with double underscore + * Makes enums explicit with their proper name + * + */ +public class GroovyTranslateVisitor extends TranslateVisitor { +public GroovyTranslateVisitor() { +this("g"); +} + +public GroovyTranslateVisitor(final String graphTraversalSourceName) { +super(graphTraversalSourceName); +} + +@Override +public Void visitStructureVertex(final GremlinParser.StructureVertexContext ctx) { +sb.append("new DetachedVertex("); +visit(ctx.getChild(3)); // id +sb.append(", "); +visit(ctx.getChild(5)); // label +sb.append(")"); +return null; +} + +@Override +public Void visitIntegerLiteral(final GremlinParser.IntegerLiteralContext ctx) { +final String integerLiteral = ctx.getText().toLowerCase(); + +// check suffix +final int lastCharIndex = integerLiteral.length() - 1; +final char lastCharacter = integerLiteral.charAt(lastCharIndex); +switch (lastCharacter) { +case 'b': +// parse B/b as byte +sb.append("new Byte("); +sb.append(integerLiteral, 0, lastCharIndex); +sb.append(")"); +break; +case 's': +// parse S/s as short +sb.append("new Short("); +sb.append(integerLiteral, 0, lastCharIndex); +sb.append(")"); +break; +case 'i': +case 'l': +// parse I/i and L/l as Integer and Long respectively +sb.append(integerLiteral, 0, lastCharIndex).append(lastCharacter); +break; +case 'n': +// parse N/n as BigInteger which for groovy is "g" shorthand +sb.append(integerLiteral, 0, lastCharIndex).append("g"); +break; +default: +
(tinkerpop) 05/08: update golang translation
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 0e8acbb02e430a5c54d6538020b87d783d06b4b8 Author: Valentyn Kahamlyk AuthorDate: Thu Jan 25 16:55:18 2024 -0800 update golang translation --- .../translator/DotNetTranslateVisitor.java | 2 +- .../language/translator/GoTranslateVisitor.java| 19 + .../language/translator/JavaTranslateVisitor.java | 2 +- .../language/translator/GremlinTranslatorTest.java | 13 ++- gremlin-go/driver/cucumber/gremlin.go | 94 +++--- gremlin-go/driver/strategies.go| 6 +- gremlin-go/driver/traversal.go | 19 + gremlin-go/go.mod | 1 - 8 files changed, 102 insertions(+), 54 deletions(-) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java index 273008e9e8..fc027ab3be 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java @@ -191,7 +191,7 @@ public class DotNetTranslateVisitor extends AbstractTranslateVisitor { public Void visitStringLiteralList(final GremlinParser.StringLiteralListContext ctx) { sb.append("new List { "); for (int ix = 0; ix < ctx.getChild(1).getChildCount(); ix++) { -if (ctx.getChild(ix).getChild(ix) instanceof TerminalNode) +if (ctx.getChild(1).getChild(ix) instanceof TerminalNode) continue; visit(ctx.getChild(1).getChild(ix)); if (ix < ctx.getChild(1).getChildCount() - 1) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java index 0835643099..12f60296f9 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java @@ -195,6 +195,23 @@ public class GoTranslateVisitor extends AbstractTranslateVisitor { return null; } +@Override +public Void visitTraversalStrategyArgs_PartitionStrategy(final GremlinParser.TraversalStrategyArgs_PartitionStrategyContext ctx) { +appendStrategyArguments(ctx); + +if (ctx.getChild(0).getText().equals("readPartitions")) { +final int ix = sb.lastIndexOf("ReadPartitions: ["); +if (ix > 0) { +final int endIx = sb.indexOf("\"]", ix); +sb.replace(endIx, endIx + 2, "\")"); +sb.replace(ix, ix + 17, "ReadPartitions: gremlingo.NewSimpleSet("); +} + +} + +return null; +} + @Override public Void visitTraversalCardinality(final GremlinParser.TraversalCardinalityContext ctx) { // handle the enum style of cardinality if there is one child, otherwise it's the function call style @@ -251,6 +268,8 @@ public class GoTranslateVisitor extends AbstractTranslateVisitor { TO_GO_MAP.put("OUT", "Out"); TO_GO_MAP.put("IN", "In"); TO_GO_MAP.put("BOTH", "Both"); +TO_GO_MAP.put("WithOptions", GO_PACKAGE_NAME + "WithOptions"); +TO_GO_MAP.put("IO", GO_PACKAGE_NAME + "IO"); TO_GO_MAP.put("__", GO_PACKAGE_NAME + "T__"); TO_GO_MAP.forEach((k, v) -> FROM_GO_MAP.put(v, k)); } diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java index 2fd5a349fb..480a1b5fa3 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java @@ -227,7 +227,7 @@ public class JavaTranslateVisitor extends AbstractTranslateVisitor { public Void visitStringLiteralList(final GremlinParser.StringLiteralListContext ctx) { sb.append("new ArrayList() {{ "); for (int ix = 0; ix < ctx.getChild(1).getChildCount(); ix++) { -if (ctx.getChild(ix).getChild(ix) instanceof TerminalNode) +if (ctx.getChild(1).getChild(ix) instance
(tinkerpop) branch TINKERPOP-3028 updated (bcbed02f53 -> afdf357543)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git discard bcbed02f53 Refactored after rebase of withoutStrategies addition discard b0e59f679d Removed breaking change on SeedStrategy and tucked in some javadoc discard 97c2711a12 update golang translation discard e959e96335 wip for Go discard e81230cbc5 .NET discard f37cd7ce5d groovy discard bde8c26b83 TINKERPOP-3028 Translators using grammar add aa90f77595 Bump Polly from 8.3.0 to 8.3.1 in /gremlin-dotnet add 936dd8137a Merge branch '3.6-dev' into 3.7-dev add cc43fbf57a Merge branch '3.7-dev' add f5d8225ca8 Bump System.Text.Json from 8.0.2 to 8.0.3 in /gremlin-dotnet add 8a71161877 Merge branch '3.6-dev' into 3.7-dev add bd5d4f77ad Merge branch '3.7-dev' add 196d61920c Added test for select() semantics CTR add cfbeb304cc Merge branch '3.6-dev' into 3.7-dev add 6c01291d06 Merge branch '3.7-dev' add f7c64dabf0 TINKERPOP-3056 Follow-on fix for mid-traversal mergeE/V add 20443b0d7b Merge branch '3.6-dev' into 3.7-dev add 0771f34afc Merge branch '3.7-dev' add 3015f37043 TINKERPOP-3056 Consistently promoting matched/created edge/vertex new 5269740a97 TINKERPOP-3028 Translators using grammar new 23bcd96000 groovy new d6836cb483 .NET new ba47795442 wip for Go new 0e8acbb02e update golang translation new 564b2a2437 Removed breaking change on SeedStrategy and tucked in some javadoc new 9afe7a4fdf Refactored after rebase of withoutStrategies addition new afdf357543 rebased This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (bcbed02f53) \ N -- N -- N refs/heads/TINKERPOP-3028 (afdf357543) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 8 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CHANGELOG.asciidoc | 7 +- docs/src/reference/the-traversal.asciidoc | 16 ++--- .../process/traversal/step/map/MergeEdgeStep.java | 6 +- .../process/traversal/step/map/MergeStep.java | 1 + .../traversal/step/map/MergeVertexStep.java| 9 ++- gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj | 4 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 9 ++- gremlin-go/driver/cucumber/gremlin.go | 9 ++- .../gremlin-javascript/test/cucumber/gremlin.js| 9 ++- gremlin-python/src/main/python/radish/gremlin.py | 9 ++- .../gremlin/test/features/map/MergeEdge.feature| 74 +- .../gremlin/test/features/map/MergeVertex.feature | 46 +- .../gremlin/test/features/map/Select.feature | 16 + 13 files changed, 185 insertions(+), 30 deletions(-)
(tinkerpop) 06/08: Removed breaking change on SeedStrategy and tucked in some javadoc
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 564b2a24376067162fe62bea6dcae9665f20e213 Author: Stephen Mallette AuthorDate: Fri Jan 26 08:00:20 2024 -0500 Removed breaking change on SeedStrategy and tucked in some javadoc --- CHANGELOG.asciidoc | 3 +-- .../language/translator/TranslateVisitor.java | 1 - .../gremlin/language/translator/Translator.java| 2 +- .../language/translator/TranslatorException.java | 3 +++ .../strategy/decoration/SeedStrategy.java | 13 +++- gremlin-go/driver/cucumber/gremlin.go | 24 +++--- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 77d2f418bb..513473a185 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,8 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 4.0.0 (NOT OFFICIALLY RELEASED YET) * Added support for deserialization of `Set` for `gremlin-javascript`. -* Made `SeedStrategy` construction consistent with the builder pattern and removed the public constructor. -* Added grammar-based `Translator`. +* Added grammar-based `Translator` for all languages including explicit ones for Java and anonymization. * Added integer overflow checks for `sum()`. * Gremlin Server only supports instantiation of `authentication.authenticationHandler` with three-arg constructor. * Removed previously deprecated two-arg constructors for `authentication.authenticationHandler` implementations. diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java index 41d0849dd3..27e68d818f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java @@ -49,7 +49,6 @@ import java.util.Set; * Makes anonymous traversals explicit with double underscore * Makes enums explicit with their proper name * - * */ public class TranslateVisitor extends AbstractParseTreeVisitor implements GremlinVisitor { diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java index fdf6d35073..0712599835 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java @@ -64,7 +64,7 @@ public enum Translator { * Translates to gremlin-python. */ PYTHON("Python", PythonTranslateVisitor::new), -//GROOVY("Groovy", "org.apache.tinkerpop.gremlin.language.translator.GroovyTranslateVisitor"), + ; private final String name; diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java index da59614876..524aa8a81a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java @@ -18,6 +18,9 @@ */ package org.apache.tinkerpop.gremlin.language.translator; +/** + * Exception produced by the {@link Translator} when it encounters an error. + */ public class TranslatorException extends RuntimeException { public TranslatorException(final String message) { super(message); diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java index 15f6f3c7e5..3584cc69c0 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java @@ -44,7 +44,11 @@ public class SeedStrategy extends AbstractTraversalStrategy
(tinkerpop) 08/08: rebased
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit afdf357543e7f5363f7a3137b1cbd447db46fb5c Author: Stephen Mallette AuthorDate: Fri Mar 22 13:39:01 2024 -0400 rebased --- .../test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 9 +++-- gremlin-go/driver/cucumber/gremlin.go| 9 +++-- .../main/javascript/gremlin-javascript/test/cucumber/gremlin.js | 9 +++-- gremlin-python/src/main/python/radish/gremlin.py | 9 +++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index 1ee5f5052f..a3204a3111 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@ -929,8 +929,10 @@ namespace Gremlin.Net.IntegrationTest.Gherkin {"g_mergeV_mergeE_combination_new_vertices", new List, ITraversal>> {(g,p) =>g.MergeV((IDictionary) p["xx1"]).As("outV").MergeV((IDictionary) p["xx2"]).As("inV").MergeE((IDictionary) p["xx3"]).Option(Merge.OutV, (ITraversal) __.Select("outV")).Option(Merge.InV, (ITraversal) __.Select("inV")), (g,p) =>g.V(), (g,p) =>g.E(), (g,p) =>g.V().Has("name", "marko") [...] {"g_mergeV_mergeE_combination_existing_vertices", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").AddV("person").Property("name", "vadas"), (g,p) =>g.MergeV((IDictionary) p["xx1"]).As("outV").MergeV((IDictionary) p["xx2"]).As("inV").MergeE((IDictionary) p["xx3"]).Option(Merge.OutV, (ITraversal) __.Select("outV")).Option(Merge.InV, (ITrav [...] {"g_V_asXvX_mergeEXxx1X_optionXMerge_onMatch_xx2X_optionXMerge_outV_selectXvXX_optionXMerge_inV_selectXvXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29), (g,p) =>g.V().As("v").MergeE((IDictionary) p["xx1"]).Option(Merge.OnMatch, (IDictionary) p["xx2"]).Option(Merge.OutV, (ITraversal) __.Select("v")).Option(Merge.InV, (ITraversal) [...] - {"g_V_mergeEXlabel_knows_out_marko_in_vadasX_optionXonMatch_sideEffectXpropertyXweight_0XX_constantXemptyXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").As("a").AddV("person").Property("name", "vadas").As("b").AddE("knows").Property("weight", 1).From("a").To("b"), (g,p) =>g.V().MergeE((IDictionary) p["xx1"]).Option(Merge.OnMatch, (ITraversal) __.SideEffect(__.Property("we [...] + {"g_V_mergeEXlabel_knows_out_marko_in_vadasX_optionXonMatch_sideEffectXpropertyXweight_0XX_constantXemptyXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").As("a").AddV("person").Property("name", "vadas").As("b").AddE("knows").Property("weight", 1).From("a").To("b"), (g,p) =>g.V().MergeE((IDictionary) p["xx1"]).Option(Merge.OnMatch, (ITraversal) __.SideEffect(__.Property("we [...] {"g_mergeEXlabel_knows_out_marko_in_vadasX_optionXonMatch_sideEffectXpropertyXweight_0XX_constantXemptyXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").As("a").AddV("person").Property("name", "vadas").As("b").AddE("knows").Property("weight", 1).From("a").To("b"), (g,p) =>g.MergeE((IDictionary) p["xx1"]).Option(Merge.OnMatch, (ITraversal) __.SideEffect(__.Property("weight", [...] + {"g_injectXlist1_list2X_mergeEXlimitXlocal_1XX_optionXonCreate_rangeXlocal_1_2XX_optionXonMatch_tailXlocalXX_to_match", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").
(tinkerpop) branch master updated: TINKERPOP-3056 Consistently promoting matched/created edge/vertex
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 The following commit(s) were added to refs/heads/master by this push: new 3015f37043 TINKERPOP-3056 Consistently promoting matched/created edge/vertex 3015f37043 is described below commit 3015f370431aa890492c33f94fa31138a0099d92 Author: Stephen Mallette AuthorDate: Fri Mar 22 11:13:06 2024 -0400 TINKERPOP-3056 Consistently promoting matched/created edge/vertex --- CHANGELOG.asciidoc | 1 + docs/src/reference/the-traversal.asciidoc | 30 +-- .../process/traversal/step/map/MergeEdgeStep.java | 10 +++ .../process/traversal/step/map/MergeStep.java | 34 -- .../traversal/step/map/MergeVertexStep.java| 12 .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 12 gremlin-go/driver/cucumber/gremlin.go | 12 .../gremlin-javascript/test/cucumber/gremlin.js| 12 gremlin-python/src/main/python/radish/gremlin.py | 12 .../gremlin/test/features/map/MergeEdge.feature| 21 +++-- .../gremlin/test/features/map/MergeVertex.feature | 20 +++-- 11 files changed, 67 insertions(+), 109 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index becc49c1ce..119d5cd987 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -35,6 +35,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Removed the deprecated `withGraph()` option from `AnonymousTraversalSource`. * Removed the `gremlin-archetype` module in favor of newer sample applications in each GLV's `examples` folder. * Bumped to `commons-collection4`. +* Made `mergeE()` and `mergeV()` consistent in their use as a start step and as mid-traversal by always promoting the currently created or matched `Element` to the `onCreate` or `onMatch` child traversal. * Added `withoutStrategies()` syntax to the Gremlin ANTLR grammar. * Modified the Gremlin ANTLR grammar to more dynamically interact with any strategies registered globally to the `TraversalStrategies` cache sets. * Made `new` keyword optional in the Gremlin grammar. diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index c75cdc9180..99d51b24f3 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -2886,13 +2886,6 @@ g.E().elementMap() <1> Create three dogs. <2> Stream the edge maps into `mergeE()` steps. -WARNING: There is a bit of an inconsistency present when `mergeE()` is used as a start step versus when it is used -mid-traversal. As a start step, `mergeE()` will promote the currently created or matched `Edge` to the child traversal, -allowing you to directly update it like `option(onMatch, property('k', 'v').constant([:]))`. However, when `mergeE()` is -used mid-traversal, the `Edge` is not promoted to the child traversal and the incoming traverser is used instead. Such -behavior is essentially blocked to prevent accidental misuse and will result in an exception at execution time that will -have a message like, "The incoming traverser for MergeEdgeStep cannot be an Element". - The `mergeE` step can be combined with the `mergeV` step (or any other step producing a `Vertex`) using the `Merge.outV` and `Merge.inV` option modulators. These options can be used to "late-bind" the `OUT` and `IN` vertices in the main merge argument and in the `onCreate` argument: @@ -3105,15 +3098,15 @@ contains additional information that will be applied if an existing vertex is fo [gremlin-groovy] -g.inject([[(T.id):400],[(T.label):'Dog',name:'Pixel',age:1],[updated:'2022-02-1']]). - mergeV(limit(local,1)). <1> - option(Merge.onCreate,range(local,1,2)). <2> - option(Merge.onMatch,tail(local)) <3> +g.inject([[(T.id):400],[(T.label):'Dog',name:'Pixel',age:1],[updated:'2022-02-1']]).as('m'). + mergeV(select('m').limit(local,1)). <1> + option(Merge.onCreate, select('m').range(local,1,2)). <2> + option(Merge.onMatch, select('m').tail(local)) <3> g.V(400).valueMap().with(WithOptions.tokens) -g.inject([[(T.id):400],[(T.label):'Dog',name:'Pixel',age:1],[updated:'2022-02-1']]). - mergeV(limit(local,1)). - option(Merge.onCreate,range(local,1,2)). - option(Merge.onMatch,tail(local)) <4> +g.inject([[(T.id):400],[(T.label):'Dog',name:'Pixel',age:1],[updated:'2022-02-1']]).as('m'). + mergeV(select('m').limit(local,1)). + option(Merge.onCreate, select('m').range(local,1,2)). + option(Merge.onMatch, select('m').tail(local)) <4> g.V(400).valueMap().with(WithOptions.tokens) <5> @@ -3123,13 +3116,6 @@ g.V(400).valueMap().with(WithOptions.tokens) <5> <4> Pixel exists now, so we
(tinkerpop) branch 3.6-dev updated (196d61920c -> f7c64dabf0)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.6-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 196d61920c Added test for select() semantics CTR add f7c64dabf0 TINKERPOP-3056 Follow-on fix for mid-traversal mergeE/V No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc | 6 +- docs/src/reference/the-traversal.asciidoc | 14 .../process/traversal/step/map/MergeEdgeStep.java | 8 ++- .../process/traversal/step/map/MergeStep.java | 35 ++ .../traversal/step/map/MergeVertexStep.java| 7 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 8 ++- gremlin-go/driver/cucumber/gremlin.go | 8 ++- .../gremlin-javascript/test/cucumber/gremlin.js| 8 ++- gremlin-python/src/main/python/radish/gremlin.py | 8 ++- .../gremlin/test/features/map/MergeEdge.feature| 77 -- .../gremlin/test/features/map/MergeVertex.feature | 46 - 11 files changed, 201 insertions(+), 24 deletions(-)
(tinkerpop) branch 3.7-dev updated (cfbeb304cc -> 20443b0d7b)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from cfbeb304cc Merge branch '3.6-dev' into 3.7-dev add f7c64dabf0 TINKERPOP-3056 Follow-on fix for mid-traversal mergeE/V add 20443b0d7b Merge branch '3.6-dev' into 3.7-dev No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc | 6 +- docs/src/reference/the-traversal.asciidoc | 14 .../process/traversal/step/map/MergeEdgeStep.java | 8 ++- .../process/traversal/step/map/MergeStep.java | 35 ++ .../traversal/step/map/MergeVertexStep.java| 7 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 8 ++- gremlin-go/driver/cucumber/gremlin.go | 8 ++- .../gremlin-javascript/test/cucumber/gremlin.js| 8 ++- gremlin-python/src/main/python/radish/gremlin.py | 8 ++- .../gremlin/test/features/map/MergeEdge.feature| 77 -- .../gremlin/test/features/map/MergeVertex.feature | 48 -- 11 files changed, 202 insertions(+), 25 deletions(-)
(tinkerpop) 01/03: TINKERPOP-3056 Follow-on fix for mid-traversal mergeE/V
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 f7c64dabf07f6d5008bf457690b85b6a86d2c924 Author: Stephen Mallette AuthorDate: Fri Mar 22 09:03:26 2024 -0400 TINKERPOP-3056 Follow-on fix for mid-traversal mergeE/V Prevents child traversals to option() from having an Element in it so that you can't mistakenly update the wrong thing CTR --- CHANGELOG.asciidoc | 6 +- docs/src/reference/the-traversal.asciidoc | 14 .../process/traversal/step/map/MergeEdgeStep.java | 8 ++- .../process/traversal/step/map/MergeStep.java | 35 ++ .../traversal/step/map/MergeVertexStep.java| 7 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 8 ++- gremlin-go/driver/cucumber/gremlin.go | 8 ++- .../gremlin-javascript/test/cucumber/gremlin.js| 8 ++- gremlin-python/src/main/python/radish/gremlin.py | 8 ++- .../gremlin/test/features/map/MergeEdge.feature| 77 -- .../gremlin/test/features/map/MergeVertex.feature | 46 - 11 files changed, 201 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 27fde68afd..b813d15ae7 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -29,13 +29,13 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Fixed bug in bytecode translation of `g.tx().commit()` and `g.tx().rollback()` in all languages. * Improved error message from `JavaTranslator` by including exception source. * Added missing `short` serialization (`gx:Int16`) to GraphSONV2 and GraphSONV3 in `gremlin-python`. -* Added tests for error handling for GLV's if tx.commit() is called remotely for graphs without transactions support. +* Added tests for error handling for GLV's if `tx.commit()`` is called remotely for graphs without transactions support. * Introduced multi-architecture AMD64/ARM64 docker images for gremlin-console. * Fixed bug in `JavaTranslator` where `has(String, null)` could call `has(String, Traversal)` to generate an error. * Fixed issue where server errors weren't being properly parsed when sending bytecode over HTTP. -* Improved bulkset contains check for elements if all elements in bulkset are of the same type. +* Improved `Bulkset` contains check for elements if all elements in `Bulkset` are of the same type. * Fixed bug in `EarlyLimitStrategy` which was too aggressive when promoting `limit()` before `map()`. -* Fixed bug in mid-traversal `mergeE()` where mutations in `sideEffect()` were being applied to the current traverser rather than a `onMatch` edge. +* Prevented mid-traversal `mergeE()` and `mergeV()` from operating on an incoming `Traverser` that contains an `Element`. * Improved performance of the application of `FilterRankingStrategy` for large traversals with deeply nested traversals by improving the cache operation. [[release-3-6-6]] diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index ef1192d0ad..ca89014eef 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -2515,6 +2515,13 @@ g.E().elementMap() <1> Create three dogs. <2> Stream the edge maps into `mergeE()` steps. +WARNING: There is a bit of an inconsistency present when `mergeE()` is used as a start step versus when it is used +mid-traversal. As a start step, `mergeE()` will promote the currently created or matched `Edge` to the child traversal, +allowing you to directly update it like `option(onMatch, property('k', 'v').constant([:]))`. However, when `mergeE()` is +used mid-traversal, the `Edge` is not promoted to the child traversal and the incoming traverser is used instead. Such +behavior is essentially blocked to prevent accidental misuse and will result in an exception at execution time that will +have a message like, "The incoming traverser for MergeEdgeStep cannot be an Element". + The `mergeE` step can be combined with the `mergeV` step (or any other step producing a `Vertex`) using the `Merge.outV` and `Merge.inV` option modulators. These options can be used to "late-bind" the `OUT` and `IN` vertices in the main merge argument and in the `onCreate` argument: @@ -2732,6 +2739,13 @@ g.V(400).valueMap().with(WithOptions.tokens) <5> <4> Pixel exists now, so we will take this option. <5> The `updated` property has now been added. +WARNING: There is a bit of an inconsistency present when `mergeV()` is used as a start step versus when it is used +mid-traversal. As a start step, `mergeV()` will promote the currently created or matched `Vertex` to the child +traversal, allowing you to directly update it like `option(onMatch, property('k', 'v').constant([:]))`. However, when +`mergeV()` i
(tinkerpop) 03/03: Merge branch '3.7-dev'
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 0771f34afcc0436f144ec56a2d96154ec5668bba Merge: 6c01291d06 20443b0d7b Author: Stephen Mallette AuthorDate: Fri Mar 22 09:36:17 2024 -0400 Merge branch '3.7-dev' CHANGELOG.asciidoc | 6 +- docs/src/reference/the-traversal.asciidoc | 14 .../process/traversal/step/map/MergeEdgeStep.java | 8 ++- .../process/traversal/step/map/MergeStep.java | 35 ++ .../traversal/step/map/MergeVertexStep.java| 7 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 8 ++- gremlin-go/driver/cucumber/gremlin.go | 8 ++- .../gremlin-javascript/test/cucumber/gremlin.js| 8 ++- gremlin-python/src/main/python/radish/gremlin.py | 8 ++- .../gremlin/test/features/map/MergeEdge.feature| 77 -- .../gremlin/test/features/map/MergeVertex.feature | 48 -- 11 files changed, 202 insertions(+), 25 deletions(-)
(tinkerpop) branch master updated (6c01291d06 -> 0771f34afc)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 6c01291d06 Merge branch '3.7-dev' new f7c64dabf0 TINKERPOP-3056 Follow-on fix for mid-traversal mergeE/V new 20443b0d7b Merge branch '3.6-dev' into 3.7-dev new 0771f34afc Merge branch '3.7-dev' The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CHANGELOG.asciidoc | 6 +- docs/src/reference/the-traversal.asciidoc | 14 .../process/traversal/step/map/MergeEdgeStep.java | 8 ++- .../process/traversal/step/map/MergeStep.java | 35 ++ .../traversal/step/map/MergeVertexStep.java| 7 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 8 ++- gremlin-go/driver/cucumber/gremlin.go | 8 ++- .../gremlin-javascript/test/cucumber/gremlin.js| 8 ++- gremlin-python/src/main/python/radish/gremlin.py | 8 ++- .../gremlin/test/features/map/MergeEdge.feature| 77 -- .../gremlin/test/features/map/MergeVertex.feature | 48 -- 11 files changed, 202 insertions(+), 25 deletions(-)
(tinkerpop) 02/03: Merge branch '3.6-dev' into 3.7-dev
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 20443b0d7b241f121a53ae98d8fc3ed343ddedbd Merge: cfbeb304cc f7c64dabf0 Author: Stephen Mallette AuthorDate: Fri Mar 22 09:06:03 2024 -0400 Merge branch '3.6-dev' into 3.7-dev CHANGELOG.asciidoc | 6 +- docs/src/reference/the-traversal.asciidoc | 14 .../process/traversal/step/map/MergeEdgeStep.java | 8 ++- .../process/traversal/step/map/MergeStep.java | 35 ++ .../traversal/step/map/MergeVertexStep.java| 7 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 8 ++- gremlin-go/driver/cucumber/gremlin.go | 8 ++- .../gremlin-javascript/test/cucumber/gremlin.js| 8 ++- gremlin-python/src/main/python/radish/gremlin.py | 8 ++- .../gremlin/test/features/map/MergeEdge.feature| 77 -- .../gremlin/test/features/map/MergeVertex.feature | 48 -- 11 files changed, 202 insertions(+), 25 deletions(-) diff --cc gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index 873667a1a2,bf7e01c810..e520b2b328 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@@ -962,17 -741,9 +964,19 @@@ namespace Gremlin.Net.IntegrationTest.G {"g_mergeV_hidden_label_value_onCreate_prohibited", new List, ITraversal>> {(g,p) =>g.MergeV((IDictionary) new Dictionary {}).Option(Merge.OnCreate, (IDictionary) p["xx1"])}}, {"g_mergeV_hidden_id_key_onMatch_matched_prohibited", new List, ITraversal>> {(g,p) =>g.AddV("vertex"), (g,p) =>g.MergeV((IDictionary) new Dictionary {}).Option(Merge.OnMatch, (IDictionary) p["xx1"])}}, {"g_mergeV_hidden_label_key_matched_onMatch_matched_prohibited", new List, ITraversal>> {(g,p) =>g.AddV("vertex"), (g,p) =>g.MergeV((IDictionary) new Dictionary {}).Option(Merge.OnMatch, (IDictionary) p["xx1"])}}, + {"g_mergeVXname_markoX_optionXonMatch_age_listX33XX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name","marko").Property(Cardinality.List,"age",29).Property(Cardinality.List,"age",31).Property(Cardinality.List,"age",32), (g,p) =>g.MergeV((IDictionary) new Dictionary {{"name", "marko"}}).Option(Merge.OnMatch, (IDictionary) new Dictionary {{"age [...] + {"g_mergeVXname_markoX_optionXonMatch_age_setX33XX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name","marko").Property(Cardinality.List,"age",29).Property(Cardinality.List,"age",31).Property(Cardinality.List,"age",32), (g,p) =>g.MergeV((IDictionary) new Dictionary {{"name", "marko"}}).Option(Merge.OnMatch, (IDictionary) new Dictionary {{"age" [...] + {"g_mergeVXname_markoX_optionXonMatch_age_setX31XX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name","marko").Property(Cardinality.List,"age",29).Property(Cardinality.List,"age",31).Property(Cardinality.List,"age",32), (g,p) =>g.MergeV((IDictionary) new Dictionary {{"name", "marko"}}).Option(Merge.OnMatch, (IDictionary) new Dictionary {{"age" [...] + {"g_mergeVXname_markoX_optionXonMatch_age_singleX33XX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name","marko").Property(Cardinality.List,"age",29).Property(Cardinality.List,"age",31).Property(Cardinality.List,"age",32), (g,p) =>g.MergeV((IDictionary) new Dictionary {{"name", "marko"}}).Option(Merge.OnMatch, (IDictionary) new Dictionary {{"a [...] + {"g_mergeVXname_markoX_optionXonMatch_age_33_singleX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name","marko").Property(Cardinality.List,"age",29).Property(Cardinality.List,"age",31).Property(Cardinality.List,"age",32), (g,p) =>g.MergeV((IDictionary) new Dictionary {{"name", "marko"}}).Option(Merge.OnMatch,new Dictionary {{"age", 33}},Cardinality.Single), [...] + {"g_mergeVXname_markoX_optionXonMatch_name_allen_age_setX31X_singleX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name","marko").Property(Cardinalit
(tinkerpop) branch 3.6-dev updated (f5d8225ca8 -> 196d61920c)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.6-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from f5d8225ca8 Bump System.Text.Json from 8.0.2 to 8.0.3 in /gremlin-dotnet add 196d61920c Added test for select() semantics CTR No new revisions were added by this update. Summary of changes: .../test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go| 1 + .../gremlin-javascript/test/cucumber/gremlin.js | 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../tinkerpop/gremlin/test/features/map/Select.feature | 16 5 files changed, 20 insertions(+)
(tinkerpop) branch 3.7-dev updated (8a71161877 -> cfbeb304cc)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 8a71161877 Merge branch '3.6-dev' into 3.7-dev add 196d61920c Added test for select() semantics CTR add cfbeb304cc Merge branch '3.6-dev' into 3.7-dev No new revisions were added by this update. Summary of changes: .../test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go| 1 + .../gremlin-javascript/test/cucumber/gremlin.js | 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../tinkerpop/gremlin/test/features/map/Select.feature | 16 5 files changed, 20 insertions(+)
(tinkerpop) branch master updated (bd5d4f77ad -> 6c01291d06)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from bd5d4f77ad Merge branch '3.7-dev' new 196d61920c Added test for select() semantics CTR new cfbeb304cc Merge branch '3.6-dev' into 3.7-dev new 6c01291d06 Merge branch '3.7-dev' The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go| 1 + .../gremlin-javascript/test/cucumber/gremlin.js | 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../tinkerpop/gremlin/test/features/map/Select.feature | 16 5 files changed, 20 insertions(+)
(tinkerpop) 02/03: Merge branch '3.6-dev' into 3.7-dev
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 cfbeb304ccabb2d3d0ef48b60685a57eec5fa077 Merge: 8a71161877 196d61920c Author: Stephen Mallette AuthorDate: Thu Mar 14 07:53:00 2024 -0400 Merge branch '3.6-dev' into 3.7-dev .../test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go| 1 + .../gremlin-javascript/test/cucumber/gremlin.js | 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../tinkerpop/gremlin/test/features/map/Select.feature | 16 5 files changed, 20 insertions(+)
(tinkerpop) 01/03: Added test for select() semantics CTR
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 196d61920cee68e54ef488e26ddbeb44a6eeb4a8 Author: Stephen Mallette AuthorDate: Thu Mar 14 07:33:21 2024 -0400 Added test for select() semantics CTR --- .../test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go| 1 + .../gremlin-javascript/test/cucumber/gremlin.js | 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../tinkerpop/gremlin/test/features/map/Select.feature | 16 5 files changed, 20 insertions(+) diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index c44e000bb5..9fc7e76b51 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@ -888,6 +888,7 @@ namespace Gremlin.Net.IntegrationTest.Gherkin {"g_withStrategiesXProductiveByStrategyX_V_asXaX_selectXaX_byXageX", new List, ITraversal>> {(g,p) =>g.WithStrategies(new ProductiveByStrategy(productiveKeys: new List {})).V().As("a").Select("a").By("age")}}, {"g_withSideEffectXk_nullX_injectXxX_selectXkX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("k",null).Inject("x").Select("k")}}, {"g_V_out_in_selectXall_a_a_aX_byXunfold_name_foldX", new List, 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, ITraversal>> {(g,p) =>g.V().As("label").Aggregate(Scope.Local,"x").Select("x").Select("label")}}, {"g_V_shortestPath", new List, ITraversal>> {(g,p) =>g.V().Identity().ShortestPath()}}, {"g_V_both_dedup_shortestPath", new List, ITraversal>> {(g,p) =>g.V().Both().Dedup().ShortestPath()}}, {"g_V_shortestPath_edgesIncluded", new List, 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 babc62777f..d1f6fc1493 100644 --- a/gremlin-go/driver/cucumber/gremlin.go +++ b/gremlin-go/driver/cucumber/gremlin.go @@ -859,6 +859,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_withStrategiesXProductiveByStrategyX_V_asXaX_selectXaX_byXageX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.ProductiveByStrategy(gremlingo.ProductiveByStrategyConfig{ProductiveKeys: []string{}})).V().As("a").Select("a").By("age")}}, "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,
(tinkerpop) 03/03: Merge branch '3.7-dev'
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 6c01291d0694c629fc7733ce5890aab4c714fca0 Merge: bd5d4f77ad cfbeb304cc Author: Stephen Mallette AuthorDate: Thu Mar 14 08:11:49 2024 -0400 Merge branch '3.7-dev' .../test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go| 1 + .../gremlin-javascript/test/cucumber/gremlin.js | 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../tinkerpop/gremlin/test/features/map/Select.feature | 16 5 files changed, 20 insertions(+)
(tinkerpop) 05/07: update golang translation
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 97c2711a12540b18a0bc6332749f3a1c704e900d Author: Valentyn Kahamlyk AuthorDate: Thu Jan 25 16:55:18 2024 -0800 update golang translation --- .../translator/DotNetTranslateVisitor.java | 2 +- .../language/translator/GoTranslateVisitor.java| 19 + .../language/translator/JavaTranslateVisitor.java | 2 +- .../language/translator/GremlinTranslatorTest.java | 13 ++- gremlin-go/driver/cucumber/gremlin.go | 94 +++--- gremlin-go/driver/strategies.go| 6 +- gremlin-go/driver/traversal.go | 19 + gremlin-go/go.mod | 1 - 8 files changed, 102 insertions(+), 54 deletions(-) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java index 273008e9e8..fc027ab3be 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java @@ -191,7 +191,7 @@ public class DotNetTranslateVisitor extends AbstractTranslateVisitor { public Void visitStringLiteralList(final GremlinParser.StringLiteralListContext ctx) { sb.append("new List { "); for (int ix = 0; ix < ctx.getChild(1).getChildCount(); ix++) { -if (ctx.getChild(ix).getChild(ix) instanceof TerminalNode) +if (ctx.getChild(1).getChild(ix) instanceof TerminalNode) continue; visit(ctx.getChild(1).getChild(ix)); if (ix < ctx.getChild(1).getChildCount() - 1) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java index 0835643099..12f60296f9 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java @@ -195,6 +195,23 @@ public class GoTranslateVisitor extends AbstractTranslateVisitor { return null; } +@Override +public Void visitTraversalStrategyArgs_PartitionStrategy(final GremlinParser.TraversalStrategyArgs_PartitionStrategyContext ctx) { +appendStrategyArguments(ctx); + +if (ctx.getChild(0).getText().equals("readPartitions")) { +final int ix = sb.lastIndexOf("ReadPartitions: ["); +if (ix > 0) { +final int endIx = sb.indexOf("\"]", ix); +sb.replace(endIx, endIx + 2, "\")"); +sb.replace(ix, ix + 17, "ReadPartitions: gremlingo.NewSimpleSet("); +} + +} + +return null; +} + @Override public Void visitTraversalCardinality(final GremlinParser.TraversalCardinalityContext ctx) { // handle the enum style of cardinality if there is one child, otherwise it's the function call style @@ -251,6 +268,8 @@ public class GoTranslateVisitor extends AbstractTranslateVisitor { TO_GO_MAP.put("OUT", "Out"); TO_GO_MAP.put("IN", "In"); TO_GO_MAP.put("BOTH", "Both"); +TO_GO_MAP.put("WithOptions", GO_PACKAGE_NAME + "WithOptions"); +TO_GO_MAP.put("IO", GO_PACKAGE_NAME + "IO"); TO_GO_MAP.put("__", GO_PACKAGE_NAME + "T__"); TO_GO_MAP.forEach((k, v) -> FROM_GO_MAP.put(v, k)); } diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java index 2fd5a349fb..480a1b5fa3 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java @@ -227,7 +227,7 @@ public class JavaTranslateVisitor extends AbstractTranslateVisitor { public Void visitStringLiteralList(final GremlinParser.StringLiteralListContext ctx) { sb.append("new ArrayList() {{ "); for (int ix = 0; ix < ctx.getChild(1).getChildCount(); ix++) { -if (ctx.getChild(ix).getChild(ix) instanceof TerminalNode) +if (ctx.getChild(1).getChild(ix) instance
(tinkerpop) 06/07: Removed breaking change on SeedStrategy and tucked in some javadoc
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit b0e59f679d0829c7add7b225c81ab4bacf4aa70f Author: Stephen Mallette AuthorDate: Fri Jan 26 08:00:20 2024 -0500 Removed breaking change on SeedStrategy and tucked in some javadoc --- CHANGELOG.asciidoc | 3 +-- .../language/translator/TranslateVisitor.java | 1 - .../gremlin/language/translator/Translator.java| 2 +- .../language/translator/TranslatorException.java | 3 +++ .../strategy/decoration/SeedStrategy.java | 13 +++- gremlin-go/driver/cucumber/gremlin.go | 24 +++--- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 19121a1445..f299d198b0 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,8 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 4.0.0 (NOT OFFICIALLY RELEASED YET) * Added support for deserialization of `Set` for `gremlin-javascript`. -* Made `SeedStrategy` construction consistent with the builder pattern and removed the public constructor. -* Added grammar-based `Translator`. +* Added grammar-based `Translator` for all languages including explicit ones for Java and anonymization. * Added integer overflow checks for `sum()`. * Gremlin Server only supports instantiation of `authentication.authenticationHandler` with three-arg constructor. * Removed previously deprecated two-arg constructors for `authentication.authenticationHandler` implementations. diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java index 41d0849dd3..27e68d818f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslateVisitor.java @@ -49,7 +49,6 @@ import java.util.Set; * Makes anonymous traversals explicit with double underscore * Makes enums explicit with their proper name * - * */ public class TranslateVisitor extends AbstractParseTreeVisitor implements GremlinVisitor { diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java index fdf6d35073..0712599835 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/Translator.java @@ -64,7 +64,7 @@ public enum Translator { * Translates to gremlin-python. */ PYTHON("Python", PythonTranslateVisitor::new), -//GROOVY("Groovy", "org.apache.tinkerpop.gremlin.language.translator.GroovyTranslateVisitor"), + ; private final String name; diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java index da59614876..524aa8a81a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/TranslatorException.java @@ -18,6 +18,9 @@ */ package org.apache.tinkerpop.gremlin.language.translator; +/** + * Exception produced by the {@link Translator} when it encounters an error. + */ public class TranslatorException extends RuntimeException { public TranslatorException(final String message) { super(message); diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java index 15f6f3c7e5..3584cc69c0 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SeedStrategy.java @@ -44,7 +44,11 @@ public class SeedStrategy extends AbstractTraversalStrategy
(tinkerpop) 02/07: groovy
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit f37cd7ce5df70cbb06e3b0397c69edbe7fcc7c27 Author: Stephen Mallette AuthorDate: Wed Jan 3 08:32:02 2024 -0500 groovy --- .../translator/GroovyTranslateVisitor.java | 116 +++ .../language/translator/JavaTranslateVisitor.java | 2 + .../translator/JavascriptTranslateVisitor.java | 10 ++ .../translator/PythonTranslateVisitor.java | 1 + .../language/translator/TranslateVisitor.java | 5 +- .../gremlin/language/translator/Translator.java| 5 + .../language/translator/GremlinTranslatorTest.java | 128 +++-- .../tinkerpop/gremlin/features/StepDefinition.java | 8 +- 8 files changed, 262 insertions(+), 13 deletions(-) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java new file mode 100644 index 00..44e7d2d56f --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java @@ -0,0 +1,116 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tinkerpop.gremlin.language.translator; + +import org.apache.tinkerpop.gremlin.language.grammar.GremlinParser; + +/** + * Converts a Gremlin traversal string into a Groovy source code representation of that traversal with an aim at + * sacrificing some formatting for the ability to compile correctly. The translations may require use of TinkerPop's + * sugar syntax and therefore requires use of the {@code GremlinLoader} in the gremlin-groovy module unless you are + * specifically certain that your translations will not result in the use of that syntax. If in doubt, prefer the + * {@link JavaTranslateVisitor} instead. + * + * Normalize numeric suffixes to lower case + * If floats are not suffixed they will translate as BigDecimal + * Makes anonymous traversals explicit with double underscore + * Makes enums explicit with their proper name + * + */ +public class GroovyTranslateVisitor extends TranslateVisitor { +public GroovyTranslateVisitor() { +this("g"); +} + +public GroovyTranslateVisitor(final String graphTraversalSourceName) { +super(graphTraversalSourceName); +} + +@Override +public Void visitStructureVertex(final GremlinParser.StructureVertexContext ctx) { +sb.append("new DetachedVertex("); +visit(ctx.getChild(3)); // id +sb.append(", "); +visit(ctx.getChild(5)); // label +sb.append(")"); +return null; +} + +@Override +public Void visitIntegerLiteral(final GremlinParser.IntegerLiteralContext ctx) { +final String integerLiteral = ctx.getText().toLowerCase(); + +// check suffix +final int lastCharIndex = integerLiteral.length() - 1; +final char lastCharacter = integerLiteral.charAt(lastCharIndex); +switch (lastCharacter) { +case 'b': +// parse B/b as byte +sb.append("new Byte("); +sb.append(integerLiteral, 0, lastCharIndex); +sb.append(")"); +break; +case 's': +// parse S/s as short +sb.append("new Short("); +sb.append(integerLiteral, 0, lastCharIndex); +sb.append(")"); +break; +case 'i': +case 'l': +// parse I/i and L/l as Integer and Long respectively +sb.append(integerLiteral, 0, lastCharIndex).append(lastCharacter); +break; +case 'n': +// parse N/n as BigInteger which for groovy is "g" shorthand +sb.append(integerLiteral, 0, lastCharIndex).append("g"); +break; +default: +
(tinkerpop) branch TINKERPOP-3028 updated (9e7b9e763d -> bcbed02f53)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-3028 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git discard 9e7b9e763d Removed breaking change on SeedStrategy and tucked in some javadoc discard 05bbf199b7 update golang translation discard a36c9af585 wip for Go discard e08eb031ce .NET discard c87bc398d6 groovy discard c884ef359c TINKERPOP-3028 Translators using grammar add 804eeab954 TINKERPOP-2456 Added a few language tests CTR add 6d99fca4bc Merge branch '3.7-dev' add 936258e052 Regenerate tests after merge CTR add 1a00f1ae33 Bump eslint-plugin-prettier (#2434) add 2f2a08a0ac Bump chai in /gremlin-javascript/src/main/javascript/gremlin-javascript (#2437) add 325055b472 Bump prettier from 3.1.0 to 3.2.4 in /gremlint (#2451) add d78b35e9c9 Bump prettier (#2453) add a6c8108a5a Bump actions/cache from 3 to 4 (#2456) add 8ef689557e Bump github.com/google/uuid from 1.5.0 to 1.6.0 in /gremlin-go (#2457) add d2303d5fad Bump @types/node from 20.10.3 to 20.11.10 in /gremlint (#2463) add c0d704cb37 Merge branch '3.6-dev' into 3.7-dev add 573ff8e8bd Merge branch '3.7-dev' add d3b7aa942e Fix test that wasn't parameterized CTR add c32d0cdf4c Merge branch '3.7-dev' add 963bece33c Loosen error message validation a bit by ignoring case. add a2b2550838 TINKERPOP-3045: EarlyLimitStrategy is too aggresive to promote Limit and thus causing incorrect results https://issues.apache.org/jira/browse/TINKERPOP-3045 add 0d119be3bb Follow-on to #2475 to fixup compile/test issues CTR add 6bfb0365f1 Merge branch '3.6-dev' into 3.7-dev add b282194056 Merge branch '3.7-dev' add 66db18e17a TINKERPOP-3049 Fixed Cardinality function in onCreate add b837fc7eb2 Merge branch '3.7-dev' add 809a20986c Remove minor syntax error in feature file CTR add fae51e87e7 Merge branch '3.7-dev' add c7f3d2454a Drop use of unmodifiable map in arity predictor CTR add d804e4a3b9 Merge branch '3.6-dev' into 3.7-dev add 55a7b7f256 Merge branch '3.7-dev' add 4e8a8f95fa Bumped patch/minors in examples for python CTR add e4ea40ffe9 Merge branch '3.6-dev' into 3.7-dev add c56e91738a Merge branch '3.7-dev' add 9c9266b350 Bump org.codehaus.mojo:exec-maven-plugin from 1.2.1 to 3.1.1 add 2d9fabf3bc Merge branch 'pr-2353' add d7c2a7913b TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch add d9e34fb467 Merge branch 'TINKERPOP-3056' into 3.6-dev add 9b46b6777d Merge branch '3.6-dev' into 3.7-dev add 2d32517b3b Merge branch '3.7-dev' add d862355334 Bump codecov/codecov-action from 3 to 4 (#2472) add 01de8868c7 Merge branch '3.6-dev' into 3.7-dev add 9c1c9fa033 Merge branch '3.7-dev' add 42c40110b7 Bump Polly from 8.2.1 to 8.3.0 in /gremlin-dotnet add d55a9b9a8a Merge branch 'dependabot/nuget/gremlin-dotnet/3.6-dev/Polly-8.3.0' into 3.6-dev add 26184669dc Bump Microsoft.NET.Test.Sdk from 17.8.0 to 17.9.0 in /gremlin-dotnet add 259296b5b6 Merge branch 'dependabot/nuget/gremlin-dotnet/3.6-dev/Microsoft.NET.Test.Sdk-17.9.0' into 3.6-dev add f8d69f2779 Merge branch '3.6-dev' into 3.7-dev add 546d219c6d Merge branch '3.7-dev' add d4892ada54 TINKERPOP-3031 Fixed bug in translation of g.tx() options add acc8fd347d Merge branch 'TINKERPOP-3031' into 3.6-dev add 9aff7bb8fe Merge branch '3.6-dev' into 3.7-dev add a8b6b1bf96 Merge branch '3.7-dev' add 2370cfca18 TINKERPOP-2862 Added withoutStrategies syntax to grammar add 8e8d7f16a1 Merge pull request #2483 from apache/TINKERPOP-2862 add 2c0ce57ecb TINKERPOP-3030 Update to .NET 8 add e0c0735232 Merge branch 'TINKERPOP-3030' into 3.6-dev add 140339aa3e Merge branch '3.6-dev' into 3.7-dev add d3d971b0d6 Merge branch '3.7-dev' add 8f2fdcb500 Bump System.Text.Json from 8.0.1 to 8.0.2 in /gremlin-dotnet add 234d140b53 Merge branch 'dependabot/nuget/gremlin-dotnet/3.6-dev/System.Text.Json-8.0.2' into 3.6-dev add aeedc575cd Bump xunit from 2.6.6 to 2.7.0 in /gremlin-dotnet add ef27d69b7f Merge branch 'dependabot/nuget/gremlin-dotnet/3.6-dev/xunit-2.7.0' into 3.6-dev add 35cc1592ae Bump gherkin from 27.0.0 to 28.0.0 in /gremlin-dotnet add 22791ceaa0 Merge branch 'dependabot/nuget/gremlin-dotnet/3.6-dev/gherkin-28.0.0' into 3.6-dev add bf63fcb181 Bump xunit.runner.visualstudio from 2.5.6 to 2.5.7 in /gremlin-dotnet add bdf91a77f0 Merge branch 'dependabot/nuget/gremlin-dotnet/3.6-dev/xunit.runner.visualstudio-2.5.7' into 3.6-dev add a919b90ebe Merge branch '3.6-dev' into 3.7-dev add ada49fa41d Merge branch '3.7-dev' add a8f90ea959 Remove gremlin-archetype (#2486) add 98236ba70a Squash of 3 docs/gremlint dependabots add b7115b57d3 Bump eslint (#2507) add af5c9148b6 Bump mocha in /gremlin
(tinkerpop) 03/03: Merge branch '3.7-dev'
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 d52b0b1217ae1425b327e2841b3bb5928dc5c95a Merge: 03e9f24f06 06af2ec6d5 Author: Stephen Mallette AuthorDate: Mon Mar 4 12:55:15 2024 -0500 Merge branch '3.7-dev' CHANGELOG.asciidoc| 1 + .../traversal/strategy/optimization/PathRetractionStrategy.java | 4 2 files changed, 5 insertions(+)
(tinkerpop) branch 3.6-dev updated (1efe40b288 -> beb1a5f35d)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.6-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 1efe40b288 TINKERPOP-3054 Fix requestId Deserialization in `gremlin-python` (#2494) add beb1a5f35d Improve performance of PathRetractionStrategy No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc| 1 + .../traversal/strategy/optimization/PathRetractionStrategy.java | 4 2 files changed, 5 insertions(+)
(tinkerpop) branch master updated (03e9f24f06 -> d52b0b1217)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 03e9f24f06 Merge branch '3.7-dev' new beb1a5f35d Improve performance of PathRetractionStrategy new 06af2ec6d5 Merge branch '3.6-dev' into 3.7-dev new d52b0b1217 Merge branch '3.7-dev' The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CHANGELOG.asciidoc| 1 + .../traversal/strategy/optimization/PathRetractionStrategy.java | 4 2 files changed, 5 insertions(+)
(tinkerpop) 02/03: Merge branch '3.6-dev' into 3.7-dev
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 06af2ec6d58d5727ebc9c70f85bc4a199273d9ce Merge: cc9b3cf02c beb1a5f35d Author: Stephen Mallette AuthorDate: Mon Mar 4 12:55:03 2024 -0500 Merge branch '3.6-dev' into 3.7-dev CHANGELOG.asciidoc| 1 + .../traversal/strategy/optimization/PathRetractionStrategy.java | 4 2 files changed, 5 insertions(+)
(tinkerpop) branch 3.7-dev updated (cc9b3cf02c -> 06af2ec6d5)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from cc9b3cf02c Merge branch '3.6-dev' into 3.7-dev add beb1a5f35d Improve performance of PathRetractionStrategy add 06af2ec6d5 Merge branch '3.6-dev' into 3.7-dev No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc| 1 + .../traversal/strategy/optimization/PathRetractionStrategy.java | 4 2 files changed, 5 insertions(+)
(tinkerpop) 01/03: Improve performance of PathRetractionStrategy
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 beb1a5f35d27e0e76d3a75f2cceb6546b503b297 Author: Stephen Mallette AuthorDate: Fri Mar 1 09:25:09 2024 -0500 Improve performance of PathRetractionStrategy Helpful for traversals with lots of children where labels don't need to propagate. CTR --- CHANGELOG.asciidoc| 1 + .../traversal/strategy/optimization/PathRetractionStrategy.java | 4 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 6f2e3d63c3..e6f71e13bc 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Fixed a bug in Gremlin.Net for .NET 8 that led to exceptions: `InvalidOperationException: Enumeration has not started. Call MoveNext.` * Fixed message requestId serialization in `gremlin-python`. +* Improved performance of `PathRetractionStrategy` for traversals that carry many children, but don't hold many labels to propogate. * Fixed bug in bytecode translation of `g.tx().commit()` and `g.tx().rollback()` in all languages. * Improved error message from `JavaTranslator` by including exception source. * Added missing `short` serialization (`gx:Int16`) to GraphSONV2 and GraphSONV3 in `gremlin-python`. diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java index cd29b28820..fc4e845797 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java @@ -249,6 +249,10 @@ public final class PathRetractionStrategy extends AbstractTraversalStrategy keepLabels, final List> children) { +// if there are no labels to keep, then there no need to iterate all the children because we won't be +// adding anything PathProcessor keepLabels - avoids the added recursion +if (keepLabels.isEmpty()) return; + for (final Traversal.Admin child : children) { TraversalHelper.applyTraversalRecursively(trav -> addLabels(trav, keepLabels), child); }
(tinkerpop) 01/01: Improve performance of PathRetractionStrategy
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch 3.6-pathretraction in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 961699659fc69a6ba5418e24c00fd27ba11bc14a Author: Stephen Mallette AuthorDate: Fri Mar 1 09:25:09 2024 -0500 Improve performance of PathRetractionStrategy Helpful for traversals with lots of children where labels don't need to propagate. CTR --- CHANGELOG.asciidoc| 1 + .../traversal/strategy/optimization/PathRetractionStrategy.java | 4 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 6f2e3d63c3..e6f71e13bc 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Fixed a bug in Gremlin.Net for .NET 8 that led to exceptions: `InvalidOperationException: Enumeration has not started. Call MoveNext.` * Fixed message requestId serialization in `gremlin-python`. +* Improved performance of `PathRetractionStrategy` for traversals that carry many children, but don't hold many labels to propogate. * Fixed bug in bytecode translation of `g.tx().commit()` and `g.tx().rollback()` in all languages. * Improved error message from `JavaTranslator` by including exception source. * Added missing `short` serialization (`gx:Int16`) to GraphSONV2 and GraphSONV3 in `gremlin-python`. diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java index cd29b28820..fc4e845797 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java @@ -249,6 +249,10 @@ public final class PathRetractionStrategy extends AbstractTraversalStrategy keepLabels, final List> children) { +// if there are no labels to keep, then there no need to iterate all the children because we won't be +// adding anything PathProcessor keepLabels - avoids the added recursion +if (keepLabels.isEmpty()) return; + for (final Traversal.Admin child : children) { TraversalHelper.applyTraversalRecursively(trav -> addLabels(trav, keepLabels), child); }
(tinkerpop) branch 3.6-pathretraction created (now 961699659f)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.6-pathretraction in repository https://gitbox.apache.org/repos/asf/tinkerpop.git at 961699659f Improve performance of PathRetractionStrategy This branch includes the following new commits: new 961699659f Improve performance of PathRetractionStrategy The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
(tinkerpop) branch TINKERPOP-2862 deleted (was 2370cfca18)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-2862 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git was 2370cfca18 TINKERPOP-2862 Added withoutStrategies syntax to grammar The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
(tinkerpop) branch master updated (a8b6b1bf96 -> 8e8d7f16a1)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from a8b6b1bf96 Merge branch '3.7-dev' add 2370cfca18 TINKERPOP-2862 Added withoutStrategies syntax to grammar new 8e8d7f16a1 Merge pull request #2483 from apache/TINKERPOP-2862 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CHANGELOG.asciidoc | 3 + docs/src/upgrade/release-4.x.x.asciidoc| 39 +++- .../grammar/DefaultGremlinBaseVisitor.java | 63 +++--- .../language/grammar/GenericLiteralVisitor.java| 2 + .../grammar/TraversalSourceSelfMethodVisitor.java | 19 +- .../language/grammar/TraversalStrategyVisitor.java | 169 +- .../process/traversal/TraversalStrategies.java | 93 +++- .../traversal/translator/PythonTranslator.java | 2 +- .../GremlinDisabledListDelimiterHandler.java} | 32 ++- .../grammar/GeneralLiteralVisitorTest.java | 1 + .../TraversalSourceSelfMethodVisitorTest.java | 11 +- .../grammar/TraversalStrategyVisitorTest.java | 6 + gremlin-dotnet/build/generate.groovy | 2 +- .../Gherkin/GherkinTestRunner.cs | 3 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/build/generate.groovy | 1 + gremlin-go/driver/cucumber/gremlin.go | 1 + .../test/cucumber/feature-steps.js | 2 + .../gremlin-javascript/test/cucumber/gremlin.js| 1 + gremlin-language/src/main/antlr4/Gremlin.g4| 242 + gremlin-python/build/generate.groovy | 2 +- .../src/main/python/radish/feature_steps.py| 4 +- gremlin-python/src/main/python/radish/gremlin.py | 3 +- .../test/features/integrated/Miscellaneous.feature | 12 + 24 files changed, 396 insertions(+), 318 deletions(-) copy gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/{process/traversal/step/map/ElementStep.java => util/GremlinDisabledListDelimiterHandler.java} (50%)
(tinkerpop) 01/01: Merge pull request #2483 from apache/TINKERPOP-2862
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 8e8d7f16a13f097d2799aa93a48e5b169bb23556 Merge: a8b6b1bf96 2370cfca18 Author: Stephen Mallette AuthorDate: Fri Feb 16 11:48:25 2024 -0500 Merge pull request #2483 from apache/TINKERPOP-2862 TINKERPOP-2862 Added withoutStrategies syntax to grammar CHANGELOG.asciidoc | 3 + docs/src/upgrade/release-4.x.x.asciidoc| 39 +++- .../grammar/DefaultGremlinBaseVisitor.java | 63 +++--- .../language/grammar/GenericLiteralVisitor.java| 2 + .../grammar/TraversalSourceSelfMethodVisitor.java | 19 +- .../language/grammar/TraversalStrategyVisitor.java | 169 +- .../process/traversal/TraversalStrategies.java | 93 +++- .../traversal/translator/PythonTranslator.java | 2 +- .../util/GremlinDisabledListDelimiterHandler.java | 46 .../grammar/GeneralLiteralVisitorTest.java | 1 + .../TraversalSourceSelfMethodVisitorTest.java | 11 +- .../grammar/TraversalStrategyVisitorTest.java | 6 + gremlin-dotnet/build/generate.groovy | 2 +- .../Gherkin/GherkinTestRunner.cs | 3 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/build/generate.groovy | 1 + gremlin-go/driver/cucumber/gremlin.go | 1 + .../test/cucumber/feature-steps.js | 2 + .../gremlin-javascript/test/cucumber/gremlin.js| 1 + gremlin-language/src/main/antlr4/Gremlin.g4| 242 + gremlin-python/build/generate.groovy | 2 +- .../src/main/python/radish/feature_steps.py| 4 +- gremlin-python/src/main/python/radish/gremlin.py | 3 +- .../test/features/integrated/Miscellaneous.feature | 12 + 24 files changed, 428 insertions(+), 300 deletions(-)
(tinkerpop) branch TINKERPOP-3031 deleted (was d4892ada54)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-3031 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git was d4892ada54 TINKERPOP-3031 Fixed bug in translation of g.tx() options The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
(tinkerpop) branch 3.7-dev updated (f8d69f2779 -> 9aff7bb8fe)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from f8d69f2779 Merge branch '3.6-dev' into 3.7-dev add d4892ada54 TINKERPOP-3031 Fixed bug in translation of g.tx() options add acc8fd347d Merge branch 'TINKERPOP-3031' into 3.6-dev add 9aff7bb8fe Merge branch '3.6-dev' into 3.7-dev No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/GraphOp.java | 7 +-- .../traversal/dsl/graph/GraphTraversalSource.java | 1 + .../traversal/translator/DotNetTranslator.java | 4 .../traversal/translator/GolangTranslator.java | 21 + .../traversal/translator/GroovyTranslator.java | 5 - .../traversal/translator/JavascriptTranslator.java | 4 .../traversal/translator/PythonTranslator.java | 6 +- .../process/traversal/util/BytecodeHelper.java | 1 + .../tinkerpop/gremlin/structure/Transaction.java| 14 ++ .../traversal/translator/DotNetTranslatorTest.java | 9 + .../traversal/translator/GolangTranslatorTest.java | 9 + .../traversal/translator/GroovyTranslatorTest.java | 9 + .../translator/JavascriptTranslatorTest.java| 9 + .../traversal/translator/PythonTranslatorTest.java | 9 + 15 files changed, 97 insertions(+), 12 deletions(-)
(tinkerpop) branch master updated (546d219c6d -> a8b6b1bf96)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 546d219c6d Merge branch '3.7-dev' add d4892ada54 TINKERPOP-3031 Fixed bug in translation of g.tx() options new acc8fd347d Merge branch 'TINKERPOP-3031' into 3.6-dev new 9aff7bb8fe Merge branch '3.6-dev' into 3.7-dev new a8b6b1bf96 Merge branch '3.7-dev' The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/GraphOp.java | 7 +-- .../traversal/dsl/graph/GraphTraversalSource.java | 1 + .../traversal/translator/DotNetTranslator.java | 4 .../traversal/translator/GolangTranslator.java | 21 + .../traversal/translator/GroovyTranslator.java | 5 - .../traversal/translator/JavascriptTranslator.java | 4 .../traversal/translator/PythonTranslator.java | 6 +- .../process/traversal/util/BytecodeHelper.java | 1 + .../tinkerpop/gremlin/structure/Transaction.java| 14 ++ .../traversal/translator/DotNetTranslatorTest.java | 9 + .../traversal/translator/GolangTranslatorTest.java | 9 + .../traversal/translator/GroovyTranslatorTest.java | 9 + .../translator/JavascriptTranslatorTest.java| 9 + .../traversal/translator/PythonTranslatorTest.java | 9 + 15 files changed, 97 insertions(+), 12 deletions(-)
(tinkerpop) branch 3.6-dev updated (259296b5b6 -> acc8fd347d)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.6-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 259296b5b6 Merge branch 'dependabot/nuget/gremlin-dotnet/3.6-dev/Microsoft.NET.Test.Sdk-17.9.0' into 3.6-dev add d4892ada54 TINKERPOP-3031 Fixed bug in translation of g.tx() options add acc8fd347d Merge branch 'TINKERPOP-3031' into 3.6-dev No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/GraphOp.java | 7 +-- .../traversal/dsl/graph/GraphTraversalSource.java | 1 + .../traversal/translator/DotNetTranslator.java | 4 .../traversal/translator/GolangTranslator.java | 21 + .../traversal/translator/GroovyTranslator.java | 5 - .../traversal/translator/JavascriptTranslator.java | 4 .../traversal/translator/PythonTranslator.java | 6 +- .../process/traversal/util/BytecodeHelper.java | 1 + .../tinkerpop/gremlin/structure/Transaction.java| 14 ++ .../traversal/translator/DotNetTranslatorTest.java | 9 + .../traversal/translator/GolangTranslatorTest.java | 9 + .../traversal/translator/GroovyTranslatorTest.java | 9 + .../translator/JavascriptTranslatorTest.java| 9 + .../traversal/translator/PythonTranslatorTest.java | 9 + 15 files changed, 97 insertions(+), 12 deletions(-)
(tinkerpop) 01/03: Merge branch 'TINKERPOP-3031' into 3.6-dev
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 acc8fd347dfc1f950004e19bc9ad12494563cf6f Merge: 259296b5b6 d4892ada54 Author: Stephen Mallette AuthorDate: Fri Feb 16 08:12:15 2024 -0500 Merge branch 'TINKERPOP-3031' into 3.6-dev CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/GraphOp.java | 7 +-- .../traversal/dsl/graph/GraphTraversalSource.java | 1 + .../traversal/translator/DotNetTranslator.java | 4 .../traversal/translator/GolangTranslator.java | 21 + .../traversal/translator/GroovyTranslator.java | 5 - .../traversal/translator/JavascriptTranslator.java | 4 .../traversal/translator/PythonTranslator.java | 6 +- .../process/traversal/util/BytecodeHelper.java | 1 + .../tinkerpop/gremlin/structure/Transaction.java| 14 ++ .../traversal/translator/DotNetTranslatorTest.java | 9 + .../traversal/translator/GolangTranslatorTest.java | 9 + .../traversal/translator/GroovyTranslatorTest.java | 9 + .../translator/JavascriptTranslatorTest.java| 9 + .../traversal/translator/PythonTranslatorTest.java | 9 + 15 files changed, 97 insertions(+), 12 deletions(-)
(tinkerpop) 03/03: Merge branch '3.7-dev'
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 a8b6b1bf96b2cdbad5d84f0a4a2bf71dfe5d1495 Merge: 546d219c6d 9aff7bb8fe Author: Stephen Mallette AuthorDate: Fri Feb 16 08:50:52 2024 -0500 Merge branch '3.7-dev' CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/GraphOp.java | 7 +-- .../traversal/dsl/graph/GraphTraversalSource.java | 1 + .../traversal/translator/DotNetTranslator.java | 4 .../traversal/translator/GolangTranslator.java | 21 + .../traversal/translator/GroovyTranslator.java | 5 - .../traversal/translator/JavascriptTranslator.java | 4 .../traversal/translator/PythonTranslator.java | 6 +- .../process/traversal/util/BytecodeHelper.java | 1 + .../tinkerpop/gremlin/structure/Transaction.java| 14 ++ .../traversal/translator/DotNetTranslatorTest.java | 9 + .../traversal/translator/GolangTranslatorTest.java | 9 + .../traversal/translator/GroovyTranslatorTest.java | 9 + .../translator/JavascriptTranslatorTest.java| 9 + .../traversal/translator/PythonTranslatorTest.java | 9 + 15 files changed, 97 insertions(+), 12 deletions(-)
(tinkerpop) 02/03: Merge branch '3.6-dev' into 3.7-dev
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 9aff7bb8fe2467c63553ca76b417088c12394c8c Merge: f8d69f2779 acc8fd347d Author: Stephen Mallette AuthorDate: Fri Feb 16 08:13:28 2024 -0500 Merge branch '3.6-dev' into 3.7-dev CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/GraphOp.java | 7 +-- .../traversal/dsl/graph/GraphTraversalSource.java | 1 + .../traversal/translator/DotNetTranslator.java | 4 .../traversal/translator/GolangTranslator.java | 21 + .../traversal/translator/GroovyTranslator.java | 5 - .../traversal/translator/JavascriptTranslator.java | 4 .../traversal/translator/PythonTranslator.java | 6 +- .../process/traversal/util/BytecodeHelper.java | 1 + .../tinkerpop/gremlin/structure/Transaction.java| 14 ++ .../traversal/translator/DotNetTranslatorTest.java | 9 + .../traversal/translator/GolangTranslatorTest.java | 9 + .../traversal/translator/GroovyTranslatorTest.java | 9 + .../translator/JavascriptTranslatorTest.java| 9 + .../traversal/translator/PythonTranslatorTest.java | 9 + 15 files changed, 97 insertions(+), 12 deletions(-) diff --cc gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/translator/DotNetTranslatorTest.java index 6662de2347,f6c6b51c50..25db43d592 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/translator/DotNetTranslatorTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/translator/DotNetTranslatorTest.java @@@ -278,64 -274,14 +279,72 @@@ public class DotNetTranslatorTest script4); } +@Test +public void shouldTranslateStringFunctionWithAndWithoutScopes(){ +assertEquals("g.Inject(1).AsString()", + translator.translate(g.inject(1).asString().asAdmin().getBytecode()).getScript()); +assertEquals("g.Inject(1).AsString(Scope.Local)", + translator.translate(g.inject(1).asString(Scope.local).asAdmin().getBytecode()).getScript()); + +assertEquals("g.Inject(\"hello\").Length()", + translator.translate(g.inject("hello").length().asAdmin().getBytecode()).getScript()); +assertEquals("g.Inject(\"hello\").Length(Scope.Local)", + translator.translate(g.inject("hello").length(Scope.local).asAdmin().getBytecode()).getScript()); + +assertEquals("g.Inject(\"hello\").LTrim()", + translator.translate(g.inject("hello").lTrim().asAdmin().getBytecode()).getScript()); +assertEquals("g.Inject(\"hello\").LTrim(Scope.Local)", + translator.translate(g.inject("hello").lTrim(Scope.local).asAdmin().getBytecode()).getScript()); + +assertEquals("g.Inject(\"hello\").RTrim()", + translator.translate(g.inject("hello").rTrim().asAdmin().getBytecode()).getScript()); +assertEquals("g.Inject(\"hello\").RTrim(Scope.Local)", + translator.translate(g.inject("hello").rTrim(Scope.local).asAdmin().getBytecode()).getScript()); + +assertEquals("g.Inject(\"hello\").ToUpper()", + translator.translate(g.inject("hello").toUpper().asAdmin().getBytecode()).getScript()); +assertEquals("g.Inject(\"hello\").ToUpper(Scope.Local)", + translator.translate(g.inject("hello").toUpper(Scope.local).asAdmin().getBytecode()).getScript()); + +assertEquals("g.Inject(\"hello\").ToLower()", + translator.translate(g.inject("hello").toLower().asAdmin().getBytecode()).getScript()); +assertEquals("g.Inject(\"hello\").ToLower(Scope.Local)", + translator.translate(g.inject("hello").toLower(Scope.local).asAdmin().getBytecode()).getScript()); + +assertEquals("g.Inject(\"hello\").Trim()", + translator.translate(g.inject("hello").trim().asAdmin().getBytecode()).getScript()); +assertEquals("g.Inject(\"hello\").Trim(Scope.Local)", + translator.translate(g.inject("hello").trim(Scope.local).asAdmin().getBytecode()).getScript()); + +assertEquals("g.Inject(\"hello\").Replace(\"o\",\"a\")", +translator.translate(g.inject("hello").replace("o", "a")
(tinkerpop) branch TINKERPOP-3056 deleted (was d7c2a7913b)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-3056 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git was d7c2a7913b TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
(tinkerpop) branch 3.6-dev updated (4e8a8f95fa -> d9e34fb467)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.6-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 4e8a8f95fa Bumped patch/minors in examples for python CTR add d7c2a7913b TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch add d9e34fb467 Merge branch 'TINKERPOP-3056' into 3.6-dev No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc | 1 + .../process/traversal/step/map/MergeEdgeStep.java | 6 ++-- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 2 ++ gremlin-go/driver/cucumber/gremlin.go | 2 ++ .../gremlin-javascript/test/cucumber/gremlin.js| 2 ++ gremlin-python/src/main/python/radish/gremlin.py | 2 ++ .../gremlin/test/features/map/MergeEdge.feature| 42 ++ 7 files changed, 54 insertions(+), 3 deletions(-)
(tinkerpop) branch 3.7-dev updated (e4ea40ffe9 -> 9b46b6777d)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from e4ea40ffe9 Merge branch '3.6-dev' into 3.7-dev add d7c2a7913b TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch add d9e34fb467 Merge branch 'TINKERPOP-3056' into 3.6-dev add 9b46b6777d Merge branch '3.6-dev' into 3.7-dev No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc | 1 + .../process/traversal/step/map/MergeEdgeStep.java | 6 ++-- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 2 ++ gremlin-go/driver/cucumber/gremlin.go | 2 ++ .../gremlin-javascript/test/cucumber/gremlin.js| 2 ++ gremlin-python/src/main/python/radish/gremlin.py | 2 ++ .../gremlin/test/features/map/MergeEdge.feature| 42 ++ 7 files changed, 54 insertions(+), 3 deletions(-)
(tinkerpop) branch master updated (2d9fabf3bc -> 2d32517b3b)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 2d9fabf3bc Merge branch 'pr-2353' add d7c2a7913b TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch new d9e34fb467 Merge branch 'TINKERPOP-3056' into 3.6-dev new 9b46b6777d Merge branch '3.6-dev' into 3.7-dev new 2d32517b3b Merge branch '3.7-dev' The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CHANGELOG.asciidoc | 1 + .../process/traversal/step/map/MergeEdgeStep.java | 6 ++-- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 2 ++ gremlin-go/driver/cucumber/gremlin.go | 2 ++ .../gremlin-javascript/test/cucumber/gremlin.js| 2 ++ gremlin-python/src/main/python/radish/gremlin.py | 2 ++ .../gremlin/test/features/map/MergeEdge.feature| 42 ++ 7 files changed, 54 insertions(+), 3 deletions(-)
(tinkerpop) 03/03: Merge branch '3.7-dev'
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 2d32517b3bca1b00d716b3205c2abdbcd6ed3352 Merge: 2d9fabf3bc 9b46b6777d Author: Stephen Mallette AuthorDate: Tue Feb 13 15:33:42 2024 -0500 Merge branch '3.7-dev' CHANGELOG.asciidoc | 1 + .../process/traversal/step/map/MergeEdgeStep.java | 6 ++-- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 2 ++ gremlin-go/driver/cucumber/gremlin.go | 2 ++ .../gremlin-javascript/test/cucumber/gremlin.js| 2 ++ gremlin-python/src/main/python/radish/gremlin.py | 2 ++ .../gremlin/test/features/map/MergeEdge.feature| 42 ++ 7 files changed, 54 insertions(+), 3 deletions(-)
(tinkerpop) 02/03: Merge branch '3.6-dev' into 3.7-dev
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 9b46b6777d2fa250e41daacf2fa4554605aff53a Merge: e4ea40ffe9 d9e34fb467 Author: Stephen Mallette AuthorDate: Tue Feb 13 15:17:32 2024 -0500 Merge branch '3.6-dev' into 3.7-dev CHANGELOG.asciidoc | 1 + .../process/traversal/step/map/MergeEdgeStep.java | 6 ++-- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 2 ++ gremlin-go/driver/cucumber/gremlin.go | 2 ++ .../gremlin-javascript/test/cucumber/gremlin.js| 2 ++ gremlin-python/src/main/python/radish/gremlin.py | 2 ++ .../gremlin/test/features/map/MergeEdge.feature| 42 ++ 7 files changed, 54 insertions(+), 3 deletions(-)
(tinkerpop) 01/03: Merge branch 'TINKERPOP-3056' into 3.6-dev
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 d9e34fb4678c29ffa167066de45a9fa7329a319a Merge: 4e8a8f95fa d7c2a7913b Author: Stephen Mallette AuthorDate: Tue Feb 13 15:17:20 2024 -0500 Merge branch 'TINKERPOP-3056' into 3.6-dev CHANGELOG.asciidoc | 1 + .../process/traversal/step/map/MergeEdgeStep.java | 6 ++-- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 2 ++ gremlin-go/driver/cucumber/gremlin.go | 2 ++ .../gremlin-javascript/test/cucumber/gremlin.js| 2 ++ gremlin-python/src/main/python/radish/gremlin.py | 2 ++ .../gremlin/test/features/map/MergeEdge.feature| 42 ++ 7 files changed, 54 insertions(+), 3 deletions(-)
(tinkerpop) branch TINKERPOP-3031 created (now d4892ada54)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-3031 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git at d4892ada54 TINKERPOP-3031 Fixed bug in translation of g.tx() options This branch includes the following new commits: new d4892ada54 TINKERPOP-3031 Fixed bug in translation of g.tx() options The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
(tinkerpop) 01/01: TINKERPOP-3031 Fixed bug in translation of g.tx() options
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3031 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit d4892ada5432e9e850883aef6a76b78a81200840 Author: Stephen Mallette AuthorDate: Tue Feb 13 13:30:13 2024 -0500 TINKERPOP-3031 Fixed bug in translation of g.tx() options --- CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/GraphOp.java | 7 +-- .../traversal/dsl/graph/GraphTraversalSource.java | 1 + .../traversal/translator/DotNetTranslator.java | 4 .../traversal/translator/GolangTranslator.java | 21 + .../traversal/translator/GroovyTranslator.java | 5 - .../traversal/translator/JavascriptTranslator.java | 4 .../traversal/translator/PythonTranslator.java | 6 +- .../process/traversal/util/BytecodeHelper.java | 1 + .../tinkerpop/gremlin/structure/Transaction.java| 14 ++ .../traversal/translator/DotNetTranslatorTest.java | 9 + .../traversal/translator/GolangTranslatorTest.java | 9 + .../traversal/translator/GroovyTranslatorTest.java | 9 + .../translator/JavascriptTranslatorTest.java| 9 + .../traversal/translator/PythonTranslatorTest.java | 9 + 15 files changed, 97 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index e886f0a7ae..40fa474891 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,6 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 3.6.7 (NOT OFFICIALLY RELEASED YET) * Fixed a bug in Gremlin.Net for .NET 8 that led to exceptions: `InvalidOperationException: Enumeration has not started. Call MoveNext.` +* Fixed bug in bytecode translation of `g.tx().commit()` and `g.tx().rollback()` in all languages. * Improved error message from `JavaTranslator` by including exception source. * Added missing `short` serialization (`gx:Int16`) to GraphSONV2 and GraphSONV3 in `gremlin-python` * Added tests for error handling for GLV's if tx.commit() is called remotely for graphs without transactions support. diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/GraphOp.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/GraphOp.java index 370009c193..ad47929414 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/GraphOp.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/GraphOp.java @@ -18,6 +18,9 @@ */ package org.apache.tinkerpop.gremlin.process.traversal; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Transaction; + /** * A {@code GraphOp} or "graph operation" is a static {@link Bytecode} form that does not translate to a traversal * but instead refers to a specific function to perform on a graph instance. @@ -27,12 +30,12 @@ public enum GraphOp { /** * Commit a transaction. */ -TX_COMMIT(new Bytecode("tx", "commit")), +TX_COMMIT(new Bytecode(GraphTraversalSource.Symbols.tx, Transaction.Symbols.commit)), /** * Rollback a transaction. */ -TX_ROLLBACK(new Bytecode("tx", "rollback")); +TX_ROLLBACK(new Bytecode(GraphTraversalSource.Symbols.tx, Transaction.Symbols.rollback)); private final Bytecode bytecode; diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java index c12bf41e46..a4bc9e33fa 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java @@ -77,6 +77,7 @@ public class GraphTraversalSource implements TraversalSource { public static final String withBulk = "withBulk"; public static final String withPath = "withPath"; +public static final String tx = "tx"; } diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/translator/DotNetTranslator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/translator/DotNetTranslator.java index 8e70b3000b..fbc2c1dc83 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/translator/DotNetTranslator.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/translator/DotNetTranslator.java @@ -33,6 +33,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
(tinkerpop) branch TINKERPOP-3056 updated (7c99643813 -> d7c2a7913b)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-3056 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git discard 7c99643813 TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch add d7c2a7913b TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (7c99643813) \ N -- N -- N refs/heads/TINKERPOP-3056 (d7c2a7913b) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. No new revisions were added by this update. Summary of changes: gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs| 4 ++-- gremlin-go/driver/cucumber/gremlin.go | 4 ++-- .../src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js | 4 ++-- gremlin-python/src/main/python/radish/gremlin.py | 4 ++-- .../org/apache/tinkerpop/gremlin/test/features/map/MergeEdge.feature | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-)
(tinkerpop) 01/01: Merge branch 'pr-2353'
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 2d9fabf3bcf3725d12a64893bab6803d812481a8 Merge: c56e91738a 9c9266b350 Author: Stephen Mallette AuthorDate: Tue Feb 13 11:28:08 2024 -0500 Merge branch 'pr-2353' gremlin-dotnet/test/pom.xml | 2 +- gremlin-go/pom.xml | 2 +- gremlin-javascript/pom.xml | 2 +- gremlin-server/pom.xml | 2 +- pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
(tinkerpop) branch master updated (c56e91738a -> 2d9fabf3bc)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from c56e91738a Merge branch '3.7-dev' add 9c9266b350 Bump org.codehaus.mojo:exec-maven-plugin from 1.2.1 to 3.1.1 new 2d9fabf3bc Merge branch 'pr-2353' The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: gremlin-dotnet/test/pom.xml | 2 +- gremlin-go/pom.xml | 2 +- gremlin-javascript/pom.xml | 2 +- gremlin-server/pom.xml | 2 +- pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
(tinkerpop) 01/03: Bumped patch/minors in examples for python CTR
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 4e8a8f95fa5237bca98de9b7b65a3a056ee44067 Author: Stephen Mallette AuthorDate: Tue Feb 13 11:16:28 2024 -0500 Bumped patch/minors in examples for python CTR --- gremlin-python/src/main/python/examples/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gremlin-python/src/main/python/examples/requirements.txt b/gremlin-python/src/main/python/examples/requirements.txt index aac2e56d11..fb17e70620 100644 --- a/gremlin-python/src/main/python/examples/requirements.txt +++ b/gremlin-python/src/main/python/examples/requirements.txt @@ -19,11 +19,11 @@ aenum==3.1.15 aiohttp==3.8.0 aiosignal==1.3.1 async-timeout==4.0.3 -attrs==23.1.0 +attrs==23.2.0 charset-normalizer==3.3.2 -frozenlist==1.4.0 +frozenlist==1.4.1 idna==3.6 isodate==0.6.1 -multidict==6.0.4 +multidict==6.0.5 six==1.16.0 yarl==1.9.4
(tinkerpop) branch 3.6-dev updated (c7f3d2454a -> 4e8a8f95fa)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.6-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from c7f3d2454a Drop use of unmodifiable map in arity predictor CTR add 4e8a8f95fa Bumped patch/minors in examples for python CTR No new revisions were added by this update. Summary of changes: gremlin-python/src/main/python/examples/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
(tinkerpop) branch 3.7-dev updated (d804e4a3b9 -> e4ea40ffe9)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from d804e4a3b9 Merge branch '3.6-dev' into 3.7-dev add 4e8a8f95fa Bumped patch/minors in examples for python CTR add e4ea40ffe9 Merge branch '3.6-dev' into 3.7-dev No new revisions were added by this update. Summary of changes: gremlin-python/src/main/python/examples/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
(tinkerpop) branch master updated (55a7b7f256 -> c56e91738a)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 55a7b7f256 Merge branch '3.7-dev' new 4e8a8f95fa Bumped patch/minors in examples for python CTR new e4ea40ffe9 Merge branch '3.6-dev' into 3.7-dev new c56e91738a Merge branch '3.7-dev' The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: gremlin-python/src/main/python/examples/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
(tinkerpop) 02/03: Merge branch '3.6-dev' into 3.7-dev
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 e4ea40ffe99b9b7a31a582f12d83fee90e65e687 Merge: d804e4a3b9 4e8a8f95fa Author: Stephen Mallette AuthorDate: Tue Feb 13 11:17:31 2024 -0500 Merge branch '3.6-dev' into 3.7-dev gremlin-python/src/main/python/examples/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
(tinkerpop) 03/03: Merge branch '3.7-dev'
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 c56e91738a647a56c8e7fee72d59319b931aa7f8 Merge: 55a7b7f256 e4ea40ffe9 Author: Stephen Mallette AuthorDate: Tue Feb 13 11:17:50 2024 -0500 Merge branch '3.7-dev' gremlin-python/src/main/python/examples/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
(tinkerpop) branch TINKERPOP-3056 created (now 7c99643813)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-3056 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git at 7c99643813 TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch This branch includes the following new commits: new 7c99643813 TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
(tinkerpop) 01/01: TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3056 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 7c9964381344279bda2dd82086bc4422ab7f613b Author: Stephen Mallette AuthorDate: Tue Feb 13 09:24:40 2024 -0500 TINKERPOP-3056 Fixed bug in mid-traversal mergeE for onMatch Since the current traverser was only being updated onMatch when it was used as a start step doing mutations in a sideEffect() would update whatever the current traverser was. This code may have been leftover from a time when the merge steps operated more readily on the current traverser as an argument to the step. --- CHANGELOG.asciidoc | 1 + .../process/traversal/step/map/MergeEdgeStep.java | 6 ++-- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 2 ++ gremlin-go/driver/cucumber/gremlin.go | 2 ++ .../gremlin-javascript/test/cucumber/gremlin.js| 2 ++ gremlin-python/src/main/python/radish/gremlin.py | 2 ++ .../gremlin/test/features/map/MergeEdge.feature| 42 ++ 7 files changed, 54 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index e886f0a7ae..38ded69065 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -32,6 +32,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Fixed issue where server errors weren't being properly parsed when sending bytecode over HTTP. * Improved bulkset contains check for elements if all elements in bulkset are of the same type * Fixed bug in `EarlyLimitStrategy` which was too aggressive when promoting `limit()` before `map()`. +* Fixed bug in mid-traversal `mergeE()` where mutations in `sideEffect()` were being applied to the current traverser rather than a `onMatch` edge. [[release-3-6-6]] === TinkerPop 3.6.6 (November 20, 2023) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeEdgeStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeEdgeStep.java index 748df266e0..761426efe3 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeEdgeStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeEdgeStep.java @@ -273,9 +273,9 @@ public class MergeEdgeStep extends MergeStep { edges = IteratorUtils.peek(edges, e -> { -// if this was a start step the traverser is initialized with placeholder edge, so override that with -// the matched Edge so that the option() traversal can operate on it properly -if (isStart) traverser.set((S) e); +// override current traverser with the matched Edge so that the option() traversal can operate +// on it properly +traverser.set((S) e); // assume good input from GraphTraversal - folks might drop in a T here even though it is immutable final Map onMatchMap = materializeMap(traverser, onMatchTraversal); diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index 5fc05ee05b..9dc4aa5745 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@ -689,6 +689,8 @@ namespace Gremlin.Net.IntegrationTest.Gherkin {"g_mergeV_mergeE_combination_new_vertices", new List, ITraversal>> {(g,p) =>g.MergeV((IDictionary) p["xx1"]).As("outV").MergeV((IDictionary) p["xx2"]).As("inV").MergeE((IDictionary) p["xx3"]).Option(Merge.OutV, (ITraversal) __.Select("outV")).Option(Merge.InV, (ITraversal) __.Select("inV")), (g,p) =>g.V(), (g,p) =>g.E(), (g,p) =>g.V().Has("name","marko").Out [...] {"g_mergeV_mergeE_combination_existing_vertices", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name","marko").AddV("person").Property("name","vadas"), (g,p) =>g.MergeV((IDictionary) p["xx1"]).As("outV").MergeV((IDictionary) p["xx2"]).As("inV").MergeE((IDictionary) p["xx3"]).Option(Merge.OutV, (ITraversal) __.Select("outV")).Option(Merge.InV, (ITraversal [...] {"g_V_asXvX_mergeEXxx1X_optionXMerge_onMatch_xx2X_optionXMerge_outV_selectXvXX_optionXMerge_inV_selectXvXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name","marko").Property("age",29), (g,p) =>g.V().As("v").MergeE((ID
(tinkerpop) branch TINKERPOP-2862 updated (5a3030700b -> 2370cfca18)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-2862 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git discard 5a3030700b TINKERPOP-2862 Added withoutStrategies syntax to grammar add 2370cfca18 TINKERPOP-2862 Added withoutStrategies syntax to grammar This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (5a3030700b) \ N -- N -- N refs/heads/TINKERPOP-2862 (2370cfca18) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. No new revisions were added by this update. Summary of changes: .../gremlin/process/traversal/TraversalStrategies.java | 10 ++ 1 file changed, 10 insertions(+)
(tinkerpop) branch arity-adjustment deleted (was 36056207f0)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch arity-adjustment in repository https://gitbox.apache.org/repos/asf/tinkerpop.git was 36056207f0 Drop use of unmodifiable map in arity predictor CTR This change permanently discards the following revisions: discard 36056207f0 Drop use of unmodifiable map in arity predictor CTR
(tinkerpop) branch 3.6-dev updated (0d119be3bb -> c7f3d2454a)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.6-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 0d119be3bb Follow-on to #2475 to fixup compile/test issues CTR add c7f3d2454a Drop use of unmodifiable map in arity predictor CTR No new revisions were added by this update. Summary of changes: .../strategy/util/StepOutputArityPredictor.java| 24 +- 1 file changed, 10 insertions(+), 14 deletions(-)
(tinkerpop) 01/03: Drop use of unmodifiable map in arity predictor CTR
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 c7f3d2454a654cea57c2a99077d859b115fec4c3 Author: Stephen Mallette AuthorDate: Thu Feb 8 13:03:47 2024 -0500 Drop use of unmodifiable map in arity predictor CTR --- .../strategy/util/StepOutputArityPredictor.java| 24 +- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java index 1e0157bd51..136922a3a7 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java @@ -231,27 +231,23 @@ public class StepOutputArityPredictor { final private static Map> SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP; static { -final Map> tempMap1 = new HashMap<>(); +STEP_TO_ARITY_FUNCTION_MAP = new HashMap<>(); for (Class elem : STEP_CLASSES_WITH_DEFINITELY_SINGULAR_ARITY_BEHAVIOR) { -tempMap1.put(elem.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_STEP_INPUT); +STEP_TO_ARITY_FUNCTION_MAP.put(elem.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_STEP_INPUT); } for (Class elem : STEP_CLASSES_WITH_OPTIONAL_SINGULAR_ARITY_BEHAVIOR) { -tempMap1.put(elem.getSimpleName(), RETURN_MAY_BE_SINGLE_ARITY_FOR_STEP_INPUT); +STEP_TO_ARITY_FUNCTION_MAP.put(elem.getSimpleName(), RETURN_MAY_BE_SINGLE_ARITY_FOR_STEP_INPUT); } -tempMap1.put(EdgeVertexStep.class.getSimpleName(), StepOutputArityPredictor::wouldEdgeVertexStepHaveSingleResult); -tempMap1.put(TraversalMapStep.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTraversalMapStep); +STEP_TO_ARITY_FUNCTION_MAP.put(EdgeVertexStep.class.getSimpleName(), StepOutputArityPredictor::wouldEdgeVertexStepHaveSingleResult); +STEP_TO_ARITY_FUNCTION_MAP.put(TraversalMapStep.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTraversalMapStep); -STEP_TO_ARITY_FUNCTION_MAP = Collections.unmodifiableMap(tempMap1); - -final Map> tempMap2 = new HashMap<>(); -tempMap2.put(ValueTraversal.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForValueTraversal); -tempMap2.put(TokenTraversal.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTokenTraversal); -tempMap2.put(IdentityTraversal.class.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_TRAVERSAL_INPUT); -tempMap2.put(ColumnTraversal.class.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_TRAVERSAL_INPUT); - -SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP = Collections.unmodifiableMap(tempMap2); +SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP = new HashMap<>(); + SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP.put(ValueTraversal.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForValueTraversal); + SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP.put(TokenTraversal.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTokenTraversal); + SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP.put(IdentityTraversal.class.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_TRAVERSAL_INPUT); + SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP.put(ColumnTraversal.class.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_TRAVERSAL_INPUT); } private static Arity getStepOutputArity(final Step step, final Arity inputArity) {
(tinkerpop) branch 3.7-dev updated (809a20986c -> d804e4a3b9)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 809a20986c Remove minor syntax error in feature file CTR add c7f3d2454a Drop use of unmodifiable map in arity predictor CTR add d804e4a3b9 Merge branch '3.6-dev' into 3.7-dev No new revisions were added by this update. Summary of changes: .../strategy/util/StepOutputArityPredictor.java| 24 +- 1 file changed, 10 insertions(+), 14 deletions(-)
(tinkerpop) branch master updated (fae51e87e7 -> 55a7b7f256)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from fae51e87e7 Merge branch '3.7-dev' new c7f3d2454a Drop use of unmodifiable map in arity predictor CTR new d804e4a3b9 Merge branch '3.6-dev' into 3.7-dev new 55a7b7f256 Merge branch '3.7-dev' The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../strategy/util/StepOutputArityPredictor.java| 24 +- 1 file changed, 10 insertions(+), 14 deletions(-)
(tinkerpop) 03/03: Merge branch '3.7-dev'
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 55a7b7f25677c38ad23a813d19dfb58d69954d35 Merge: fae51e87e7 d804e4a3b9 Author: Stephen Mallette AuthorDate: Thu Feb 8 13:16:55 2024 -0500 Merge branch '3.7-dev' .../strategy/util/StepOutputArityPredictor.java| 24 +- 1 file changed, 10 insertions(+), 14 deletions(-)
(tinkerpop) 02/03: Merge branch '3.6-dev' into 3.7-dev
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 d804e4a3b9d7d12c679e218abc24091453031467 Merge: 809a20986c c7f3d2454a Author: Stephen Mallette AuthorDate: Thu Feb 8 13:16:48 2024 -0500 Merge branch '3.6-dev' into 3.7-dev .../strategy/util/StepOutputArityPredictor.java| 24 +- 1 file changed, 10 insertions(+), 14 deletions(-)
(tinkerpop) branch arity-adjustment created (now 36056207f0)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch arity-adjustment in repository https://gitbox.apache.org/repos/asf/tinkerpop.git at 36056207f0 Drop use of unmodifiable map in arity predictor CTR This branch includes the following new commits: new 36056207f0 Drop use of unmodifiable map in arity predictor CTR The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
(tinkerpop) 01/01: Drop use of unmodifiable map in arity predictor CTR
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch arity-adjustment in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 36056207f0daef7370f2969849de50e0b55148fe Author: Stephen Mallette AuthorDate: Thu Feb 8 13:03:47 2024 -0500 Drop use of unmodifiable map in arity predictor CTR --- .../strategy/util/StepOutputArityPredictor.java| 24 +- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java index 1e0157bd51..136922a3a7 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java @@ -231,27 +231,23 @@ public class StepOutputArityPredictor { final private static Map> SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP; static { -final Map> tempMap1 = new HashMap<>(); +STEP_TO_ARITY_FUNCTION_MAP = new HashMap<>(); for (Class elem : STEP_CLASSES_WITH_DEFINITELY_SINGULAR_ARITY_BEHAVIOR) { -tempMap1.put(elem.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_STEP_INPUT); +STEP_TO_ARITY_FUNCTION_MAP.put(elem.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_STEP_INPUT); } for (Class elem : STEP_CLASSES_WITH_OPTIONAL_SINGULAR_ARITY_BEHAVIOR) { -tempMap1.put(elem.getSimpleName(), RETURN_MAY_BE_SINGLE_ARITY_FOR_STEP_INPUT); +STEP_TO_ARITY_FUNCTION_MAP.put(elem.getSimpleName(), RETURN_MAY_BE_SINGLE_ARITY_FOR_STEP_INPUT); } -tempMap1.put(EdgeVertexStep.class.getSimpleName(), StepOutputArityPredictor::wouldEdgeVertexStepHaveSingleResult); -tempMap1.put(TraversalMapStep.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTraversalMapStep); +STEP_TO_ARITY_FUNCTION_MAP.put(EdgeVertexStep.class.getSimpleName(), StepOutputArityPredictor::wouldEdgeVertexStepHaveSingleResult); +STEP_TO_ARITY_FUNCTION_MAP.put(TraversalMapStep.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTraversalMapStep); -STEP_TO_ARITY_FUNCTION_MAP = Collections.unmodifiableMap(tempMap1); - -final Map> tempMap2 = new HashMap<>(); -tempMap2.put(ValueTraversal.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForValueTraversal); -tempMap2.put(TokenTraversal.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTokenTraversal); -tempMap2.put(IdentityTraversal.class.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_TRAVERSAL_INPUT); -tempMap2.put(ColumnTraversal.class.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_TRAVERSAL_INPUT); - -SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP = Collections.unmodifiableMap(tempMap2); +SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP = new HashMap<>(); + SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP.put(ValueTraversal.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForValueTraversal); + SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP.put(TokenTraversal.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTokenTraversal); + SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP.put(IdentityTraversal.class.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_TRAVERSAL_INPUT); + SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP.put(ColumnTraversal.class.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_TRAVERSAL_INPUT); } private static Arity getStepOutputArity(final Step step, final Arity inputArity) {
(tinkerpop) branch TINKERPOP-2862 updated (d3650430a1 -> 5a3030700b)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch TINKERPOP-2862 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git discard d3650430a1 TINKERPOP-2862 wip add d3b7aa942e Fix test that wasn't parameterized CTR add c32d0cdf4c Merge branch '3.7-dev' add 963bece33c Loosen error message validation a bit by ignoring case. add a2b2550838 TINKERPOP-3045: EarlyLimitStrategy is too aggresive to promote Limit and thus causing incorrect results https://issues.apache.org/jira/browse/TINKERPOP-3045 add 0d119be3bb Follow-on to #2475 to fixup compile/test issues CTR add 6bfb0365f1 Merge branch '3.6-dev' into 3.7-dev add b282194056 Merge branch '3.7-dev' add 66db18e17a TINKERPOP-3049 Fixed Cardinality function in onCreate add b837fc7eb2 Merge branch '3.7-dev' add 809a20986c Remove minor syntax error in feature file CTR add fae51e87e7 Merge branch '3.7-dev' new 5a3030700b TINKERPOP-2862 Added withoutStrategies syntax to grammar This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (d3650430a1) \ N -- N -- N refs/heads/TINKERPOP-2862 (5a3030700b) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CHANGELOG.asciidoc | 5 + docs/src/upgrade/release-4.x.x.asciidoc| 39 ++- .../grammar/DefaultGremlinBaseVisitor.java | 6 +- .../language/grammar/GenericLiteralVisitor.java| 2 + .../language/grammar/TraversalStrategyVisitor.java | 48 +-- .../process/traversal/TraversalStrategies.java | 52 +-- .../process/traversal/step/map/MergeEdgeStep.java | 6 +- .../traversal/step/map/MergeVertexStep.java| 21 +- .../strategy/optimization/EarlyLimitStrategy.java | 6 +- .../strategy/util/StepOutputArityPredictor.java| 361 + .../traversal/translator/PythonTranslator.java | 2 +- .../util/GremlinDisabledListDelimiterHandler.java | 6 +- .../grammar/GeneralLiteralVisitorTest.java | 1 + .../TraversalSourceSelfMethodVisitorTest.java | 3 +- .../grammar/TraversalStrategyVisitorTest.java | 1 + gremlin-dotnet/build/generate.groovy | 2 +- .../Gherkin/CommonSteps.cs | 6 +- .../Gherkin/GherkinTestRunner.cs | 3 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 7 +- gremlin-go/build/generate.groovy | 1 + gremlin-go/driver/cucumber/cucumberSteps_test.go | 6 +- gremlin-go/driver/cucumber/gremlin.go | 7 +- .../test/cucumber/feature-steps.js | 8 +- .../gremlin-javascript/test/cucumber/gremlin.js| 7 +- gremlin-language/src/main/antlr4/Gremlin.g4| 40 ++- gremlin-python/build/generate.groovy | 2 +- .../src/main/python/radish/feature_steps.py| 10 +- gremlin-python/src/main/python/radish/gremlin.py | 9 +- .../tinkerpop/gremlin/features/StepDefinition.java | 13 +- .../process/traversal/step/map/MergeEdgeTest.java | 2 +- .../gremlin/test/features/filter/Range.feature | 15 +- .../test/features/integrated/Miscellaneous.feature | 12 + .../gremlin/test/features/map/Format.feature | 3 +- .../gremlin/test/features/map/MergeEdge.feature| 4 +- .../gremlin/test/features/map/MergeVertex.feature | 42 +++ 35 files changed, 639 insertions(+), 119 deletions(-) create mode 100644 gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java
(tinkerpop) 01/01: TINKERPOP-2862 Added withoutStrategies syntax to grammar
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-2862 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 5a3030700b186df88ff8c9c3505c3fe5e3f6e7d6 Author: Stephen Mallette AuthorDate: Wed Jan 31 17:05:49 2024 -0500 TINKERPOP-2862 Added withoutStrategies syntax to grammar Made "new" keyword optional in grammar TINKERPOP-3046. Language variants still have trouble using withoutStrategies() because of TINKERPOP-3047 and TINKERPOP-3048 that will need to get completed before they will work properly. --- CHANGELOG.asciidoc | 3 + docs/src/upgrade/release-4.x.x.asciidoc| 39 +++- .../grammar/DefaultGremlinBaseVisitor.java | 63 +++--- .../language/grammar/GenericLiteralVisitor.java| 2 + .../grammar/TraversalSourceSelfMethodVisitor.java | 19 +- .../language/grammar/TraversalStrategyVisitor.java | 169 +- .../process/traversal/TraversalStrategies.java | 83 ++- .../traversal/translator/PythonTranslator.java | 2 +- .../util/GremlinDisabledListDelimiterHandler.java | 46 .../grammar/GeneralLiteralVisitorTest.java | 1 + .../TraversalSourceSelfMethodVisitorTest.java | 11 +- .../grammar/TraversalStrategyVisitorTest.java | 6 + gremlin-dotnet/build/generate.groovy | 2 +- .../Gherkin/GherkinTestRunner.cs | 3 +- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/build/generate.groovy | 1 + gremlin-go/driver/cucumber/gremlin.go | 1 + .../test/cucumber/feature-steps.js | 2 + .../gremlin-javascript/test/cucumber/gremlin.js| 1 + gremlin-language/src/main/antlr4/Gremlin.g4| 242 + gremlin-python/build/generate.groovy | 2 +- .../src/main/python/radish/feature_steps.py| 4 +- gremlin-python/src/main/python/radish/gremlin.py | 3 +- .../test/features/integrated/Miscellaneous.feature | 12 + 24 files changed, 418 insertions(+), 300 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 6dd1373a71..311d783f4e 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -34,6 +34,9 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Added new list filtering step `none()`. * Removed the deprecated `withGraph()` option from `AnonymousTraversalSource`. * Bumped to `commons-collection4`. +* Added `withoutStrategies()` syntax to the Gremlin ANTLR grammar. +* Modified the Gremlin ANTLR grammar to more dynamically interact with any strategies registered globally to the `TraversalStrategies` cache sets. +* Made `new` keyword optional in the Gremlin grammar. == TinkerPop 3.7.0 (Gremfir Master of the Pan Flute) diff --git a/docs/src/upgrade/release-4.x.x.asciidoc b/docs/src/upgrade/release-4.x.x.asciidoc index ffd424f872..f0cbdd4cba 100644 --- a/docs/src/upgrade/release-4.x.x.asciidoc +++ b/docs/src/upgrade/release-4.x.x.asciidoc @@ -75,10 +75,43 @@ See: link:https://issues.apache.org/jira/browse/TINKERPOP-3017[TINKERPOP-3017] Starting from this version, `gremlin-javascript` will deserialize `Set` data into a ECMAScript 2015 Set. Previously, these were deserialized into arrays. + Gremlin Grammar Changes + +A number of changes have been introduce to the Gremlin grammar to help make it be more consistent and easier to use. + +*`new` keyword is now optional* + +The `new` keyword is now optional in all cases where it was previously used. Both of the following examples are now +valid syntax with the second being the preferred form going forward: + +[source,groovy] + +g.V().withStrategies(new SubgraphStrategy(vertices: __.hasLabel('person'))) + +g.V().withStrategies(SubgraphStrategy(vertices: __.hasLabel('person'))) + + +In a future version, it is likely that the `new` keyword will be removed entirely from the grammar. + +*Supports withoutStrategies()* + +The `withoutStrategies()` configuration step is now supported syntax for the grammar. While this option is not commonly +used it is still a part of the Gremlin language and there are times where it is helpful to have this fine grained +control over how a traversal works. + +[source,groovy] + +g.V().withoutStrategies(CountStrategy) + + +See: link:https://issues.apache.org/jira/browse/TINKERPOP-2862[TINKERPOP-2862], +link:https://issues.apache.org/jira/browse/TINKERPOP-3046[TINKERPOP-3046] + Renaming none() to discard() -`none()`, which was primarily used by `iterate()` to discard traversal results in remote contexts, has been renamed to -`discard()`. In its place is a new list filtering step `none()`, which takes a predicate as an argument and passes lists -with no elements matching the predicate. + +The `none()` step, which was primarily used by `iterate()` to discard travers
(tinkerpop) branch 3.7-dev updated (66db18e17a -> 809a20986c)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 66db18e17a TINKERPOP-3049 Fixed Cardinality function in onCreate add 809a20986c Remove minor syntax error in feature file CTR No new revisions were added by this update. Summary of changes: .../org/apache/tinkerpop/gremlin/test/features/map/MergeVertex.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
(tinkerpop) branch master updated: Remove minor syntax error in feature file CTR
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 The following commit(s) were added to refs/heads/master by this push: new 809a20986c Remove minor syntax error in feature file CTR new fae51e87e7 Merge branch '3.7-dev' 809a20986c is described below commit 809a20986cc011cd03afda7d6b47a5d090f5034c Author: Stephen Mallette AuthorDate: Wed Feb 7 13:34:19 2024 -0500 Remove minor syntax error in feature file CTR --- .../org/apache/tinkerpop/gremlin/test/features/map/MergeVertex.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/MergeVertex.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/MergeVertex.feature index af34ce42dd..2aaa7b6983 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/MergeVertex.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/MergeVertex.feature @@ -926,7 +926,7 @@ Feature: Step - mergeV() g.addV("person").property("name", "marko").property(Cardinality.list, "age", 29).property(Cardinality.list, "age", 31).property(Cardinality.list, "age", 32) """ And the traversal of - """e + """ g.mergeV([name: "marko"]). option(Merge.onMatch, [name: "allen", age: Cardinality.set(31)], single) """
(tinkerpop) branch 3.7-dev updated (6bfb0365f1 -> 66db18e17a)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 6bfb0365f1 Merge branch '3.6-dev' into 3.7-dev add 66db18e17a TINKERPOP-3049 Fixed Cardinality function in onCreate No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc | 1 + .../traversal/step/map/MergeVertexStep.java| 21 +-- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 3 ++ gremlin-go/driver/cucumber/gremlin.go | 3 ++ .../gremlin-javascript/test/cucumber/gremlin.js| 3 ++ gremlin-python/src/main/python/radish/gremlin.py | 3 ++ .../gremlin/test/features/map/MergeVertex.feature | 44 +- 7 files changed, 73 insertions(+), 5 deletions(-)
(tinkerpop) branch master updated: TINKERPOP-3049 Fixed Cardinality function in onCreate
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 The following commit(s) were added to refs/heads/master by this push: new 66db18e17a TINKERPOP-3049 Fixed Cardinality function in onCreate new b837fc7eb2 Merge branch '3.7-dev' 66db18e17a is described below commit 66db18e17ad2937c71a3b2167fd0d7989ab2cbd7 Author: Stephen Mallette AuthorDate: Tue Feb 6 18:46:13 2024 -0500 TINKERPOP-3049 Fixed Cardinality function in onCreate Not sure why this wasn't implemented earlier, but I think the intent was that providers would natively handled the CardinalityValueTraversal. Don't think that was a great choice becasue then this feature doesn't work out of the box. CTR --- CHANGELOG.asciidoc | 1 + .../traversal/step/map/MergeVertexStep.java| 21 +-- .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 3 ++ gremlin-go/driver/cucumber/gremlin.go | 3 ++ .../gremlin-javascript/test/cucumber/gremlin.js| 3 ++ gremlin-python/src/main/python/radish/gremlin.py | 3 ++ .../gremlin/test/features/map/MergeVertex.feature | 44 +- 7 files changed, 73 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index cd9d7e2b11..3029735004 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,6 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 3.7.2 (NOT OFFICIALLY RELEASED YET) * Deprecated `ltrim()` and `rTrim()` in favor of `l_trim()` and `r_trim` in Python. +* Fixed bug in `onCreate` for `mergeV()` where use of the `Cardinality` functions was not properly handled. [[release-3-7-1]] === TinkerPop 3.7.1 (November 20, 2023) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeVertexStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeVertexStep.java index 1b7ba4bafc..713b839e8d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeVertexStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeVertexStep.java @@ -145,10 +145,23 @@ public class MergeVertexStep extends MergeStep { */ final Map onCreateMap = onCreateMap(traverser, mergeMap); -final Object[] flatArgs = onCreateMap.entrySet().stream() -.flatMap(e -> Stream.of(e.getKey(), e.getValue())).collect(toList()).toArray(); - -final Vertex vertex = graph.addVertex(flatArgs); +// extract the key/value pairs from the map and flatten them into an array but exclude any that have a +// CardinalityValueTraversal as the value. you have to ignore those in a call to addVertex because that would +// make it so that the Graph had to know how to deal with the CardinalityValueTraversal which it doesn't. this +// allows this feature to work out of the box. +final Object[] flatArgsWithoutExplicitCardinality = onCreateMap.entrySet().stream(). +filter(e -> !(e.getValue() instanceof CardinalityValueTraversal)). +flatMap(e -> Stream.of(e.getKey(), e.getValue())).collect(toList()).toArray(); + +final Vertex vertex = graph.addVertex(flatArgsWithoutExplicitCardinality); + +// deal with values that have the cardinality explicitly set which should only occur on string keys +onCreateMap.entrySet().stream(). +filter(e -> e.getKey() instanceof String && e.getValue() instanceof CardinalityValueTraversal). +forEach(e -> { +final CardinalityValueTraversal cardinalityValueTraversal = (CardinalityValueTraversal) e.getValue(); + vertex.property(cardinalityValueTraversal.getCardinality(), (String) e.getKey(), cardinalityValueTraversal.getValue()); +}); // trigger callbacks for eventing - in this case, it's a VertexAddedEvent if (this.callbackRegistry != null && !callbackRegistry.getCallbacks().isEmpty()) { diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index 4df9adfe09..12fd0ddb9f 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@ -965,6 +965,9 @@ namespace Gremlin.Net.IntegrationTest.Gherkin {"g_mergeVXname_markoX_optionXonMatch_age_33_singleX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name","marko").Property(Cardinality.List,"age",29).Property(Cardinality.List,"age",31).P
(tinkerpop) 01/03: Follow-on to #2475 to fixup compile/test issues CTR
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 0d119be3bbb09cfc73536fc0a2f5337d9011667e Author: Stephen Mallette AuthorDate: Tue Feb 6 07:42:22 2024 -0500 Follow-on to #2475 to fixup compile/test issues CTR --- CHANGELOG.asciidoc | 1 + .../strategy/util/StepOutputArityPredictor.java| 95 ++ .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go | 1 + .../gremlin-javascript/test/cucumber/gremlin.js| 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../gremlin/test/features/filter/Range.feature | 5 +- 7 files changed, 71 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 8a77efd16c..e886f0a7ae 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -31,6 +31,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Fixed bug in `JavaTranslator` where `has(String, null)` could call `has(String, Traversal)` to generate an error. * Fixed issue where server errors weren't being properly parsed when sending bytecode over HTTP. * Improved bulkset contains check for elements if all elements in bulkset are of the same type +* Fixed bug in `EarlyLimitStrategy` which was too aggressive when promoting `limit()` before `map()`. [[release-3-6-6]] === TinkerPop 3.6.6 (November 20, 2023) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java index 6da09f6ae8..1e0157bd51 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java @@ -18,8 +18,9 @@ */ package org.apache.tinkerpop.gremlin.process.traversal.strategy.util; - import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.function.Function; @@ -79,12 +80,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierS import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.T; -import com.google.common.collect.ImmutableMap; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NonNull; - /** * Output Arity Predictor for Tinkerpop steps */ @@ -236,29 +231,34 @@ public class StepOutputArityPredictor { final private static Map> SPECIAL_TRAVERSAL_TO_ARITY_FUNCTION_MAP; static { -final ImmutableMap.Builder> builder1 = ImmutableMap.builder(); -STEP_CLASSES_WITH_DEFINITELY_SINGULAR_ARITY_BEHAVIOR.forEach( -elem -> builder1.put(elem.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_STEP_INPUT)); +final Map> tempMap1 = new HashMap<>(); +for (Class elem : STEP_CLASSES_WITH_DEFINITELY_SINGULAR_ARITY_BEHAVIOR) { +tempMap1.put(elem.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_STEP_INPUT); +} -STEP_CLASSES_WITH_OPTIONAL_SINGULAR_ARITY_BEHAVIOR.forEach( -elem -> builder1.put(elem.getSimpleName(), RETURN_MAY_BE_SINGLE_ARITY_FOR_STEP_INPUT)); +for (Class elem : STEP_CLASSES_WITH_OPTIONAL_SINGULAR_ARITY_BEHAVIOR) { +tempMap1.put(elem.getSimpleName(), RETURN_MAY_BE_SINGLE_ARITY_FOR_STEP_INPUT); +} -builder1.put(EdgeVertexStep.class.getSimpleName(), StepOutputArityPredictor::wouldEdgeVertexStepHaveSingleResult); -builder1.put(TraversalMapStep.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTraversalMapStep); +tempMap1.put(EdgeVertexStep.class.getSimpleName(), StepOutputArityPredictor::wouldEdgeVertexStepHaveSingleResult); +tempMap1.put(TraversalMapStep.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTraversalMapStep); -STEP_TO_ARITY_FUNCTION_MAP = builder1.build(); +STEP_TO_ARITY_FUNCTION_MAP = Collections.unmodifiableMap(tempMap1); -final ImmutableMap.Builder> builder2 = ImmutableMap.builder(); -builder2.put(ValueTraversal.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForValueTraversal); -builder2.put(TokenTraversal.class.getSimpleName(), StepOutputArityPredictor::getOutputArityBehaviorForTokenTraversal); -builder2.put(IdentityTraversal.class.getSimpleName(), RETURN_DEFINITELY_SINGLE_ARITY_FOR_TRAVERSAL_INPUT); -builder2.put(ColumnTraversal.class.getSimpleName(), RETURN_DEFINITELY_SINGLE_A
(tinkerpop) 02/03: Merge branch '3.6-dev' into 3.7-dev
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 6bfb0365f14b5c69ca7af3397cd7b36ef91a7197 Merge: d3b7aa942e 0d119be3bb Author: Stephen Mallette AuthorDate: Tue Feb 6 07:43:39 2024 -0500 Merge branch '3.6-dev' into 3.7-dev CHANGELOG.asciidoc | 1 + .../strategy/optimization/EarlyLimitStrategy.java | 6 +- .../strategy/util/StepOutputArityPredictor.java| 361 + .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go | 1 + .../gremlin-javascript/test/cucumber/gremlin.js| 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../gremlin/test/features/filter/Range.feature | 15 +- 8 files changed, 385 insertions(+), 2 deletions(-)
(tinkerpop) branch 3.6-dev updated (d2303d5fad -> 0d119be3bb)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.6-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from d2303d5fad Bump @types/node from 20.10.3 to 20.11.10 in /gremlint (#2463) add a2b2550838 TINKERPOP-3045: EarlyLimitStrategy is too aggresive to promote Limit and thus causing incorrect results https://issues.apache.org/jira/browse/TINKERPOP-3045 add 0d119be3bb Follow-on to #2475 to fixup compile/test issues CTR No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc | 1 + .../strategy/optimization/EarlyLimitStrategy.java | 6 +- .../strategy/util/StepOutputArityPredictor.java| 361 + .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go | 1 + .../gremlin-javascript/test/cucumber/gremlin.js| 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../gremlin/test/features/filter/Range.feature | 15 +- 8 files changed, 385 insertions(+), 2 deletions(-) create mode 100644 gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java
(tinkerpop) branch 3.7-dev updated (d3b7aa942e -> 6bfb0365f1)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from d3b7aa942e Fix test that wasn't parameterized CTR add a2b2550838 TINKERPOP-3045: EarlyLimitStrategy is too aggresive to promote Limit and thus causing incorrect results https://issues.apache.org/jira/browse/TINKERPOP-3045 add 0d119be3bb Follow-on to #2475 to fixup compile/test issues CTR add 6bfb0365f1 Merge branch '3.6-dev' into 3.7-dev No new revisions were added by this update. Summary of changes: CHANGELOG.asciidoc | 1 + .../strategy/optimization/EarlyLimitStrategy.java | 6 +- .../strategy/util/StepOutputArityPredictor.java| 361 + .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go | 1 + .../gremlin-javascript/test/cucumber/gremlin.js| 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../gremlin/test/features/filter/Range.feature | 15 +- 8 files changed, 385 insertions(+), 2 deletions(-) create mode 100644 gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java
(tinkerpop) 03/03: Merge branch '3.7-dev'
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 b2821940560dc7c5e168590164c1bfb347b4a69e Merge: 963bece33c 6bfb0365f1 Author: Stephen Mallette AuthorDate: Tue Feb 6 07:43:57 2024 -0500 Merge branch '3.7-dev' CHANGELOG.asciidoc | 1 + .../strategy/optimization/EarlyLimitStrategy.java | 6 +- .../strategy/util/StepOutputArityPredictor.java| 361 + .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go | 1 + .../gremlin-javascript/test/cucumber/gremlin.js| 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../gremlin/test/features/filter/Range.feature | 15 +- 8 files changed, 385 insertions(+), 2 deletions(-)
(tinkerpop) branch master updated (963bece33c -> b282194056)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from 963bece33c Loosen error message validation a bit by ignoring case. add a2b2550838 TINKERPOP-3045: EarlyLimitStrategy is too aggresive to promote Limit and thus causing incorrect results https://issues.apache.org/jira/browse/TINKERPOP-3045 new 0d119be3bb Follow-on to #2475 to fixup compile/test issues CTR new 6bfb0365f1 Merge branch '3.6-dev' into 3.7-dev new b282194056 Merge branch '3.7-dev' The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CHANGELOG.asciidoc | 1 + .../strategy/optimization/EarlyLimitStrategy.java | 6 +- .../strategy/util/StepOutputArityPredictor.java| 361 + .../Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 1 + gremlin-go/driver/cucumber/gremlin.go | 1 + .../gremlin-javascript/test/cucumber/gremlin.js| 1 + gremlin-python/src/main/python/radish/gremlin.py | 1 + .../gremlin/test/features/filter/Range.feature | 15 +- 8 files changed, 385 insertions(+), 2 deletions(-) create mode 100644 gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/util/StepOutputArityPredictor.java
(tinkerpop) branch master updated: Loosen error message validation a bit by ignoring case.
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 The following commit(s) were added to refs/heads/master by this push: new 963bece33c Loosen error message validation a bit by ignoring case. 963bece33c is described below commit 963bece33ce0f662ea8e6106b1128e27b587aaed Author: Stephen Mallette AuthorDate: Thu Feb 1 10:50:23 2024 -0500 Loosen error message validation a bit by ignoring case. Not sure this is a good long term solution but perhaps it will help a bit. We've been a bit oppressive with error message assertions in the past and it hasn't really worked well. Asserting just an error doesn't seem right either without some qualification that it is the right one. CTR --- .../gremlin/process/traversal/step/map/MergeEdgeStep.java | 6 +++--- .../test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs | 6 +++--- gremlin-go/driver/cucumber/cucumberSteps_test.go| 6 +++--- .../gremlin-javascript/test/cucumber/feature-steps.js | 6 +++--- gremlin-python/src/main/python/radish/feature_steps.py | 6 +++--- .../apache/tinkerpop/gremlin/features/StepDefinition.java | 13 ++--- .../gremlin/process/traversal/step/map/MergeEdgeTest.java | 2 +- .../tinkerpop/gremlin/test/features/map/MergeEdge.feature | 4 ++-- 8 files changed, 24 insertions(+), 25 deletions(-) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeEdgeStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeEdgeStep.java index 748df266e0..5a31664b1e 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeEdgeStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MergeEdgeStep.java @@ -400,7 +400,7 @@ public class MergeEdgeStep extends MergeStep { return tryAttachVertex(v); } throw new IllegalArgumentException( -String.format("Vertex could not be resolved from mergeE: %s", o)); +String.format("Vertex does not exist for mergeE: %s", o)); } /* @@ -415,7 +415,7 @@ public class MergeEdgeStep extends MergeStep { try (CloseableIterator it = CloseableIterator.of(getGraph().vertices(arg))) { if (!it.hasNext()) throw new IllegalArgumentException( -String.format("Vertex id could not be resolved from mergeE: %s", arg)); +String.format("Vertex does not exist for mergeE: %s", arg)); return it.next(); } } @@ -430,7 +430,7 @@ public class MergeEdgeStep extends MergeStep { return ((Attachable) v).attach(Attachable.Method.get(getGraph())); } catch (IllegalStateException ise) { throw new IllegalArgumentException( -String.format("Vertex could not be resolved from mergeE: %s", v)); +String.format("Vertex does not exist for mergeE: %s", v)); } } else { return v; diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs index f6540019f4..98f8b0b5b4 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs @@ -229,13 +229,13 @@ namespace Gremlin.Net.IntegrationTest.Gherkin switch (comparison) { case "containing": -Assert.Contains(expectedMessage, _error.Message); +Assert.Contains(expectedMessage.ToUpper(), _error.Message.ToUpper()); break; case "starting": -Assert.StartsWith(expectedMessage, _error.Message); +Assert.StartsWith(expectedMessage.ToUpper(), _error.Message.ToUpper()); break; case "ending": -Assert.EndsWith(expectedMessage, _error.Message); +Assert.EndsWith(expectedMessage.ToUpper(), _error.Message.ToUpper()); break; default: throw new NotSupportedException( diff --git a/gremlin-go/driver/cucumber/cucumberSteps_test.go b/gremlin-go/driver/cucumber/cucumberSteps_test.go index cab43a6870..fd49c7d8b4 100644 --- a/gremlin-go/driver/cucumber/cucumberSteps_test.go +++ b/gremlin-go/driver/cucumber/cucumberSteps_test.go @@ -846,19 +846,19 @@ func (tg *tinkerPopGraph) theTraversalWillRaiseAnErrorWithMessageContainingTextO } switch comparison {
(tinkerpop) branch 3.7-dev updated (c0d704cb37 -> d3b7aa942e)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch 3.7-dev in repository https://gitbox.apache.org/repos/asf/tinkerpop.git from c0d704cb37 Merge branch '3.6-dev' into 3.7-dev add d3b7aa942e Fix test that wasn't parameterized CTR No new revisions were added by this update. Summary of changes: gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 2 +- gremlin-go/driver/cucumber/gremlin.go | 2 +- .../src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js| 2 +- gremlin-python/src/main/python/radish/gremlin.py | 2 +- .../org/apache/tinkerpop/gremlin/test/features/map/Format.feature | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-)
(tinkerpop) branch master updated: Fix test that wasn't parameterized CTR
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 The following commit(s) were added to refs/heads/master by this push: new d3b7aa942e Fix test that wasn't parameterized CTR new c32d0cdf4c Merge branch '3.7-dev' d3b7aa942e is described below commit d3b7aa942ebd6e1dd4f155924994748cdbf4e63f Author: Stephen Mallette AuthorDate: Thu Feb 1 07:25:13 2024 -0500 Fix test that wasn't parameterized CTR --- gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs | 2 +- gremlin-go/driver/cucumber/gremlin.go | 2 +- .../src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js| 2 +- gremlin-python/src/main/python/radish/gremlin.py | 2 +- .../org/apache/tinkerpop/gremlin/test/features/map/Format.feature | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index eaa8d8c58b..50f0ea6bbf 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@ -714,7 +714,7 @@ namespace Gremlin.Net.IntegrationTest.Gherkin {"g_injectX1X_asXageX_V_formatXstrX", new List, ITraversal>> {(g,p) =>g.Inject(1).As("age").V().Format("%{name} is %{age} years old")}}, {"g_V_formatXstrX_byXvaluesXnameXX_byXvaluesXageXX", new List, ITraversal>> {(g,p) =>g.V().Format("%{_} is %{_} years old").By(__.Values("name")).By(__.Values("age"))}}, {"g_V_hasLabelXpersonX_formatXstrX_byXconstantXhelloXX_byXvaluesXnameXX", new List, ITraversal>> {(g,p) =>g.V().HasLabel("person").Format("%{_} %{_} %{_}").By(__.Constant("hello")).By(__.Values("name"))}}, - {"g_VX1X_formatXstrX_byXconstantXhelloXX_byXvaluesXnameXX", new List, ITraversal>> {(g,p) =>g.V(1).Format("%{_}").By(__.Constant("hello")).By(__.Values("name"))}}, + {"g_VX1X_formatXstrX_byXconstantXhelloXX_byXvaluesXnameXX", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Format("%{_}").By(__.Constant("hello")).By(__.Values("name"))}}, {"g_V_formatXstrX_byXbothE_countX", new List, ITraversal>> {(g,p) =>g.V().Format("%{name} has %{_} connections").By(__.BothE().Count())}}, {"g_V_projectXname_countX_byXvaluesXnameXX_byXbothE_countX_formatXstrX", new List, ITraversal>> {(g,p) =>g.V().Project("name","count").By(__.Values("name")).By(__.BothE().Count()).Format("%{name} has %{count} connections")}}, {"g_V_elementMap_formatXstrX", new List, ITraversal>> {(g,p) =>g.V().ElementMap().Format("%{name} is %{age} years old")}}, diff --git a/gremlin-go/driver/cucumber/gremlin.go b/gremlin-go/driver/cucumber/gremlin.go index cef068fe95..4c01c90a24 100644 --- a/gremlin-go/driver/cucumber/gremlin.go +++ b/gremlin-go/driver/cucumber/gremlin.go @@ -685,7 +685,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_injectX1X_asXageX_V_formatXstrX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(1).As("age").V().Format("%{name} is %{age} years old")}}, "g_V_formatXstrX_byXvaluesXnameXX_byXvaluesXageXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Format("%{_} is %{_} years old").By(gremlingo.T__.Values("name")).By(gremlingo.T__.Values("age"))}}, "g_V_hasLabelXpersonX_formatXstrX_byXconstantXhelloXX_byXvaluesXnameXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Format("%{_} %{_} %{_}").By(gremlingo.T__.Constant("hello")).By(gremlingo.T__.Values("name"))}}, -"g_VX1X_formatXstrX_byXconstantXhelloXX_byXvaluesXnameXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(1).Format("%{_}").By(gremlingo.T__.Constant("hello")).By(gremlingo.T__.Values("name"))}}, +"g_VX1X_formatXstrX_byXconstantXhelloXX_byXvaluesXnameXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"])