tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jorg...@apache.org
Subject [47/47] tinkerpop git commit: gremlin-javascript pom, generation update and parse T in test scenarios
Date Thu, 25 Jan 2018 11:01:45 GMT
gremlin-javascript pom, generation update and parse T in test scenarios


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1fae5d01
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1fae5d01
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1fae5d01

Branch: refs/heads/master
Commit: 1fae5d014863c25460f1b4526eb36dc7e2d25f46
Parents: 6923a6a
Author: Jorge Bay Gondra <jorgebaygondra@gmail.com>
Authored: Thu Jan 25 11:51:41 2018 +0100
Committer: Jorge Bay Gondra <jorgebaygondra@gmail.com>
Committed: Thu Jan 25 11:51:41 2018 +0100

----------------------------------------------------------------------
 gremlin-javascript/pom.xml                      |  2 +-
 .../lib/process/graph-traversal.js              | 79 +++++++-------------
 .../gremlin-javascript/lib/process/traversal.js |  8 +-
 .../javascript/gremlin-javascript/package.json  |  2 +-
 .../test/cucumber/feature-steps.js              | 12 ++-
 5 files changed, 43 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1fae5d01/gremlin-javascript/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index f9f0c8e..8868f85 100644
--- a/gremlin-javascript/pom.xml
+++ b/gremlin-javascript/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.8-SNAPSHOT</version>
+        <version>3.3.2-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-javascript</artifactId>
     <name>Apache TinkerPop :: Gremlin Javascript</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1fae5d01/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
index fe1e467..edeb2cb 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
@@ -143,6 +143,16 @@ class GraphTraversalSource {
   }
   
   /**
+   * addE GraphTraversalSource step method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  addE(...args) {
+    const b = new Bytecode(this.bytecode).addStep('addE', args);
+    return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies),
b);
+  }
+  
+  /**
    * addV GraphTraversalSource step method.
    * @param {...Object} args
    * @returns {GraphTraversal}
@@ -193,26 +203,6 @@ class GraphTraversal extends Traversal {
   }
   
   /**
-   * Graph traversal addInE method.
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  addInE(...args) {
-    this.bytecode.addStep('addInE', args);
-    return this;
-  }
-  
-  /**
-   * Graph traversal addOutE method.
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  addOutE(...args) {
-    this.bytecode.addStep('addOutE', args);
-    return this;
-  }
-  
-  /**
    * Graph traversal addV method.
    * @param {...Object} args
    * @returns {GraphTraversal}
@@ -473,16 +463,6 @@ class GraphTraversal extends Traversal {
   }
   
   /**
-   * Graph traversal groupV3d0 method.
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  groupV3d0(...args) {
-    this.bytecode.addStep('groupV3d0', args);
-    return this;
-  }
-  
-  /**
    * Graph traversal has method.
    * @param {...Object} args
    * @returns {GraphTraversal}
@@ -673,32 +653,22 @@ class GraphTraversal extends Traversal {
   }
   
   /**
-   * Graph traversal mapKeys method.
-   * @param {...Object} args
-   * @returns {GraphTraversal}
-   */
-  mapKeys(...args) {
-    this.bytecode.addStep('mapKeys', args);
-    return this;
-  }
-  
-  /**
-   * Graph traversal mapValues method.
+   * Graph traversal match method.
    * @param {...Object} args
    * @returns {GraphTraversal}
    */
-  mapValues(...args) {
-    this.bytecode.addStep('mapValues', args);
+  match(...args) {
+    this.bytecode.addStep('match', args);
     return this;
   }
   
   /**
-   * Graph traversal match method.
+   * Graph traversal math method.
    * @param {...Object} args
    * @returns {GraphTraversal}
    */
-  match(...args) {
-    this.bytecode.addStep('match', args);
+  math(...args) {
+    this.bytecode.addStep('math', args);
     return this;
   }
   
@@ -983,6 +953,16 @@ class GraphTraversal extends Traversal {
   }
   
   /**
+   * Graph traversal skip method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  skip(...args) {
+    this.bytecode.addStep('skip', args);
+    return this;
+  }
+  
+  /**
    * Graph traversal store method.
    * @param {...Object} args
    * @returns {GraphTraversal}
@@ -1166,8 +1146,6 @@ function callOnEmptyTraversal(fnName, args) {
 const statics = {
   V: (...args) => callOnEmptyTraversal('V', args),
   addE: (...args) => callOnEmptyTraversal('addE', args),
-  addInE: (...args) => callOnEmptyTraversal('addInE', args),
-  addOutE: (...args) => callOnEmptyTraversal('addOutE', args),
   addV: (...args) => callOnEmptyTraversal('addV', args),
   aggregate: (...args) => callOnEmptyTraversal('aggregate', args),
   and: (...args) => callOnEmptyTraversal('and', args),
@@ -1192,7 +1170,6 @@ const statics = {
   fold: (...args) => callOnEmptyTraversal('fold', args),
   group: (...args) => callOnEmptyTraversal('group', args),
   groupCount: (...args) => callOnEmptyTraversal('groupCount', args),
-  groupV3d0: (...args) => callOnEmptyTraversal('groupV3d0', args),
   has: (...args) => callOnEmptyTraversal('has', args),
   hasId: (...args) => callOnEmptyTraversal('hasId', args),
   hasKey: (...args) => callOnEmptyTraversal('hasKey', args),
@@ -1212,9 +1189,8 @@ const statics = {
   local: (...args) => callOnEmptyTraversal('local', args),
   loops: (...args) => callOnEmptyTraversal('loops', args),
   map: (...args) => callOnEmptyTraversal('map', args),
-  mapKeys: (...args) => callOnEmptyTraversal('mapKeys', args),
-  mapValues: (...args) => callOnEmptyTraversal('mapValues', args),
   match: (...args) => callOnEmptyTraversal('match', args),
+  math: (...args) => callOnEmptyTraversal('math', args),
   max: (...args) => callOnEmptyTraversal('max', args),
   mean: (...args) => callOnEmptyTraversal('mean', args),
   min: (...args) => callOnEmptyTraversal('min', args),
@@ -1238,6 +1214,7 @@ const statics = {
   select: (...args) => callOnEmptyTraversal('select', args),
   sideEffect: (...args) => callOnEmptyTraversal('sideEffect', args),
   simplePath: (...args) => callOnEmptyTraversal('simplePath', args),
+  skip: (...args) => callOnEmptyTraversal('skip', args),
   store: (...args) => callOnEmptyTraversal('store', args),
   subgraph: (...args) => callOnEmptyTraversal('subgraph', args),
   sum: (...args) => callOnEmptyTraversal('sum', args),

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1fae5d01/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
index 4464097..b214d8d 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js
@@ -257,12 +257,12 @@ module.exports = {
   cardinality: toEnum('Cardinality', 'list set single'),
   column: toEnum('Column', 'keys values'),
   direction: toEnum('Direction', 'BOTH IN OUT'),
-  graphSONVersion: toEnum('GraphSONVersion', 'V1_0 V2_0'),
-  gryoVersion: toEnum('GryoVersion', 'V1_0'),
+  graphSONVersion: toEnum('GraphSONVersion', 'V1_0 V2_0 V3_0'),
+  gryoVersion: toEnum('GryoVersion', 'V1_0 V3_0'),
   operator: toEnum('Operator', 'addAll and assign div max min minus mult or sum sumLong'),
-  order: toEnum('Order', 'decr incr keyDecr keyIncr shuffle valueDecr valueIncr'),
+  order: toEnum('Order', 'decr incr shuffle'),
   pick: toEnum('Pick', 'any none'),
-  pop: toEnum('Pop', 'all first last'),
+  pop: toEnum('Pop', 'all first last mixed'),
   scope: toEnum('Scope', 'global local'),
   t: toEnum('T', 'id key label value')
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1fae5d01/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json b/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
index c668be7..b9e7cdd 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
@@ -1,6 +1,6 @@
 {
   "name": "gremlin-javascript",
-  "version": "3.2.8-alpha1",
+  "version": "3.3.2-alpha1",
   "description": "JavaScript Gremlin Language Variant",
   "author": "Apache TinkerPop team",
   "keywords": [

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1fae5d01/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
index 12bc835..c29789d 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js
@@ -33,6 +33,7 @@ const utils = require('../../lib/utils');
 const Graph = graphModule.Graph;
 const Path = graphModule.Path;
 const __ = graphTraversalModule.statics;
+const t = traversalModule.t;
 
 // Determines whether the feature maps (m[]), are deserialized as objects (true) or maps
(false).
 // Use false for GraphSON3.
@@ -50,7 +51,8 @@ const parsers = [
   [ 'l\\[(.*)\\]', toArray ],
   [ 's\\[(.*)\\]', toArray ],
   [ 'm\\[(.+)\\]', toMap ],
-  [ 'c\\[(.+)\\]', toLambda ]
+  [ 'c\\[(.+)\\]', toLambda ],
+  [ 't\\[(.+)\\]', toT ]
 ].map(x => [ new RegExp('^' + x[0] + '$'), x[1] ]);
 
 const ignoreReason = {
@@ -260,6 +262,10 @@ function toPath(value) {
   return new Path(new Array(0), parts.map(x => parseValue.call(this, x)));
 }
 
+function toT(value) {
+  return t[value];
+}
+
 function toArray(stringList) {
   if (stringList === '') {
     return new Array(0);
@@ -284,13 +290,13 @@ function parseMapValue(value) {
   if (mapAsObject) {
     const result = {};
     Object.keys(value).forEach(key => {
-      result[key] = parseMapValue.call(this, value[key]);
+      result[parseMapValue.call(this, key)] = parseMapValue.call(this, value[key]);
     });
     return result;
   }
   const map = new Map();
   Object.keys(value).forEach(key => {
-    map.set(key, parseMapValue.call(this, value[key]));
+    map.set(parseMapValue.call(this, key), parseMapValue.call(this, value[key]));
   });
   return map;
 }


Mime
View raw message