[ https://issues.apache.org/jira/browse/TINKERPOP-2862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17816990#comment-17816990 ]
ASF GitHub Bot commented on TINKERPOP-2862: ------------------------------------------- spmallette commented on code in PR #2483: URL: https://github.com/apache/tinkerpop/pull/2483#discussion_r1487827851 ########## 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) Review Comment: It doesn't need a String. The grammar should accept any `Identifier` there. If it matches a registered strategy from a provider, it will work as valid syntax. https://github.com/apache/tinkerpop/pull/2483/files#diff-39ed59720093773649512a14aeba8c3da9e6d21ce016c7f0cdf7a1242e3a76a1R72 I suppose it will be up to each programming language to decide what to do with that. For Java, you could have reference to the actual class file from the provider and could use that. Since it matches on the simple name of the class a dummy class could also be used. Alternatively, Java (and other languages) could be changed to allow a `String` I suppose, but I wasn't ready to make that choice. I mostly wanted to focus in on the grammar and getting that working right for standard TinkerPop strategies. Created: https://issues.apache.org/jira/browse/TINKERPOP-3055 to track. > A grammar in TinkerPop should accept withoutStrategies > ------------------------------------------------------ > > Key: TINKERPOP-2862 > URL: https://issues.apache.org/jira/browse/TINKERPOP-2862 > Project: TinkerPop > Issue Type: Improvement > Components: language > Affects Versions: 3.6.1, 3.5.4 > Reporter: Norio Akagi > Priority: Major > > In our Grammar, we have {{withStrategies}} but not {{{}withoutStrategies{}}}. > [https://github.com/apache/tinkerpop/blob/08afd4e475b56189500c31361b624ecc687e8b7b/gremlin-language/src/main/antlr4/Gremlin.g4#L65] > > We should support so that a caller can disable a specific TinkerPop optimizer > at will. Note that graph providers can have their own Strategy, which may be > out of scope of {{withoutStrategies.}} -- This message was sent by Atlassian Jira (v8.20.10#820010)