[GitHub] tinkerpop pull request #946: TINKERPOP-2037 removed groovy-sql
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/946 ---
[GitHub] tinkerpop pull request #949: TINKERPOP-2056 Use NumberHelper in Compare
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/949 ---
[GitHub] tinkerpop pull request #953: TINKERPOP-1972 Fix inject step in Gremlin.Net
GitHub user FlorianHockmann opened a pull request: https://github.com/apache/tinkerpop/pull/953 TINKERPOP-1972 Fix inject step in Gremlin.Net https://issues.apache.org/jira/browse/TINKERPOP-1972 We had two issues with the `inject` step in Gremlin.Net. The first one prevented the Gherkin test runner from executing scenarios that included an `inject` step. This was fixed by @jorgebay with the first commit in this PR. Thanks for that, Jorge! The second issue was that the arguments passed to the `inject` step were always wrapped in an array which was caused by the fact that the `inject` step takes a `params` array with a generic member type. We created a `List` for these arguments and provided that to the method `ByteCode.AddStep()` which expects a `params object[]` argument. Since the compiler can't convert `List` into `object[]`, it simply treated the `List` as the first argument which resulted in an `object[]` with just one element, namely the `List`. Simply using a `List` for the arguments and then converting each argument to `object` fixes the problem. This could also have affected other steps, but `inject` was the only one with such a generic `params` array which is probably why we didn't notice the problem before. All .NET tests, including the GLV scenarios, are now passing again ð VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1972 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/953.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #953 commit 2a2e47ebdb5342c30ebee2e9a0cca138e07fc58c Author: Jorge Bay Gondra Date: 2018-09-12T09:17:54Z TINKERPOP-1972 Fix test harness, extract child type in generic params array commit dee155e50eab747afa1d302ed0c027c8c3629e2b Author: Florian Hockmann Date: 2018-10-05T15:32:09Z TINKERPOP-1972 Fix arg handling for inject step To be precise, this affects all steps that have a params array with a generic type parameter as the member type but currently inject is the only step in Gremlin.Net that has such an array as an argument. The arguments passed as such a params array were incorrectly wrapped in one array before instead of individual arguments. ---
[GitHub] tinkerpop pull request #952: TINKERPOP-1959 submit scripts in javascript
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/952#discussion_r223009609 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js --- @@ -216,14 +219,18 @@ class DriverRemoteConnection extends RemoteConnection { return args.map(val => this._adaptArgs(val)); } +if (args instanceof t.EnumValue) { --- End diff -- this works - slightly less gross that what there now, but still kinda :rage1: ```js _adaptArgs(args, tl) { if (args instanceof Object) { let newObj = {}; Object.keys(args).forEach((key) => { if (tl && key === 'bindings') newObj[key] = this._adaptArgs(args[key], false); else newObj[key] = this._writer.adaptObject(args[key]); }); return newObj; } return args; } ``` hate that "bindings" needs special handling, but it generates weird stuff without it. ---
[GitHub] tinkerpop pull request #952: TINKERPOP-1959 submit scripts in javascript
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/952#discussion_r223001408 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js --- @@ -216,14 +219,18 @@ class DriverRemoteConnection extends RemoteConnection { return args.map(val => this._adaptArgs(val)); } +if (args instanceof t.EnumValue) { --- End diff -- yeah - that part is still not nice. i tried what you suggested and it didn't work (though it seemed like the right idea). still tinkering with it. ---
[GitHub] tinkerpop pull request #952: TINKERPOP-1959 submit scripts in javascript
Github user jorgebay commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/952#discussion_r222996609 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js --- @@ -216,14 +219,18 @@ class DriverRemoteConnection extends RemoteConnection { return args.map(val => this._adaptArgs(val)); } +if (args instanceof t.EnumValue) { --- End diff -- It would be nice to handle it in a more elegant way, maybe: ```javascript _adaptArgs(args) { let newObj = {}; Object.keys(args).forEach((key) => { newObj[key] = this._writer.adaptObject(args[key]); }); return newObj; } ``` From what I understand, `args` must be serialized as a JSON Object, where each property value is in GraphSON2/3. ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/922 ---
[GitHub] tinkerpop pull request #952: TINKERPOP-1959 submit scripts in javascript
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/952 TINKERPOP-1959 submit scripts in javascript https://issues.apache.org/jira/browse/TINKERPOP-1959 Follow on PR to #922 - more details there. This branch now contains a fix for the test failure that was referenced in the comments toward the end. Still tweaking code - not quite ready for review. You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1959 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/952.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #952 commit b6478d666407656bc1cfc749a81d3e1ad6f06692 Author: Matthew Allen Date: 2018-08-23T14:48:36Z Initial Commit for TINKERPOP-1959 solution. commit c04ddae8a5793177d7515629358346d91be73e43 Author: Matthew Allen Date: 2018-08-24T15:14:29Z Refactor of RemoteStrategy apply() commit 090f1394a82be9bfd8fede85fa75655ab1f0f249 Author: Matthew Allen Date: 2018-08-24T23:02:27Z Fix on eval() incorrect documentation commit 3f87545f47c8ab36a2c9ed4041029c5a038c2be8 Author: Matthew Allen Date: 2018-08-27T08:52:49Z Fixed issue where eval was added to wrong class in GraphTravesal commit a8e5454589291fb88261ae2b489ac3ed8ecb99ff Author: Matthew Allen Date: 2018-09-01T06:53:13Z Client and Translator classes for better handling of scripts commit e464d82913a805482bf3a9f7800e77dc1989247f Author: Matthew Allen Date: 2018-09-01T07:24:05Z Fix for numbers not being translated correctly in the bytecode translator commit 12e835086328a1a6ba8bf1f6f6aae24c8037b156 Author: Matthew Allen Date: 2018-09-05T19:50:42Z Changed Client implementation to wrap DriverRemoteConnection commit cbedb32642ef739aa6478735499866a1cfaa88e9 Author: Matthew Allen Date: 2018-10-04T19:57:57Z Test added to Client to confirm correct handling of non JS native types. Changed script submission to accept GraphSON v2. Reverted TraversalSource template to original. Removed configuration of standardOp Processor. Updated CHANGELOG and upgrade documentation. commit d43031a33c4886989b80db9f7bd10957904a91bb Author: Stephen Mallette Date: 2018-10-05T12:36:01Z Merge branch 'pr-922' into TINKERPOP-1959 commit ad624be50df60ba107cea2982ee760df4b80abda Author: Stephen Mallette Date: 2018-10-05T12:36:25Z TINKERPOP-1959 Handled EnumValue serialization in script bindings ---
[GitHub] tinkerpop pull request #951: Optimizes Set with enum using the EnumSet imple...
GitHub user otaviojava opened a pull request: https://github.com/apache/tinkerpop/pull/951 Optimizes Set with enum using the EnumSet implementation [tp32] This PR replaces the HashSet implementation to [EnumSet](https://docs.oracle.com/javase/7/docs/api/java/util/EnumSet.html) that as its documentation says: > A specialized Set implementation for use with enum types. All of the elements in an enum set must come from a single enum type that is specified, explicitly or implicitly, when the set is created. Enum sets are represented internally as bit vectors. This representation is extremely compact and efficient. The space and time performance of this class should be good enough to allow its use as a high-quality, typesafe alternative to traditional int-based "bit flags." Even bulk operations (such as containsAll and retainAll) should run very quickly if their argument is also an enum set. That is a continuation of the PR: https://github.com/apache/tinkerpop/pull/948 that has the same benchmark value. You can merge this pull request into a Git repository by running: $ git pull https://github.com/otaviojava/tinkerpop tp32_enum_set Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/951.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #951 commit 68f069d6adfe99e6a4d5fa96b7b88c5137773626 Author: Otavio Santana Date: 2018-10-05T10:57:30Z repleaces EnumSet to HashSet ---
[GitHub] tinkerpop pull request #948: Optimizes Map with enum using the EnumMap imple...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/948 ---
[GitHub] tinkerpop pull request #947: TINKERPOP-2055 Support NaN and Infinity in Grap...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/947 ---
[GitHub] tinkerpop pull request #947: TINKERPOP-2055 Support NaN and Infinity in Grap...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/947#discussion_r222757984 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js --- @@ -46,6 +46,30 @@ describe('GraphSONReader', function () { assert.strictEqual(result, item[1]); }); }); + it('should parse GraphSON Nan from GraphSON', function () { + const reader = new GraphSONReader(); + var result = reader.read({ +"@type": "g:Double", +"@value": "NaN" + }); + assert.ok(isNaN(result)); + }); + it('should parse GraphSON -Infinity and Nan from GraphSON', function () { --- End diff -- just missed the capitlization in that string. i can fix it ---
[GitHub] tinkerpop pull request #947: TINKERPOP-2055 Support NaN and Infinity in Grap...
Github user FlorianHockmann commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/947#discussion_r222751451 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js --- @@ -46,6 +46,30 @@ describe('GraphSONReader', function () { assert.strictEqual(result, item[1]); }); }); + it('should parse GraphSON Nan from GraphSON', function () { + const reader = new GraphSONReader(); + var result = reader.read({ +"@type": "g:Double", +"@value": "NaN" + }); + assert.ok(isNaN(result)); + }); + it('should parse GraphSON -Infinity and Nan from GraphSON', function () { --- End diff -- Just a minor nit but why does it say _and Nan_ when only `-Infinity` is tested here? ---
[GitHub] tinkerpop pull request #943: TINKERPOP-2044 Configurable traversal to valida...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/943 ---
[GitHub] tinkerpop pull request #944: TINKERPOP-2041 Text Predicates
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/944 ---
[GitHub] tinkerpop pull request #950: TINKERPOP-2058 Contains predicates should rely ...
GitHub user dkuppitz opened a pull request: https://github.com/apache/tinkerpop/pull/950 TINKERPOP-2058 Contains predicates should rely on Compare predicates https://issues.apache.org/jira/browse/TINKERPOP-2058 If the object to be filtered is a number, `Contains` predicates will now scan the provided collection, comparing each element using `Compare.eq`. For non-numeric values `Contains.within` will still use `collection.contains()` in order to make use of search-optimized data types (e.g. `Set`). This is a breaking change as the test suite previously ensured that number types had an effect on `Contains` predicates. This, however, was inconsistent with `Compare` predicates which ignore the number type. `docker/build.sh -t -i -n` passed. VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2058 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/950.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #950 commit ec0d8805fe18e6d1985af5544106f78169f3f5b4 Author: Daniel Kuppitz Date: 2018-10-04T14:15:09Z TINKERPOP-2058 Use `Compare.eq` in `Contains.within` to ensure equal filter behaviors. If the object to be filtered is a number, `Contains` predicates will now scan the provided collection, comparing each element using `Compare.eq`. For non-numeric values `Contains.within` will still use `collection.contains()` in order to make use of search-optimized data types (e.g. `Set`). ---
[GitHub] tinkerpop pull request #949: TINKERPOP-2056 Use NumberHelper in Compare
GitHub user dkuppitz opened a pull request: https://github.com/apache/tinkerpop/pull/949 TINKERPOP-2056 Use NumberHelper in Compare Instead of converting all numbers to `BigDecimal`, `Compare` predicates now use `NumberHelper` for numerical comparisons. `docker/build.sh -t -i -n` passed. VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2056 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/949.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #949 commit 8759b39ce83b2165bc1415d1feead005e970a505 Author: Daniel Kuppitz Date: 2018-10-04T14:07:27Z TINKERPOP-2056 Made use of `NumberHelper` in `Compare` predicates. ---
[GitHub] tinkerpop pull request #942: TINKERPOP-2049 Added with(k) overload
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/942 ---
[GitHub] tinkerpop pull request #941: TINKERPOP-2040 Improve flexibility of GroovyTra...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/941 ---
[GitHub] tinkerpop pull request #948: Optimizes Map with enum using the EnumMap imple...
GitHub user otaviojava opened a pull request: https://github.com/apache/tinkerpop/pull/948 Optimizes Map with enum using the EnumMap implementation This PR replaces the HashMap implementation to [EnumMap](https://docs.oracle.com/javase/8/docs/api/java/util/EnumMap.html) that as its documentation says: "A specialized Map implementation for use with enum type keys. All of the keys in an enum map must come from a single enum type that is specified, explicitly or implicitly, when the map is created. Enum maps are represented internally as arrays. This representation is extremely compact and efficient." You can merge this pull request into a Git repository by running: $ git pull https://github.com/otaviojava/tinkerpop tp32_enum_map Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/948.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #948 commit 9e1865a98d9350451d29dc837e053109d714d7e3 Author: Otavio Santana Date: 2018-10-03T17:17:07Z Optimazes Map with enum using the EnumMap implementation ---
[GitHub] tinkerpop pull request #947: TINKERPOP-2055 Support NaN and Infinity in Grap...
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/947 TINKERPOP-2055 Support NaN and Infinity in GraphSON https://issues.apache.org/jira/browse/TINKERPOP-2055 GraphSON wasn't supporting NaN and Infinity but Gryo was. Merging to tp33 and forward will require some additional commits for GraphSON 3.0. All tests pass with `docker/build.sh -t -n -i` VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2055 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/947.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #947 commit afc12bd27bc9c4c26b3ba2594c4c0810d5d76421 Author: Stephen Mallette Date: 2018-10-02T19:35:53Z TINKERPOP-2055 Added support for special Double values Includes Nan and the infinity values. commit 854914e6e3adbf7f0854eb0fec0c3a38b61d4644 Author: Stephen Mallette Date: 2018-10-02T20:55:50Z TINKERPOP-2055 Support for special numbers in python commit 2d3041f226310379c966214461c79cf47432f4c9 Author: Stephen Mallette Date: 2018-10-03T08:33:40Z TINKERPOP-2055 Added special number handling in javascript commit b542027825fe905c0c46b81a00fe7dfd5275e8c6 Author: Stephen Mallette Date: 2018-10-03T09:11:56Z TINKERPOP-2055 Added tests for .Net on special numbers commit a083fbff62fcc38a3dae9b138f56b0d052e0c143 Author: Stephen Mallette Date: 2018-10-03T09:30:27Z TINKERPOP-2055 Updated IO docs to include special numbers ---
[GitHub] tinkerpop pull request #928: TINKERPOP-2015 Expose WebSocket configuration i...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/928 ---
[GitHub] tinkerpop pull request #920: optmizes collection copy with Collections addAl...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/920 ---
[GitHub] tinkerpop pull request #944: TINKERPOP-2041 Text Predicates
Github user dkuppitz commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/944#discussion_r222065189 --- Diff: docs/src/reference/the-traversal.asciidoc --- @@ -3356,24 +3356,32 @@ interface. Steps that allow for this type of modulation will explicitly state so [[a-note-on-predicates]] == A Note on Predicates -A `P` is a predicate of the form `Function`. That is, given some object, return true or false. The -provided predicates are outlined in the table below and are used in various steps such as <>-step, +A `P` is a predicate of the form `Function`. That is, given some object, return true or false. As of +the relase of TinkerPop 3.4.0, Gremlin also supports simple text predicates, which only work on `String` values. The `TextP` +text predicates extend the `P` predicates, but are specialized in that they are of the form `Function`. +The provided predicates are outlined in the table below and are used in various steps such as <>-step, <>-step, <>-step, etc. [width="100%",cols="3,15",options="header"] |= | Predicate | Description -| `eq(object)` | Is the incoming object equal to the provided object? -| `neq(object)` | Is the incoming object not equal to the provided object? -| `lt(number)` | Is the incoming number less than the provided number? -| `lte(number)` | Is the incoming number less than or equal to the provided number? -| `gt(number)` | Is the incoming number greater than the provided number? -| `gte(number)` | Is the incoming number greater than or equal to the provided number? -| `inside(number,number)` | Is the incoming number greater than the first provided number and less than the second? -| `outside(number,number)` | Is the incoming number less than the first provided number or greater than the second? -| `between(number,number)` | Is the incoming number greater than or equal to the first provided number and less than the second? -| `within(objects...)` | Is the incoming object in the array of provided objects? -| `without(objects...)` | Is the incoming object not in the array of the provided objects? +| `P.eq(object)` | Is the incoming object equal to the provided object? +| `P.neq(object)` | Is the incoming object not equal to the provided object? +| `P.lt(number)` | Is the incoming number less than the provided number? +| `P.lte(number)` | Is the incoming number less than or equal to the provided number? +| `P.gt(number)` | Is the incoming number greater than the provided number? +| `P.gte(number)` | Is the incoming number greater than or equal to the provided number? +| `P.inside(number,number)` | Is the incoming number greater than the first provided number and less than the second? +| `P.outside(number,number)` | Is the incoming number less than the first provided number or greater than the second? +| `P.between(number,number)` | Is the incoming number greater than or equal to the first provided number and less than the second? +| `P.within(objects...)` | Is the incoming object in the array of provided objects? +| `P.without(objects...)` | Is the incoming object not in the array of the provided objects? +| `TextP.startsWith(string)` | Does the incoming `String` start with the provided `String`? +| `TextP.endsWith(string)` | Does the incoming `String` end with the provided `String`? +| `TextP.contains(string)` | Does the incoming `String` contain the provided `String`? +| `TextP.startsNotWith(string)` | TODO: find a better name --- End diff -- Sounds good to me, much better than what it is now. ---
[GitHub] tinkerpop pull request #944: TINKERPOP-2041 Text Predicates
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/944#discussion_r222063944 --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TextP.java --- @@ -0,0 +1,107 @@ +/* + * 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.process.traversal; + +import java.util.function.BiPredicate; + +/** + * @author Daniel Kuppitz (http://gremlin.guru) --- End diff -- Just needs some class javadoc - looks like you covered the methods pretty well. ---
[GitHub] tinkerpop pull request #944: TINKERPOP-2041 Text Predicates
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/944#discussion_r222063562 --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Text.java --- @@ -0,0 +1,123 @@ +/* + * 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.process.traversal; + +import java.util.function.BiPredicate; + +/** + * @author Daniel Kuppitz (http://gremlin.guru) + */ +public enum Text implements BiPredicate { --- End diff -- Could you please complete all the javadoc on this class since it's public facing like `Compare` - I think you need all the `@since` tags on everything in here. ---
[GitHub] tinkerpop pull request #944: TINKERPOP-2041 Text Predicates
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/944#discussion_r222062939 --- Diff: docs/src/reference/the-traversal.asciidoc --- @@ -3356,24 +3356,32 @@ interface. Steps that allow for this type of modulation will explicitly state so [[a-note-on-predicates]] == A Note on Predicates -A `P` is a predicate of the form `Function`. That is, given some object, return true or false. The -provided predicates are outlined in the table below and are used in various steps such as <>-step, +A `P` is a predicate of the form `Function`. That is, given some object, return true or false. As of +the relase of TinkerPop 3.4.0, Gremlin also supports simple text predicates, which only work on `String` values. The `TextP` +text predicates extend the `P` predicates, but are specialized in that they are of the form `Function`. +The provided predicates are outlined in the table below and are used in various steps such as <>-step, <>-step, <>-step, etc. [width="100%",cols="3,15",options="header"] |= | Predicate | Description -| `eq(object)` | Is the incoming object equal to the provided object? -| `neq(object)` | Is the incoming object not equal to the provided object? -| `lt(number)` | Is the incoming number less than the provided number? -| `lte(number)` | Is the incoming number less than or equal to the provided number? -| `gt(number)` | Is the incoming number greater than the provided number? -| `gte(number)` | Is the incoming number greater than or equal to the provided number? -| `inside(number,number)` | Is the incoming number greater than the first provided number and less than the second? -| `outside(number,number)` | Is the incoming number less than the first provided number or greater than the second? -| `between(number,number)` | Is the incoming number greater than or equal to the first provided number and less than the second? -| `within(objects...)` | Is the incoming object in the array of provided objects? -| `without(objects...)` | Is the incoming object not in the array of the provided objects? +| `P.eq(object)` | Is the incoming object equal to the provided object? +| `P.neq(object)` | Is the incoming object not equal to the provided object? +| `P.lt(number)` | Is the incoming number less than the provided number? +| `P.lte(number)` | Is the incoming number less than or equal to the provided number? +| `P.gt(number)` | Is the incoming number greater than the provided number? +| `P.gte(number)` | Is the incoming number greater than or equal to the provided number? +| `P.inside(number,number)` | Is the incoming number greater than the first provided number and less than the second? +| `P.outside(number,number)` | Is the incoming number less than the first provided number or greater than the second? +| `P.between(number,number)` | Is the incoming number greater than or equal to the first provided number and less than the second? +| `P.within(objects...)` | Is the incoming object in the array of provided objects? +| `P.without(objects...)` | Is the incoming object not in the array of the provided objects? +| `TextP.startsWith(string)` | Does the incoming `String` start with the provided `String`? +| `TextP.endsWith(string)` | Does the incoming `String` end with the provided `String`? +| `TextP.contains(string)` | Does the incoming `String` contain the provided `String`? +| `TextP.startsNotWith(string)` | TODO: find a better name --- End diff -- maybe we should put all the "nots" together so that: * `notStartingWith()` * `notEndingWith()` * `notContaining()` They seem to read a bit less awkwardly when I say them out loud. if we wanted we could make it all consistent and be like: * `startingWith()` * `endingWith()` * `containing()` * `notStartingWith()` * `notEndingWith()` * `notContaining()` but maybe not necessary??? ---
[GitHub] tinkerpop pull request #946: TINKERPOP-2037 removed groovy-sql
GitHub user robertdale opened a pull request: https://github.com/apache/tinkerpop/pull/946 TINKERPOP-2037 removed groovy-sql Removed unused groovy-sql dependency. https://issues.apache.org/jira/browse/TINKERPOP-2037 `sh docker/build.sh -i -t` BUILD SUCCESS VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2037 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/946.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #946 commit 24ca28e08fa8a672f64c93fe95e5ae9ffa06dbee Author: Robert Dale Date: 2018-10-02T16:24:31Z TINKERPOP-2037 removed groovy-sql ---
[GitHub] tinkerpop pull request #945: TINKERPOP-2053 Support for OptionsStrategy
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/945 TINKERPOP-2053 Support for OptionsStrategy https://issues.apache.org/jira/browse/TINKERPOP-2053 `OptionsStrategy` lets users pass arbitrary configurations at a traversal level. At first I thought this might be a first class object, but decided instead to try it out as a `TraversalStrategy`. In that way it was implemented with little overhead. If it becomes useful and popular in the future then we can consider making it more integrated into the `TraversalSource` and `Traversal` itself. I didn't implement this for javascript because I don't think we have all the infrastructure there for supporting `TraversalStrategy` stuff yet. All tests pass with `docker/build.sh -t -i` VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2053 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/945.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #945 commit 91573d5c7d44944186a9cd11ce880dec32caff47 Author: Stephen Mallette Date: 2018-10-01T20:02:46Z TINKERPOP-2053 Added OptionsStrategy Included a test in TinkerGraph rather than the main test suite because the test really isn't easily asserted without a custom step that reads the OptionsStrategy. commit 16c324e67686b5c7dbebe941928b56113048d21a Author: Stephen Mallette Date: 2018-10-02T15:44:22Z TINKERPOP-2053 Python support for OptionsStrategy commit 334ea8ae9a1c1168f285d43afcb9b71c836febe7 Author: Stephen Mallette Date: 2018-10-02T16:42:49Z TINKERPOP-2053 Added OptionsStrategy support for .NET commit 9b155132eb80efec52a34bf912ee2e247bc005b5 Author: Stephen Mallette Date: 2018-10-02T17:55:21Z TINKERPOP-2053 Added upgrade docs for OptionsStrategy ---
[GitHub] tinkerpop pull request #943: TINKERPOP-2044 Configurable traversal to valida...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/943#discussion_r221908780 --- Diff: gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java --- @@ -243,6 +243,8 @@ public static Settings from(final Configuration conf) { if (connectionPoolConf.containsKey("keepAliveInterval")) cpSettings.keepAliveInterval = connectionPoolConf.getLong("keepAliveInterval"); +if (connectionPoolConf.containsKey("validationRequest")) +cpSettings.validationRequest = connectionPoolConf.getList("validationRequest").stream().map(Object::toString).collect(Collectors.joining(",")); --- End diff -- I thought that period as with the script `g.inject()` was being treated as a delimiter for Apache Configuration, but I can't get the test to fail anymore, so I must have been mistaken in what I was seeing. changing it. ---
[GitHub] tinkerpop pull request #943: TINKERPOP-2044 Configurable traversal to valida...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/943#discussion_r221908735 --- Diff: gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java --- @@ -575,6 +585,8 @@ SslContext createSSLContext() throws Exception { private String trustStore = null; private String trustStorePassword = null; private String keyStoreType = null; +private String validationRequest = "''"; +private boolean useBytecodeForValidation = false; --- End diff -- Thought i got them all - fixed. ---
[GitHub] tinkerpop pull request #943: TINKERPOP-2044 Configurable traversal to valida...
Github user robertdale commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/943#discussion_r221858009 --- Diff: gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java --- @@ -575,6 +585,8 @@ SslContext createSSLContext() throws Exception { private String trustStore = null; private String trustStorePassword = null; private String keyStoreType = null; +private String validationRequest = "''"; +private boolean useBytecodeForValidation = false; --- End diff -- `useBytecodeForValidation` was added but doesn't appear to be used anywhere else. ---
[GitHub] tinkerpop pull request #943: TINKERPOP-2044 Configurable traversal to valida...
Github user robertdale commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/943#discussion_r221859065 --- Diff: gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java --- @@ -243,6 +243,8 @@ public static Settings from(final Configuration conf) { if (connectionPoolConf.containsKey("keepAliveInterval")) cpSettings.keepAliveInterval = connectionPoolConf.getLong("keepAliveInterval"); +if (connectionPoolConf.containsKey("validationRequest")) +cpSettings.validationRequest = connectionPoolConf.getList("validationRequest").stream().map(Object::toString).collect(Collectors.joining(",")); --- End diff -- Why is this `getList()` instead of `getString()`? ---
[GitHub] tinkerpop pull request #939: TINKERPOP-2045 removed duplicate non-indy groov...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/939 ---
[GitHub] tinkerpop pull request #944: TINKERPOP-2041 Text Predicates
GitHub user dkuppitz opened a pull request: https://github.com/apache/tinkerpop/pull/944 TINKERPOP-2041 Text Predicates https://issues.apache.org/jira/browse/TINKERPOP-2041 This PR adds a few text predicates (`TP`): * `startsWith` * `endsWith` * `contains` By the contract definition, every predicate needs an opposite predicate, hence I also added the following: * `startsNotWith` * `endsNotWith` * `absent` However, I don't like the naming too much. If anybody has better suggestions, I'm all ears. `docker/build.sh -t -i -n` passed. VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2041 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/944.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #944 commit 242a9e399f4c73c02068dda73cc3bd52eeb7e00f Author: Daniel Kuppitz Date: 2018-09-26T22:44:35Z TINKERPOP-2041 Implemented text predicates commit 1a0ca3ade124dcc34761085ee58db2f7e68e3d06 Author: Stephen Mallette Date: 2018-09-27T20:33:26Z TINKERPOP-2041 Fixed gremlin-javascript serializers for TP commit 441cf6aa4769805215045e460e1daad8b46a1cfb Author: Stephen Mallette Date: 2018-09-28T12:27:25Z TINKERPOP-2041 Fixed .NET tests around TP predicates ---
[GitHub] tinkerpop pull request #943: TINKERPOP-2044 Configurable traversal to valida...
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/943 TINKERPOP-2044 Configurable traversal to validate host connectivity. https://issues.apache.org/jira/browse/TINKERPOP-2044 The user can now configure the script used to validate the operations of the remote. ```text Cluster cluster = Cluster.build().validationRequest("g.inject()").create() ``` Builds with `mvn clean install -pl gremlin-driver && mvn verify -pl gremlin-server -DskipIntegrationTests=false` VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2044 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/943.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #943 commit bd1760f56a1e70cc49f4129a367c60e748aa54ad Author: Stephen Mallette Date: 2018-09-28T19:54:30Z TINKERPOP-2044 Configurable traversal to validate host connectivity. ---
[GitHub] tinkerpop pull request #940: TINKERPOP-2039 Bump to Groovy 2.5.2
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/940 ---
[GitHub] tinkerpop pull request #938: Add link to Elixir language driver
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/938 ---
[GitHub] tinkerpop pull request #942: TINKERPOP-2049 Added with(k) overload
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/942 TINKERPOP-2049 Added with(k) overload https://issues.apache.org/jira/browse/TINKERPOP-2049 Makes flag-like uses of with() a bit more succinct. Basically, the shorthand of `with(k,true)` is simply `with(k)`. All tests pass with `docker/build.sh -t -n -i` VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2049 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/942.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #942 commit 4025af9cf1cc521c80c4cbc6a30691d879e84659 Author: Stephen Mallette Date: 2018-09-27T12:49:41Z TINKERPOP-2049 Added with(k) overload Makes flag-like uses of with() a bit more succinct. ---
[GitHub] tinkerpop pull request #935: TINKERPOP-2025 Change to SHA-256/512 and drop S...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/935 ---
[GitHub] tinkerpop pull request #929: TINKERPOP-2035 Pass custom headers to the webso...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/929 ---
[GitHub] tinkerpop pull request #941: TINKERPOP-2040 Improve flexibility of GroovyTra...
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/941 TINKERPOP-2040 Improve flexibility of GroovyTranslator to handle custom types https://issues.apache.org/jira/browse/TINKERPOP-2040 Handled all of the core GraphSON types in the `GroovyTranslator`. Included a new `TypeTranslator` to allow the behavior of the `ScriptTranslator` to be modified and allowed the `GremlinGroovyScriptEngine` to accept a `TranslatorCustomizer` to allow that custom `TypeTranslator` to be used. All tests pass with `docker/build.sh -t -i` VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2040 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/941.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #941 commit b33c8c683d7e95cfccae07b20dccf54a83b5eba0 Author: Stephen Mallette Date: 2018-09-20T15:53:07Z TINKERPOP-2040 Provide improved type handling for GroovyTranslator Refactored testing and added support for UUID, Date, Timestamp as well as a method to override standard type handling. commit 873609bcb23552d033de91282bde3705f729fdc2 Author: Stephen Mallette Date: 2018-09-25T17:46:38Z TINKERPOP-2040 Added more tests to cover more GraphSON types commit 93d99ef1a0119b4c0994daeccaf312d45c894f45 Author: Stephen Mallette Date: 2018-09-25T21:29:49Z TINKERPOP-2040 Hooked up Customizer for TypeTranslator Enables the Groovy GremlinScriptEngine to use custom TypeTranslators ---
[GitHub] tinkerpop pull request #940: TINKERPOP-2039 Bump to Groovy 2.5.2
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/940 TINKERPOP-2039 Bump to Groovy 2.5.2 https://issues.apache.org/jira/browse/TINKERPOP-2039 Required some minor changes to the Console as the CliBuilder is no longer the recommended approach for Groovy - had to use picocli classes instead. Still couldn't make the command line parsing work exclusively under picocli - I think we have somewhat nonstandard options in our command line. Performed manual tests and builds with `mvn clean install && mvn verify -pl gremlin-console -DskipIntegrationTests=false`. VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2039 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/940.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #940 commit 0c2347b535e2120c72278b011fe3dce0ec36bdf5 Author: Stephen Mallette Date: 2018-09-19T14:50:20Z TINKERPOP-2039 Bump to Groovy 2.5.2 Required some minor changes to the Console as the CliBuilder is no longer the recommended approach for Groovy - had to use picocli classes instead. Still couldn't make the command line parsing work exclusively under picocli - I think we have somewhat nonstandard options in our command line. ---
[GitHub] tinkerpop pull request #939: TINKERPOP-2045 removed duplicate non-indy groov...
GitHub user robertdale opened a pull request: https://github.com/apache/tinkerpop/pull/939 TINKERPOP-2045 removed duplicate non-indy groovy core dep https://issues.apache.org/jira/browse/TINKERPOP-2045 Exclude non-indy transitive dep on groovy core. You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2045 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/939.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #939 commit 6e320daa57a9ec9acb19a213f6dd2081e70e2e26 Author: Robert Dale Date: 2018-09-25T11:40:50Z TINKERPOP-2045 removed duplicate non-indy groovy core dep ---
[GitHub] tinkerpop pull request #933: TINKERPOP-1913 Make status attributes available
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/933 ---
[GitHub] tinkerpop pull request #936: Apply StringEscapeUtils in GroovyTranslator#con...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/936 ---
[GitHub] tinkerpop pull request #937: Apply StringEscapeUtils in GroovyTranslator#con...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/937 ---
[GitHub] tinkerpop pull request #934: Apply StringEscapeUtils in GroovyTranslator#con...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/934 ---
[GitHub] tinkerpop pull request #938: Add link to Elixir language driver
GitHub user samhavens opened a pull request: https://github.com/apache/tinkerpop/pull/938 Add link to Elixir language driver We have an Elixir language driver for Gremlin and would like the community to be aware of it. You can merge this pull request into a Git repository by running: $ git pull https://github.com/samhavens/tinkerpop patch-1 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/938.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #938 commit c9777b6533f11d707bfffcdd36357b05c599978c Author: Sam Havens Date: 2018-09-24T23:04:49Z Add link to Elixir language driver We have an Elixir language driver for Gremlin and would like the community to be aware of it. ---
[GitHub] tinkerpop pull request #937: Apply StringEscapeUtils in GroovyTranslator#con...
GitHub user justinchuch opened a pull request: https://github.com/apache/tinkerpop/pull/937 Apply StringEscapeUtils in GroovyTranslator#convertToString(String) [master] Preface: There's character escaping issue when translating. What's changed: - Merge the changes from tp33 You can merge this pull request into a Git repository by running: $ git pull https://github.com/justinchuch/tinkerpop groovy-translator-master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/937.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #937 commit aff2037b5973c62c0292ab3065761e923899aa57 Author: Justin Chu <15710241+justinchuch@...> Date: 2018-09-21T19:12:26Z Apply StringEscapeUtils in GroovyTranslator#convertToString(String) commit 02e412d92d6f6c7004bdeef206e3d7adb9bd148a Author: Justin Chu <15710241+justinchuch@...> Date: 2018-09-24T15:41:36Z Merge branch 'groovy-translator-tp32' into groovy-translator-tp33 commit 3f221968d79e2db6e170eec9285cb75d8cb203f0 Author: Justin Chu <15710241+justinchuch@...> Date: 2018-09-24T16:44:17Z Adjust test cases for tp33 commit 7d7e4c0a6344b1eafc86df11580a19e5a0a0fbeb Author: Justin Chu <15710241+justinchuch@...> Date: 2018-09-24T16:57:47Z Merge branch 'groovy-translator-tp33' into groovy-translator-master ---
[GitHub] tinkerpop pull request #936: Apply StringEscapeUtils in GroovyTranslator#con...
GitHub user justinchuch opened a pull request: https://github.com/apache/tinkerpop/pull/936 Apply StringEscapeUtils in GroovyTranslator#convertToString(String) [tp33] Preface: There's character escaping issue when translating. What's changed: - Merge the changes from tp32 - org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslatorTest Adjust the test case to verify the changes in tp33. You can merge this pull request into a Git repository by running: $ git pull https://github.com/justinchuch/tinkerpop groovy-translator-tp33 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/936.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #936 commit aff2037b5973c62c0292ab3065761e923899aa57 Author: Justin Chu <15710241+justinchuch@...> Date: 2018-09-21T19:12:26Z Apply StringEscapeUtils in GroovyTranslator#convertToString(String) commit 02e412d92d6f6c7004bdeef206e3d7adb9bd148a Author: Justin Chu <15710241+justinchuch@...> Date: 2018-09-24T15:41:36Z Merge branch 'groovy-translator-tp32' into groovy-translator-tp33 commit 3f221968d79e2db6e170eec9285cb75d8cb203f0 Author: Justin Chu <15710241+justinchuch@...> Date: 2018-09-24T16:44:17Z Adjust test cases for tp33 ---
[GitHub] tinkerpop pull request #935: TINKERPOP-2025 Change to SHA-256/512 and drop S...
GitHub user dkuppitz opened a pull request: https://github.com/apache/tinkerpop/pull/935 TINKERPOP-2025 Change to SHA-256/512 and drop SHA-1 for releases https://issues.apache.org/jira/browse/TINKERPOP-2025 Unfortunately, upgrading the Apache parent pom didn't solve the problem completely. With the upgrade we get the sha512 checksum file for the source release, but not for the other artifacts. This PR upgrades the parent pom, but also adds a step in the release process to replace any remaining sha1 checksum file with its sha512 counterpart. The release validation script was adjusted to reflect those changes; the validation will fail if there exists * a md5 file * a sha1 file * no asc file * no sha512 file ... for any of the release artifacts. VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2025 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/935.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #935 commit 1fb3431910c0b22a06c3c9b86020c9e4db36af96 Author: Daniel Kuppitz Date: 2018-09-24T15:47:27Z Remove release artifact SHA1 checksums and generate SHA512 checksums instead. ---
[GitHub] tinkerpop pull request #934: Apply StringEscapeUtils in GroovyTranslator#con...
Github user justinchuch commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/934#discussion_r219678394 --- Diff: gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java --- @@ -115,7 +116,8 @@ else if (object instanceof Bytecode) else if (object instanceof Traversal) return convertToString(((Traversal) object).asAdmin().getBytecode()); else if (object instanceof String) { -return (((String) object).contains("\"") ? "\"\"\"" + object + "\"\"\"" : "\"" + object + "\"").replace("$", "\\$"); +return (((String) object).contains("\"") ? "\"\"\"" + StringEscapeUtils.escapeJava((String) object) + "\"\"\"" : "\"" + StringEscapeUtils.escapeJava((String) object) + "\"") +.replace("$", "\\$"); --- End diff -- The final `replace("$", "\\$")` has to be preserved or else some other original tests will be failed. ---
[GitHub] tinkerpop pull request #934: Apply StringEscapeUtils in GroovyTranslator#con...
Github user justinchuch commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/934#discussion_r219678287 --- Diff: gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java --- @@ -141,4 +144,52 @@ public void shouldHandleEmptyMaps() { public void shouldHaveValidToString() { assertEquals("translator[h:gremlin-groovy]", GroovyTranslator.of("h").toString()); } + +@Test +@LoadGraphWith(LoadGraphWith.GraphData.MODERN) +public void shouldHandleTraversalAddV() { --- End diff -- I have renamed the test method and separate into two: 1. `shouldEscapeStrings` 2. `shouldHandleVertexAndEdge` ---
[GitHub] tinkerpop pull request #934: Apply StringEscapeUtils in GroovyTranslator#con...
Github user justinchuch commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/934#discussion_r219676264 --- Diff: gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java --- @@ -141,4 +144,52 @@ public void shouldHandleEmptyMaps() { public void shouldHaveValidToString() { assertEquals("translator[h:gremlin-groovy]", GroovyTranslator.of("h").toString()); } + +@Test +@LoadGraphWith(LoadGraphWith.GraphData.MODERN) --- End diff -- Thanks for pointing that out. I have combined the tests. ---
[GitHub] tinkerpop pull request #934: Apply StringEscapeUtils in GroovyTranslator#con...
Github user justinchuch commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/934#discussion_r219676198 --- Diff: gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java --- @@ -141,4 +144,52 @@ public void shouldHandleEmptyMaps() { public void shouldHaveValidToString() { assertEquals("translator[h:gremlin-groovy]", GroovyTranslator.of("h").toString()); } + +@Test +@LoadGraphWith(LoadGraphWith.GraphData.MODERN) +public void shouldHandleTraversalAddV() { +final GraphTraversalSource g = graph.traversal(); +final String script = GroovyTranslator.of("g").translate(g.addV("customer") +.property("customer_id", 501L) +.property("name", "Foo\u0020Bar") +.property("salary", "\u0024\u00201000") +.property("age", 25) +.asAdmin().getBytecode()); + +assertEquals("g.addV(\"customer\")" + +".property(\"customer_id\",501L)" + +".property(\"name\",\"Foo\u0020Bar\")" + + ".property(\"salary\",\"\u005c\u005c\u0024\u00201000\")" + +".property(\"age\",(int) 25)", +script); +} + +@Test +@LoadGraphWith(LoadGraphWith.GraphData.MODERN) +public void shouldHandleVertex() { +final GraphTraversalSource g = graph.traversal(); + +final String label1 = "customer"; +final Object id1 = "name:20:foo\u0020bar#50"; + +final Vertex vertex1 = DetachedVertex.build().setLabel(label1).setId(id1).create(); +final String script1 = GroovyTranslator.of("g").translate(g.V().inject(vertex1).asAdmin().getBytecode()); +assertEquals("g.V().inject(new org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex(\"name:20:foo bar#50\",\"customer\", Collections.emptyMap()))", script1); + +final String label2 = "user"; +final Object id2 = "name:20:foo\\u0020bar#50"; + +final Vertex vertex2 = DetachedVertex.build().setLabel(label2).setId(id2).create(); +final String script2 = GroovyTranslator.of("g").translate(g.V().inject(vertex2).asAdmin().getBytecode()); +assertEquals("g.V().inject(new org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex(\"name:20:foou0020bar#50\",\"user\", Collections.emptyMap()))", script2); +} + +@Test +@LoadGraphWith(LoadGraphWith.GraphData.MODERN) +public void shouldHandleLambda() { --- End diff -- I have appended the test `shouldSupportStringSupplierLambdas` to include assert the result of `translate`. ---
[GitHub] tinkerpop pull request #:
Github user srondelli commented on the pull request: https://github.com/apache/tinkerpop/commit/564236ed6aa84682fa5f25d07347d8dfcf73b69a#commitcomment-30598427 Hi Stephen, There are 2 problems with this solution, 1. It doesn't solve the problem of too many keepAlive requests queued up (and subsequently sent to the Server) 2. When the queue will get full (which will happen if you have an intense workload with many queries sent every second) you'll start to discard also important jobs. I'm preparing a pull request based on the fix proposed in the Jira issue. ---
[GitHub] tinkerpop pull request #934: Apply StringEscapeUtils in GroovyTranslator#con...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/934#discussion_r219608379 --- Diff: gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java --- @@ -115,7 +116,8 @@ else if (object instanceof Bytecode) else if (object instanceof Traversal) return convertToString(((Traversal) object).asAdmin().getBytecode()); else if (object instanceof String) { -return (((String) object).contains("\"") ? "\"\"\"" + object + "\"\"\"" : "\"" + object + "\"").replace("$", "\\$"); +return (((String) object).contains("\"") ? "\"\"\"" + StringEscapeUtils.escapeJava((String) object) + "\"\"\"" : "\"" + StringEscapeUtils.escapeJava((String) object) + "\"") +.replace("$", "\\$"); --- End diff -- since you used the "groovy" package for this, i was wondering if it still handles the "$" properly or if we still need the final `replace("$", "\\$")`? either way, could you please modify your tests to include a "$" character so that we can be sure that gets asserted? ---
[GitHub] tinkerpop pull request #934: Apply StringEscapeUtils in GroovyTranslator#con...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/934#discussion_r219607573 --- Diff: gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java --- @@ -141,4 +144,52 @@ public void shouldHandleEmptyMaps() { public void shouldHaveValidToString() { assertEquals("translator[h:gremlin-groovy]", GroovyTranslator.of("h").toString()); } + +@Test +@LoadGraphWith(LoadGraphWith.GraphData.MODERN) +public void shouldHandleTraversalAddV() { --- End diff -- the names of our tests are meant to convey information about what is being tested (when possible). to that end, you're not really testing "addV()" here but you're testing "string escaping", so something more like `shouldEscapeStrings()` would probably be a better name. I would probably combine this test with `shouldHandleVertex()` as they are both validating the "escaping" but if you have a better name for that test as it test something more specific than that then feel free to just rename the other test and keep them separate. ---
[GitHub] tinkerpop pull request #934: Apply StringEscapeUtils in GroovyTranslator#con...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/934#discussion_r219606770 --- Diff: gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java --- @@ -141,4 +144,52 @@ public void shouldHandleEmptyMaps() { public void shouldHaveValidToString() { assertEquals("translator[h:gremlin-groovy]", GroovyTranslator.of("h").toString()); } + +@Test +@LoadGraphWith(LoadGraphWith.GraphData.MODERN) --- End diff -- It doesn't look like you need the "modern" graph data here - you can remove this annotation. ---
[GitHub] tinkerpop pull request #925: TINKERPOP-2026 Make closing of connections more...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/925 ---
[GitHub] tinkerpop pull request #934: Apply StringEscapeUtils in GroovyTranslator#con...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/934#discussion_r219606369 --- Diff: gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java --- @@ -141,4 +144,52 @@ public void shouldHandleEmptyMaps() { public void shouldHaveValidToString() { assertEquals("translator[h:gremlin-groovy]", GroovyTranslator.of("h").toString()); } + +@Test +@LoadGraphWith(LoadGraphWith.GraphData.MODERN) +public void shouldHandleTraversalAddV() { +final GraphTraversalSource g = graph.traversal(); +final String script = GroovyTranslator.of("g").translate(g.addV("customer") +.property("customer_id", 501L) +.property("name", "Foo\u0020Bar") +.property("salary", "\u0024\u00201000") +.property("age", 25) +.asAdmin().getBytecode()); + +assertEquals("g.addV(\"customer\")" + +".property(\"customer_id\",501L)" + +".property(\"name\",\"Foo\u0020Bar\")" + + ".property(\"salary\",\"\u005c\u005c\u0024\u00201000\")" + +".property(\"age\",(int) 25)", +script); +} + +@Test +@LoadGraphWith(LoadGraphWith.GraphData.MODERN) +public void shouldHandleVertex() { +final GraphTraversalSource g = graph.traversal(); + +final String label1 = "customer"; +final Object id1 = "name:20:foo\u0020bar#50"; + +final Vertex vertex1 = DetachedVertex.build().setLabel(label1).setId(id1).create(); +final String script1 = GroovyTranslator.of("g").translate(g.V().inject(vertex1).asAdmin().getBytecode()); +assertEquals("g.V().inject(new org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex(\"name:20:foo bar#50\",\"customer\", Collections.emptyMap()))", script1); + +final String label2 = "user"; +final Object id2 = "name:20:foo\\u0020bar#50"; + +final Vertex vertex2 = DetachedVertex.build().setLabel(label2).setId(id2).create(); +final String script2 = GroovyTranslator.of("g").translate(g.V().inject(vertex2).asAdmin().getBytecode()); +assertEquals("g.V().inject(new org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex(\"name:20:foou0020bar#50\",\"user\", Collections.emptyMap()))", script2); +} + +@Test +@LoadGraphWith(LoadGraphWith.GraphData.MODERN) +public void shouldHandleLambda() { --- End diff -- is this doing anything discernibly different than `shouldSupportStringSupplierLambdas()` test above? if there is a specific you are trying to assert here, perhaps it could be just appended into that test? ---
[GitHub] tinkerpop pull request #934: Apply StringEscapeUtils in GroovyTranslator#con...
GitHub user justinchuch opened a pull request: https://github.com/apache/tinkerpop/pull/934 Apply StringEscapeUtils in GroovyTranslator#convertToString(String) Preface: There's character escaping issue when translating. What's changed: - `org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslator#convertToString` Apply `StringEscapeUtils.escapeJava(String)` for String object. - `org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslatorTest` Add a few test cases to verify the changes. You can merge this pull request into a Git repository by running: $ git pull https://github.com/justinchuch/tinkerpop groovy-translator-tp32 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/934.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #934 commit 3416e52db8c2f81239a774e2dd17b09a9e471b14 Author: Justin Chu <15710241+justinchuch@...> Date: 2018-09-21T19:12:26Z Apply StringEscapeUtils in GroovyTranslator#convertToString(String) ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user jorgebay commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r219471784 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.js --- @@ -0,0 +1,87 @@ +/* + * 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. + */ +'use strict'; + +const DriverRemoteConnection = require('./driver-remote-connection'); +const Bytecode = require('../process/bytecode'); + +class Client { + /** + * Creates a new instance of DriverRemoteConnection. + * @param {String} url The resource uri. + * @param {Object} [options] The connection options. + * @param {Array} [options.ca] Trusted certificates. + * @param {String|Array|Buffer} [options.cert] The certificate key. + * @param {String} [options.mimeType] The mime type to use. + * @param {String|Buffer} [options.pfx] The private key, certificate, and CA certs. + * @param {GraphSONReader} [options.reader] The reader to use. + * @param {Boolean} [options.rejectUnauthorized] Determines whether to verify or not the server certificate. + * @param {String} [options.traversalSource] The traversal source. Defaults to: 'g'. + * @param {GraphSONWriter} [options.writer] The writer to use. + * @param {Authenticator} [options.authenticator] The authentication handler to use. + * @constructor + */ + constructor(url, options) { +this._options = options; +this._connection = new DriverRemoteConnection(url, options); + } + + /** + * Opens the underlying connection to the Gremlin Server, if it's not already opened. + * @returns {Promise} + */ + open() { +return this._connection.open(); + } + + /** + * Send a request to the Gremlin Server, can send a script or bytecode steps. + * @param {Bytecode|string} message The bytecode or script to send + * @param {Object} bindings The script bindings, if any. + * @returns {Promise} + */ + submit(message, bindings) { +if (typeof message === 'string' || message instanceof String) { + const args = { +'gremlin': message, +'bindings': bindings, --- End diff -- oh, I see that `args` are adapted by the `Connection` afterwards, never mind my previous comment. @mattallenuk: Can we include a test containing a binding like a `Long` or `Set` or any type that is not a native js type? ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user jorgebay commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r219469511 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.js --- @@ -0,0 +1,87 @@ +/* + * 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. + */ +'use strict'; + +const DriverRemoteConnection = require('./driver-remote-connection'); +const Bytecode = require('../process/bytecode'); + +class Client { + /** + * Creates a new instance of DriverRemoteConnection. + * @param {String} url The resource uri. + * @param {Object} [options] The connection options. + * @param {Array} [options.ca] Trusted certificates. + * @param {String|Array|Buffer} [options.cert] The certificate key. + * @param {String} [options.mimeType] The mime type to use. + * @param {String|Buffer} [options.pfx] The private key, certificate, and CA certs. + * @param {GraphSONReader} [options.reader] The reader to use. + * @param {Boolean} [options.rejectUnauthorized] Determines whether to verify or not the server certificate. + * @param {String} [options.traversalSource] The traversal source. Defaults to: 'g'. + * @param {GraphSONWriter} [options.writer] The writer to use. + * @param {Authenticator} [options.authenticator] The authentication handler to use. + * @constructor + */ + constructor(url, options) { +this._options = options; +this._connection = new DriverRemoteConnection(url, options); + } + + /** + * Opens the underlying connection to the Gremlin Server, if it's not already opened. + * @returns {Promise} + */ + open() { +return this._connection.open(); + } + + /** + * Send a request to the Gremlin Server, can send a script or bytecode steps. + * @param {Bytecode|string} message The bytecode or script to send + * @param {Object} bindings The script bindings, if any. + * @returns {Promise} + */ + submit(message, bindings) { +if (typeof message === 'string' || message instanceof String) { + const args = { +'gremlin': message, +'bindings': bindings, --- End diff -- I think bindings need to be serialized. Currently, I think it will only work with json supported types (boolean, number, strings), but it should work with any type supported by GraphSON2. ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user mattallenuk commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r218858884 --- Diff: gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml --- @@ -41,6 +41,7 @@ serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} processors: - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 2880 }} + - { className: org.apache.tinkerpop.gremlin.server.op.standard.StandardOpProcessor, config: { maxParameters: 64 }} --- End diff -- No we don't I'd just read somewhere that it was the recommended. I'll remove that option so the default is used. ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r218854373 --- Diff: gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml --- @@ -41,6 +41,7 @@ serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} processors: - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 2880 }} + - { className: org.apache.tinkerpop.gremlin.server.op.standard.StandardOpProcessor, config: { maxParameters: 64 }} --- End diff -- Do we have to test for more than the default parameters (which is 16)? ---
[GitHub] tinkerpop pull request #930: TINKERPOP-2032 bump jython-standalone 2.7.1
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/930 ---
[GitHub] tinkerpop pull request #933: TINKERPOP-1913 Make status attributes available
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/933 TINKERPOP-1913 Make status attributes available https://issues.apache.org/jira/browse/TINKERPOP-1913 Status attributes have always been returned from Gremlin Server but they haven't been easy to access unless you were working with the lower end of the protocol. They are now available in a fairly wide number of ways across most of the various drivers in a fairly consistent fashion. The current gap in this feature is related to gremlin-javascript probably needs #922 - [TINKERPOP-1959](https://issues.apache.org/jira/browse/TINKERPOP-1959) so that we even have a "ResultSet" of sorts to hold the status attributes and make them available. All tests pass with `docker/build.sh -t -n -i` VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1913 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/933.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #933 commit fb3984aad10b1aa78a75a8d4d370e89fa384bac1 Author: Stephen Mallette Date: 2018-03-07T15:29:11Z TINKERPOP-1913 Made status attributes available to the ResultSet commit 60883a109d493f39b0c0445582a199a65037d1ab Author: Stephen Mallette Date: 2018-03-07T17:05:23Z TINKERPOP-1913 Added status attribute access to traversal side-effects commit fe5ae5c369d4724e2c44d74de5357bf894126b9a Author: Ashwini Singh Date: 2018-05-14T18:42:54Z status attribute for gremlin dotnet commit 705ce4ee3816884a57ee00aef9f5b65eafb0004a Author: Ashwini Singh Date: 2018-05-14T18:48:29Z Adding comment commit 6310dabb7fc33c44b97ef75e9a8663aa17e51319 Author: Ashwini Singh Date: 2018-05-16T19:14:01Z Addressing review comments commit 24e08d2b99d77ae634576acc6cd0c4061d1b0bac Author: Stephen Mallette Date: 2018-08-16T12:08:11Z TINKERPOP-1913 Corrected status attributes messages after rebase Test graphs are now named differently given the refactoring that went into improving integration configurations. Also fixed a bug in NO_CONTENT messages and added a test. commit f7193c90a3cd1433961028e2e5ad7e330b08c339 Author: Stephen Mallette Date: 2018-08-16T13:24:21Z TINKERPOP-1913 Fixed compile error after rebase on master commit 956b177f7a62b45713bd7111f139c1140c974915 Author: Stephen Mallette Date: 2018-08-16T14:38:48Z TINKERPOP-1913 ResponseException will have status attributes present commit 7fca7af74e5bd2695ba6035cf341543f9750fc4d Author: Stephen Mallette Date: 2018-08-16T15:38:09Z TINKERPOP-1913 Refactored how response status attributes are set Didn't seem necessary to set them directly into a member variable on ResultQueue when they could be passed more safely by just including them with the completion state update commit 137f36510a134f4599dc30210341004b6912fbfd Author: Patrik Husfloen Date: 2018-09-05T21:40:57Z Exposes ResultSet on GremlinClient. Adds StatusAttributes property on ResponseException. Removed explicit this from ResultSet to align with existing style. commit 5de845462c61c81cdccf50088481ab5ac831ec4c Author: Patrik Husfloen Date: 2018-09-06T21:16:56Z Updates GremlinClientExtension to pass through ResultSet from client. commit c720dba7ffa212fc8574af84f4fc90f1b7174b58 Author: Patrik Husfloen Date: 2018-09-08T14:54:11Z Adds StatusCode (of type ResponseStatusCode) property on ResponseException. commit cbc2b68959842a3a01b9f776ed42486d3a135684 Author: Patrik Husfloen Date: 2018-09-13T21:39:19Z Tweaks xml doc comment formatting to match existing code. commit 5eac32efb135520f2d0c844bd085df5204b7920c Author: Patrik Husfloen Date: 2018-09-13T21:58:32Z Fixes incorrect usage of commit 55549cfd49817da35c4dd460b596c734daaaf011 Author: Stephen Mallette Date: 2018-09-18T16:45:15Z TINKERPOP-1913 Modified changelog commit 9a8f57623a2482711007a840bf0c9ede247943f3 Author: Stephen Mallette Date: 2018-09-18T16:47:43Z TINKERPOP-1913 Cleaned up deprecation messages commit bb01d96fbd7efdd4de30d7c0e570e48b91c0d490 Author: Stephen Mallette Date: 2018-09-18T17:15:59Z TINKERPOP-1913 Upgrade docs for status attributes on responses commit 49b1507fdcf15bed2667beb205357cb44a4d57e8 Author: Stephen Mallette Date: 2018-09-18T19:06:46Z TINKERPOP-1913 Added status attributes to ResultSet for python commit d457d7cba5a4a136597127c2793014bafa47b843 Author: Stephen Mallette Date: 2018-09-18T19:38:44Z TINKERPOP-1913 GremlinServerError for python has status attributes now commit 3aacd06fa84c4250505aad3809265a578cfc3d8f Author: Stephen Mallette Date: 2018-09-18T19:51:32Z TINKERPOP-1913 Retrieve status attributes through side-effects in
[GitHub] tinkerpop pull request #915: Tinkerpop 1913-Followup
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/915 ---
[GitHub] tinkerpop pull request #932: TINKERPOP-2033 Maintain order in profile() anno...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/932 ---
[GitHub] tinkerpop pull request #931: TINKERPOP-2029 ConcurrentModificationException ...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/931 ---
[GitHub] tinkerpop pull request #932: TINKERPOP-2033 Maintain order in profile() anno...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/932#discussion_r218272943 --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java --- @@ -427,7 +428,12 @@ else if (1 == arguments) output.writeString(object.getName()); output.writeDouble(object.getDuration(TimeUnit.NANOSECONDS) / 100d); kryo.writeObject(output, object.getCounts()); -kryo.writeObject(output, object.getAnnotations()); + +// annotations is a synchronized LinkedHashMap - get rid of the "synch" for serialization as gryo +// doesn't know how to deserialize that well and LinkedHashMap should work with 3.3.x and previous +final Map annotations = new LinkedHashMap<>(); +object.getAnnotations().forEach(annotations::put); +kryo.writeObject(output, annotations); // kryo might have a problem with LinkedHashMap value collections. can't recreate it independently but --- End diff -- @robertdale i thought about it some more. the problem (whatever it was) wasn't related to `LinkedHashMap` itself which is what i'm serializing in the new code. the comment is in relation to the collection returned from `LinkedHashMap.values()` which is why I converted that collection to an `ArrayList`. better explanation? ---
[GitHub] tinkerpop pull request #931: TINKERPOP-2029 ConcurrentModificationException ...
Github user dkuppitz commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/931#discussion_r217759875 --- Diff: docs/src/upgrade/release-3.4.x.asciidoc --- @@ -29,6 +29,29 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.4.0/CHANGELOG.asc === Upgrading for Users + Changed infix behavior + +The infix notation of `and()` and `or()` now supports an arbitrary number of traversals and `ConnectiveStrategy` produces a traversal with the correct AND and OR semantics. Furthermore, +previous versions failed to apply 3 or more `and()` steps in an infix notation, this is now fixed. + +[source,groovy] + +gremlin> g.V().has("name","marko").and().has("age", lt(30)).or().has("name","josh").and().has("age", gt(30)).and().out("created") +==>v[1] +==>v[4] + + +In previous versions the above traversal --- End diff -- Ugh, I was going to remove this piece as I mentioned previous versions in the comments above. ---
[GitHub] tinkerpop pull request #932: TINKERPOP-2033 Maintain order in profile() anno...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/932#discussion_r217737875 --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java --- @@ -427,7 +428,12 @@ else if (1 == arguments) output.writeString(object.getName()); output.writeDouble(object.getDuration(TimeUnit.NANOSECONDS) / 100d); kryo.writeObject(output, object.getCounts()); -kryo.writeObject(output, object.getAnnotations()); + +// annotations is a synchronized LinkedHashMap - get rid of the "synch" for serialization as gryo +// doesn't know how to deserialize that well and LinkedHashMap should work with 3.3.x and previous +final Map annotations = new LinkedHashMap<>(); +object.getAnnotations().forEach(annotations::put); +kryo.writeObject(output, annotations); // kryo might have a problem with LinkedHashMap value collections. can't recreate it independently but --- End diff -- i wonder what that was in reference to.we serder `LinkedHashMap` all over the place ---
[GitHub] tinkerpop pull request #932: TINKERPOP-2033 Maintain order in profile() anno...
Github user robertdale commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/932#discussion_r217736025 --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java --- @@ -427,7 +428,12 @@ else if (1 == arguments) output.writeString(object.getName()); output.writeDouble(object.getDuration(TimeUnit.NANOSECONDS) / 100d); kryo.writeObject(output, object.getCounts()); -kryo.writeObject(output, object.getAnnotations()); + +// annotations is a synchronized LinkedHashMap - get rid of the "synch" for serialization as gryo +// doesn't know how to deserialize that well and LinkedHashMap should work with 3.3.x and previous +final Map annotations = new LinkedHashMap<>(); +object.getAnnotations().forEach(annotations::put); +kryo.writeObject(output, annotations); // kryo might have a problem with LinkedHashMap value collections. can't recreate it independently but --- End diff -- Do we not need to worry about this comment? ---
[GitHub] tinkerpop pull request #931: TINKERPOP-2029 ConcurrentModificationException ...
Github user robertdale commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/931#discussion_r217720970 --- Diff: docs/src/upgrade/release-3.4.x.asciidoc --- @@ -29,6 +29,29 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.4.0/CHANGELOG.asc === Upgrading for Users + Changed infix behavior + +The infix notation of `and()` and `or()` now supports an arbitrary number of traversals and `ConnectiveStrategy` produces a traversal with the correct AND and OR semantics. Furthermore, +previous versions failed to apply 3 or more `and()` steps in an infix notation, this is now fixed. + +[source,groovy] + +gremlin> g.V().has("name","marko").and().has("age", lt(30)).or().has("name","josh").and().has("age", gt(30)).and().out("created") +==>v[1] +==>v[4] + + +In previous versions the above traversal --- End diff -- Seems like something more is needed here. ---
[GitHub] tinkerpop pull request #931: TINKERPOP-2029 ConcurrentModificationException ...
Github user robertdale commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/931#discussion_r217732616 --- Diff: docs/src/upgrade/release-3.4.x.asciidoc --- @@ -29,6 +29,29 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.4.0/CHANGELOG.asc === Upgrading for Users + Changed infix behavior + +The infix notation of `and()` and `or()` now supports an arbitrary number of traversals and `ConnectiveStrategy` produces a traversal with the correct AND and OR semantics. Furthermore, +previous versions failed to apply 3 or more `and()` steps in an infix notation, this is now fixed. + +[source,groovy] + +gremlin> g.V().has("name","marko").and().has("age", lt(30)).or().has("name","josh").and().has("age", gt(30)).and().out("created") +==>v[1] +==>v[4] + + +In previous versions the above traversal +[source,groovy] + +gremlin> g.V().repeat(__.in('traverses').repeat(__.in('develops')).emit()).emit().values('name') +==>stephen +==>matthias +==>marko + + +See: link:https://issues.apache.org/jira/browse/TINKERPOP-967[TINKERPOP-967] --- End diff -- There should be a link to this issue as well - https://issues.apache.org/jira/browse/TINKERPOP-2029 ---
[GitHub] tinkerpop pull request #931: TINKERPOP-2029 ConcurrentModificationException ...
Github user robertdale commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/931#discussion_r217731843 --- Diff: docs/src/upgrade/release-3.4.x.asciidoc --- @@ -29,6 +29,29 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.4.0/CHANGELOG.asc === Upgrading for Users + Changed infix behavior + +The infix notation of `and()` and `or()` now supports an arbitrary number of traversals and `ConnectiveStrategy` produces a traversal with the correct AND and OR semantics. Furthermore, +previous versions failed to apply 3 or more `and()` steps in an infix notation, this is now fixed. + --- End diff -- The graph example is good for those familiar with the graph but it's not immediately clear what the difference in behavior is. I really like the example from the comments. I think it would be good to add here (not necessarily verbatim) for clarity. ``` # BEHAVIOR Input: a.or.b.and.c.or.d.and.e.or.f.and.g.and.h.or.i ## BEFORE Output: or(a, or(and(b, c), or(and(d, e), or(and(and(f, g), h), i ## NOW Output: or(a, and(b, c), and(d, e), and(f, g, h), i) ``` ---
[GitHub] tinkerpop pull request #927: TINKERPOP-1921 Added hasNext() in gremlin-pytho...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/927 ---
[GitHub] tinkerpop pull request #929: TINKERPOP-2035 Pass custom headers to the webso...
Github user deejvince commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/929#discussion_r217515752 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js --- @@ -49,12 +49,14 @@ class DriverRemoteConnection extends RemoteConnection { * @param {String} [options.traversalSource] The traversal source. Defaults to: 'g'. * @param {GraphSONWriter} [options.writer] The writer to use. * @param {Authenticator} [options.authenticator] The authentication handler to use. + * @param {String} [options.headers] Add custom headers to the request. --- End diff -- Regarding other GLVs, yes i believe its important to have that. ---
[GitHub] tinkerpop pull request #929: TINKERPOP-2035 Pass custom headers to the webso...
Github user deejvince commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/929#discussion_r217509807 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js --- @@ -49,12 +49,14 @@ class DriverRemoteConnection extends RemoteConnection { * @param {String} [options.traversalSource] The traversal source. Defaults to: 'g'. * @param {GraphSONWriter} [options.writer] The writer to use. * @param {Authenticator} [options.authenticator] The authentication handler to use. + * @param {String} [options.headers] Add custom headers to the request. --- End diff -- Hi, You're correct, i'm fixing this right away. Thanks! ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user spmallette commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r217501779 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.js --- @@ -0,0 +1,93 @@ +/* + * 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. + */ +'use strict'; + +/** + * Class to translate glv bytecode steps into executable Gremlin-Groovy script + */ +class Translator { --- End diff -- I think translators are an established part of TinkerPop at this point. We have them for Java, Groovy, and Python and I've personally found them to be insanely useful on so many internal odds/ends. We don't over-publicize them because we don't want to promote "scripts" but I understand the current need for CosmosDB. Anyway, including a Javascript translator is an acceptable addition imo. ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user mattallenuk commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r217498294 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.js --- @@ -0,0 +1,93 @@ +/* + * 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. + */ +'use strict'; + +/** + * Class to translate glv bytecode steps into executable Gremlin-Groovy script + */ +class Translator { --- End diff -- @jorgebay I'm more than happy to move the Translator functionality into a support project if it doesn't fit within the gremlin-javascript project. I realise it might be too specific a case and hope I haven't overstepped a mark by including it with this PR, it just made total sense to me. ---
[GitHub] tinkerpop pull request #932: TINKERPOP-2033 Maintain order in profile() anno...
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/932 TINKERPOP-2033 Maintain order in profile() annotations https://issues.apache.org/jira/browse/TINKERPOP-2033 Used a synchronized map around a `LinkedHashMap` rather than `ConcurrentHashMap`. Not expecting a performance issue with this as its for `profile()` step which doesn't have to be "fast" necessarily as it is a debugging step. Tested manually for backward compatibility across a number of different versions. That was quite time consuming because I'd not realized that the we'd introduced a perhaps unintended break between 3.3.0 and 3.2.x when it comes to "metrics" serialization in Gryo 1.0. Ultimately, I should have just accepted the output i was seeing in the IO tests as being correct in terms of what the compatibility was. Note that while the Gryo 1.0 test file changed for 3.4.0 it still remains compatible with previous versions - there is just a different representation of a {{Map}} in the binary. All of this seems somehow a non-issue because Gryo 3.0 has been the default since 3.3.0 released. VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2033 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/932.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #932 commit 788bf8703488f02ed1a609c6d2abf56cc4c24b3f Author: Stephen Mallette Date: 2018-09-11T16:44:07Z TINKERPOP-2033 Maintain order in profile() annotations Used a synchronized map around a LinkedHashMap rather than ConcurrentHashMap. Not expecting a performance issue with this as its for profile() step which doesn't have to be "fast" per se as it is a debugging step. Affected gryo more than graphson - specifically gryo 1.0 which didn't coerce "metrics" to an interfaces as it does in 3.0. Added a custom serializer to force the annotations to a regular LinkedHashMap and then back to synchronized LinkedHashMap during serder to keep compatibility. ---
[GitHub] tinkerpop pull request #929: TINKERPOP-2035 Pass custom headers to the webso...
Github user jorgebay commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/929#discussion_r217371869 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js --- @@ -49,12 +49,14 @@ class DriverRemoteConnection extends RemoteConnection { * @param {String} [options.traversalSource] The traversal source. Defaults to: 'g'. * @param {GraphSONWriter} [options.writer] The writer to use. * @param {Authenticator} [options.authenticator] The authentication handler to use. + * @param {String} [options.headers] Add custom headers to the request. --- End diff -- The correct type of the `@param` is `{Object}`. What do you think about providing a little more detail, like: "An associative array containing the additional header key/values for the initial request" ---
[GitHub] tinkerpop pull request #926: TINKERPOP-2031 Removed support for -i in gremli...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/926 ---
[GitHub] tinkerpop pull request #931: TINKERPOP-2029 ConcurrentModificationException ...
GitHub user dkuppitz opened a pull request: https://github.com/apache/tinkerpop/pull/931 TINKERPOP-2029 ConcurrentModificationException for InlineFilterStrategy https://issues.apache.org/jira/browse/TINKERPOP-2029 To fix the original issue, I basically rewrote `ConnectiveStrategy`. The infix notation of `and()` and `or()` now supports an arbitrary number of traversals and `ConnectiveStrategy` produces a traversal with correct `AND` and `OR` semantics. The reason for targeting `master/` is that there were no strict semantics before and thus this needs to be considered a breaking change. ``` # BEHAVIOR Input: a.or.b.and.c.or.d.and.e.or.f.and.g.and.h.or.i ## BEFORE Output: or(a, or(and(b, c), or(and(d, e), or(and(and(f, g), h), i ## NOW Output: or(a, and(b, c), and(d, e), and(f, g, h), i) ``` `docker/build.sh -t -i -n` passed. VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2029-master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/931.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #931 commit 46ee42686a875baf123176040b2f341218e02e1a Author: Stephen Mallette Date: 2018-09-05T17:08:01Z TINKERPOP-2029 Added tests demonstrating strategy failures Identified potentially two problems, one with ConnectedStrategy and by virtue of its application InlineFilterStrategy. commit e518c9af9a4aca56449af2b743f24d35a8a43b50 Author: Daniel Kuppitz Date: 2018-09-10T18:41:34Z Rewrote `ConnectiveStrategy`. It's a breaking change as it now behaves slightly differently, but now it * produces correct AND and OR semantics. * has fewer recursive calls (at most 1). * is faster in its own execution and produces fewer steps in the final traversal which should make the processed traversal faster as well. commit 2ce9a6def3426b2a2ff89e6b556ae8b2653f6098 Author: Daniel Kuppitz Date: 2018-09-10T18:47:46Z Merge branch 'TINKERPOP-2029' into TINKERPOP-2029-master commit 9330fcbc477e6a64649b6c6aa22f697756d31140 Author: Daniel Kuppitz Date: 2018-09-10T18:49:52Z Removed note about infix restriction for `and()` and `or()` as they are no longer existent. commit 40b21bbd1361712c7b3cef140773ea87da30dbd0 Author: Daniel Kuppitz Date: 2018-09-10T19:21:17Z updated docs ---
[GitHub] tinkerpop pull request #930: TINKERPOP-2032 bump jython-standalone 2.7.1
GitHub user robertdale opened a pull request: https://github.com/apache/tinkerpop/pull/930 TINKERPOP-2032 bump jython-standalone 2.7.1 https://snyk.io/vuln/SNYK-JAVA-ORGPYTHON-31451 Overview org.python:jython-standalone Affected versions of this package are vulnerable to Arbitrary Code Execution by sending a serialized function to the deserializer, which in turn will execute the code. References [CVE](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-4000) [Jython Bug Report](http://bugs.jython.org/issue2454) [Fix Commit](https://hg.python.org/jython/rev/d06e29d100c0) You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2032 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/930.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #930 commit f70d108e0e9cace79565c658e6bac5c7e9f045ba Author: Robert Dale Date: 2018-09-11T12:35:33Z TINKERPOP-2032 bump jython-standalone 2.7.1 ---
[GitHub] tinkerpop pull request #929: Pass custom headers to the websocket connection
GitHub user deejvince opened a pull request: https://github.com/apache/tinkerpop/pull/929 Pass custom headers to the websocket connection In order to authorize to the gremlin server (in this case AWS Neptune) i need to pass custom headers for authorization to the service. the PR will allow to send any headers (like an API key or signature) and pass them to the Websocket function. While there can be many use cases for this, in my case i pass the Authorization & x-amz-date required for Signature V4 (IAM) authentication. You can merge this pull request into a Git repository by running: $ git pull https://github.com/deejvince/tinkerpop patch-1 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/929.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #929 commit 1acb4f78d827f7903d4ebe73a21a0b45f0ce124e Author: Lior Pollack Date: 2018-09-10T19:16:38Z Pass custom headers to the websocket connection In order to authorize to the gremlin server (in this case AWS Neptune) i need to pass custom headers for authorization to the service. the PR will allow to send any headers (like an API key or signature) and pass them to the Websocket function. While there can be many use cases for this, in my case i pass the Authorization & x-amz-date required for Signature V4 (IAM) authentication. ---
[GitHub] tinkerpop pull request #927: TINKERPOP-1921 Added hasNext() in gremlin-pytho...
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/927 TINKERPOP-1921 Added hasNext() in gremlin-python https://issues.apache.org/jira/browse/TINKERPOP-1921 Adds `hasNext()` to gremlin-python - pretty self explanatory. Would be nice to get the rest of the GLVs done too. Also fixed some PEP8 formatting nags. Builds with `mvn clean install -pl gremlin-python` VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1921 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/927.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #927 commit 9dbd2d28b624ae262b359a7320fdcb5d7b207476 Author: Stephen Mallette Date: 2018-09-07T17:23:36Z TINKERPOP-1921 Added hasNext() in gremlin-python ---
[GitHub] tinkerpop pull request #926: TINKERPOP-2031 Removed support for -i in gremli...
GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/926 TINKERPOP-2031 Removed support for -i in gremlin-server.sh https://issues.apache.org/jira/browse/TINKERPOP-2031 VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2031 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/926.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #926 commit d79c3fff4cce6d4298ddc1c0d7c5a0c9f0a00dc6 Author: Stephen Mallette Date: 2018-09-06T12:40:31Z TINKERPOP-2031 Removed support for -i in gremlin-server.sh ---
[GitHub] tinkerpop pull request #923: TINKERPOP-2028: Register GremlinServerModule to...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/923 ---
[GitHub] tinkerpop pull request #912: TINKERPOP-2023 SSL Enhancements
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/912 ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user bterlson commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r214988968 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.js --- @@ -0,0 +1,93 @@ +/* + * 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. + */ +'use strict'; + +/** + * Class to translate glv bytecode steps into executable Gremlin-Groovy script + */ +class Translator { --- End diff -- Just want to say, as another CosmosDB user, that I very much would love to be able to use the fluent step API even though cosmos doesn't yet support bytecode submissions. I hadn't considered it was possible to convert the glv steps to a script, but now that I see it working, I want it badly ð ---
[GitHub] tinkerpop pull request #898: gremlin-javascript: Typescript typings definiti...
Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/898 ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user mattallenuk commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r214833558 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.js --- @@ -0,0 +1,93 @@ +/* + * 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. + */ +'use strict'; + +/** + * Class to translate glv bytecode steps into executable Gremlin-Groovy script + */ +class Translator { --- End diff -- And that is why I was querying bindings in the bytecode as you'll use the glv steps to build a query before converting it to a script. If you are happy for the translator class to stay then I'll need to know how parameters are implemented in bytecode to ensure the translation is done correctly. ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user mattallenuk commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r214832381 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.js --- @@ -0,0 +1,65 @@ +/* + * 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. + */ +'use strict'; + +const DriverRemoteConnection = require('./driver-remote-connection'); +const Bytecode = require('../process/bytecode'); + +class Client extends DriverRemoteConnection { --- End diff -- np, I'll get that implemented :) ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user mattallenuk commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r214831866 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.js --- @@ -0,0 +1,93 @@ +/* + * 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. + */ +'use strict'; + +/** + * Class to translate glv bytecode steps into executable Gremlin-Groovy script + */ +class Translator { --- End diff -- Hi @jorgebay, The purpose of the translator is to allow building of a script from bytecode for users that don't yet have bytecode implementation on their Gremlin Server but want to use GLV instructions rather than writing scripts in text. Case in point, I'll be using the project on Azure CosmoDB but I cannot send bytecode as it's not yet supported, they're working on it. So I don't want to have to write all my queries as strings and then have to go back at a later date and convert to glv steps. I'd rather use the glv steps and go back later and implement terminal commands. This might just be my own personal preferences, but I'm sure others would appreciate that flexibility? This is how it would be used: ```javascript const g = new graph.Graph().traversal(); g.V().order().by('age', t.order.decr); const script = new Translator('g').translate(g.getBytecode()); ``` That script could then be submitted via the client. ---
[GitHub] tinkerpop pull request #922: TINKERPOP-1959: Gremlin Javascript ability to s...
Github user jorgebay commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/922#discussion_r214825070 --- Diff: gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/translator.js --- @@ -0,0 +1,93 @@ +/* + * 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. + */ +'use strict'; + +/** + * Class to translate glv bytecode steps into executable Gremlin-Groovy script + */ +class Translator { --- End diff -- I don't understand the purpose of the translator for this patch. Maybe you were looking to implement bindings? https://github.com/apache/tinkerpop/blob/fcabd01c4425061334901082a81e62151adaeb64/gremlin-python/src/main/jython/gremlin_python/process/traversal.py#L504 ---