[GitHub] [tinkerpop] jorgebay commented on issue #1241: TINKERPOP-2330 JavaScript GLV: Export GraphSON2 and 3 writers/readers
jorgebay commented on issue #1241: TINKERPOP-2330 JavaScript GLV: Export GraphSON2 and 3 writers/readers URL: https://github.com/apache/tinkerpop/pull/1241#issuecomment-577739665 VOTE +1 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [tinkerpop] jorgebay opened a new pull request #1241: TINKERPOP-2330 JavaScript GLV: Export GraphSON2 and 3 writers/readers
jorgebay opened a new pull request #1241: TINKERPOP-2330 JavaScript GLV: Export GraphSON2 and 3 writers/readers URL: https://github.com/apache/tinkerpop/pull/1241 https://issues.apache.org/jira/browse/TINKERPOP-2330 Adds GraphSON2 and GraphSON3 writer/readers for background compatibility, something that I've missed when introducing GraphSON3 support in #858. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[tinkerpop] branch TINKERPOP-2330 created (now 57ba497)
This is an automated email from the ASF dual-hosted git repository. jorgebg pushed a change to branch TINKERPOP-2330 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git. at 57ba497 TINKERPOP-2330 JavaScript GLV: Export GraphSON2 and 3 writers/readers This branch includes the following new commits: new 57ba497 TINKERPOP-2330 JavaScript GLV: Export GraphSON2 and 3 writers/readers The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[tinkerpop] 01/01: TINKERPOP-2330 JavaScript GLV: Export GraphSON2 and 3 writers/readers
This is an automated email from the ASF dual-hosted git repository. jorgebg pushed a commit to branch TINKERPOP-2330 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 57ba497f7de1fee8945e9c92b011c27739423c0d Author: Jorge Bay Gondra AuthorDate: Thu Jan 23 14:54:48 2020 +0100 TINKERPOP-2330 JavaScript GLV: Export GraphSON2 and 3 writers/readers --- .../main/javascript/gremlin-javascript/index.js| 5 +- .../gremlin-javascript/lib/driver/connection.js| 29 +--- .../lib/structure/io/graph-serializer.js | 84 ++ .../gremlin-javascript/test/unit/client-test.js| 4 +- .../gremlin-javascript/test/unit/exports-test.js | 6 ++ 5 files changed, 99 insertions(+), 29 deletions(-) diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js index c8fe547..5ef0eca 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/index.js @@ -80,10 +80,7 @@ module.exports = { AnonymousTraversalSource }, structure: { -io: { - GraphSONReader: gs.GraphSONReader, - GraphSONWriter: gs.GraphSONWriter -}, +io: gs, Edge: graph.Edge, Graph: graph.Graph, Path: graph.Path, diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js index 692dbe1..29be5dc 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js @@ -38,6 +38,7 @@ const responseStatusCode = { }; const defaultMimeType = 'application/vnd.gremlin-v3.0+json'; +const graphSON2MimeType = 'application/vnd.gremlin-v2.0+json'; const pingIntervalDelay = 60 * 1000; const pongTimeoutDelay = 30 * 1000; @@ -73,10 +74,16 @@ class Connection extends EventEmitter { this.url = url; this.options = options = options || {}; +/** + * Gets the MIME type. + * @type {String} + */ +this.mimeType = options.mimeType || defaultMimeType; + // A map containing the request id and the handler this._responseHandlers = {}; -this._reader = options.reader || new serializer.GraphSONReader(); -this._writer = options.writer || new serializer.GraphSONWriter(); +this._reader = options.reader || this._getDefaultReader(this.mimeType); +this._writer = options.writer || this._getDefaultWriter(this.mimeType); this._openPromise = null; this._openCallback = null; this._closePromise = null; @@ -84,12 +91,6 @@ class Connection extends EventEmitter { this._pingInterval = null; this._pongTimeout = null; -/** - * Gets the MIME type. - * @type {String} - */ -this.mimeType = options.mimeType || defaultMimeType; - this._header = String.fromCharCode(this.mimeType.length) + this.mimeType; this.isOpen = false; this.traversalSource = options.traversalSource || 'g'; @@ -169,6 +170,18 @@ class Connection extends EventEmitter { })); } + _getDefaultReader(mimeType) { +return mimeType === graphSON2MimeType + ? new serializer.GraphSON2Reader() + : new serializer.GraphSONReader(); + } + + _getDefaultWriter(mimeType) { +return mimeType === graphSON2MimeType + ? new serializer.GraphSON2Writer() + : new serializer.GraphSONWriter(); + } + _getRequest(id, bytecode, op, args, processor) { if (args) { args = this._adaptArgs(args, true); diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js index 4a7fdf2..fb461d9 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js @@ -25,24 +25,27 @@ const typeSerializers = require('./type-serializers'); /** - * GraphSON Writer + * GraphSON2 writer. */ -class GraphSONWriter { +class GraphSON2Writer { + /** * @param {Object} [options] - * @param {Object} options.serializers An object used as an associative array with GraphSON 2 type name as keys and + * @param {Object} [options.serializers] An object used as an associative array with GraphSON 2 type name as keys and * serializer instances as values, ie: { 'g:Int64': longSerializer }. * @constructor */ constructor(options) { this._options = options || {}; // Create instance of the default serializers -this._serializers = serializers.map(serializerConstructor => { +this._serializers = this.getDefaultSerializers().map(serializerConstructor => { const s = new serializerConstruc
[tinkerpop] 01/01: Merge pull request #1240 from apache/TINKERPOP-2312
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 434a41c97c33b0c5f35486912a77d6e1397e3db5 Merge: 5775a24 5662c03 Author: stephen mallette AuthorDate: Thu Jan 23 08:39:12 2020 -0500 Merge pull request #1240 from apache/TINKERPOP-2312 TINKERPOP-2312 Empty keys to group() should group to null docs/src/reference/gremlin-variants.asciidoc | 58 ++ docs/src/upgrade/release-3.5.x.asciidoc| 21 ...mentValueTraversal.java => ValueTraversal.java} | 26 ++--- .../process/traversal/step/ByModulating.java | 6 +- .../process/traversal/step/PathProcessor.java | 4 +- .../process/traversal/step/map/GroupStep.java | 4 +- .../strategy/decoration/SubgraphStrategy.java | 8 +- .../process/traversal/util/TraversalHelper.java| 4 +- .../lambda/ElementValueTraversalTest.java | 78 -- .../traversal/lambda/ValueTraversalTest.java | 118 + .../optimization/PathProcessorStrategyTest.java| 14 +-- .../Gherkin/GherkinTestRunner.cs | 1 + .../Gherkin/IgnoreException.cs | 9 +- .../Gherkin/ScenarioData.cs| 6 +- .../test/cucumber/feature-steps.js | 2 + gremlin-test/features/sideEffect/Group.feature | 11 ++ .../traversal/step/sideEffect/GroupTest.java | 27 - 17 files changed, 275 insertions(+), 122 deletions(-)
[tinkerpop] branch master updated (5775a24 -> 434a41c)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git. from 5775a24 Merge pull request #1238 from apache/TINKERPOP-2107 add 5662c03 TINKERPOP-2312 Empty keys to group() should group to null new 434a41c Merge pull request #1240 from apache/TINKERPOP-2312 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: docs/src/reference/gremlin-variants.asciidoc | 58 ++ docs/src/upgrade/release-3.5.x.asciidoc| 21 ...mentValueTraversal.java => ValueTraversal.java} | 26 ++--- .../process/traversal/step/ByModulating.java | 6 +- .../process/traversal/step/PathProcessor.java | 4 +- .../process/traversal/step/map/GroupStep.java | 4 +- .../strategy/decoration/SubgraphStrategy.java | 8 +- .../process/traversal/util/TraversalHelper.java| 4 +- .../lambda/ElementValueTraversalTest.java | 78 -- .../traversal/lambda/ValueTraversalTest.java | 118 + .../optimization/PathProcessorStrategyTest.java| 14 +-- .../Gherkin/GherkinTestRunner.cs | 1 + .../Gherkin/IgnoreException.cs | 9 +- .../Gherkin/ScenarioData.cs| 6 +- .../test/cucumber/feature-steps.js | 2 + gremlin-test/features/sideEffect/Group.feature | 11 ++ .../traversal/step/sideEffect/GroupTest.java | 27 - 17 files changed, 275 insertions(+), 122 deletions(-) rename gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/{ElementValueTraversal.java => ValueTraversal.java} (66%) delete mode 100644 gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/ElementValueTraversalTest.java create mode 100644 gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/ValueTraversalTest.java
[tinkerpop] branch master updated (6fa0acd -> 5775a24)
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git. from 6fa0acd Added some notes on neo4j to the upgrade documentation CTR add b6f9936 TINKERPOP-2017 Added failing test case add 99a985a TINKERPOP-2107 Fixed problem with reattachment of Property instances new 5775a24 Merge pull request #1238 from apache/TINKERPOP-2107 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CHANGELOG.asciidoc | 1 + docs/src/reference/the-traversal.asciidoc | 3 ++ .../traversal/step/filter/DedupGlobalStep.java | 17 +++- gremlin-test/features/filter/Dedup.feature | 32 ++ .../process/traversal/step/filter/DedupTest.java | 49 ++ 5 files changed, 100 insertions(+), 2 deletions(-)
[GitHub] [tinkerpop] spmallette merged pull request #1238: TINKERPOP-2107 Fixed property re-attachment
spmallette merged pull request #1238: TINKERPOP-2107 Fixed property re-attachment URL: https://github.com/apache/tinkerpop/pull/1238 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [tinkerpop] spmallette merged pull request #1240: TINKERPOP-2312 Empty keys to group() should group to null
spmallette merged pull request #1240: TINKERPOP-2312 Empty keys to group() should group to null URL: https://github.com/apache/tinkerpop/pull/1240 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[tinkerpop] 01/01: Merge pull request #1238 from apache/TINKERPOP-2107
This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 5775a2494c3b3aac6dba04bc2a72842268ad1cb8 Merge: 6fa0acd 99a985a Author: stephen mallette AuthorDate: Thu Jan 23 08:38:40 2020 -0500 Merge pull request #1238 from apache/TINKERPOP-2107 TINKERPOP-2107 Fixed property re-attachment CHANGELOG.asciidoc | 1 + docs/src/reference/the-traversal.asciidoc | 3 ++ .../traversal/step/filter/DedupGlobalStep.java | 17 +++- gremlin-test/features/filter/Dedup.feature | 32 ++ .../process/traversal/step/filter/DedupTest.java | 49 ++ 5 files changed, 100 insertions(+), 2 deletions(-)