You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/05/13 14:35:50 UTC

[01/50] tinkerpop git commit: Update release date for 3.3.3 and JIRAs in changelog CTR [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1878 752e38c4e -> f05064146 (forced update)


Update release date for 3.3.3 and JIRAs in changelog CTR


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

Branch: refs/heads/TINKERPOP-1878
Commit: d86fcc590033e4e40f791fe81a8889a928166e6f
Parents: 7b2783f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue May 8 12:10:33 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue May 8 12:10:33 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                      | 21 ++++++++++++++++++++-
 docs/src/upgrade/release-3.3.x.asciidoc |  2 +-
 2 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d86fcc59/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 246db49..8535bad 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -21,7 +21,7 @@ limitations under the License.
 image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/images/gremlin-mozart.png[width=185]
 
 [[release-3-3-3]]
-=== TinkerPop 3.3.3 (Release Date: NOT OFFICIALLY RELEASED YET)
+=== TinkerPop 3.3.3 (Release Date: May 8, 2018)
 
 This release also includes changes from <<release-3-2-9, 3.2.9>>.
 
@@ -30,6 +30,25 @@ This release also includes changes from <<release-3-2-9, 3.2.9>>.
 * Deprecated `CredentialsGraph` DSL in favor of `CredentialsTraversalDsl` which uses the recommended method for Gremlin DSL development.
 * Allowed `iterate()` to be called after `profile()`.
 
+==== Bugs
+
+* TINKERPOP-1869 Profile step and iterate do not play nicely with each other
+* TINKERPOP-1927 Gherkin scenario expects list with duplicates, but receives g:Set
+* TINKERPOP-1947 Path history isn't preserved for keys in mutations
+
+==== Improvements
+
+* TINKERPOP-1628 Implement TraversalSelectStep
+* TINKERPOP-1755 No docs for ReferenceElements
+* TINKERPOP-1903 Credentials DSL should use the Java annotation processor
+* TINKERPOP-1912 Remove MD5 checksums
+* TINKERPOP-1934 Bump to latest version of httpclient
+* TINKERPOP-1936 Performance enhancement to Bytecode deserialization
+* TINKERPOP-1943 JavaScript GLV: Support GraphSON3
+* TINKERPOP-1944 JavaScript GLV: DriverRemoteConnection is not exported in the root module
+* TINKERPOP-1950 Traversal construction performance enhancements
+* TINKERPOP-1953 Bump to Groovy 2.4.15
+
 [[release-3-3-2]]
 === TinkerPop 3.3.2 (Release Date: April 2, 2018)
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d86fcc59/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.3.x.asciidoc b/docs/src/upgrade/release-3.3.x.asciidoc
index 79b7ef5..e6c15cd 100644
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@ -23,7 +23,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 == TinkerPop 3.3.2
 
-*Release Date: NOT OFFICIALLY RELEASED YET*
+*Release Date: May 8, 2018*
 
 Please see the link:https://github.com/apache/tinkerpop/blob/3.3.3/CHANGELOG.asciidoc#release-3-3-3[changelog] for a complete list of all the modifications that are part of this release.
 


[21/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33

Conflicts:
	docs/src/dev/developer/development-environment.asciidoc
	giraph-gremlin/pom.xml
	gremlin-archetype/gremlin-archetype-dsl/pom.xml
	gremlin-archetype/gremlin-archetype-server/pom.xml
	gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
	gremlin-archetype/pom.xml
	gremlin-console/bin/gremlin.sh
	gremlin-console/pom.xml
	gremlin-core/pom.xml
	gremlin-dotnet/pom.xml
	gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
	gremlin-dotnet/src/pom.xml
	gremlin-dotnet/test/pom.xml
	gremlin-driver/pom.xml
	gremlin-groovy-test/pom.xml
	gremlin-groovy/pom.xml
	gremlin-javascript/pom.xml
	gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
	gremlin-python/pom.xml
	gremlin-server/pom.xml
	gremlin-shaded/pom.xml
	gremlin-test/pom.xml
	gremlin-tools/gremlin-benchmark/pom.xml
	hadoop-gremlin/pom.xml
	neo4j-gremlin/pom.xml
	pom.xml
	spark-gremlin/pom.xml
	tinkergraph-gremlin/pom.xml


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

Branch: refs/heads/TINKERPOP-1878
Commit: bfdd4c2477f92e8f0ef7a73fddd95d599b670ce7
Parents: d492136 3635ff6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 11 14:48:07 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 14:48:07 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  4 ++
 .../developer/development-environment.asciidoc  |  1 +
 .../upgrade/release-3.2.x-incubating.asciidoc   |  7 +++
 gremlin-dotnet/pom.xml                          | 17 +++++--
 gremlin-groovy/pom.xml                          |  6 ---
 gremlin-javascript/pom.xml                      | 47 ++++----------------
 gremlin-python/pom.xml                          |  4 +-
 pom.xml                                         | 19 +++++---
 8 files changed, 48 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bfdd4c24/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bfdd4c24/docs/src/dev/developer/development-environment.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bfdd4c24/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bfdd4c24/gremlin-dotnet/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bfdd4c24/gremlin-groovy/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bfdd4c24/gremlin-javascript/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bfdd4c24/gremlin-python/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bfdd4c24/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 3ef4da9,9737fef..7fc8ac3
--- a/pom.xml
+++ b/pom.xml
@@@ -451,9 -375,10 +457,9 @@@ limitations under the License
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-surefire-plugin</artifactId>
-                     <version>2.20</version>
+                     <version>2.21.0</version>
                      <configuration>
 -                        <argLine>-Dlog4j.configuration=${log4j-test.properties} -Dbuild.dir=${project.build.directory}
 -                            -Dis.testing=true
 +                        <argLine>-Dlog4j.configuration=${log4j-test.properties} -Dbuild.dir=${project.build.directory} -Dis.testing=true
                          </argLine>
                          <excludes>
                              <exclude>**/*IntegrateTest.java</exclude>


[29/50] tinkerpop git commit: TINKERPOP-1878 Changed gryo version of SparqlStrategy

Posted by sp...@apache.org.
TINKERPOP-1878 Changed gryo version of SparqlStrategy

Was using some temporary nonsense before...


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

Branch: refs/heads/TINKERPOP-1878
Commit: a83aa7ce00fb27b7a2a20096728f0fb502700e2e
Parents: 69a7f29
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jan 26 08:16:24 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/io/gryo/GryoVersion.java      | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a83aa7ce/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
index 4a325dd..f922411 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
@@ -373,7 +373,7 @@ public enum GryoVersion {
             add(GryoTypeReg.of(RangeGlobalStep.RangeBiOperator.class, 114));
             add(GryoTypeReg.of(OrderGlobalStep.OrderBiOperator.class, 118));
             add(GryoTypeReg.of(ProfileStep.ProfileBiOperator.class, 119));
-            add(GryoTypeReg.of(IndexedTraverserSet.VertexIndexedTraverserSet.class, 173));                 // ***LAST ID***
+            add(GryoTypeReg.of(IndexedTraverserSet.VertexIndexedTraverserSet.class, 173));
 
             // placeholder serializers for classes that don't live here in core. this will allow them to be used if
             // present  or ignored if the class isn't available. either way the registration numbers are held as
@@ -383,8 +383,9 @@ public enum GryoVersion {
             tryAddDynamicType(this, "org.apache.tinkerpop.gremlin.driver.message.ResponseMessage",
                     "org.apache.tinkerpop.gremlin.driver.ser.ResponseMessageGryoSerializer", 169);
 
-            tryAddDynamicType(this, "org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy.SparqlStrategy",
-                    null, 1690);
+            tryAddDynamicType(this,
+                    "org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy.SparqlStrategy",
+                    null, 174);                 // ***LAST ID***
         }};
     }
 


[49/50] tinkerpop git commit: TINKERPOP-1878 Added a test for ordering and corrected some problems in logic

Posted by sp...@apache.org.
TINKERPOP-1878 Added a test for ordering and corrected some problems in logic

Ordering didn't work - at least not completely. The test, as it is written in this commit, that failed to sort properly. Changed the logic for ordering to track all of the keys specified to ORDER with their appropriate ASC/DESC operators and added all of them to the traversal.


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

Branch: refs/heads/TINKERPOP-1878
Commit: b8b1e959803579b34d97298d92ed594ccef40289
Parents: 25953e4
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jan 26 15:41:10 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 .../sparql/SparqlToGremlinTranspiler.java       | 55 ++++++--------------
 .../dsl/sparql/SparqlTraversalSourceTest.java   | 31 +++++++++--
 2 files changed, 44 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b8b1e959/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
index 9db7d82..ea3f828 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
@@ -21,9 +21,10 @@ package org.apache.tinkerpop.gremlin.sparql;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
-import org.apache.jena.graph.Triple;
 import org.apache.jena.query.Query;
 import org.apache.jena.query.QueryFactory;
 import org.apache.jena.query.SortCondition;
@@ -58,8 +59,6 @@ public class SparqlToGremlinTranspiler {
 
     private List<Traversal> traversalList = new ArrayList<>();
 
-    private String sortingVariable = "";
-
 	private SparqlToGremlinTranspiler(final GraphTraversal<Vertex, ?> traversal) {
 		this.traversal = traversal;
 	}
@@ -96,31 +95,18 @@ public class SparqlToGremlinTranspiler {
 		final int numberOfTraversal = traversalList.size();
         final Traversal arrayOfAllTraversals[] = new Traversal[numberOfTraversal];
 
-		if (query.hasOrderBy() && !query.hasGroupBy()) {
-            final List<SortCondition> sortingConditions = query.getOrderBy();
-
-			for (SortCondition sortCondition : sortingConditions) {
-                final Expr expr = sortCondition.getExpression();
-				sortingVariable = expr.getVarName();
-			}
-		}
-
 		for (Traversal tempTrav : traversalList) {
 			arrayOfAllTraversals[traversalIndex++] = tempTrav;
 		}
 
-		Order orderDirection = Order.incr;
+		final Map<String, Order> orderingIndex = new HashMap<>();
 		if (query.hasOrderBy()) {
-            int directionOfSort = 0;
             final List<SortCondition> sortingConditions = query.getOrderBy();
 
 			for (SortCondition sortCondition : sortingConditions) {
                 final Expr expr = sortCondition.getExpression();
-				directionOfSort = sortCondition.getDirection();
-				sortingVariable = expr.getVarName();
+                orderingIndex.put(expr.getVarName(), sortCondition.getDirection() == 1 ? Order.incr : Order.decr);
 			}
-
-			if (directionOfSort == -1) orderDirection = Order.decr;
 		}
 
 		if (traversalList.size() > 0)
@@ -128,6 +114,8 @@ public class SparqlToGremlinTranspiler {
 
 		final List<String> vars = query.getResultVars();
 		if (!query.isQueryResultStar() && !query.hasGroupBy()) {
+		    // the result sizes have special handling to get the right signatures of select() called. perhaps this
+            // could be refactored to work more nicely
             switch (vars.size()) {
                 case 0:
                     throw new IllegalStateException();
@@ -135,20 +123,16 @@ public class SparqlToGremlinTranspiler {
                     if (query.isDistinct())
                         traversal = traversal.dedup(vars.get(0));
 
-                    if (query.hasOrderBy())
-                        traversal = traversal.order().by(sortingVariable, orderDirection);
-                    else
-                        traversal = traversal.select(vars.get(0));
+                    orderingIndex.forEach((k,v) -> traversal = traversal.order().by(__.select(k), v));
+                    traversal = traversal.select(vars.get(0));
 
                     break;
                 case 2:
                     if (query.isDistinct())
                         traversal = traversal.dedup(vars.get(0), vars.get(1));
 
-                    if (query.hasOrderBy())
-                        traversal = traversal.order().by(__.select(vars.get(0)), orderDirection).by(__.select(vars.get(1)));
-                    else
-                        traversal = traversal.select(vars.get(0), vars.get(1));
+                    orderingIndex.forEach((k,v) -> traversal = traversal.order().by(__.select(k), v));
+                    traversal = traversal.select(vars.get(0), vars.get(1));
 
                     break;
                 default:
@@ -157,11 +141,11 @@ public class SparqlToGremlinTranspiler {
                     if (query.isDistinct())
                         traversal = traversal.dedup(all);
 
+                    orderingIndex.forEach((k,v) -> traversal = traversal.order().by(__.select(k), v));
+
+                    // just some shenanigans to get the right signature of select() called
                     final String[] others = Arrays.copyOfRange(all, 2, vars.size());
-                    if (query.hasOrderBy())
-                        traversal = traversal.order().by(__.select(vars.get(0)), orderDirection).by(__.select(vars.get(1)));
-                    else
-                        traversal = traversal.select(vars.get(0), vars.get(1), others);
+                    traversal = traversal.select(vars.get(0), vars.get(1), others);
 
                     break;
             }
@@ -202,7 +186,7 @@ public class SparqlToGremlinTranspiler {
 		}
 
 		if (query.hasOrderBy() && query.hasGroupBy())
-			traversal = traversal.order().by(sortingVariable, orderDirection);
+            orderingIndex.forEach((k,v) -> traversal = traversal.order().by(__.select(k), v));
 
 		if (query.hasLimit()) {
 			long limit = query.getLimit(), offset = 0;
@@ -233,14 +217,7 @@ public class SparqlToGremlinTranspiler {
          */
         @Override
         public void visit(final OpBGP opBGP) {
-            final List<Triple> triples = opBGP.getPattern().getList();
-            final Traversal[] matchTraversals = new Traversal[triples.size()];
-            int i = 0;
-            for (final Triple triple : triples) {
-
-                matchTraversals[i++] = TraversalBuilder.transform(triple);
-                traversalList.add(matchTraversals[i - 1]);
-            }
+            opBGP.getPattern().getList().forEach(triple -> traversalList.add(TraversalBuilder.transform(triple)));
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b8b1e959/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
index 9bb6025..2743255 100644
--- a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
+++ b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
@@ -27,16 +27,18 @@ import java.util.List;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class SparqlTraversalSourceTest {
 
+    private static final Graph graph = TinkerFactory.createModern();
+    private static final SparqlTraversalSource g = graph.traversal(SparqlTraversalSource.class);
+
     @Test
-    public void shouldDoStuff() {
-        final Graph graph = TinkerFactory.createModern();
-        final SparqlTraversalSource g = graph.traversal(SparqlTraversalSource.class);
+    public void shouldFindAllPersonsNamesAndAges() {
         final List<?> x = g.sparql("SELECT ?name ?age WHERE { ?person v:name ?name . ?person v:age ?age }").toList();
         assertThat(x, containsInAnyOrder(
                 new HashMap<String,Object>(){{
@@ -57,4 +59,27 @@ public class SparqlTraversalSourceTest {
                 }}
         ));
     }
+
+    @Test
+    public void shouldFindAllPersonsNamesAndAgesOrdered() {
+        final List<?> x = g.sparql("SELECT ?name ?age WHERE { ?person v:name ?name . ?person v:age ?age } ORDER BY ASC(?age)").toList();
+        assertThat(x, contains(
+                new HashMap<String,Object>(){{
+                    put("name", "vadas");
+                    put("age", 27);
+                }},
+                new HashMap<String,Object>(){{
+                    put("name", "marko");
+                    put("age", 29);
+                }},
+                new HashMap<String,Object>(){{
+                    put("name", "josh");
+                    put("age", 32);
+                }},
+                new HashMap<String,Object>(){{
+                    put("name", "peter");
+                    put("age", 35);
+                }}
+        ));
+    }
 }


[19/50] tinkerpop git commit: Updated site for 3.2.9/3.3.3 release CTR

Posted by sp...@apache.org.
Updated site for 3.2.9/3.3.3 release CTR


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

Branch: refs/heads/TINKERPOP-1878
Commit: d492136dcb3725d4783fd7b5d7d4d30eb7a5ace1
Parents: b63e2f9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 11 14:43:33 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 14:43:33 2018 -0400

----------------------------------------------------------------------
 docs/site/home/downloads.html              | 60 ++++++++++++++++++++-----
 docs/site/home/index.html                  | 10 ++---
 docs/site/home/template/header-footer.html | 12 ++---
 3 files changed, 60 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d492136d/docs/site/home/downloads.html
----------------------------------------------------------------------
diff --git a/docs/site/home/downloads.html b/docs/site/home/downloads.html
index f5f0ab3..fd27d66 100644
--- a/docs/site/home/downloads.html
+++ b/docs/site/home/downloads.html
@@ -35,7 +35,48 @@ limitations under the License.
     <table class="table">
         <tr>
             <td>
-                <strong>3.3.2</strong> (latest, stable)
+                <strong>3.3.3</strong> (latest, stable)
+            </td>
+            <td>
+                8-May-2018
+            </td>
+            <td>
+                <a href="https://github.com/apache/tinkerpop/blob/3.3.3/CHANGELOG.asciidoc#release-3-3-3">release notes</a> |
+                <a href="http://tinkerpop.apache.org/docs/3.3.3/upgrade/#_tinkerpop_3_3_3">upgrade</a> |
+                <a href="http://tinkerpop.apache.org/docs/3.3.3/">documentation</a> |
+                <a href="http://tinkerpop.apache.org/javadocs/3.3.3/full/">javadoc</a>
+            </td>
+            <td align="right">
+                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.3/apache-tinkerpop-gremlin-console-3.3.3-bin.zip" class="btn btn-primary">Gremlin Console <span class="glyphicon glyphicon-download-alt"></span></a>
+                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.3/apache-tinkerpop-gremlin-server-3.3.3-bin.zip" class="btn btn-primary">Gremlin Server <span class="glyphicon glyphicon-download-alt"></span></a>
+                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.3/apache-tinkerpop-3.3.3-src.zip" class="btn btn-primary">Source <span class="glyphicon glyphicon-download-alt"></span></a>
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <strong>3.2.9</strong> (maintenance)
+            </td>
+            <td>
+                8-May-2018
+            </td>
+            <td>
+                <a href="https://github.com/apache/tinkerpop/blob/3.2.9/CHANGELOG.asciidoc#release-3-2-9">release notes</a> |
+                <a href="http://tinkerpop.apache.org/docs/3.2.9/upgrade/#_tinkerpop_3_2_9">upgrade</a> |
+                <a href="http://tinkerpop.apache.org/docs/3.2.9/">documentation</a> |
+                <a href="http://tinkerpop.apache.org/javadocs/3.2.9/full/">javadoc</a>
+            </td>
+            <td align="right">
+                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.2.9/apache-tinkerpop-gremlin-console-3.2.9-bin.zip" class="btn btn-primary">Gremlin Console <span class="glyphicon glyphicon-download-alt"></span></a>
+                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.2.9/apache-tinkerpop-gremlin-server-3.2.9-bin.zip" class="btn btn-primary">Gremlin Server <span class="glyphicon glyphicon-download-alt"></span></a>
+                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.2.9/apache-tinkerpop-3.2.9-src.zip" class="btn btn-primary">Source <span class="glyphicon glyphicon-download-alt"></span></a>
+            </td>
+        </tr>
+    </table>
+    <h4>Archived Releases</h4>
+    <table class="table">
+        <tr>
+            <td>
+                <strong>3.3.2</strong>
             </td>
             <td>
                 2-Apr-2018
@@ -47,14 +88,14 @@ limitations under the License.
                 <a href="http://tinkerpop.apache.org/javadocs/3.3.2/full/">javadoc</a>
             </td>
             <td align="right">
-                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.2/apache-tinkerpop-gremlin-console-3.3.2-bin.zip" class="btn btn-primary">Gremlin Console <span class="glyphicon glyphicon-download-alt"></span></a>
-                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.2/apache-tinkerpop-gremlin-server-3.3.2-bin.zip" class="btn btn-primary">Gremlin Server <span class="glyphicon glyphicon-download-alt"></span></a>
-                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.2/apache-tinkerpop-3.3.2-src.zip" class="btn btn-primary">Source <span class="glyphicon glyphicon-download-alt"></span></a>
+                <a href="https://archive.apache.org/dist/tinkerpop/3.3.2/apache-tinkerpop-gremlin-console-3.3.2-bin.zip" class="btn btn-primary">Gremlin Console <span class="glyphicon glyphicon-download-alt"></span></a>
+                <a href="https://archive.apache.org/dist/tinkerpop/3.3.2/apache-tinkerpop-gremlin-server-3.3.2-bin.zip" class="btn btn-primary">Gremlin Server <span class="glyphicon glyphicon-download-alt"></span></a>
+                <a href="https://archive.apache.org/dist/tinkerpop/3.3.2/apache-tinkerpop-3.3.2-src.zip" class="btn btn-primary">Source <span class="glyphicon glyphicon-download-alt"></span></a>
             </td>
         </tr>
         <tr>
             <td>
-                <strong>3.2.8</strong> (maintenance)
+                <strong>3.2.8</strong>
             </td>
             <td>
                 2-Apr-2018
@@ -66,14 +107,11 @@ limitations under the License.
                 <a href="http://tinkerpop.apache.org/javadocs/3.2.8/full/">javadoc</a>
             </td>
             <td align="right">
-                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.2.8/apache-tinkerpop-gremlin-console-3.2.8-bin.zip" class="btn btn-primary">Gremlin Console <span class="glyphicon glyphicon-download-alt"></span></a>
-                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.2.8/apache-tinkerpop-gremlin-server-3.2.8-bin.zip" class="btn btn-primary">Gremlin Server <span class="glyphicon glyphicon-download-alt"></span></a>
-                <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.2.8/apache-tinkerpop-3.2.8-src.zip" class="btn btn-primary">Source <span class="glyphicon glyphicon-download-alt"></span></a>
+                <a href="https://archive.apache.org/dist/tinkerpop/3.2.8/apache-tinkerpop-gremlin-console-3.2.8-bin.zip" class="btn btn-primary">Gremlin Console <span class="glyphicon glyphicon-download-alt"></span></a>
+                <a href="https://archive.apache.org/dist/tinkerpop/3.2.8/apache-tinkerpop-gremlin-server-3.2.8-bin.zip" class="btn btn-primary">Gremlin Server <span class="glyphicon glyphicon-download-alt"></span></a>
+                <a href="https://archive.apache.org/dist/tinkerpop/3.2.8/apache-tinkerpop-3.2.8-src.zip" class="btn btn-primary">Source <span class="glyphicon glyphicon-download-alt"></span></a>
             </td>
         </tr>
-    </table>
-    <h4>Archived Releases</h4>
-    <table class="table">
         <tr>
             <td>
                 <strong>3.3.1</strong>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d492136d/docs/site/home/index.html
----------------------------------------------------------------------
diff --git a/docs/site/home/index.html b/docs/site/home/index.html
index 9152a7e..9ee55c5 100644
--- a/docs/site/home/index.html
+++ b/docs/site/home/index.html
@@ -25,13 +25,13 @@ limitations under the License.
          <div class="col-md-6">
             <br/>
             <p>
-               <b><font size="4">TinkerPop</font> <font size="4">3.3.2</font></b> (<font size="2">Released: 2-Apr-2018</font>)
+               <b><font size="4">TinkerPop</font> <font size="4">3.3.3</font></b> (<font size="2">Released: 8-May-2018</font>)
             </p>
             <p><b>Downloads</b></p>
             <p>
-               <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.2/apache-tinkerpop-gremlin-console-3.3.2-bin.zip" class="btn btn-primary">Gremlin Console <span class="glyphicon glyphicon-download-alt"></span></a>
-               <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.2/apache-tinkerpop-gremlin-server-3.3.2-bin.zip" class="btn btn-primary">Gremlin Server <span class="glyphicon glyphicon-download-alt"></span></a>
-               <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.2/apache-tinkerpop-3.3.2-src.zip" class="btn btn-primary">Source <span class="glyphicon glyphicon-download-alt"></span></a>
+               <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.3/apache-tinkerpop-gremlin-console-3.3.3-bin.zip" class="btn btn-primary">Gremlin Console <span class="glyphicon glyphicon-download-alt"></span></a>
+               <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.3/apache-tinkerpop-gremlin-server-3.3.3-bin.zip" class="btn btn-primary">Gremlin Server <span class="glyphicon glyphicon-download-alt"></span></a>
+               <a href="https://www.apache.org/dyn/closer.lua/tinkerpop/3.3.3/apache-tinkerpop-3.3.3-src.zip" class="btn btn-primary">Source <span class="glyphicon glyphicon-download-alt"></span></a>
             </p>
             <div class="row">
                <div class="col-md-6">
@@ -41,7 +41,7 @@ limitations under the License.
                      <ul>
                         <li><a href="http://tinkerpop.apache.org/docs/current/reference">Reference Documentation</a></li>
                      </ul>
-                     <li><a href="http://tinkerpop.apache.org/docs/3.3.2/upgrade/#_tinkerpop_3_3_2">Upgrade Information</a></li>
+                     <li><a href="http://tinkerpop.apache.org/docs/3.3.3/upgrade/#_tinkerpop_3_3_3">Upgrade Information</a></li>
                      <li>TinkerPop Javadoc - <a href="http://tinkerpop.apache.org/javadocs/current/core/">core</a> / <a href="http://tinkerpop.apache.org/javadocs/current/full/">full</a></li>
                   </ul>
                </div>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d492136d/docs/site/home/template/header-footer.html
----------------------------------------------------------------------
diff --git a/docs/site/home/template/header-footer.html b/docs/site/home/template/header-footer.html
index 863c4b7..0aeb6ed 100644
--- a/docs/site/home/template/header-footer.html
+++ b/docs/site/home/template/header-footer.html
@@ -75,16 +75,16 @@ limitations under the License.
                   Documentation <b class="caret"></b>
                   </a>
                   <ul class="dropdown-menu">
-                     <li class="dropdown-header">Latest: 3.3.2 (2-Apr-2018)</li>
-                     <li><a href="http://tinkerpop.apache.org/docs/current">TinkerPop 3.3.2</a></li>
+                     <li class="dropdown-header">Latest: 3.3.3 (8-May-2018)</li>
+                     <li><a href="http://tinkerpop.apache.org/docs/current">TinkerPop 3.3.3</a></li>
                      <li><a href="http://tinkerpop.apache.org/docs/current/upgrade">Upgrade Information</a></li>
                      <li><a href="http://tinkerpop.apache.org/javadocs/current/core/">Core Javadoc API</a></li>
                      <li><a href="http://tinkerpop.apache.org/javadocs/current/full/">Full Javadoc API</a></li>
                      <li role="separator" class="divider"></li>
-                     <li class="dropdown-header">Maintenance: 3.2.8 (2-Apr-2018)</li>
-                     <li><a href="http://tinkerpop.apache.org/docs/3.2.8/">TinkerPop 3.2.8</a></li>
-                     <li><a href="http://tinkerpop.apache.org/javadocs/3.2.8/core/">Core Javadoc API</a></li>
-                     <li><a href="http://tinkerpop.apache.org/javadocs/3.2.8/full/">Full Javadoc API</a></li>
+                     <li class="dropdown-header">Maintenance: 3.2.9 (8-May-2018)</li>
+                     <li><a href="http://tinkerpop.apache.org/docs/3.2.9/">TinkerPop 3.2.9</a></li>
+                     <li><a href="http://tinkerpop.apache.org/javadocs/3.2.9/core/">Core Javadoc API</a></li>
+                     <li><a href="http://tinkerpop.apache.org/javadocs/3.2.9/full/">Full Javadoc API</a></li>
                      <li role="separator" class="divider"></li>
                      <li><a href="http://tinkerpop.apache.org/docs/">Documentation Archives</a></li>
                      <li><a href="http://tinkerpop.apache.org/javadocs/">Javadoc Archives</a></li>


[39/50] tinkerpop git commit: TINKERPOP-1878 sparql() step works over remoting

Posted by sp...@apache.org.
TINKERPOP-1878 sparql() step works over remoting

At this point it is only tested to work with Gryo 3.0. Fixed a bug with how dynamic gryo registrations work - they failed if you didn't have a specific serializer specified. Introduced a bit of a hack to make SparqlTraversalSource behave like a GraphTraversalSource and thus more cleanly follow the DSL pattern. Not sure if that's a great approach yet or not, but it seems harmless at this point.


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

Branch: refs/heads/TINKERPOP-1878
Commit: 6fae2a359bef21c06f2a3f41a3ec08a480148a4d
Parents: ecb8100
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jan 25 17:00:54 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java | 5 ++++-
 sparql-gremlin/pom.xml                                          | 4 ----
 .../process/traversal/dsl/sparql/SparqlTraversalSource.java     | 3 +++
 .../sparql/process/traversal/strategy/SparqlStrategy.java       | 5 +++--
 4 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6fae2a35/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
index 6bb7b34..4a325dd 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java
@@ -382,6 +382,9 @@ public enum GryoVersion {
                     "org.apache.tinkerpop.gremlin.driver.ser.RequestMessageGryoSerializer", 167);
             tryAddDynamicType(this, "org.apache.tinkerpop.gremlin.driver.message.ResponseMessage",
                     "org.apache.tinkerpop.gremlin.driver.ser.ResponseMessageGryoSerializer", 169);
+
+            tryAddDynamicType(this, "org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy.SparqlStrategy",
+                    null, 1690);
         }};
     }
 
@@ -560,7 +563,7 @@ public enum GryoVersion {
                                             final String serializer, final int registrationId) {
         try {
             final Class typeClass = Class.forName(type);
-            final Optional<SerializerShim<?>> serializerInstance = Optional.of(serializer)
+            final Optional<SerializerShim<?>> serializerInstance = Optional.ofNullable(serializer)
                     .map(FunctionUtils.wrapFunction(Class::forName))
                     .map(FunctionUtils.wrapFunction(c -> (SerializerShim<?>) c.getConstructor().newInstance()));
             if (serializerInstance.isPresent()) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6fae2a35/sparql-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/sparql-gremlin/pom.xml b/sparql-gremlin/pom.xml
index 0dceb85..0e3da38 100644
--- a/sparql-gremlin/pom.xml
+++ b/sparql-gremlin/pom.xml
@@ -11,10 +11,6 @@
     <artifactId>sparql-gremlin</artifactId>
     <name>Apache TinkerPop :: SPARQL Gremlin</name>
 
-    <properties>
-        <query.dir>src/test/resources/sparql/queries</query.dir>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.jena</groupId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6fae2a35/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
index b156ed1..3889d95 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ConstantStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.InjectStep;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
@@ -123,8 +124,10 @@ public class SparqlTraversalSource implements TraversalSource {
      */
     public <S> SparqlTraversal<S,String> sparql(final String query) {
         final SparqlTraversalSource clone = this.clone();
+        clone.bytecode.addStep(GraphTraversal.Symbols.inject);
         clone.bytecode.addStep(GraphTraversal.Symbols.constant, query);
         final SparqlTraversal.Admin<S, S> traversal = new DefaultSparqlTraversal<>(clone);
+        traversal.addStep(new InjectStep<S>(traversal));
         return traversal.addStep(new ConstantStep<S,String>(traversal, query));
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6fae2a35/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
index bb0b326..d74ac3e 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy;
 
 import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
+import org.apache.tinkerpop.gremlin.process.remote.traversal.strategy.decoration.RemoteStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ConstantStep;
@@ -44,7 +45,7 @@ public class SparqlStrategy extends AbstractTraversalStrategy<TraversalStrategy.
         implements TraversalStrategy.DecorationStrategy {
     private static final SparqlStrategy INSTANCE = new SparqlStrategy();
 
-    private static final Set<Class<? extends DecorationStrategy>> POSTS = Collections.singleton(VertexProgramStrategy.class);
+    private static final Set<Class<? extends DecorationStrategy>> POSTS = Collections.singleton(RemoteStrategy.class);
 
     private SparqlStrategy() {}
 
@@ -63,7 +64,7 @@ public class SparqlStrategy extends AbstractTraversalStrategy<TraversalStrategy.
         if (!(traversal.getParent() instanceof EmptyStep))
             return;
 
-        if (traversal.getSteps().size() == 1 && traversal.getEndStep() instanceof ConstantStep) {
+        if (traversal.getSteps().size() == 2 && traversal.getEndStep() instanceof ConstantStep) {
             final ConstantStep stepWithSparql = (ConstantStep) traversal.getEndStep();
             final Object constant = stepWithSparql.getConstant();
             if (constant instanceof String) {


[41/50] tinkerpop git commit: TINKERPOP-1878 Added a test for GROUP

Posted by sp...@apache.org.
TINKERPOP-1878 Added a test for GROUP


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

Branch: refs/heads/TINKERPOP-1878
Commit: 9d93852f6c4e031b75313f82be15103f0e190e45
Parents: c9e36fb
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jan 29 09:09:07 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 .../dsl/sparql/SparqlTraversalSourceTest.java       | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9d93852f/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
index 56d62c9..0e56347 100644
--- a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
+++ b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
@@ -110,6 +110,7 @@ public class SparqlTraversalSourceTest {
         assertEquals(x.get("a"), _g.V(1).next());
         assertEquals(x.get("b"), _g.V(4).next());
         assertEquals(x.get("c"), _g.V(3).next());
+        assertEquals(3, x.size());
     }
 
     @Test
@@ -134,4 +135,19 @@ public class SparqlTraversalSourceTest {
                         "ORDER BY ?name").toList();
         assertThat(x, contains("josh", "marko", "peter"));
     }
+
+    @Test
+    public void shouldGroup() {
+        final Map<String,Long> x = (Map) g.sparql(
+                "SELECT ?name (COUNT(?name) AS ?name_count)\n" +
+                        "WHERE {\n" +
+                        "    ?a e:created ?b .\n" +
+                        "    ?a v:name ?name .\n" +
+                        "}" +
+                        "GROUP BY ?name").next();
+        assertEquals(new Long(2), x.get("josh"));
+        assertEquals(new Long(1), x.get("peter"));
+        assertEquals(new Long(1), x.get("marko"));
+        assertEquals(3, x.size());
+    }
 }


[14/50] tinkerpop git commit: Merge branch 'tp33'

Posted by sp...@apache.org.
Merge branch 'tp33'


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

Branch: refs/heads/TINKERPOP-1878
Commit: bcaced4f4061ff1e0857eb49888ada1ec6f4ebf4
Parents: c24136a b63e2f9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 10 11:57:41 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 10 11:57:41 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bcaced4f/CHANGELOG.asciidoc
----------------------------------------------------------------------


[30/50] tinkerpop git commit: TINKERPOP-1878 Major refactoring of sparql-gremlin classes

Posted by sp...@apache.org.
TINKERPOP-1878 Major refactoring of sparql-gremlin classes

Renamed the "compiler" to a "transpiler" since it's really transforming sparql to a language of a similar level of abstraction in Gremlin. Lots of code reformatting and dead code pruning.


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

Branch: refs/heads/TINKERPOP-1878
Commit: 25953e4b0b2b54adc5e6be7ca42ff0bec17c0f1a
Parents: abff3b9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jan 26 13:36:29 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 .../gremlin/sparql/SparqlToGremlinCompiler.java | 381 -------------------
 .../sparql/SparqlToGremlinTranspiler.java       | 286 ++++++++++++++
 .../gremlin/sparql/TraversalBuilder.java        |   7 +-
 .../gremlin/sparql/WhereTraversalBuilder.java   |  66 ++--
 .../traversal/strategy/SparqlStrategy.java      |   5 +-
 5 files changed, 322 insertions(+), 423 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25953e4b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompiler.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompiler.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompiler.java
deleted file mode 100644
index adb36e9..0000000
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompiler.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * 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.sparql;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.jena.graph.Triple;
-import org.apache.jena.query.Query;
-import org.apache.jena.query.QueryFactory;
-import org.apache.jena.query.SortCondition;
-import org.apache.jena.query.Syntax;
-import org.apache.jena.sparql.algebra.Algebra;
-import org.apache.jena.sparql.algebra.Op;
-import org.apache.jena.sparql.algebra.OpVisitorBase;
-import org.apache.jena.sparql.algebra.OpWalker;
-import org.apache.jena.sparql.algebra.op.OpBGP;
-import org.apache.jena.sparql.algebra.op.OpFilter;
-import org.apache.jena.sparql.algebra.op.OpLeftJoin;
-import org.apache.jena.sparql.algebra.op.OpUnion;
-import org.apache.jena.sparql.core.Var;
-import org.apache.jena.sparql.core.VarExprList;
-import org.apache.jena.sparql.expr.Expr;
-import org.apache.jena.sparql.expr.ExprAggregator;
-import org.apache.tinkerpop.gremlin.process.traversal.Order;
-import org.apache.tinkerpop.gremlin.process.traversal.Scope;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-
-// TODO: implement OpVisitor, don't extend OpVisitorBase
-public class SparqlToGremlinCompiler extends OpVisitorBase {
-
-	private GraphTraversal<Vertex, ?> traversal;
-
-	List<Traversal> traversalList = new ArrayList<Traversal>();
-
-	String groupVariable = "";
-	int sortingDirection = 0;
-	long offsetLimit = 0;
-	String sortingVariable = "";
-
-	GraphTraversalSource temp;
-	Graph graph;
-
-	private SparqlToGremlinCompiler(final GraphTraversal<Vertex, ?> traversal) {
-		this.traversal = traversal;
-	}
-
-	private SparqlToGremlinCompiler(final GraphTraversalSource g) {
-		this(g.V());
-		temp = g;
-
-	}
-
-	private SparqlToGremlinCompiler(final Graph g) {
-		this.traversal = (GraphTraversal<Vertex, ?>) g.traversal();
-		graph = g;
-	}
-
-	public String createMatchStep(String step) {
-		String st = "";
-		step = step.substring(1, step.length() - 2);
-		String first = step.substring(0, step.indexOf(","));
-		String second = step.substring(step.indexOf(",") + 1);
-		//System.out.println("First : " + first);
-		//System.out.println("Second : " + second);
-		st = first.substring(first.indexOf("["), first.length() - 1);
-		st = "[" + st + "," + second + "]";
-		return st;
-	}
-
-	GraphTraversal<Vertex, ?> convertToGremlinTraversal(final Query query) {
-		
-		// long startTime = System.currentTimeMillis();
-		// long endTime;
-		final Op op = Algebra.compile(query); // SPARQL query compiles here to
-												// OP
-//		System.out.println("OP Tree: " + op.toString());
-
-		
-		OpWalker.walk(op, this); // OP is being walked here
-		
-		
-		
-		
-		//System.out.println("time taken for opWalker:"+ (endTime-startTime));
-		// startTime = System.currentTimeMillis();
-		int traversalIndex = 0;
-		int numberOfTraversal = traversalList.size();
-		Traversal arrayOfAllTraversals[] = new Traversal[numberOfTraversal];
-
-		if (query.hasOrderBy() && !query.hasGroupBy()) {
-			List<SortCondition> sortingConditions = query.getOrderBy();
-			int directionOfSort = 0;
-
-			for (SortCondition sortCondition : sortingConditions) {
-				Expr expr = sortCondition.getExpression();
-				directionOfSort = sortCondition.getDirection();
-				sortingVariable = expr.getVarName();
-
-			}
-
-			Order orderDirection = Order.incr;
-			if (directionOfSort == -1) {
-				orderDirection = Order.decr;
-			}
-		}
-		for (Traversal tempTrav : traversalList) {
-
-			arrayOfAllTraversals[traversalIndex++] = tempTrav;
-		}
-
-		int directionOfSort = 0;
-		Order orderDirection = Order.incr;
-		if (query.hasOrderBy()) {
-			List<SortCondition> sortingConditions = query.getOrderBy();
-
-			//
-			for (SortCondition sortCondition : sortingConditions) {
-				Expr expr = sortCondition.getExpression();
-				directionOfSort = sortCondition.getDirection();
-				sortingVariable = expr.getVarName();
-//				System.out.println("order by var: "+sortingDirection);
-			}
-			//
-
-			if (directionOfSort == -1) {
-				orderDirection = Order.decr;
-			}
-
-		}
-
-		if (traversalList.size() > 0)
-			traversal = traversal.match(arrayOfAllTraversals);
-
-		final List<String> vars = query.getResultVars();
-		List<ExprAggregator> lstexpr = query.getAggregators();
-		if (!query.isQueryResultStar() && !query.hasGroupBy()) {
-
-			switch (vars.size()) {
-			case 0:
-				throw new IllegalStateException();
-			case 1:
-				if (query.isDistinct()) {
-//					System.out.println("Inside ------------------- >Select 1------------------------> Distinct");
-					traversal = traversal.dedup(vars.get(0));
-				}
-				if (query.hasOrderBy()) {
-//					System.out.println("Inside ------------------- >Select 1");
-					traversal = traversal.order().by(sortingVariable, orderDirection);
-				} else {
-
-					traversal = traversal.select(vars.get(0));
-				}
-				break;
-			case 2:
-				if (query.isDistinct()) {
-					traversal = traversal.dedup(vars.get(0), vars.get(1));
-				}
-				if (query.hasOrderBy()) {
-//					System.out.println("Inside ------------------- >Select 1");
-					traversal = traversal.order().by(__.select(vars.get(0)), orderDirection).by(__.select(vars.get(1)));
-				} else
-					traversal = traversal.select(vars.get(0), vars.get(1));
-				break;
-			default:
-				final String[] all = new String[vars.size()];
-				vars.toArray(all);
-				if (query.isDistinct()) {
-
-					traversal = traversal.dedup(all);
-				}
-				final String[] others = Arrays.copyOfRange(all, 2, vars.size());
-				if (query.hasOrderBy()) {
-
-					traversal = traversal.order().by(__.select(vars.get(0)), orderDirection).by(__.select(vars.get(1)));
-
-				} else
-					traversal = traversal.select(vars.get(0), vars.get(1), others);
-
-				break;
-			}
-
-		}
-		
-		
-		if (query.hasGroupBy()) {
-			VarExprList lstExpr = query.getGroupBy();
-			String grpVar = "";
-			Traversal tempTrav;
-			for (Var expr : lstExpr.getVars()) {
-				grpVar = expr.getName();
-				// System.out.println("The Group by var: " + expr.getName());
-			}
-
-			if (query.hasLimit()) {
-				long limit = query.getLimit(), offset = 0;
-
-				if (query.hasOffset()) {
-					offset = query.getOffset();
-
-				}
-				// if (query.hasGroupBy() && query.hasOrderBy())
-				// traversal = traversal.range( offset, offset + limit);
-				// else
-				// traversal = traversal.range(offset, offset + limit);
-
-			}
-
-			if (!grpVar.isEmpty())
-				traversal = traversal.select(grpVar);
-			if (query.hasAggregators()) {
-				List<ExprAggregator> exprAgg = query.getAggregators();
-				for (ExprAggregator expr : exprAgg) {
-
-//					System.out.println("The Aggregator by var: " + expr.getAggregator().getExprList().toString()
-//							+ " is :" + expr.getAggregator().toString());
-					if (expr.getAggregator().getName().contains("COUNT")) {
-						if (!query.toString().contains("GROUP")) {
-							if (expr.getAggregator().toString().contains("DISTINCT")) {
-								traversal = traversal
-										.dedup(expr.getAggregator().getExprList().get(0).toString().substring(1));
-							} else {
-								traversal = traversal
-										.select(expr.getAggregator().getExprList().get(0).toString().substring(1));
-							}
-							traversal = traversal.count();
-						} else
-							traversal = traversal.groupCount();
-					}
-					if (expr.getAggregator().getName().contains("MAX")) {
-						traversal = traversal.max();
-					}
-				}
-
-			} else {
-
-				traversal = traversal.group();
-			}
-			
-			
-		}
-
-
-		if (query.hasOrderBy() && query.hasGroupBy()) {
-
-			traversal = traversal.order().by(sortingVariable, orderDirection);
-		}
-		if (query.hasLimit()) {
-			long limit = query.getLimit(), offset = 0;
-
-			if (query.hasOffset()) {
-				offset = query.getOffset();
-
-			}
-			if (query.hasGroupBy() && query.hasOrderBy())
-				traversal = traversal.range(Scope.local, offset, offset + limit);
-			else
-				traversal = traversal.range(offset, offset + limit);
-
-		}
-		// endTime = System.currentTimeMillis();
-		// System.out.println("time taken for convertToGremlinTraversal Function : "+ (endTime-startTime)+" mili seconds");
-		
-		return traversal;
-	}
-
-	private static GraphTraversal<Vertex, ?> convertToGremlinTraversal(final GraphTraversalSource g,
-			final Query query) {
-		return new SparqlToGremlinCompiler(g).convertToGremlinTraversal(query);
-	}
-
-	public static GraphTraversal<Vertex, ?> convertToGremlinTraversal(final Graph graph, final String query) {
-		return convertToGremlinTraversal(graph.traversal(),	QueryFactory.create(Prefixes.prepend(query)));
-	}
-
-	public static GraphTraversal<Vertex, ?> convertToGremlinTraversal(final GraphTraversalSource g,
-			final String query) {
-		return convertToGremlinTraversal(g, QueryFactory.create(Prefixes.prepend(query), Syntax.syntaxSPARQL));
-	}
-
-	// VISITING SPARQL ALGEBRA OP BASIC TRIPLE PATTERNS - MAYBE
-	@Override
-	public void visit(final OpBGP opBGP) {
-		{
-			
-			// System.out.println("Inside opBGP ---------------------------------------------->");
-			final List<Triple> triples = opBGP.getPattern().getList();
-			final Traversal[] matchTraversals = new Traversal[triples.size()];
-			int i = 0;
-			for (final Triple triple : triples) {
-
-				matchTraversals[i++] = TraversalBuilder.transform(triple);
-				traversalList.add(matchTraversals[i - 1]);
-			}
-
-		}
-
-	}
-
-	// VISITING SPARQL ALGEBRA OP FILTER - MAYBE
-	@Override
-	public void visit(final OpFilter opFilter) {
-
-		// System.out.println("Inside opFilter ---------------------------------------------->");
-		Traversal traversal = null;
-
-		for (Expr expr : opFilter.getExprs().getList()) {
-			if (expr != null) {
-
-				traversal = __.where(WhereTraversalBuilder.transform(expr));
-				traversalList.add(traversal);
-			}
-		}
-
-	}
-	// TODO: add more functions for operators other than FILTER, such as
-	// OPTIONAL
-	// This can be done by understanding how Jena handles these other
-	// operators/filters inherently and then map them to Gremlin
-
-	public void visit(final OpLeftJoin opLeftJoin) {
-
-//		System.out.println("Inside opOptional ---------------------------------------------->");
-//		System.out.println(opLeftJoin.getRight().toString());
-
-	}
-
-	@Override
-	public void visit(final OpUnion opUnion) {
-
-		// System.out.println("Inside opUnion ---------------------------------------------->");
-		Traversal unionTemp[] = new Traversal[2];
-		Traversal unionTemp1[] = new Traversal[traversalList.size() / 2];
-		Traversal unionTemp2[] = new Traversal[traversalList.size() / 2];
-
-		int count = 0;
-
-		for (int i = 0; i < traversalList.size(); i++) {
-
-			if (i < traversalList.size() / 2) {
-
-				unionTemp1[i] = traversalList.get(i);
-			} else {
-				unionTemp2[count++] = traversalList.get(i);
-			}
-		}
-
-		unionTemp[1] = __.match(unionTemp2);
-		unionTemp[0] = __.match(unionTemp1);
-
-		traversalList.clear();
-		traversal = (GraphTraversal<Vertex, ?>) traversal.union(unionTemp);
-		// System.out.println("Getting out from Union -------------------> :
-		// "+traversal);
-		// traversalList.add(__.union(unionTemp));
-		// traversalList.clear();
-	}
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25953e4b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
new file mode 100644
index 0000000..9db7d82
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
@@ -0,0 +1,286 @@
+/*
+ * 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.sparql;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.jena.graph.Triple;
+import org.apache.jena.query.Query;
+import org.apache.jena.query.QueryFactory;
+import org.apache.jena.query.SortCondition;
+import org.apache.jena.query.Syntax;
+import org.apache.jena.sparql.algebra.Algebra;
+import org.apache.jena.sparql.algebra.Op;
+import org.apache.jena.sparql.algebra.OpVisitorBase;
+import org.apache.jena.sparql.algebra.OpWalker;
+import org.apache.jena.sparql.algebra.op.OpBGP;
+import org.apache.jena.sparql.algebra.op.OpFilter;
+import org.apache.jena.sparql.algebra.op.OpUnion;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.core.VarExprList;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.expr.ExprAggregator;
+import org.apache.tinkerpop.gremlin.process.traversal.Order;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+
+/**
+ * The engine that transpiles SPARQL to Gremlin traversals thus enabling SPARQL to be executed on any TinkerPop-enabled
+ * graph system.
+ */
+public class SparqlToGremlinTranspiler {
+
+	private GraphTraversal<Vertex, ?> traversal;
+
+    private List<Traversal> traversalList = new ArrayList<>();
+
+    private String sortingVariable = "";
+
+	private SparqlToGremlinTranspiler(final GraphTraversal<Vertex, ?> traversal) {
+		this.traversal = traversal;
+	}
+
+	private SparqlToGremlinTranspiler(final GraphTraversalSource g) {
+		this(g.V());
+	}
+
+    /**
+     * Converts SPARQL to a Gremlin traversal.
+     *
+     * @param graph the {@link Graph} instance to execute the traversal from
+     * @param sparqlQuery the query to transpile to Gremlin
+     */
+    public static GraphTraversal<Vertex, ?> transpile(final Graph graph, final String sparqlQuery) {
+        return transpile(graph.traversal(),	sparqlQuery);
+    }
+
+    /**
+     * Converts SPARQL to a Gremlin traversal.
+     *
+     * @param g the {@link GraphTraversalSource} instance to execute the traversal from
+     * @param sparqlQuery the query to transpile to Gremlin
+     */
+    public static GraphTraversal<Vertex, ?> transpile(final GraphTraversalSource g, final String sparqlQuery) {
+        return transpile(g, QueryFactory.create(Prefixes.prepend(sparqlQuery), Syntax.syntaxSPARQL));
+    }
+
+	private GraphTraversal<Vertex, ?> transpile(final Query query) {
+		final Op op = Algebra.compile(query);
+		OpWalker.walk(op, new GremlinOpVisitor());
+
+		int traversalIndex = 0;
+		final int numberOfTraversal = traversalList.size();
+        final Traversal arrayOfAllTraversals[] = new Traversal[numberOfTraversal];
+
+		if (query.hasOrderBy() && !query.hasGroupBy()) {
+            final List<SortCondition> sortingConditions = query.getOrderBy();
+
+			for (SortCondition sortCondition : sortingConditions) {
+                final Expr expr = sortCondition.getExpression();
+				sortingVariable = expr.getVarName();
+			}
+		}
+
+		for (Traversal tempTrav : traversalList) {
+			arrayOfAllTraversals[traversalIndex++] = tempTrav;
+		}
+
+		Order orderDirection = Order.incr;
+		if (query.hasOrderBy()) {
+            int directionOfSort = 0;
+            final List<SortCondition> sortingConditions = query.getOrderBy();
+
+			for (SortCondition sortCondition : sortingConditions) {
+                final Expr expr = sortCondition.getExpression();
+				directionOfSort = sortCondition.getDirection();
+				sortingVariable = expr.getVarName();
+			}
+
+			if (directionOfSort == -1) orderDirection = Order.decr;
+		}
+
+		if (traversalList.size() > 0)
+			traversal = traversal.match(arrayOfAllTraversals);
+
+		final List<String> vars = query.getResultVars();
+		if (!query.isQueryResultStar() && !query.hasGroupBy()) {
+            switch (vars.size()) {
+                case 0:
+                    throw new IllegalStateException();
+                case 1:
+                    if (query.isDistinct())
+                        traversal = traversal.dedup(vars.get(0));
+
+                    if (query.hasOrderBy())
+                        traversal = traversal.order().by(sortingVariable, orderDirection);
+                    else
+                        traversal = traversal.select(vars.get(0));
+
+                    break;
+                case 2:
+                    if (query.isDistinct())
+                        traversal = traversal.dedup(vars.get(0), vars.get(1));
+
+                    if (query.hasOrderBy())
+                        traversal = traversal.order().by(__.select(vars.get(0)), orderDirection).by(__.select(vars.get(1)));
+                    else
+                        traversal = traversal.select(vars.get(0), vars.get(1));
+
+                    break;
+                default:
+                    final String[] all = new String[vars.size()];
+                    vars.toArray(all);
+                    if (query.isDistinct())
+                        traversal = traversal.dedup(all);
+
+                    final String[] others = Arrays.copyOfRange(all, 2, vars.size());
+                    if (query.hasOrderBy())
+                        traversal = traversal.order().by(__.select(vars.get(0)), orderDirection).by(__.select(vars.get(1)));
+                    else
+                        traversal = traversal.select(vars.get(0), vars.get(1), others);
+
+                    break;
+            }
+		}
+
+		if (query.hasGroupBy()) {
+			final VarExprList lstExpr = query.getGroupBy();
+			String grpVar = "";
+			for (Var expr : lstExpr.getVars()) {
+				grpVar = expr.getName();
+			}
+
+			if (!grpVar.isEmpty())
+				traversal = traversal.select(grpVar);
+			if (query.hasAggregators()) {
+                final List<ExprAggregator> exprAgg = query.getAggregators();
+				for (ExprAggregator expr : exprAgg) {
+					if (expr.getAggregator().getName().contains("COUNT")) {
+						if (!query.toString().contains("GROUP")) {
+							if (expr.getAggregator().toString().contains("DISTINCT"))
+								traversal = traversal.dedup(expr.getAggregator().getExprList().get(0).toString().substring(1));
+							else
+								traversal = traversal.select(expr.getAggregator().getExprList().get(0).toString().substring(1));
+
+							traversal = traversal.count();
+						} else {
+                            traversal = traversal.groupCount();
+                        }
+					}
+
+					if (expr.getAggregator().getName().contains("MAX")) {
+						traversal = traversal.max();
+					}
+				}
+			} else {
+                traversal = traversal.group();
+            }
+		}
+
+		if (query.hasOrderBy() && query.hasGroupBy())
+			traversal = traversal.order().by(sortingVariable, orderDirection);
+
+		if (query.hasLimit()) {
+			long limit = query.getLimit(), offset = 0;
+
+			if (query.hasOffset())
+				offset = query.getOffset();
+
+			if (query.hasGroupBy() && query.hasOrderBy())
+				traversal = traversal.range(Scope.local, offset, offset + limit);
+			else
+				traversal = traversal.range(offset, offset + limit);
+		}
+
+		return traversal;
+	}
+
+    private static GraphTraversal<Vertex, ?> transpile(final GraphTraversalSource g, final Query query) {
+        return new SparqlToGremlinTranspiler(g).transpile(query);
+    }
+
+    /**
+     * An {@code OpVisitor} implementation that reads SPARQL algebra operations into Gremlin traversals.
+     */
+    private class GremlinOpVisitor extends OpVisitorBase {
+
+        /**
+         * Visiting triple patterns in SPARQL algebra.
+         */
+        @Override
+        public void visit(final OpBGP opBGP) {
+            final List<Triple> triples = opBGP.getPattern().getList();
+            final Traversal[] matchTraversals = new Traversal[triples.size()];
+            int i = 0;
+            for (final Triple triple : triples) {
+
+                matchTraversals[i++] = TraversalBuilder.transform(triple);
+                traversalList.add(matchTraversals[i - 1]);
+            }
+        }
+
+        /**
+         * Visiting filters in SPARQL algebra.
+         */
+        @Override
+        public void visit(final OpFilter opFilter) {
+            Traversal traversal;
+            for (Expr expr : opFilter.getExprs().getList()) {
+                if (expr != null) {
+                    traversal = __.where(WhereTraversalBuilder.transform(expr));
+                    traversalList.add(traversal);
+                }
+            }
+        }
+
+        /**
+         * Visiting unions in SPARQL algebra.
+         */
+        @Override
+        public void visit(final OpUnion opUnion) {
+            final Traversal unionTemp[] = new Traversal[2];
+            final Traversal unionTemp1[] = new Traversal[traversalList.size() / 2];
+            final Traversal unionTemp2[] = new Traversal[traversalList.size() / 2];
+
+            int count = 0;
+
+            for (int i = 0; i < traversalList.size(); i++) {
+                if (i < traversalList.size() / 2)
+                    unionTemp1[i] = traversalList.get(i);
+                else
+                    unionTemp2[count++] = traversalList.get(i);
+            }
+
+            unionTemp[1] = __.match(unionTemp2);
+            unionTemp[0] = __.match(unionTemp1);
+
+            traversalList.clear();
+            traversal = (GraphTraversal<Vertex, ?>) traversal.union(unionTemp);
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25953e4b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/TraversalBuilder.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/TraversalBuilder.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/TraversalBuilder.java
index 72a32a5..6d29442 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/TraversalBuilder.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/TraversalBuilder.java
@@ -26,10 +26,12 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.structure.PropertyType;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 
-
+/**
+ * Converts triple patterns into {@link GraphTraversal} instances.
+ */
 class TraversalBuilder {
 
-    public static GraphTraversal<?, ?> transform(final Triple triple) {
+    static GraphTraversal<?, ?> transform(final Triple triple) {
         final GraphTraversal<Vertex, ?> matchTraversal = __.as(triple.getSubject().getName());
         
         final Node predicate = triple.getPredicate();
@@ -53,7 +55,6 @@ class TraversalBuilder {
                                                       final PropertyType type, final Node object) {
         switch (propertyName) {
             case "id":
-         
                 return object.isConcrete()
                         ? traversal.hasId(object.getLiteralValue())
                         : traversal.id().as(object.getName());

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25953e4b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/WhereTraversalBuilder.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/WhereTraversalBuilder.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/WhereTraversalBuilder.java
index f4d49b6..80da707 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/WhereTraversalBuilder.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/WhereTraversalBuilder.java
@@ -33,61 +33,77 @@ import org.apache.jena.sparql.expr.E_LogicalAnd;
 import org.apache.jena.sparql.expr.E_LogicalOr;
 import org.apache.jena.sparql.expr.E_NotEquals;
 import org.apache.jena.sparql.expr.E_NotExists;
-import org.apache.jena.sparql.expr.E_StrLength;
 import org.apache.jena.sparql.expr.Expr;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 
+/**
+ * Converts SPARQL "where" expressions to Gremlin predicates.
+ */
 class WhereTraversalBuilder {
 
-    public static GraphTraversal<?, ?> transform(final E_Equals expression) {
-    //	System.out.println("The aggr one : "+expression.getArg1().getClass().getName() + "The aggr one :"+expression.getArg2().getClass().getName());
+    /**
+     * Converts a general {@code Expr} to an anonymous {@link GraphTraversal}.
+     */
+    static GraphTraversal<?, ?> transform(final Expr expression) {
+        if (expression instanceof E_Equals) return transform((E_Equals) expression);
+        if (expression instanceof E_NotEquals) return transform((E_NotEquals) expression);
+        if (expression instanceof E_LessThan) return transform((E_LessThan) expression);
+        if (expression instanceof E_LessThanOrEqual) return transform((E_LessThanOrEqual) expression);
+        if (expression instanceof E_GreaterThan) return transform((E_GreaterThan) expression);
+        if (expression instanceof E_GreaterThanOrEqual) return transform((E_GreaterThanOrEqual) expression);
+        if (expression instanceof E_LogicalAnd) return transform((E_LogicalAnd) expression);
+        if (expression instanceof E_LogicalOr) return transform((E_LogicalOr) expression);
+        if (expression instanceof E_Exists) return transform((E_Exists) expression);
+        if (expression instanceof E_NotExists) return transform((E_NotExists) expression);
+        throw new IllegalStateException(String.format("Unhandled expression: %s", expression));
+    }
+
+    private static GraphTraversal<?, ?> transform(final E_Equals expression) {
         final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
         return __.as(expression.getArg1().getVarName()).is(P.eq(value));
     }
 
-    public static GraphTraversal<?, ?> transform(final E_NotEquals expression) {
+    private static GraphTraversal<?, ?> transform(final E_NotEquals expression) {
         final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
         return __.as(expression.getArg1().getVarName()).is(P.neq(value));
     }
 
-    public static GraphTraversal<?, ?> transform(final E_LessThan expression) {
-    //	System.out.println("The aggr one : "+expression.getArg1().getClass().getName() + "The aggr one :"+expression.getArg2().getClass().getName());
+    private static GraphTraversal<?, ?> transform(final E_LessThan expression) {
     	final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
         return __.as(expression.getArg1().getVarName()).is(P.lt(value));
     }
 
-    public static GraphTraversal<?, ?> transform(final E_LessThanOrEqual expression) {
-    //	System.out.println("The aggr one : "+expression.getArg1().getClass().getName() + "The aggr one :"+expression.getArg2().getClass().getName());
+    private static GraphTraversal<?, ?> transform(final E_LessThanOrEqual expression) {
         final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
         return __.as(expression.getArg1().getVarName()).is(P.lte(value));
     }
 
-    public static GraphTraversal<?, ?> transform(final E_GreaterThan expression) {
+    private static GraphTraversal<?, ?> transform(final E_GreaterThan expression) {
         final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
         return __.as(expression.getArg1().getVarName()).is(P.gt(value));
     }
 
-    public static GraphTraversal<?, ?> transform(final E_GreaterThanOrEqual expression) {
+    private static GraphTraversal<?, ?> transform(final E_GreaterThanOrEqual expression) {
         final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
         return __.as(expression.getArg1().getVarName()).is(P.gte(value));
     }
 
-    public static GraphTraversal<?, ?> transform(final E_LogicalAnd expression) {
+    private static GraphTraversal<?, ?> transform(final E_LogicalAnd expression) {
         return __.and(
                 transform(expression.getArg1()),
                 transform(expression.getArg2()));
     }
 
-    public static GraphTraversal<?, ?> transform(final E_LogicalOr expression) {
+    private static GraphTraversal<?, ?> transform(final E_LogicalOr expression) {
         return __.or(
                 transform(expression.getArg1()),
                 transform(expression.getArg2()));
     }
 
-    public static GraphTraversal<?, ?> transform(final E_Exists expression) {
+    private static GraphTraversal<?, ?> transform(final E_Exists expression) {
         final OpBGP opBGP = (OpBGP) expression.getGraphPattern();
         final List<Triple> triples = opBGP.getPattern().getList();
         if (triples.size() != 1) throw new IllegalStateException("Unhandled EXISTS pattern");
@@ -99,7 +115,7 @@ class WhereTraversalBuilder {
     }
     
 
-    public static GraphTraversal<?, ?> transform(final E_NotExists expression) {
+    private static GraphTraversal<?, ?> transform(final E_NotExists expression) {
         final OpBGP opBGP = (OpBGP) expression.getGraphPattern();
         final List<Triple> triples = opBGP.getPattern().getList();
         if (triples.size() != 1) throw new IllegalStateException("Unhandled NOT EXISTS pattern");
@@ -109,26 +125,4 @@ class WhereTraversalBuilder {
         endStep.removeLabel(label);
         return __.not(traversal);
     }
-    
-    public static int getStrLength(final E_StrLength expression){
-    	
-    	return expression.getArg().toString().length();
-    	
-    }
-    
-    
-    //what does <?, ?> signify? possibly <S,E>
-    public static GraphTraversal<?, ?> transform(final Expr expression) {
-        if (expression instanceof E_Equals) return transform((E_Equals) expression);
-        if (expression instanceof E_NotEquals) return transform((E_NotEquals) expression);
-        if (expression instanceof E_LessThan) return transform((E_LessThan) expression);
-        if (expression instanceof E_LessThanOrEqual) return transform((E_LessThanOrEqual) expression);
-        if (expression instanceof E_GreaterThan) return transform((E_GreaterThan) expression);
-        if (expression instanceof E_GreaterThanOrEqual) return transform((E_GreaterThanOrEqual) expression);
-        if (expression instanceof E_LogicalAnd) return transform((E_LogicalAnd) expression);
-        if (expression instanceof E_LogicalOr) return transform((E_LogicalOr) expression);
-        if (expression instanceof E_Exists) return transform((E_Exists) expression);
-        if (expression instanceof E_NotExists) return transform((E_NotExists) expression);
-        throw new IllegalStateException(String.format("Unhandled expression: %s", expression));
-    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25953e4b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
index d74ac3e..4073ec2 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
@@ -18,7 +18,6 @@
  */
 package org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy;
 
-import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
 import org.apache.tinkerpop.gremlin.process.remote.traversal.strategy.decoration.RemoteStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -26,7 +25,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.ConstantStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
-import org.apache.tinkerpop.gremlin.sparql.SparqlToGremlinCompiler;
+import org.apache.tinkerpop.gremlin.sparql.SparqlToGremlinTranspiler;
 import org.apache.tinkerpop.gremlin.sparql.process.traversal.dsl.sparql.SparqlTraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 
@@ -69,7 +68,7 @@ public class SparqlStrategy extends AbstractTraversalStrategy<TraversalStrategy.
             final Object constant = stepWithSparql.getConstant();
             if (constant instanceof String) {
                 final String sparql = (String) constant;
-                final Traversal<Vertex, ?> sparqlTraversal = SparqlToGremlinCompiler.convertToGremlinTraversal(
+                final Traversal<Vertex, ?> sparqlTraversal = SparqlToGremlinTranspiler.transpile(
                         traversal.getGraph().get(), sparql);
                 TraversalHelper.removeAllSteps(traversal);
                 sparqlTraversal.asAdmin().getSteps().forEach(s -> traversal.addStep(s));


[20/50] tinkerpop git commit: Merge branch 'tp33'

Posted by sp...@apache.org.
Merge branch 'tp33'


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

Branch: refs/heads/TINKERPOP-1878
Commit: 757de480384db439cf6022d1a7615f4c540cd510
Parents: 173a8b5 d492136
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 11 14:43:57 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 14:43:57 2018 -0400

----------------------------------------------------------------------
 docs/site/home/downloads.html              | 60 ++++++++++++++++++++-----
 docs/site/home/index.html                  | 10 ++---
 docs/site/home/template/header-footer.html | 12 ++---
 3 files changed, 60 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/757de480/docs/site/home/downloads.html
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/757de480/docs/site/home/index.html
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/757de480/docs/site/home/template/header-footer.html
----------------------------------------------------------------------


[25/50] tinkerpop git commit: TINKERPOP-1961 Removed duplication of images in binaries.

Posted by sp...@apache.org.
TINKERPOP-1961 Removed duplication of images in binaries.

The asciidoc plugin copies all files in the source directories of its execution. The asciidoc plugin was upgraded between 3.2.5 and 3.2.6 which introduced this new behavior.


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

Branch: refs/heads/TINKERPOP-1878
Commit: 288b455a731bbc2f062b2cfe043f8c775dee9700
Parents: 3635ff6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed May 9 07:03:13 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 20:03:31 2018 -0400

----------------------------------------------------------------------
 pom.xml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/288b455a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9737fef..9c4b507 100644
--- a/pom.xml
+++ b/pom.xml
@@ -811,9 +811,14 @@ limitations under the License.
                                     <goal>process-asciidoc</goal>
                                 </goals>
                                 <configuration>
-                                    <sourceDirectory>${asciidoc.input.dir}/</sourceDirectory>
+                                    <resources>
+                                        <resource>
+                                            <directory>${asciidoc.input.dir}/</directory>
+                                            <targetPath>${htmlsingle.output.dir}/</targetPath>
+                                            <excludes>${asciidoc.input.dir}/static/*.*</excludes>
+                                        </resource>
+                                    </resources>
                                     <sourceDocumentName>index.asciidoc</sourceDocumentName>
-                                    <outputDirectory>${htmlsingle.output.dir}/</outputDirectory>
                                     <backend>html5</backend>
                                     <doctype>article</doctype>
                                     <attributes>


[48/50] tinkerpop git commit: updating the reference documentation

Posted by sp...@apache.org.
updating the reference documentation

added the following:
- fix the logo
- added prefixes
- added limitations
- added examples

todo:
- cover all limitations and special cases with examples

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

Branch: refs/heads/TINKERPOP-1878
Commit: c43c6658247274270c2184cc5bbdb1e3afdf5efa
Parents: 5acc280
Author: Harsh Thakkar <ha...@gmail.com>
Authored: Wed Mar 28 17:27:32 2018 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 docs/src/reference/transpilers.asciidoc | 355 ++++++++++++++++++++++++++-
 1 file changed, 351 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c43c6658/docs/src/reference/transpilers.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/transpilers.asciidoc b/docs/src/reference/transpilers.asciidoc
index 9100f84..386b4a5 100644
--- a/docs/src/reference/transpilers.asciidoc
+++ b/docs/src/reference/transpilers.asciidoc
@@ -17,10 +17,6 @@ limitations under the License.
 [[transpilers]]
 = Gremlin Transpilers
 
-![gremlinator][SPARQL-Gremlin]
-
-[SPARQL-Gremlin]: https://raw.githubusercontent.com/LITMUS-Benchmark-Suite/sparql-to-gremlin/master/docs/images/sparql-gremlin-logo.png
-
 There are many languages built to query data. SQL is typically used to query relational data. There is SPARQL for RDF
 data. Cypher is used to do pattern matching in graph data. The list could go on. Transpilers convert languages like
 these to Gremlin so that it becomes possible to use them in any context that Gremlin is used. In other words, a
@@ -28,6 +24,24 @@ Gremlin Transpiler enables a particular query language to work on any TinkerPop-
 
 == SPARQL-Gremlin
 
+image:https://raw.githubusercontent.com/LITMUS-Benchmark-Suite/sparql-to-gremlin/master/docs/images/sparql-gremlin-logo.png[gremlinator]
+
+The SPARQL-Gremlin transpiler, transforms link:https://en.wikipedia.org/wiki/SPARQL[SPARQL] queries into Gremlin traversals. It is based on the  https://jena.apache.org/index.html[Apache Jena] SPARQL processor https://jena.apache.org/documentation/query/index.html[ARQ], which provides access to a syntax tree of a SPARQL query.
+
+
+The goal of this work is to bridge the query interoperability gap between the two famous, yet fairly disconnected, graph communities: Semantic Web (which relies on the RDF data model) and Graph database
+(which relies on Property graph data model).
+
+NOTE: The foundational research work on SPARQL-Gremlin transpiler (aka Gremlinator) can be found from -
+https://arxiv.org/pdf/1801.02911.pdf[Gremlinator full paper]. In this
+paper, we present and discuss the notion of graph query language
+semantics of SPARQL and Gremlin, and a formal mapping between SPARQL
+pattern matching graph patterns and Gremlin traversals. Furthermore, we
+point the interested reader to the following resourcesfor a better
+understanding: (1) Gremlinator demonstration -
+(http://gremlinator.iai.uni-bonn.de:8080/Demo/[Public Demo Mirror 1])
+and (http://195.201.31.31:8080/Demo/[Public Demo Mirror 2]); (2) A short video tutorial on how to use the demonstration - https://www.youtube.com/watch?v=Z0ETx2IBamw[here]
+
 [source,xml]
 ----
 <dependency>
@@ -68,3 +82,336 @@ start step.
 <2> Execute a SPARQL query against the TinkerGraph instance. The `SparqlTraversalSource` uses a
 <<traversalstrategy,TraversalStrategy>> to transparently converts that SPARQL query into a standard Gremlin traversal
 and then when finally iterated, executes that against the TinkerGraph.
+
+[[prefixes]]
+Prefixes
+~~~~~~~~~
+
+The SPARQL-Gremlin transpiler supports the following prefixes to traverse the graph:
+
+[cols=",",options="header",]
+|====================================
+|Prefix |Purpose
+|`v:<label>` |label-access traversal
+|`e:<label>` |out-edge traversal
+|`p:<name>` |property traversal
+|`v:<name>` |property-value traversal
+|====================================
+
+Note that element IDs and labels are treated like normal properties, hence they can be accessed using the same pattern:
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT ?name ?id ?label 
+	WHERE { 
+	?element v:name ?name . 
+	?element v:id ?id . 
+	?element v:label ?label .}""")
+----
+
+[[supported-queries]]
+Supported Queries
+~~~~~~~~~~~~~~~~~~
+
+The SPARQL-Gremlin transpiler is currently an on-going effort with an aim to cover the entire SPARQL 1.1 query feature spectrum, however we currently only support translation of the SPARQL 1.0 specification, especially _SELECT_ queries. The supported SPARQL query types are: 
+
+* Union 
+* Optional 
+* Order-By 
+* Group-By 
+* STAR-shaped or _neighbourhood queries_ 
+* Query modifiers, such as: 
+** Filter with _restrictions_ 
+** Count 
+** LIMIT 
+** OFFSET
+
+[[limitations]]
+Limitations
+~~~~~~~~~~~~
+
+The current implementation of SPARQL-Gremlin transpiler (i.e. SPARQL-Gremlin) does
+not support the following cases: 
+
+* SPARQL queries with variables in the
+predicate position are not currently covered, with an exception of the
+following case:
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT * WHERE { ?x ?y ?z . }""")
+----
+
+* A SPARQL Union query with un-balanced patterns, i.e. a gremlin union
+traversal can only be generated if the unput SPARQL query has the same
+number of patterns on both the side of the union operator. For instance,
+the following SPARQL query cannot be mapped using Gremlinator, since a
+union is executed between different number of graph patterns (two
+patterns _union_ 1 pattern).
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT * 
+	WHERE {
+	{?person e:created ?software . 
+	?person v:name "daniel" .}
+	UNION
+	{?software v:lang "java" .} }""")
+----
+
+* order by
+....
+Adding more here...
+....
+
+* group by
+....
+Adding more here...
+....
+
+[[examples]]
+Examples
+~~~~~~~~~
+
+The following section presents a comprehensive examples of SPARQL queries that are currently covered by the SPARQL-Gremlin transpiler.
+
+[[select-all]]
+Select All
+^^^^^^^^^^
+
+.Select all vertices in the graph.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT * WHERE { }""")
+----
+
+[[match-constant-values]]
+Match Constant Values
+^^^^^^^^^^^^^^^^^^^^^
+
+.Select all vertices with the label `person`.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT * WHERE {  ?person v:label "person" .}""")
+----
+
+[[select-specific-elements]]
+Select Specific Elements
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+.Select the values of the properties `name` and `age` for each `person` vertex.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT ?name ?age
+WHERE {
+  ?person v:label "person" .
+  ?person v:name ?name .
+  ?person v:age ?age . }""")
+----
+
+[[pattern-matching]]
+Pattern Matching
+^^^^^^^^^^^^^^^^
+
+.Select only those persons who created a project.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT ?name ?age
+WHERE {
+  ?person v:label "person" .
+  ?person v:name ?name .
+  ?person v:age ?age .
+  ?person e:created ?project . }""")
+----
+
+[[filtering]]
+Filtering
+^^^^^^^^^
+
+.Select only those persons who are older than 30.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT ?name ?age
+WHERE {
+  ?person v:label "person" .
+  ?person v:name ?name .
+  ?person v:age ?age .
+  ?person e:created ?project .
+    FILTER (?age > 30) }""")
+----
+
+[[deduplication]]
+Deduplication
+^^^^^^^^^^^^^
+
+.Select the distinct names of the created projects.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT DISTINCT ?name
+WHERE {
+  ?person v:label "person" .
+  ?person e:created ?project .
+  ?project v:name ?name .
+    FILTER (?age > 30)}""")
+----
+
+[[multiple-filters]]
+Multiple Filters
+^^^^^^^^^^^^^^^^
+
+.Select the distinct names of all Java projects.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT DISTINCT ?name
+WHERE {
+  ?person v:label "person" .
+  ?person v:age ?age .
+  ?person e:created ?project .
+  ?project v:name ?name .
+  ?project v:lang ?lang .
+    FILTER (?age > 30 && ?lang == "java") }""")
+----
+
+[[pattern-filters]]
+Pattern Filter(s)
+^^^^^^^^^^^^^^^^^
+
+.A different way to filter all person who created a project.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT ?name
+WHERE {
+  ?person v:label "person" .
+  ?person v:name ?name .
+    FILTER EXISTS { ?person e:created ?project } }""")
+----
+
+.Filter all person who did not create a project.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT ?name
+WHERE {
+  ?person v:label "person" .
+  ?person v:name ?name .
+    FILTER NOT EXISTS { ?person e:created ?project } }""")
+----
+
+[[meta-property-access]]
+Meta-Property Access
+^^^^^^^^^^^^^^^^^^^^
+
+.Accessing the Meta-Property of a graph element. Meta-Property can be perceived as the reified statements in an RDF graph.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT ?name ?startTime
+WHERE {
+  ?person v:name "daniel" .
+  ?person p:location ?location .
+  ?location v:value ?name .
+  ?location v:startTime ?startTime }""")
+----
+
+[[union]]
+Union
+^^^^^
+
+.Select all persons who have developed a software in java using union.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT * 
+WHERE {
+  {?person e:created ?software .}
+  UNION
+  {?software v:lang "java" .} }""")
+----
+
+[[optional]]
+Optional
+^^^^^^^^
+
+.Return the names of the persons who have created a software in java and optionally python.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT ?person 
+WHERE {
+  ?person v:label "person" .
+  ?person e:created ?software .
+  ?software v:lang "java" .
+  OPTIONAL {?software v:lang "python" . }}""")
+----
+
+[[order-by]]
+Order By
+^^^^^^^^
+
+.Select all vertices with the label `person` and order them by their age.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT * 
+WHERE {
+  ?person v:label "person" .
+  ?person v:age ?age .
+} ORDER BY (?age)""")
+----
+
+[[group-by]]
+Group By
+^^^^^^^^
+
+.Select all vertices with the label `person` and group them by their age.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT * 
+WHERE {
+  ?person v:label "person" .
+  ?person v:age ?age .
+} GROUP BY (?age)""")
+----
+
+[[mixedcomplexaggregation-based-queries]]
+Mixed/complex/aggregation-based queries
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.Count the number of projects which have been created by persons under the age of 30 and group them by age. Return only the top two.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT COUNT(?project) 
+WHERE {
+  ?person v:label "person" .
+  ?person v:age ?age . FILTER (?age < 30)
+  ?person e:created ?project .
+} GROUP BY (?age) LIMIT 2""")
+----
+
+[[star-shaped-queries]]
+STAR-shaped queries
+^^^^^^^^^^^^^^^^^^^
+
+.STAR-shaped queries are the queries that form/follow a star-shaped execution plan. These in terms of graph traversals can be perceived as path queries or neighbourhood queries. For instance, getting all the information about a specific `person` or `software`.
+
+[gremlin-groovy,existing]
+----
+g.sparql("""SELECT ?age ?software ?name ?location ?startTime 
+WHERE {
+  ?person v:name "daniel" .
+  ?person v:age ?age .
+  ?person e:created ?software .
+  ?person p:location ?location .
+  ?location v:value ?name .
+  ?location v:startTime ?startTime }""")
+----


[35/50] tinkerpop git commit: TINKERPOP-1878 Added some Traversal infrastructure

Posted by sp...@apache.org.
TINKERPOP-1878 Added some Traversal infrastructure

This is the start of getting Sparql working as a DSL in TinkerPop


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

Branch: refs/heads/TINKERPOP-1878
Commit: 7941e1e9c5236c07e75850b686695cb2cfd95ddf
Parents: ce2858c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jan 24 17:04:27 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 .../dsl/sparql/DefaultSparqlTraversal.java      |  55 ++++++++
 .../traversal/dsl/sparql/SparqlTraversal.java   |  68 +++++++++
 .../dsl/sparql/SparqlTraversalSource.java       | 138 +++++++++++++++++++
 .../traversal/strategy/SparqlStrategy.java      |  25 ++++
 4 files changed, 286 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7941e1e9/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/DefaultSparqlTraversal.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/DefaultSparqlTraversal.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/DefaultSparqlTraversal.java
new file mode 100644
index 0000000..133d4be
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/DefaultSparqlTraversal.java
@@ -0,0 +1,55 @@
+/*
+ * 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.sparql.process.traversal.dsl.sparql;
+
+import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class DefaultSparqlTraversal<S, E> extends DefaultTraversal<S, E> implements SparqlTraversal.Admin<S, E> {
+
+    public DefaultSparqlTraversal() {
+        super();
+    }
+
+    public DefaultSparqlTraversal(final SparqlTraversalSource sparqlTraversalSource) {
+        super(sparqlTraversalSource);
+    }
+
+    public DefaultSparqlTraversal(final Graph graph) {
+        super(graph);
+    }
+
+    @Override
+    public SparqlTraversal.Admin<S, E> asAdmin() {
+        return this;
+    }
+
+    @Override
+    public SparqlTraversal<S, E> iterate() {
+        return SparqlTraversal.Admin.super.iterate();
+    }
+
+    @Override
+    public DefaultSparqlTraversal<S, E> clone() {
+        return (DefaultSparqlTraversal<S, E>) super.clone();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7941e1e9/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversal.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversal.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversal.java
new file mode 100644
index 0000000..efa9489
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversal.java
@@ -0,0 +1,68 @@
+/*
+ * 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.sparql.process.traversal.dsl.sparql;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Step;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public interface SparqlTraversal<S, E> extends Traversal<S, E> {
+    public interface Admin<S, E> extends Traversal.Admin<S, E>, SparqlTraversal<S, E> {
+
+        @Override
+        public default <E2> SparqlTraversal.Admin<S, E2> addStep(final Step<?, E2> step) {
+            return (SparqlTraversal.Admin<S, E2>) Traversal.Admin.super.addStep((Step) step);
+        }
+
+        @Override
+        public default SparqlTraversal<S, E> iterate() {
+            return SparqlTraversal.super.iterate();
+        }
+
+        @Override
+        public SparqlTraversal.Admin<S, E> clone();
+    }
+
+    @Override
+    public default SparqlTraversal.Admin<S, E> asAdmin() {
+        return (SparqlTraversal.Admin<S, E>) this;
+    }
+
+    ////
+
+    /**
+     * Iterates the traversal presumably for the generation of side-effects.
+     */
+    @Override
+    public default SparqlTraversal<S, E> iterate() {
+        Traversal.super.iterate();
+        return this;
+    }
+
+    public static final class Symbols {
+
+        private Symbols() {
+            // static fields only
+        }
+
+        public static final String sparql = "sparql";
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7941e1e9/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
new file mode 100644
index 0000000..3596716
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
@@ -0,0 +1,138 @@
+/*
+ * 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.sparql.process.traversal.dsl.sparql;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
+import org.apache.tinkerpop.gremlin.process.remote.traversal.strategy.decoration.RemoteStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.ConstantStep;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Transaction;
+import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class SparqlTraversalSource implements TraversalSource {
+    protected transient RemoteConnection connection;
+    protected final Graph graph;
+    protected TraversalStrategies strategies;
+    protected Bytecode bytecode = new Bytecode();
+
+    public SparqlTraversalSource(final Graph graph, final TraversalStrategies traversalStrategies) {
+        this.graph = graph;
+        this.strategies = traversalStrategies;
+    }
+
+    public SparqlTraversalSource(final Graph graph) {
+        this(graph, TraversalStrategies.GlobalCache.getStrategies(graph.getClass()));
+    }
+
+    @Override
+    public TraversalStrategies getStrategies() {
+        return this.strategies;
+    }
+
+    @Override
+    public Graph getGraph() {
+        return this.graph;
+    }
+
+    @Override
+    public Bytecode getBytecode() {
+        return this.bytecode;
+    }
+
+    @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException")
+    public SparqlTraversalSource clone() {
+        try {
+            final SparqlTraversalSource clone = (SparqlTraversalSource) super.clone();
+            clone.strategies = this.strategies.clone();
+            clone.bytecode = this.bytecode.clone();
+            return clone;
+        } catch (final CloneNotSupportedException e) {
+            throw new IllegalStateException(e.getMessage(), e);
+        }
+    }
+
+    //// CONFIGURATIONS
+
+    @Override
+    public SparqlTraversalSource withStrategies(final TraversalStrategy... traversalStrategies) {
+        return (SparqlTraversalSource) TraversalSource.super.withStrategies(traversalStrategies);
+    }
+
+    @Override
+    @SuppressWarnings({"unchecked"})
+    public SparqlTraversalSource withoutStrategies(final Class<? extends TraversalStrategy>... traversalStrategyClasses) {
+        return (SparqlTraversalSource) TraversalSource.super.withoutStrategies(traversalStrategyClasses);
+    }
+
+    @Override
+    public SparqlTraversalSource withRemote(final Configuration conf) {
+        return (SparqlTraversalSource) TraversalSource.super.withRemote(conf);
+    }
+
+    @Override
+    public SparqlTraversalSource withRemote(final String configFile) throws Exception {
+        return (SparqlTraversalSource) TraversalSource.super.withRemote(configFile);
+    }
+
+    @Override
+    public SparqlTraversalSource withRemote(final RemoteConnection connection) {
+        try {
+            // check if someone called withRemote() more than once, so just release resources on the initial
+            // connection as you can't have more than one. maybe better to toss IllegalStateException??
+            if (this.connection != null)
+                this.connection.close();
+        } catch (Exception ignored) {
+            // not sure there's anything to do here
+        }
+
+        this.connection = connection;
+        final TraversalSource clone = this.clone();
+        clone.getStrategies().addStrategies(new RemoteStrategy(connection));
+        return (SparqlTraversalSource) clone;
+    }
+
+    public <S> SparqlTraversal<S,String> sparql(final String query) {
+        final SparqlTraversalSource clone = this.clone();
+        clone.bytecode.addStep(SparqlTraversal.Symbols.sparql, query);
+        final SparqlTraversal.Admin<S, S> traversal = new DefaultSparqlTraversal<>(clone);
+        return traversal.addStep(new ConstantStep<S,String>(traversal, query));
+    }
+
+    public Transaction tx() {
+        return this.graph.tx();
+    }
+
+    @Override
+    public void close() throws Exception {
+        if (connection != null) connection.close();
+    }
+
+    @Override
+    public String toString() {
+        return StringFactory.traversalSourceString(this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7941e1e9/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
new file mode 100644
index 0000000..6440127
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
@@ -0,0 +1,25 @@
+/*
+ * 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.sparql.process.traversal.strategy;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class SparqlStrategy {
+}


[08/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


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

Branch: refs/heads/TINKERPOP-1878
Commit: fa5e7affe960d762bbcb7f7d8526e13a4fa596d9
Parents: 4e3a0a9 cfbe2ce
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 10 11:28:00 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 10 11:28:00 2018 -0400

----------------------------------------------------------------------
 gremlin-console/src/main/static/NOTICE | 2 +-
 gremlin-server/src/main/static/NOTICE  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fa5e7aff/gremlin-console/src/main/static/NOTICE
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fa5e7aff/gremlin-server/src/main/static/NOTICE
----------------------------------------------------------------------


[02/50] tinkerpop git commit: TinkerPop 3.3.3 release

Posted by sp...@apache.org.
TinkerPop 3.3.3 release


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

Branch: refs/heads/TINKERPOP-1878
Commit: 2d39f9b803e02f18d09c8fc1cced29cb903eb7d0
Parents: d86fcc5
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue May 8 14:06:53 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue May 8 14:06:53 2018 -0400

----------------------------------------------------------------------
 giraph-gremlin/pom.xml                                             | 2 +-
 gremlin-archetype/gremlin-archetype-dsl/pom.xml                    | 2 +-
 gremlin-archetype/gremlin-archetype-server/pom.xml                 | 2 +-
 gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml            | 2 +-
 gremlin-archetype/pom.xml                                          | 2 +-
 gremlin-console/bin/gremlin.sh                                     | 2 +-
 gremlin-console/pom.xml                                            | 2 +-
 gremlin-core/pom.xml                                               | 2 +-
 gremlin-dotnet/pom.xml                                             | 2 +-
 gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj                  | 2 +-
 gremlin-dotnet/src/pom.xml                                         | 2 +-
 gremlin-dotnet/test/pom.xml                                        | 2 +-
 gremlin-driver/pom.xml                                             | 2 +-
 gremlin-groovy/pom.xml                                             | 2 +-
 gremlin-javascript/pom.xml                                         | 2 +-
 .../src/main/javascript/gremlin-javascript/package.json            | 2 +-
 gremlin-python/pom.xml                                             | 2 +-
 gremlin-server/pom.xml                                             | 2 +-
 gremlin-shaded/pom.xml                                             | 2 +-
 gremlin-test/pom.xml                                               | 2 +-
 gremlin-tools/gremlin-benchmark/pom.xml                            | 2 +-
 gremlin-tools/gremlin-coverage/pom.xml                             | 2 +-
 gremlin-tools/gremlin-io-test/pom.xml                              | 2 +-
 gremlin-tools/pom.xml                                              | 2 +-
 hadoop-gremlin/pom.xml                                             | 2 +-
 neo4j-gremlin/pom.xml                                              | 2 +-
 pom.xml                                                            | 2 +-
 spark-gremlin/pom.xml                                              | 2 +-
 tinkergraph-gremlin/pom.xml                                        | 2 +-
 29 files changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/giraph-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/giraph-gremlin/pom.xml b/giraph-gremlin/pom.xml
index 4bdbbcf..5c8e7fe 100644
--- a/giraph-gremlin/pom.xml
+++ b/giraph-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>giraph-gremlin</artifactId>
     <name>Apache TinkerPop :: Giraph Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-archetype/gremlin-archetype-dsl/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-dsl/pom.xml b/gremlin-archetype/gremlin-archetype-dsl/pom.xml
index ca0fd53..812172b 100644
--- a/gremlin-archetype/gremlin-archetype-dsl/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-dsl/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-archetype</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
 
     <artifactId>gremlin-archetype-dsl</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-archetype/gremlin-archetype-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/pom.xml b/gremlin-archetype/gremlin-archetype-server/pom.xml
index 3d0d167..409f3c8 100644
--- a/gremlin-archetype/gremlin-archetype-server/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-server/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-archetype</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
 
     <artifactId>gremlin-archetype-server</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml b/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
index 93d929d..5ccbe0c 100644
--- a/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-archetype</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
 
     <artifactId>gremlin-archetype-tinkergraph</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/pom.xml b/gremlin-archetype/pom.xml
index 14d5753..79a8507 100644
--- a/gremlin-archetype/pom.xml
+++ b/gremlin-archetype/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <artifactId>tinkerpop</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
 
     <artifactId>gremlin-archetype</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-console/bin/gremlin.sh
----------------------------------------------------------------------
diff --git a/gremlin-console/bin/gremlin.sh b/gremlin-console/bin/gremlin.sh
index 1b2b798..7fb090f 120000
--- a/gremlin-console/bin/gremlin.sh
+++ b/gremlin-console/bin/gremlin.sh
@@ -1 +1 @@
-../target/apache-tinkerpop-gremlin-console-3.3.3-SNAPSHOT-standalone/bin/gremlin.sh
\ No newline at end of file
+../target/apache-tinkerpop-gremlin-console-3.3.3-standalone/bin/gremlin.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-console/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/pom.xml b/gremlin-console/pom.xml
index fefd6fe..d78d2a2 100644
--- a/gremlin-console/pom.xml
+++ b/gremlin-console/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <artifactId>tinkerpop</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-console</artifactId>
     <name>Apache TinkerPop :: Gremlin Console</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-core/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml
index ffbc077..b2b168b 100644
--- a/gremlin-core/pom.xml
+++ b/gremlin-core/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-core</artifactId>
     <name>Apache TinkerPop :: Gremlin Core</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-dotnet/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/pom.xml b/gremlin-dotnet/pom.xml
index 87adc63..883e533 100644
--- a/gremlin-dotnet/pom.xml
+++ b/gremlin-dotnet/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-dotnet</artifactId>
     <name>Apache TinkerPop :: Gremlin.Net</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
index 1a6bdad..d7bda56 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
@@ -25,7 +25,7 @@ limitations under the License.
   </PropertyGroup>
 
   <PropertyGroup Label="Package">
-    <Version>3.3.3-SNAPSHOT</Version>
+    <Version>3.3.3</Version>
     <FileVersion>3.3.3.0</FileVersion>
     <AssemblyVersion>3.3.0.0</AssemblyVersion>
     <Title>Gremlin.Net</Title>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-dotnet/src/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/pom.xml b/gremlin-dotnet/src/pom.xml
index 0474e43..83c4a53 100644
--- a/gremlin-dotnet/src/pom.xml
+++ b/gremlin-dotnet/src/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-dotnet</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-dotnet-source</artifactId>
     <name>Apache TinkerPop :: Gremlin.Net - Source</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-dotnet/test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/pom.xml b/gremlin-dotnet/test/pom.xml
index 26141b1..f51b421 100644
--- a/gremlin-dotnet/test/pom.xml
+++ b/gremlin-dotnet/test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-dotnet</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-dotnet-tests</artifactId>
     <name>Apache TinkerPop :: Gremlin.Net - Tests</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-driver/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-driver/pom.xml b/gremlin-driver/pom.xml
index d4c8dff..40f35c3 100644
--- a/gremlin-driver/pom.xml
+++ b/gremlin-driver/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-driver</artifactId>
     <name>Apache TinkerPop :: Gremlin Driver</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-groovy/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-groovy/pom.xml b/gremlin-groovy/pom.xml
index 14d85f2..363c27e 100644
--- a/gremlin-groovy/pom.xml
+++ b/gremlin-groovy/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-groovy</artifactId>
     <name>Apache TinkerPop :: Gremlin Groovy</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-javascript/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index b159b16..fb3fa84 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.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-javascript</artifactId>
     <name>Apache TinkerPop :: Gremlin Javascript</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/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 76a2dd6..8907fab 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",
-  "version": "3.3.3-alpha1",
+  "version": "3.3.3",
   "description": "JavaScript Gremlin Language Variant",
   "author": "Apache TinkerPop team",
   "keywords": [

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-python/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index 175c38b..653ca72 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-python</artifactId>
     <name>Apache TinkerPop :: Gremlin Python</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-server/pom.xml b/gremlin-server/pom.xml
index 2a23e2f..4a8b1ad 100644
--- a/gremlin-server/pom.xml
+++ b/gremlin-server/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-server</artifactId>
     <name>Apache TinkerPop :: Gremlin Server</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-shaded/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-shaded/pom.xml b/gremlin-shaded/pom.xml
index 409abe9..f565761 100644
--- a/gremlin-shaded/pom.xml
+++ b/gremlin-shaded/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-shaded</artifactId>
     <name>Apache TinkerPop :: Gremlin Shaded</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-test/pom.xml b/gremlin-test/pom.xml
index 995fa19..f666d03 100644
--- a/gremlin-test/pom.xml
+++ b/gremlin-test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-test</artifactId>
     <name>Apache TinkerPop :: Gremlin Test</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-tools/gremlin-benchmark/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-benchmark/pom.xml b/gremlin-tools/gremlin-benchmark/pom.xml
index 5e2dc31..ee343fd 100644
--- a/gremlin-tools/gremlin-benchmark/pom.xml
+++ b/gremlin-tools/gremlin-benchmark/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <artifactId>gremlin-tools</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
 
     <artifactId>gremlin-benchmark</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-tools/gremlin-coverage/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-coverage/pom.xml b/gremlin-tools/gremlin-coverage/pom.xml
index 6119a5a..a934168 100644
--- a/gremlin-tools/gremlin-coverage/pom.xml
+++ b/gremlin-tools/gremlin-coverage/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>gremlin-tools</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-coverage</artifactId>
     <name>Apache TinkerPop :: Gremlin Coverage</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-tools/gremlin-io-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/pom.xml b/gremlin-tools/gremlin-io-test/pom.xml
index e22dc15..a3fdeeb 100644
--- a/gremlin-tools/gremlin-io-test/pom.xml
+++ b/gremlin-tools/gremlin-io-test/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>gremlin-tools</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>gremlin-io-test</artifactId>
     <name>Apache TinkerPop :: Gremlin IO Test</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/gremlin-tools/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-tools/pom.xml b/gremlin-tools/pom.xml
index 780f973..bcb7abf 100644
--- a/gremlin-tools/pom.xml
+++ b/gremlin-tools/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>tinkerpop</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
 
     <artifactId>gremlin-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/hadoop-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/pom.xml b/hadoop-gremlin/pom.xml
index e384915..ccb5d55 100644
--- a/hadoop-gremlin/pom.xml
+++ b/hadoop-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>hadoop-gremlin</artifactId>
     <name>Apache TinkerPop :: Hadoop Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/neo4j-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml
index e9fa0cf..641b9df 100644
--- a/neo4j-gremlin/pom.xml
+++ b/neo4j-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>neo4j-gremlin</artifactId>
     <name>Apache TinkerPop :: Neo4j Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b142d4b..3ef4da9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ limitations under the License.
     </parent>
     <groupId>org.apache.tinkerpop</groupId>
     <artifactId>tinkerpop</artifactId>
-    <version>3.3.3-SNAPSHOT</version>
+    <version>3.3.3</version>
     <packaging>pom</packaging>
     <name>Apache TinkerPop</name>
     <description>A Graph Computing Framework</description>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/spark-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/spark-gremlin/pom.xml b/spark-gremlin/pom.xml
index 92fd65b..663bb80 100644
--- a/spark-gremlin/pom.xml
+++ b/spark-gremlin/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>spark-gremlin</artifactId>
     <name>Apache TinkerPop :: Spark Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d39f9b8/tinkergraph-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/pom.xml b/tinkergraph-gremlin/pom.xml
index 80de750..f6e60c7 100644
--- a/tinkergraph-gremlin/pom.xml
+++ b/tinkergraph-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3-SNAPSHOT</version>
+        <version>3.3.3</version>
     </parent>
     <artifactId>tinkergraph-gremlin</artifactId>
     <name>Apache TinkerPop :: TinkerGraph Gremlin</name>


[26/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


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

Branch: refs/heads/TINKERPOP-1878
Commit: eb79f398d10bd1294762b923d2bdc8d72959b7e9
Parents: 68d39dc 288b455
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 11 20:04:35 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 20:04:35 2018 -0400

----------------------------------------------------------------------
 pom.xml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/eb79f398/pom.xml
----------------------------------------------------------------------


[17/50] tinkerpop git commit: Bumped build plugin versions to latest.

Posted by sp...@apache.org.
Bumped build plugin versions to latest.

True of all plugins identified by the versions-maven-plugin except for the dotnet-maven-plugin which fails the build. Not sure why it fails, but I'm guessing that it has to do with some incompatibilty with dotnet command line or something. No longer need hyracs repo for anything so removed that entry from gremlin-groovy CTR


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

Branch: refs/heads/TINKERPOP-1878
Commit: 3635ff69e2dfb40ec29788b426029e021a5c7f32
Parents: 8a03d50
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue May 8 07:32:47 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 14:11:07 2018 -0400

----------------------------------------------------------------------
 .../dev/developer/development-environment.asciidoc  |  3 ++-
 gremlin-dotnet/pom.xml                              | 14 ++++++++++++--
 gremlin-groovy/pom.xml                              |  6 ------
 gremlin-javascript/pom.xml                          |  2 +-
 pom.xml                                             | 16 ++++++++++------
 5 files changed, 25 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3635ff69/docs/src/dev/developer/development-environment.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/development-environment.asciidoc b/docs/src/dev/developer/development-environment.asciidoc
index 0cceb5e..3e3edad 100644
--- a/docs/src/dev/developer/development-environment.asciidoc
+++ b/docs/src/dev/developer/development-environment.asciidoc
@@ -25,7 +25,7 @@ configure a development environment for TinkerPop.
 == System Configuration
 
 At a minimum, development of TinkerPop requires link:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html[Java 1.8.0_40+]
-and link:https://maven.apache.org/download.cgi[Maven 3.0.5+]. Maven is used as the common build system, which even
+and link:https://maven.apache.org/download.cgi[Maven 3.1.0+]. Maven is used as the common build system, which even
 controls the builds of non-JVM link:http://tinkerpop.apache.org/docs/current/tutorials/gremlin-language-variants/[GLVs]
 such as `gremlin-python`. Java and Maven are described as a "minimum" for a development environment, because they
 will only build JVM portions of TinkerPop and many integration tests will not fire with this simple setup. It is
@@ -209,6 +209,7 @@ mvn -Dmaven.javadoc.skip=true --projects tinkergraph-gremlin test
 * Build JavaDocs: `mvn process-resources -Djavadoc`
 * Check for Apache License headers: `mvn apache-rat:check`
 * Check for newer dependencies: `mvn versions:display-dependency-updates` or `mvn versions:display-plugin-updates`
+* Check the effective `pom.xml`: `mvn -pl gremlin-python -Pglv-python help:effective-pom -Doutput=withProfilePom.xml`
 * Deploy JavaDocs/AsciiDocs: `bin/publish-docs.sh svn-username`
 * Integration Tests: `mvn verify -DskipIntegrationTests=false`
 ** Execute with the `-DincludeNeo4j` option to include transactional tests.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3635ff69/gremlin-dotnet/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/pom.xml b/gremlin-dotnet/pom.xml
index fbc97d4..de41d38 100644
--- a/gremlin-dotnet/pom.xml
+++ b/gremlin-dotnet/pom.xml
@@ -31,14 +31,13 @@ limitations under the License.
         <module>src</module>
         <module>test</module>
     </modules>
-
+    
     <build>
         <plugins>
             <plugin>
                 <groupId>org.eobjects.build</groupId>
                 <artifactId>dotnet-maven-plugin</artifactId>
                 <extensions>true</extensions>
-                <version>0.14</version>
             </plugin>
             <plugin>
                 <groupId>org.codehaus.gmavenplus</groupId>
@@ -99,5 +98,16 @@ limitations under the License.
                 </configuration>
             </plugin>
         </plugins>
+        <pluginManagement>
+            <plugins>
+                <!-- bumping past 0.20 yields build errors - not sure what is amiss there -->
+                <plugin>
+                    <groupId>org.eobjects.build</groupId>
+                    <artifactId>dotnet-maven-plugin</artifactId>
+                    <extensions>true</extensions>
+                    <version>0.20</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
     </build>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3635ff69/gremlin-groovy/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-groovy/pom.xml b/gremlin-groovy/pom.xml
index 64405f5..3c7a122 100644
--- a/gremlin-groovy/pom.xml
+++ b/gremlin-groovy/pom.xml
@@ -88,12 +88,6 @@ limitations under the License.
             <scope>test</scope>
         </dependency>
     </dependencies>
-    <repositories>
-        <repository>
-            <id>hyracks-releases</id>
-            <url>http://obelix.ics.uci.edu/nexus/content/groups/hyracks-public-releases/</url>
-        </repository>
-    </repositories>
     <build>
         <directory>${basedir}/target</directory>
         <finalName>${project.artifactId}-${project.version}</finalName>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3635ff69/gremlin-javascript/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index f91b749..4736576 100644
--- a/gremlin-javascript/pom.xml
+++ b/gremlin-javascript/pom.xml
@@ -169,7 +169,7 @@ limitations under the License.
             <plugin>
                 <groupId>com.github.eirslett</groupId>
                 <artifactId>frontend-maven-plugin</artifactId>
-                <version>1.4</version>
+                <version>1.6</version>
                 <executions>
                     <execution>
                         <id>install node and npm</id>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3635ff69/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c724e0f..9737fef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,7 +110,7 @@ limitations under the License.
         </contributor>
     </contributors>
     <prerequisites>
-        <maven>3.0.5</maven>
+        <maven>3.1.0</maven>
     </prerequisites>
     <modules>
         <module>gremlin-shaded</module>
@@ -172,6 +172,11 @@ limitations under the License.
         <directory>${basedir}/target</directory>
         <plugins>
             <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>versions-maven-plugin</artifactId>
+                <version>2.5</version>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
             </plugin>
@@ -353,7 +358,7 @@ limitations under the License.
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
-                    <version>3.6.1</version>
+                    <version>3.7.0</version>
                     <configuration>
                         <source>1.8</source>
                         <target>1.8</target>
@@ -370,7 +375,7 @@ limitations under the License.
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
-                    <version>2.20</version>
+                    <version>2.21.0</version>
                     <configuration>
                         <argLine>-Dlog4j.configuration=${log4j-test.properties} -Dbuild.dir=${project.build.directory}
                             -Dis.testing=true
@@ -384,7 +389,7 @@ limitations under the License.
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-failsafe-plugin</artifactId>
-                    <version>2.20</version>
+                    <version>2.21.0</version>
                     <executions>
                         <execution>
                             <id>integration-test</id>
@@ -455,7 +460,7 @@ limitations under the License.
                 </plugin>
                 <plugin>
                     <artifactId>maven-resources-plugin</artifactId>
-                    <version>3.0.2</version>
+                    <version>3.1.0</version>
                 </plugin>
                 <plugin>
                     <groupId>org.codehaus.mojo</groupId>
@@ -1332,7 +1337,6 @@ limitations under the License.
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
-                        <version>2.17</version>
                         <configuration>
                             <argLine>-Dlog4j.configuration=${log4j-silent.properties}
                                 -Dbuild.dir=${project.build.directory} -Dis.testing=true


[06/50] tinkerpop git commit: Merge branch 'tp33'

Posted by sp...@apache.org.
Merge branch 'tp33'


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

Branch: refs/heads/TINKERPOP-1878
Commit: 31d20633eab352045297bf0a4bb66f9a5aa653d4
Parents: bf77d6d 4e3a0a9
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue May 8 12:44:03 2018 -0700
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue May 8 12:44:03 2018 -0700

----------------------------------------------------------------------
 bin/validate-distribution.sh | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------



[22/50] tinkerpop git commit: Update to 3.3.4-SNAPSHOT CTR

Posted by sp...@apache.org.
Update to 3.3.4-SNAPSHOT CTR


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

Branch: refs/heads/TINKERPOP-1878
Commit: 71b03ff99a520eddf2b9ee848e0c8da28db2ead0
Parents: bfdd4c2
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 11 14:50:01 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 14:50:01 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                      | 6 ++++++
 docs/src/upgrade/release-3.3.x.asciidoc                 | 7 +++++++
 giraph-gremlin/pom.xml                                  | 2 +-
 gremlin-archetype/gremlin-archetype-dsl/pom.xml         | 2 +-
 gremlin-archetype/gremlin-archetype-server/pom.xml      | 2 +-
 gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml | 2 +-
 gremlin-archetype/pom.xml                               | 2 +-
 gremlin-console/bin/gremlin.sh                          | 2 +-
 gremlin-console/pom.xml                                 | 2 +-
 gremlin-core/pom.xml                                    | 2 +-
 gremlin-dotnet/pom.xml                                  | 2 +-
 gremlin-dotnet/src/pom.xml                              | 2 +-
 gremlin-dotnet/test/pom.xml                             | 2 +-
 gremlin-driver/pom.xml                                  | 2 +-
 gremlin-groovy/pom.xml                                  | 2 +-
 gremlin-javascript/pom.xml                              | 2 +-
 gremlin-python/pom.xml                                  | 2 +-
 gremlin-server/pom.xml                                  | 2 +-
 gremlin-shaded/pom.xml                                  | 2 +-
 gremlin-test/pom.xml                                    | 2 +-
 gremlin-tools/gremlin-benchmark/pom.xml                 | 2 +-
 gremlin-tools/gremlin-coverage/pom.xml                  | 2 +-
 gremlin-tools/gremlin-io-test/pom.xml                   | 2 +-
 gremlin-tools/pom.xml                                   | 2 +-
 hadoop-gremlin/pom.xml                                  | 2 +-
 neo4j-gremlin/pom.xml                                   | 2 +-
 pom.xml                                                 | 2 +-
 spark-gremlin/pom.xml                                   | 2 +-
 tinkergraph-gremlin/pom.xml                             | 2 +-
 29 files changed, 40 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 5edda9e..7f8efcf 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -20,6 +20,12 @@ limitations under the License.
 
 image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/images/gremlin-mozart.png[width=185]
 
+[[release-3-3-4]]
+=== TinkerPop 3.3.4 (Release Date: NOT OFFICIALLY RELEASED YET)
+
+This release also includes changes from <<release-3-2-10, 3.2.10>>.
+
+
 [[release-3-3-3]]
 === TinkerPop 3.3.3 (Release Date: May 8, 2018)
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.3.x.asciidoc b/docs/src/upgrade/release-3.3.x.asciidoc
index 468616b..ea2e159 100644
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@ -21,6 +21,13 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 *Gremlin Symphony #40 in G Minor*
 
+== TinkerPop 3.3.4
+
+*Release Date: NOT OFFICIALLY RELEASED YET*
+
+Please see the link:https://github.com/apache/tinkerpop/blob/3.3.4/CHANGELOG.asciidoc#release-3-3-4[changelog] for a complete list of all the modifications that are part of this release.
+
+
 == TinkerPop 3.3.3
 
 *Release Date: May 8, 2018*

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/giraph-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/giraph-gremlin/pom.xml b/giraph-gremlin/pom.xml
index 5c8e7fe..3cca330 100644
--- a/giraph-gremlin/pom.xml
+++ b/giraph-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>giraph-gremlin</artifactId>
     <name>Apache TinkerPop :: Giraph Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-archetype/gremlin-archetype-dsl/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-dsl/pom.xml b/gremlin-archetype/gremlin-archetype-dsl/pom.xml
index 812172b..535bd43 100644
--- a/gremlin-archetype/gremlin-archetype-dsl/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-dsl/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-archetype</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-archetype-dsl</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-archetype/gremlin-archetype-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/pom.xml b/gremlin-archetype/gremlin-archetype-server/pom.xml
index 409f3c8..e237da7 100644
--- a/gremlin-archetype/gremlin-archetype-server/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-server/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-archetype</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-archetype-server</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml b/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
index 5ccbe0c..70391f6 100644
--- a/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-archetype</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-archetype-tinkergraph</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/pom.xml b/gremlin-archetype/pom.xml
index 79a8507..93bb813 100644
--- a/gremlin-archetype/pom.xml
+++ b/gremlin-archetype/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <artifactId>tinkerpop</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-archetype</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-console/bin/gremlin.sh
----------------------------------------------------------------------
diff --git a/gremlin-console/bin/gremlin.sh b/gremlin-console/bin/gremlin.sh
index 7fb090f..ec5a25b 120000
--- a/gremlin-console/bin/gremlin.sh
+++ b/gremlin-console/bin/gremlin.sh
@@ -1 +1 @@
-../target/apache-tinkerpop-gremlin-console-3.3.3-standalone/bin/gremlin.sh
\ No newline at end of file
+../target/apache-tinkerpop-gremlin-console-3.3.4-SNAPSHOT-standalone/bin/gremlin.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-console/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/pom.xml b/gremlin-console/pom.xml
index d78d2a2..8c7a59e 100644
--- a/gremlin-console/pom.xml
+++ b/gremlin-console/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <artifactId>tinkerpop</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-console</artifactId>
     <name>Apache TinkerPop :: Gremlin Console</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-core/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml
index b2b168b..db723f4 100644
--- a/gremlin-core/pom.xml
+++ b/gremlin-core/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-core</artifactId>
     <name>Apache TinkerPop :: Gremlin Core</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-dotnet/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/pom.xml b/gremlin-dotnet/pom.xml
index 192e4a7..38f3d70 100644
--- a/gremlin-dotnet/pom.xml
+++ b/gremlin-dotnet/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-dotnet</artifactId>
     <name>Apache TinkerPop :: Gremlin.Net</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-dotnet/src/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/pom.xml b/gremlin-dotnet/src/pom.xml
index 83c4a53..05303ee 100644
--- a/gremlin-dotnet/src/pom.xml
+++ b/gremlin-dotnet/src/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-dotnet</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-dotnet-source</artifactId>
     <name>Apache TinkerPop :: Gremlin.Net - Source</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-dotnet/test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/pom.xml b/gremlin-dotnet/test/pom.xml
index f51b421..42477aa 100644
--- a/gremlin-dotnet/test/pom.xml
+++ b/gremlin-dotnet/test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-dotnet</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-dotnet-tests</artifactId>
     <name>Apache TinkerPop :: Gremlin.Net - Tests</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-driver/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-driver/pom.xml b/gremlin-driver/pom.xml
index 40f35c3..738a338 100644
--- a/gremlin-driver/pom.xml
+++ b/gremlin-driver/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-driver</artifactId>
     <name>Apache TinkerPop :: Gremlin Driver</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-groovy/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-groovy/pom.xml b/gremlin-groovy/pom.xml
index d6724f7..ea0556c 100644
--- a/gremlin-groovy/pom.xml
+++ b/gremlin-groovy/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-groovy</artifactId>
     <name>Apache TinkerPop :: Gremlin Groovy</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-javascript/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index 7dd40fb..768e111 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.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-javascript</artifactId>
     <name>Apache TinkerPop :: Gremlin Javascript</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-python/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index ba5f210..6bf3fe3 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-python</artifactId>
     <name>Apache TinkerPop :: Gremlin Python</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-server/pom.xml b/gremlin-server/pom.xml
index 4a8b1ad..d4cbd19 100644
--- a/gremlin-server/pom.xml
+++ b/gremlin-server/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-server</artifactId>
     <name>Apache TinkerPop :: Gremlin Server</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-shaded/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-shaded/pom.xml b/gremlin-shaded/pom.xml
index f565761..7bdffd3 100644
--- a/gremlin-shaded/pom.xml
+++ b/gremlin-shaded/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-shaded</artifactId>
     <name>Apache TinkerPop :: Gremlin Shaded</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-test/pom.xml b/gremlin-test/pom.xml
index f666d03..6929aa5 100644
--- a/gremlin-test/pom.xml
+++ b/gremlin-test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-test</artifactId>
     <name>Apache TinkerPop :: Gremlin Test</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-tools/gremlin-benchmark/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-benchmark/pom.xml b/gremlin-tools/gremlin-benchmark/pom.xml
index ee343fd..43c1127 100644
--- a/gremlin-tools/gremlin-benchmark/pom.xml
+++ b/gremlin-tools/gremlin-benchmark/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <artifactId>gremlin-tools</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-benchmark</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-tools/gremlin-coverage/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-coverage/pom.xml b/gremlin-tools/gremlin-coverage/pom.xml
index a934168..83b13ab 100644
--- a/gremlin-tools/gremlin-coverage/pom.xml
+++ b/gremlin-tools/gremlin-coverage/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>gremlin-tools</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-coverage</artifactId>
     <name>Apache TinkerPop :: Gremlin Coverage</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-tools/gremlin-io-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-tools/gremlin-io-test/pom.xml b/gremlin-tools/gremlin-io-test/pom.xml
index a3fdeeb..8ab35fd 100644
--- a/gremlin-tools/gremlin-io-test/pom.xml
+++ b/gremlin-tools/gremlin-io-test/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>gremlin-tools</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-io-test</artifactId>
     <name>Apache TinkerPop :: Gremlin IO Test</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/gremlin-tools/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-tools/pom.xml b/gremlin-tools/pom.xml
index bcb7abf..70c643e 100644
--- a/gremlin-tools/pom.xml
+++ b/gremlin-tools/pom.xml
@@ -6,7 +6,7 @@
     <parent>
         <artifactId>tinkerpop</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-tools</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/hadoop-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/pom.xml b/hadoop-gremlin/pom.xml
index ccb5d55..11d9315 100644
--- a/hadoop-gremlin/pom.xml
+++ b/hadoop-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>hadoop-gremlin</artifactId>
     <name>Apache TinkerPop :: Hadoop Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/neo4j-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml
index 641b9df..f1b80f7 100644
--- a/neo4j-gremlin/pom.xml
+++ b/neo4j-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>neo4j-gremlin</artifactId>
     <name>Apache TinkerPop :: Neo4j Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7fc8ac3..638d023 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ limitations under the License.
     </parent>
     <groupId>org.apache.tinkerpop</groupId>
     <artifactId>tinkerpop</artifactId>
-    <version>3.3.3</version>
+    <version>3.3.4-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>Apache TinkerPop</name>
     <description>A Graph Computing Framework</description>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/spark-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/spark-gremlin/pom.xml b/spark-gremlin/pom.xml
index 663bb80..024712c 100644
--- a/spark-gremlin/pom.xml
+++ b/spark-gremlin/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>spark-gremlin</artifactId>
     <name>Apache TinkerPop :: Spark Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71b03ff9/tinkergraph-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/pom.xml b/tinkergraph-gremlin/pom.xml
index f6e60c7..4b858a6 100644
--- a/tinkergraph-gremlin/pom.xml
+++ b/tinkergraph-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.3.3</version>
+        <version>3.3.4-SNAPSHOT</version>
     </parent>
     <artifactId>tinkergraph-gremlin</artifactId>
     <name>Apache TinkerPop :: TinkerGraph Gremlin</name>


[36/50] tinkerpop git commit: TINKERPOP-1878 Dropped the console app

Posted by sp...@apache.org.
TINKERPOP-1878 Dropped the console app

This allows TinkerGraph to remain a test dependency only and the console app was more of a test rig than something that a user of this library would use, so it seemed like something that could be dropped.


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

Branch: refs/heads/TINKERPOP-1878
Commit: e16fe59ab5c2d98c5de4850e187b54ea9839bbe4
Parents: e9f4a89
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jan 25 14:49:18 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 sparql-gremlin/pom.xml                          |   1 +
 .../gremlin/sparql/ConsoleCompiler.java         | 165 -------------------
 2 files changed, 1 insertion(+), 165 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e16fe59a/sparql-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/sparql-gremlin/pom.xml b/sparql-gremlin/pom.xml
index d38a85d..0dceb85 100644
--- a/sparql-gremlin/pom.xml
+++ b/sparql-gremlin/pom.xml
@@ -42,6 +42,7 @@
             <groupId>org.apache.tinkerpop</groupId>
             <artifactId>tinkergraph-gremlin</artifactId>
             <version>${project.version}</version>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.tinkerpop</groupId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e16fe59a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/ConsoleCompiler.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/ConsoleCompiler.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/ConsoleCompiler.java
deleted file mode 100644
index 0d50475..0000000
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/ConsoleCompiler.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * 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.sparql;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.DefaultParser;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator;
-import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.io.IoCore;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
-
-import org.apache.tinkerpop.gremlin.sparql.SparqlToGremlinCompiler;
-
-class ConsoleCompiler {
-
-    public static void main(final String[] args) throws IOException {
-    	//args = "/examples/modern1.sparql";
-        final Options options = new Options();
-        options.addOption("f", "file", true, "a file that contains a SPARQL query");
-        options.addOption("g", "graph", true, "the graph that's used to execute the query [classic|modern|crew|kryo file]");
-        // TODO: add an OLAP option (perhaps: "--olap spark"?)
-
-        final CommandLineParser parser = new DefaultParser();
-        final CommandLine commandLine;
-
-        try {
-            commandLine = parser.parse(options, args);
-        } catch (ParseException e) {
-            System.out.println(e.getMessage());
-            printHelp(1);
-            return;
-        }
-        
-        final InputStream inputStream = commandLine.hasOption("file")
-                ? new FileInputStream(commandLine.getOptionValue("file"))
-                : System.in;
-        final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
-        final StringBuilder queryBuilder = new StringBuilder();
-
-        if (!reader.ready()) {
-            printHelp(1);
-        }
-
-        String line;
-        while (null != (line = reader.readLine())) {
-            queryBuilder.append(System.lineSeparator()).append(line);
-        }
-
-        final String queryString = queryBuilder.toString();
-        Graph graph;
-        
-        if (commandLine.hasOption("graph")) {
-            switch (commandLine.getOptionValue("graph").toLowerCase()) {
-                case "classic":
-                    graph = TinkerFactory.createClassic();
-                    break;
-                case "modern":
-                    graph = TinkerFactory.createModern();
-                    System.out.println("Modern Graph Created");
-                    break;
-                case "crew":
-                    graph = TinkerFactory.createTheCrew();
-                    break;
-                default:
-                    graph = TinkerGraph.open();
-                    System.out.println("Graph Created");
-                    String graphName = commandLine.getOptionValue("graph");
-                    long startTime= System.currentTimeMillis();
-                    if(graphName.endsWith(".graphml"))
-                    	graph.io(IoCore.graphml()).readGraph(graphName);
-                    else if(graphName.endsWith(".kryo")||graphName.endsWith("gryo"))
-                    	graph.io(IoCore.gryo()).readGraph(graphName);
-                    long endTime = System.currentTimeMillis();
-                    System.out.println("Time taken to load graph from kyro file: "+ (endTime-startTime)+" mili seconds");
-                    break;
-            }
-        } else {
- 
-            graph = TinkerFactory.createModern();
-        }
-
-        long startTime = System.currentTimeMillis();
-        final Traversal<Vertex, ?> traversal = SparqlToGremlinCompiler.convertToGremlinTraversal(graph, queryString);
-        long endTime = System.currentTimeMillis();
-        System.out.println("Time traken to convert SPARQL to Gremlin Traversal : "+ (endTime - startTime)+ " miliseconds");
-        
-        printWithHeadline("SPARQL Query", queryString);
-        // printWithHeadline("Traversal (prior execution)", traversal);
-  
-        
-        Bytecode traversalByteCode = traversal.asAdmin().getBytecode();
-        
-        
-//        JavaTranslator.of(graph.traversal()).translate(traversalByteCode);
-//        
-//        System.out.println("the Byte Code : "+ traversalByteCode.toString());
-        printWithHeadline("Result", String.join(System.lineSeparator(),JavaTranslator.of(graph.traversal()).translate(traversalByteCode).toStream().map(Object::toString).collect(Collectors.toList())));
-        // printWithHeadline("Traversal (after execution)", traversal);
-    }
-
-    private static void printHelp(final int exitCode) throws IOException {
-        final Map<String, String> env = System.getenv();
-        final String command = env.containsKey("LAST_COMMAND") ? env.get("LAST_COMMAND") : "sparql-gremlin.sh";
-        printWithHeadline("Usage Examples", String.join("\n",
-                command + " -f examples/modern1.sparql",
-                command + " < examples/modern2.sparql",
-                command + " <<< 'SELECT * WHERE { ?a e:knows ?b }'",
-                command + " -g crew < examples/crew1.sparql"));
-        if (exitCode >= 0) {
-            System.exit(exitCode);
-        }
-    }
-
-    private static void printWithHeadline(final String headline, final Object content) throws IOException {
-        final StringReader sr = new StringReader(content != null ? content.toString() : "null");
-        final BufferedReader br = new BufferedReader(sr);
-        String line;
-        System.out.println();
-        System.out.println( headline ); 
-        System.out.println();
-        boolean skip = true;
-        while (null != (line = br.readLine())) {
-            skip &= line.isEmpty();
-            if (!skip) {
-                System.out.println("  " + line);
-            }
-        }
-        System.out.println();
-        br.close();
-        sr.close();
-    }
-}


[38/50] tinkerpop git commit: TINKERPOP-1878 Updates to changelog and code comments

Posted by sp...@apache.org.
TINKERPOP-1878 Updates to changelog and code comments


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

Branch: refs/heads/TINKERPOP-1878
Commit: 3787a5567c4414b690d25ac3c582fc00ae4b8b3e
Parents: 6fae2a3
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jan 25 17:09:17 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                             | 1 +
 .../process/traversal/dsl/sparql/SparqlTraversalSource.java    | 6 ++++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3787a556/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 2353c99..41450da 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -87,6 +87,7 @@ This release also includes changes from <<release-3-2-8, 3.2.8>>.
 
 * Fixed regression issue where the HTTPChannelizer doesn't instantiate the specified AuthenticationHandler.
 * Defaulted GLV tests for gremlin-python to run for GraphSON 3.0.
+* Fixed a bug in dynamic Gryo registration where registrations that did not have serializers would fail.
 * Fixed a bug with `Tree` serialization in GraphSON 3.0.
 * In gremlin-python, the GraphSON 3.0 `g:Set` type is now deserialized to `List`.
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3787a556/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
index 3889d95..deb16f7 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
@@ -124,6 +124,12 @@ public class SparqlTraversalSource implements TraversalSource {
      */
     public <S> SparqlTraversal<S,String> sparql(final String query) {
         final SparqlTraversalSource clone = this.clone();
+
+        // this is a bit of a hack to get remote traversals to work cleanly. on the remote side, we'd expect a
+        // GraphTraversalSource not a SparqlTraversalSource (given that sparql-gremlin is to be implemented in the
+        // DSL pattern). Instead of just sending the constant() step with the sparql query we also include an
+        // inject() step which will be recognized by a GraphTraversalSource on the remote side. Since SparqlStrategy
+        // wholly replaces both of these steps, the traversal bytecode can be read properly.
         clone.bytecode.addStep(GraphTraversal.Symbols.inject);
         clone.bytecode.addStep(GraphTraversal.Symbols.constant, query);
         final SparqlTraversal.Admin<S, S> traversal = new DefaultSparqlTraversal<>(clone);


[45/50] tinkerpop git commit: TINKERPOP-1878 Fixed up formatting of traspiler section

Posted by sp...@apache.org.
TINKERPOP-1878 Fixed up formatting of traspiler section

There were some examples that didn't return results or generated errors. These will need some review.


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

Branch: refs/heads/TINKERPOP-1878
Commit: f050641465130858e643d89bc5d644f918e4c0d2
Parents: c43c665
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Apr 3 10:52:17 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 docs/src/reference/transpilers.asciidoc | 156 ++++++++++++---------------
 1 file changed, 71 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f0506414/docs/src/reference/transpilers.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/transpilers.asciidoc b/docs/src/reference/transpilers.asciidoc
index 386b4a5..b05be68 100644
--- a/docs/src/reference/transpilers.asciidoc
+++ b/docs/src/reference/transpilers.asciidoc
@@ -84,8 +84,7 @@ start step.
 and then when finally iterated, executes that against the TinkerGraph.
 
 [[prefixes]]
-Prefixes
-~~~~~~~~~
+=== Prefixes
 
 The SPARQL-Gremlin transpiler supports the following prefixes to traverse the graph:
 
@@ -110,10 +109,11 @@ g.sparql("""SELECT ?name ?id ?label
 ----
 
 [[supported-queries]]
-Supported Queries
-~~~~~~~~~~~~~~~~~~
+=== Supported Queries
 
-The SPARQL-Gremlin transpiler is currently an on-going effort with an aim to cover the entire SPARQL 1.1 query feature spectrum, however we currently only support translation of the SPARQL 1.0 specification, especially _SELECT_ queries. The supported SPARQL query types are: 
+The SPARQL-Gremlin transpiler is currently an on-going effort with an aim to cover the entire SPARQL 1.1 query feature
+spectrum, however we currently only support translation of the SPARQL 1.0 specification, especially _SELECT_ queries.
+The supported SPARQL query types are:
 
 * Union 
 * Optional 
@@ -127,29 +127,25 @@ The SPARQL-Gremlin transpiler is currently an on-going effort with an aim to cov
 ** OFFSET
 
 [[limitations]]
-Limitations
-~~~~~~~~~~~~
+=== Limitations
 
 The current implementation of SPARQL-Gremlin transpiler (i.e. SPARQL-Gremlin) does
 not support the following cases: 
 
-* SPARQL queries with variables in the
-predicate position are not currently covered, with an exception of the
-following case:
+* SPARQL queries with variables in the predicate position are not currently covered, with an exception of the following
+case:
 
-[gremlin-groovy,existing]
+[source,groovy]
 ----
 g.sparql("""SELECT * WHERE { ?x ?y ?z . }""")
 ----
 
-* A SPARQL Union query with un-balanced patterns, i.e. a gremlin union
-traversal can only be generated if the unput SPARQL query has the same
-number of patterns on both the side of the union operator. For instance,
-the following SPARQL query cannot be mapped using Gremlinator, since a
-union is executed between different number of graph patterns (two
-patterns _union_ 1 pattern).
+* A SPARQL Union query with un-balanced patterns, i.e. a gremlin union traversal can only be generated if the input
+SPARQL query has the same number of patterns on both the side of the union operator. For instance, the following
+SPARQL query cannot be mapped using Gremlinator, since a union is executed between different number of graph patterns
+(two patterns _union_ 1 pattern).
 
-[gremlin-groovy,existing]
+[source,groovy]
 ----
 g.sparql("""SELECT * 
 	WHERE {
@@ -170,16 +166,15 @@ Adding more here...
 ....
 
 [[examples]]
-Examples
-~~~~~~~~~
+=== Examples
 
-The following section presents a comprehensive examples of SPARQL queries that are currently covered by the SPARQL-Gremlin transpiler.
+The following section presents a comprehensive examples of SPARQL queries that are currently covered by the
+SPARQL-Gremlin transpiler.
 
 [[select-all]]
-Select All
-^^^^^^^^^^
+==== Select All
 
-.Select all vertices in the graph.
+Select all vertices in the graph.
 
 [gremlin-groovy,existing]
 ----
@@ -187,10 +182,9 @@ g.sparql("""SELECT * WHERE { }""")
 ----
 
 [[match-constant-values]]
-Match Constant Values
-^^^^^^^^^^^^^^^^^^^^^
+==== Match Constant Values
 
-.Select all vertices with the label `person`.
+Select all vertices with the label `person`.
 
 [gremlin-groovy,existing]
 ----
@@ -198,10 +192,9 @@ g.sparql("""SELECT * WHERE {  ?person v:label "person" .}""")
 ----
 
 [[select-specific-elements]]
-Select Specific Elements
-^^^^^^^^^^^^^^^^^^^^^^^^
+==== Select Specific Elements
 
-.Select the values of the properties `name` and `age` for each `person` vertex.
+Select the values of the properties `name` and `age` for each `person` vertex.
 
 [gremlin-groovy,existing]
 ----
@@ -213,10 +206,9 @@ WHERE {
 ----
 
 [[pattern-matching]]
-Pattern Matching
-^^^^^^^^^^^^^^^^
+==== Pattern Matching
 
-.Select only those persons who created a project.
+Select only those persons who created a project.
 
 [gremlin-groovy,existing]
 ----
@@ -229,10 +221,9 @@ WHERE {
 ----
 
 [[filtering]]
-Filtering
-^^^^^^^^^
+==== Filtering
 
-.Select only those persons who are older than 30.
+Select only those persons who are older than 30.
 
 [gremlin-groovy,existing]
 ----
@@ -241,31 +232,29 @@ WHERE {
   ?person v:label "person" .
   ?person v:name ?name .
   ?person v:age ?age .
-  ?person e:created ?project .
     FILTER (?age > 30) }""")
 ----
 
 [[deduplication]]
-Deduplication
-^^^^^^^^^^^^^
+==== Deduplication
 
-.Select the distinct names of the created projects.
+Select the distinct names of the created projects.
 
 [gremlin-groovy,existing]
 ----
 g.sparql("""SELECT DISTINCT ?name
 WHERE {
   ?person v:label "person" .
+  ?person v:age ?age .
   ?person e:created ?project .
   ?project v:name ?name .
     FILTER (?age > 30)}""")
 ----
 
 [[multiple-filters]]
-Multiple Filters
-^^^^^^^^^^^^^^^^
+==== Multiple Filters
 
-.Select the distinct names of all Java projects.
+Select the distinct names of all Java projects.
 
 [gremlin-groovy,existing]
 ----
@@ -276,14 +265,13 @@ WHERE {
   ?person e:created ?project .
   ?project v:name ?name .
   ?project v:lang ?lang .
-    FILTER (?age > 30 && ?lang == "java") }""")
+    FILTER (?age > 30 && ?lang = "java") }""")
 ----
 
 [[pattern-filters]]
-Pattern Filter(s)
-^^^^^^^^^^^^^^^^^
+==== Pattern Filter(s)
 
-.A different way to filter all person who created a project.
+A different way to filter all person who created a project.
 
 [gremlin-groovy,existing]
 ----
@@ -294,7 +282,7 @@ WHERE {
     FILTER EXISTS { ?person e:created ?project } }""")
 ----
 
-.Filter all person who did not create a project.
+Filter all person who did not create a project.
 
 [gremlin-groovy,existing]
 ----
@@ -305,27 +293,10 @@ WHERE {
     FILTER NOT EXISTS { ?person e:created ?project } }""")
 ----
 
-[[meta-property-access]]
-Meta-Property Access
-^^^^^^^^^^^^^^^^^^^^
-
-.Accessing the Meta-Property of a graph element. Meta-Property can be perceived as the reified statements in an RDF graph.
-
-[gremlin-groovy,existing]
-----
-g.sparql("""SELECT ?name ?startTime
-WHERE {
-  ?person v:name "daniel" .
-  ?person p:location ?location .
-  ?location v:value ?name .
-  ?location v:startTime ?startTime }""")
-----
-
 [[union]]
-Union
-^^^^^
+==== Union
 
-.Select all persons who have developed a software in java using union.
+Select all persons who have developed a software in java using union.
 
 [gremlin-groovy,existing]
 ----
@@ -337,12 +308,11 @@ WHERE {
 ----
 
 [[optional]]
-Optional
-^^^^^^^^
+==== Optional
 
-.Return the names of the persons who have created a software in java and optionally python.
+Return the names of the persons who have created a software in java and optionally python.
 
-[gremlin-groovy,existing]
+[source,groovy]
 ----
 g.sparql("""SELECT ?person 
 WHERE {
@@ -353,10 +323,9 @@ WHERE {
 ----
 
 [[order-by]]
-Order By
-^^^^^^^^
+==== Order By
 
-.Select all vertices with the label `person` and order them by their age.
+Select all vertices with the label `person` and order them by their age.
 
 [gremlin-groovy,existing]
 ----
@@ -368,12 +337,11 @@ WHERE {
 ----
 
 [[group-by]]
-Group By
-^^^^^^^^
+==== Group By
 
-.Select all vertices with the label `person` and group them by their age.
+Select all vertices with the label `person` and group them by their age.
 
-[gremlin-groovy,existing]
+[source,groovy]
 ----
 g.sparql("""SELECT * 
 WHERE {
@@ -383,12 +351,12 @@ WHERE {
 ----
 
 [[mixedcomplexaggregation-based-queries]]
-Mixed/complex/aggregation-based queries
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+==== Mixed/complex/aggregation-based queries
 
-.Count the number of projects which have been created by persons under the age of 30 and group them by age. Return only the top two.
+Count the number of projects which have been created by persons under the age of 30 and group them by age. Return only
+the top two.
 
-[gremlin-groovy,existing]
+[source,groovy]
 ----
 g.sparql("""SELECT COUNT(?project) 
 WHERE {
@@ -398,11 +366,29 @@ WHERE {
 } GROUP BY (?age) LIMIT 2""")
 ----
 
+[[meta-property-access]]
+==== Meta-Property Access
+
+Accessing the Meta-Property of a graph element. Meta-Property can be perceived as the reified statements in an RDF
+graph.
+
+[gremlin-groovy,theCrew]
+----
+g = graph.traversal(SparqlTraversalSource)
+g.sparql("""SELECT ?name ?startTime
+WHERE {
+  ?person v:name "daniel" .
+  ?person p:location ?location .
+  ?location v:value ?name .
+  ?location v:startTime ?startTime }""")
+----
+
 [[star-shaped-queries]]
-STAR-shaped queries
-^^^^^^^^^^^^^^^^^^^
+==== STAR-shaped queries
 
-.STAR-shaped queries are the queries that form/follow a star-shaped execution plan. These in terms of graph traversals can be perceived as path queries or neighbourhood queries. For instance, getting all the information about a specific `person` or `software`.
+STAR-shaped queries are the queries that form/follow a star-shaped execution plan. These in terms of graph traversals
+can be perceived as path queries or neighborhood queries. For instance, getting all the information about a specific
+`person` or `software`.
 
 [gremlin-groovy,existing]
 ----


[23/50] tinkerpop git commit: Bump to 3.3.4-SNAPSHOT CTR

Posted by sp...@apache.org.
Bump to 3.3.4-SNAPSHOT CTR


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

Branch: refs/heads/TINKERPOP-1878
Commit: 68d39dc7dd87e162384860fd26b947b2793e23ce
Parents: 71b03ff
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 11 16:15:15 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 16:15:15 2018 -0400

----------------------------------------------------------------------
 gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj                | 4 ++--
 .../src/main/javascript/gremlin-javascript/package.json          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68d39dc7/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
index d7bda56..772eb8e 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
@@ -25,8 +25,8 @@ limitations under the License.
   </PropertyGroup>
 
   <PropertyGroup Label="Package">
-    <Version>3.3.3</Version>
-    <FileVersion>3.3.3.0</FileVersion>
+    <Version>3.3.4-SNAPSHOT</Version>
+    <FileVersion>3.3.4.0</FileVersion>
     <AssemblyVersion>3.3.0.0</AssemblyVersion>
     <Title>Gremlin.Net</Title>
     <Authors>Apache TinkerPop</Authors>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68d39dc7/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 8907fab..8e51302 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",
-  "version": "3.3.3",
+  "version": "3.3.4-alpha1",
   "description": "JavaScript Gremlin Language Variant",
   "author": "Apache TinkerPop team",
   "keywords": [


[05/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


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

Branch: refs/heads/TINKERPOP-1878
Commit: 4e3a0a9bc5b72d7d98cb4b95d647f62dea23c9ee
Parents: 2d39f9b 2f8f74a
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue May 8 12:43:51 2018 -0700
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue May 8 12:43:51 2018 -0700

----------------------------------------------------------------------
 bin/validate-distribution.sh | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------



[10/50] tinkerpop git commit: Fixed version typo in upgrade docs CTR

Posted by sp...@apache.org.
Fixed version typo in upgrade docs CTR


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

Branch: refs/heads/TINKERPOP-1878
Commit: e57490625074457bd771bf326967f9db115706ae
Parents: fa5e7af
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 10 11:55:03 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 10 11:55:03 2018 -0400

----------------------------------------------------------------------
 docs/src/upgrade/release-3.3.x.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e5749062/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.3.x.asciidoc b/docs/src/upgrade/release-3.3.x.asciidoc
index e6c15cd..468616b 100644
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@ -21,7 +21,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 *Gremlin Symphony #40 in G Minor*
 
-== TinkerPop 3.3.2
+== TinkerPop 3.3.3
 
 *Release Date: May 8, 2018*
 


[11/50] tinkerpop git commit: Merge branch 'tp33'

Posted by sp...@apache.org.
Merge branch 'tp33'


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

Branch: refs/heads/TINKERPOP-1878
Commit: c24136a79ca92c1c4db291796b4b0b124508957b
Parents: 53e59fa e574906
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 10 11:55:34 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 10 11:55:34 2018 -0400

----------------------------------------------------------------------
 docs/src/upgrade/release-3.3.x.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[27/50] tinkerpop git commit: Merge branch 'tp33'

Posted by sp...@apache.org.
Merge branch 'tp33'


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

Branch: refs/heads/TINKERPOP-1878
Commit: 942494e0e12ece02e7654ad42c81068c6366ea05
Parents: e425f1a eb79f39
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 11 20:04:55 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 20:04:55 2018 -0400

----------------------------------------------------------------------
 pom.xml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/942494e0/pom.xml
----------------------------------------------------------------------


[04/50] tinkerpop git commit: CTR: Some necessary changes in the release validation script to make it work on all systems.

Posted by sp...@apache.org.
CTR: Some necessary changes in the release validation script to make it work on all systems.


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

Branch: refs/heads/TINKERPOP-1878
Commit: 2f8f74a780356850cb6cb0ef6ac96e4a024a6d41
Parents: fde136b
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue May 8 12:43:11 2018 -0700
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue May 8 12:43:11 2018 -0700

----------------------------------------------------------------------
 bin/validate-distribution.sh | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2f8f74a7/bin/validate-distribution.sh
----------------------------------------------------------------------
diff --git a/bin/validate-distribution.sh b/bin/validate-distribution.sh
index 76e0974..3622905 100755
--- a/bin/validate-distribution.sh
+++ b/bin/validate-distribution.sh
@@ -22,11 +22,7 @@
 # artifacts. You must have gpg installed and must import the
 # published KEYS file in order for that aspect of the validation
 # to pass.
-#
-# curl -L -O https://dist.apache.org/repos/dist/dev/tinkerpop/KEYS
-# gpg --import KEYS
 
-COMMITTERS=$(curl -Ls https://dist.apache.org/repos/dist/dev/tinkerpop/KEYS | grep -Po '(?<=<...@apache.org>)' | uniq)
 TMP_DIR="/tmp/tpdv"
 
 # Required. Only the latest version on each release stream is available on dist.
@@ -73,6 +69,9 @@ mkdir -p ${TMP_DIR}
 rm -rf ${TMP_DIR}/*
 cd ${TMP_DIR}
 
+COMMITTERS=$(curl -Ls https://dist.apache.org/repos/dist/dev/tinkerpop/KEYS | tee ${TMP_DIR}/KEYS | grep -Po '(?<=<...@apache.org>)' | uniq)
+gpg --import ${TMP_DIR}/KEYS 2> /dev/null && rm ${TMP_DIR}/KEYS
+
 curl -Ls https://people.apache.org/keys/committer/ | grep -v invalid > ${TMP_DIR}/.committers
 
 # validate downloads
@@ -97,7 +96,7 @@ echo "OK"
 echo "* validating signatures and checksums ... "
 
 echo -n "  * PGP signature ... "
-gpg --verify ${ZIP_FILENAME}.asc ${ZIP_FILENAME} > ${TMP_DIR}/.verify 2>&1
+gpg --verify --with-fingerprint ${ZIP_FILENAME}.asc ${ZIP_FILENAME} > ${TMP_DIR}/.verify 2>&1
 
 verified=0
 
@@ -117,11 +116,11 @@ done
 [ ${verified} -eq 1 ] || { echo "failed"; exit 1; }
 echo "OK"
 
-echo -n "  * MD5 checksum ... "
-EXPECTED=`cat ${ZIP_FILENAME}.md5`
-ACTUAL=`md5sum ${ZIP_FILENAME} | awk '{print $1}'`
-[ "$ACTUAL" = "${EXPECTED}" ] || { echo "failed"; exit 1; }
-echo "OK"
+#echo -n "  * MD5 checksum ... "
+#EXPECTED=`cat ${ZIP_FILENAME}.md5`
+#ACTUAL=`md5sum ${ZIP_FILENAME} | awk '{print $1}'`
+#[ "$ACTUAL" = "${EXPECTED}" ] || { echo "failed"; exit 1; }
+#echo "OK"
 
 echo -n "  * SHA1 checksum ... "
 EXPECTED=`cat ${ZIP_FILENAME}.sha1`


[42/50] tinkerpop git commit: TINKERPOP-1878 Test for FILTER

Posted by sp...@apache.org.
TINKERPOP-1878 Test for FILTER

Also fixed how the SparqlStrategy was being added to the TraversalStrategies in SparqlTraversalSource...it was adding it globally and all spawned TraversalSource instances were getting that strategy.


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

Branch: refs/heads/TINKERPOP-1878
Commit: a16f582e8bdea2aeff3e0b07a67481c01726e20e
Parents: 03bfa24
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jan 26 16:29:55 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 .../dsl/sparql/SparqlTraversalSource.java       |  2 +-
 .../dsl/sparql/SparqlTraversalSourceTest.java   | 23 ++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a16f582e/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
index cc54aa5..f78708b 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
@@ -47,7 +47,6 @@ public class SparqlTraversalSource implements TraversalSource {
     public SparqlTraversalSource(final Graph graph, final TraversalStrategies traversalStrategies) {
         this.graph = graph;
         this.strategies = traversalStrategies;
-        this.strategies.addStrategies(SparqlStrategy.instance());
     }
 
     public SparqlTraversalSource(final Graph graph) {
@@ -126,6 +125,7 @@ public class SparqlTraversalSource implements TraversalSource {
      */
     public <S> SparqlTraversal<S,?> sparql(final String query) {
         final SparqlTraversalSource clone = this.clone();
+        clone.getStrategies().addStrategies(SparqlStrategy.instance());
 
         // this is a bit of a hack to get remote traversals to work cleanly. on the remote side, we'd expect a
         // GraphTraversalSource not a SparqlTraversalSource (given that sparql-gremlin is to be implemented in the

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a16f582e/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
index 1b39813..4092e58 100644
--- a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
+++ b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
@@ -18,16 +18,21 @@
  */
 package org.apache.tinkerpop.gremlin.sparql.process.traversal.dsl.sparql;
 
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy.SparqlStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
 import org.junit.Test;
 
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
 import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
+import static org.junit.Assert.assertEquals;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
@@ -36,6 +41,7 @@ public class SparqlTraversalSourceTest {
 
     private static final Graph graph = TinkerFactory.createModern();
     private static final SparqlTraversalSource g = graph.traversal(SparqlTraversalSource.class);
+    private static final GraphTraversalSource _g = graph.traversal();
 
     @Test
     public void shouldFindAllPersonsNamesAndAges() {
@@ -88,4 +94,21 @@ public class SparqlTraversalSourceTest {
         final List<?> x = g.sparql("SELECT ?name WHERE { ?person v:name ?name } ORDER BY DESC(?name)").toList();
         assertThat(x, contains("vadas", "ripple", "peter", "marko", "lop", "josh"));
     }
+
+    @Test
+    public void shouldFilter() {
+        final Map<String,Vertex> x = (Map) g.sparql(  "SELECT ?a ?b ?c\n" +
+                                                            "WHERE {\n" +
+                                                            "  ?a v:label \"person\" .\n" +
+                                                            "  ?a e:knows ?b .\n" +
+                                                            "  ?a e:created ?c .\n" +
+                                                            "  ?b e:created ?c .\n" +
+                                                            "  ?a v:age ?d .\n" +
+                                                            "    FILTER (?d < 30)\n" +
+                                                            "}").next();
+
+        assertEquals(x.get("a"), _g.V(1).next());
+        assertEquals(x.get("b"), _g.V(4).next());
+        assertEquals(x.get("c"), _g.V(3).next());
+    }
 }


[31/50] tinkerpop git commit: TINKERPOP-1878 General refactoring and javadoc on Prefixes class

Posted by sp...@apache.org.
TINKERPOP-1878 General refactoring and javadoc on Prefixes class


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

Branch: refs/heads/TINKERPOP-1878
Commit: abff3b9573d989df281ffaa97c8ae8c849a892c8
Parents: a83aa7c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jan 26 09:39:28 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/sparql/Prefixes.java      | 23 ++++++++++----------
 1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/abff3b95/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/Prefixes.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/Prefixes.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/Prefixes.java
index 452bf68..32768a7 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/Prefixes.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/Prefixes.java
@@ -22,15 +22,16 @@ package org.apache.tinkerpop.gremlin.sparql;
 import java.util.Arrays;
 import java.util.List;
 
+/**
+ * Helper methods for working with prefix lines in SPARQL queries.
+ */
+class Prefixes {
 
-public class Prefixes {
-
-	// public final static String BASE_URI = "http://northwind.com/model/";
-    public final static String BASE_URI = "http://www.tinkerpop.com/traversal/";
+    final static String BASE_URI = "http://tinkerpop.apache.org/traversal/";
 
-    final static List<String> PREFIXES = Arrays.asList("edge", "property", "value");
+    private final static List<String> PREFIXES = Arrays.asList("edge", "property", "value");
 
-    final static String PREFIX_DEFINITIONS;
+    private final static String PREFIX_DEFINITIONS;
 
     static {
         final StringBuilder builder = new StringBuilder();
@@ -41,24 +42,24 @@ public class Prefixes {
         PREFIX_DEFINITIONS = builder.toString();
     }
 
-    public static String getURI(final String prefix) {
+    static String getURI(final String prefix) {
         return BASE_URI + prefix + "#";
     }
 
-    public static String getURIValue(final String uri) {
+    static String getURIValue(final String uri) {
         return uri.substring(uri.indexOf("#") + 1);
     }
 
-    public static String getPrefix(final String uri) {
+    static String getPrefix(final String uri) {
         final String tmp = uri.substring(0, uri.indexOf("#"));
         return tmp.substring(tmp.lastIndexOf("/") + 1);
     }
 
-    public static String prepend(final String script) {
+    static String prepend(final String script) {
         return PREFIX_DEFINITIONS + script;
     }
 
-    public static StringBuilder prepend(final StringBuilder scriptBuilder) {
+    static StringBuilder prepend(final StringBuilder scriptBuilder) {
         return scriptBuilder.insert(0, PREFIX_DEFINITIONS);
     }
 }


[28/50] tinkerpop git commit: TINKERPOP-1878 Test cleanup for sparql-gremlin

Posted by sp...@apache.org.
TINKERPOP-1878 Test cleanup for sparql-gremlin


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

Branch: refs/heads/TINKERPOP-1878
Commit: 69a7f297a4e95416c8b1088e0a43a8cc0187fb01
Parents: 3787a55
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jan 26 08:10:48 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 sparql-gremlin/pom.xml                          |  10 +-
 .../dsl/sparql/SparqlTraversalSource.java       |   4 +-
 .../gremlin/sparql/ResourceHelper.java          |  37 ---
 .../sparql/SparqlToGremlinCompilerTest.java     | 223 -------------------
 .../dsl/sparql/SparqlTraversalSourceTest.java   |  31 ++-
 5 files changed, 36 insertions(+), 269 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/69a7f297/sparql-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/sparql-gremlin/pom.xml b/sparql-gremlin/pom.xml
index 0e3da38..731b822 100644
--- a/sparql-gremlin/pom.xml
+++ b/sparql-gremlin/pom.xml
@@ -41,9 +41,13 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.tinkerpop</groupId>
-            <artifactId>gremlin-test</artifactId>
-            <version>${project.version}</version>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.hamcrest</groupId>
+            <artifactId>hamcrest-all</artifactId>
             <scope>test</scope>
         </dependency>
     </dependencies>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/69a7f297/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
index deb16f7..cc54aa5 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
@@ -28,6 +28,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ConstantStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.InjectStep;
+import org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy.SparqlStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
@@ -46,6 +47,7 @@ public class SparqlTraversalSource implements TraversalSource {
     public SparqlTraversalSource(final Graph graph, final TraversalStrategies traversalStrategies) {
         this.graph = graph;
         this.strategies = traversalStrategies;
+        this.strategies.addStrategies(SparqlStrategy.instance());
     }
 
     public SparqlTraversalSource(final Graph graph) {
@@ -122,7 +124,7 @@ public class SparqlTraversalSource implements TraversalSource {
     /**
      * The start step for a SPARQL based traversal that accepts a string representation of the query to execute.
      */
-    public <S> SparqlTraversal<S,String> sparql(final String query) {
+    public <S> SparqlTraversal<S,?> sparql(final String query) {
         final SparqlTraversalSource clone = this.clone();
 
         // this is a bit of a hack to get remote traversals to work cleanly. on the remote side, we'd expect a

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/69a7f297/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/ResourceHelper.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/ResourceHelper.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/ResourceHelper.java
deleted file mode 100644
index 4f58e61..0000000
--- a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/ResourceHelper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.sparql;
-
-import org.apache.commons.io.IOUtils;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * @author Daniel Kuppitz (http://gremlin.guru)
- */
-public class ResourceHelper {
-
-    public static String loadQuery(final String prefix, final int number) throws IOException {
-        final String path = "/queries/" + prefix + number + ".sparql";
-        final InputStream stream = ResourceHelper.class.getResourceAsStream(path);
-        return IOUtils.toString(stream, "UTF-8");
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/69a7f297/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompilerTest.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompilerTest.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompilerTest.java
deleted file mode 100644
index 3fb49e8..0000000
--- a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompilerTest.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * 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.sparql;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.apache.tinkerpop.gremlin.process.computer.Computer;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import static org.apache.tinkerpop.gremlin.sparql.SparqlToGremlinCompiler.convertToGremlinTraversal;
-import static org.junit.Assert.assertEquals;
-
-
-import java.io.IOException;
-
-import static org.apache.tinkerpop.gremlin.sparql.ResourceHelper.loadQuery;
-
-
-public class SparqlToGremlinCompilerTest {
-
-    private Graph modern, crew;
-    private GraphTraversalSource mg, cg;
-    private GraphTraversalSource mc, cc;
-/*
-    @Before
-    public void setUp() throws Exception {
-        modern = TinkerFactory.createModern();
-        mg = modern.traversal();
-        mc = modern.traversal(computer());
-        crew = TinkerFactory.createTheCrew();
-        cg = modern.traversal();
-        cc = modern.traversal(computer());
-    }
-
-    @Ignore
-    @Test
-    public void play() throws IOException {
-        final String query = loadQuery("modern", 11);
-        final Traversal traversal = convertToGremlinTraversal(modern, query);
-        System.out.println(traversal);
-        System.out.println(traversal.toList());
-        System.out.println(traversal);
-    }
-
-    /* Modern */
-
- /*   @Test
-    public void testModern1() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("a").hasLabel("person"),
-                as("a").out("knows").as("b"),
-                as("a").out("created").as("c"),
-                as("b").out("created").as("c"),
-                as("a").values("age").as("d")).where(as("d").is(lt(30))).
-                select("a", "b", "c");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 1)));
-    }
-
-    @Test
-    public void testModern2() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("a").hasLabel("person"),
-                as("a").out("knows").as("b"),
-                as("a").out("created").as("c"),
-                as("b").out("created").as("c"),
-                as("a").values("age").as("d")).where(as("d").is(lt(30)));
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 2)));
-    }
-
-    @Test
-    public void testModern3() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("person").values("name").as("name"),
-                as("person").values("age").as("age")).select("name", "age");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 3)));
-    }
-
-    @Test
-    public void testModern4() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("person").values("name").as("name"),
-                as("person").values("age").as("age"),
-                as("person").out("created").as("project"),
-                as("project").values("name").is("lop")).select("name", "age");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 4)));
-    }
-
-    @Test
-    public void testModern5() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("person").values("name").as("name"),
-                as("person").values("age").is(29)).select("name");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 5)));
-    }
-
-    @Test
-    public void testModern6() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("person").values("name").as("name"),
-                as("person").values("age").as("age")).where(and(as("age").is(gt(30)), as("age").is(lt(40)))).
-                select("name", "age");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 6)));
-    }
-
-    @Test
-    public void testModern7() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("person").values("name").as("name"),
-                as("person").values("age").as("age")).where(or(as("age").is(lt(30)), as("age").is(gt(40)))).
-                select("name", "age");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 7)));
-    }
-
-    @Test
-    public void testModern8() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("person").values("name").as("name"),
-                as("person").values("age").as("age")).where(
-                or(and(as("age").is(gt(30)), as("age").is(lt(40))), as("name").is("marko"))).
-                select("name", "age");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 8)));
-    }
-
-    @Test
-    public void testModern9() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("a").values("name").as("name")).where(as("a").values("age")).
-                select("name");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 9)));
-    }
-
-    @Test
-    public void testModern10() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("a").values("name").as("name")).where(__.not(as("a").values("age"))).
-                select("name");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 10)));
-    }
-
-    @Test
-    public void testModern11() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("a").out("created").as("b"),
-                as("a").values("name").as("name")).dedup("name").select("name");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 11)));
-    }
-
-    @Test
-    public void testModern12() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("a").out("created").as("b"),
-                as("b").values("name").as("name")).dedup();
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 12)));
-    }
-
-    @Test
-    public void testModern13() throws Exception {
-        final GraphTraversal expected = mg.V().match(
-                as("a").out("created").as("b"),
-                as("a").values("name").as("c")).dedup("a", "b", "c").select("a", "b", "c");
-        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 13)));
-    }
-
-    /* The Crew */
-
- /*   @Test
-    public void testCrew1() throws Exception {
-        final GraphTraversal expected = cg.V().match(
-                as("a").values("name").is("daniel"),
-                as("a").properties("location").as("b"),
-                as("b").value().as("c"),
-                as("b").values("startTime").as("d")).
-                select("c", "d");
-        assertEquals(expected, convertToGremlinTraversal(crew, loadQuery("crew", 1)));
-    }
-
-    /* Computer Mode */
-
-  /*  @Test
-    public void testModernInComputerMode() throws Exception {
-        final GraphTraversal expected = mc.V().match(
-                as("a").hasLabel("person"),
-                as("a").out("knows").as("b"),
-                as("a").out("created").as("c"),
-                as("b").out("created").as("c"),
-                as("a").values("age").as("d")).where(as("d").is(lt(30))).
-                select("a", "b", "c");
-        assertEquals(expected, convertToGremlinTraversal(mc, loadQuery("modern", 1)));
-    }
-
-    @Test
-    public void testCrewInComputerMode() throws Exception {
-        final GraphTraversal expected = cc.V().match(
-                as("a").values("name").is("daniel"),
-                as("a").properties("location").as("b"),
-                as("b").value().as("c"),
-                as("b").values("startTime").as("d")).
-                select("c", "d");
-        assertEquals(expected, convertToGremlinTraversal(crew, loadQuery("crew", 1)));
-    } */
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/69a7f297/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
index 9e5ffc0..9bb6025 100644
--- a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
+++ b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
@@ -18,11 +18,16 @@
  */
 package org.apache.tinkerpop.gremlin.sparql.process.traversal.dsl.sparql;
 
-import org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy.SparqlStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
 import org.junit.Test;
 
+import java.util.HashMap;
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
+
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
@@ -31,9 +36,25 @@ public class SparqlTraversalSourceTest {
     @Test
     public void shouldDoStuff() {
         final Graph graph = TinkerFactory.createModern();
-        final SparqlTraversalSource g = graph.traversal(SparqlTraversalSource.class).
-                                                withStrategies(SparqlStrategy.instance());
-        final Object x = g.sparql("SELECT ?name ?age WHERE { ?person v:name ?name . ?person v:age ?age }").toList();
-        System.out.println(x);
+        final SparqlTraversalSource g = graph.traversal(SparqlTraversalSource.class);
+        final List<?> x = g.sparql("SELECT ?name ?age WHERE { ?person v:name ?name . ?person v:age ?age }").toList();
+        assertThat(x, containsInAnyOrder(
+                new HashMap<String,Object>(){{
+                    put("name", "marko");
+                    put("age", 29);
+                }},
+                new HashMap<String,Object>(){{
+                    put("name", "vadas");
+                    put("age", 27);
+                }},
+                new HashMap<String,Object>(){{
+                    put("name", "josh");
+                    put("age", 32);
+                }},
+                new HashMap<String,Object>(){{
+                    put("name", "peter");
+                    put("age", 35);
+                }}
+        ));
     }
 }


[34/50] tinkerpop git commit: TINKERPOP-1878 Added a basics for sparql execution in a traversal

Posted by sp...@apache.org.
TINKERPOP-1878 Added a basics for sparql execution in a traversal


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

Branch: refs/heads/TINKERPOP-1878
Commit: e9f4a89e2fd3249357bc592bcd7099e4a44dc10d
Parents: 7941e1e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jan 25 14:46:31 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 .../traversal/step/map/ConstantStep.java        |  4 ++
 .../traversal/strategy/SparqlStrategy.java      | 56 +++++++++++++++++++-
 .../dsl/sparql/SparqlTraversalSourceTest.java   | 39 ++++++++++++++
 .../src/test/resources/log4j-silent.properties  | 23 ++++++++
 .../src/test/resources/log4j-test.properties    | 23 ++++++++
 5 files changed, 144 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e9f4a89e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ConstantStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ConstantStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ConstantStep.java
index 5d02e28..749de31 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ConstantStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ConstantStep.java
@@ -36,6 +36,10 @@ public class ConstantStep<S, E> extends MapStep<S, E> {
         this.constant = constant;
     }
 
+    public E getConstant() {
+        return this.constant;
+    }
+
     @Override
     protected E map(final Traverser.Admin<S> traverser) {
         return this.constant;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e9f4a89e/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
index 6440127..07ac4cf 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
@@ -18,8 +18,62 @@
  */
 package org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy;
 
+import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.ConstantStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.TraversalMapStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
+import org.apache.tinkerpop.gremlin.sparql.SparqlToGremlinCompiler;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+
+import java.util.Collections;
+import java.util.Set;
+
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class SparqlStrategy {
+public class SparqlStrategy extends AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy>
+        implements TraversalStrategy.DecorationStrategy {
+    private static final SparqlStrategy INSTANCE = new SparqlStrategy();
+
+    private static final Set<Class<? extends DecorationStrategy>> POSTS = Collections.singleton(VertexProgramStrategy.class);
+
+    private SparqlStrategy() {}
+
+    public static SparqlStrategy instance() {
+        return INSTANCE;
+    }
+
+    @Override
+    public Set<Class<? extends DecorationStrategy>> applyPost() {
+        return POSTS;
+    }
+
+
+    @Override
+    public void apply(final Traversal.Admin<?, ?> traversal) {
+        if (!(traversal.getParent() instanceof EmptyStep))
+            return;
+
+        if (traversal.getSteps().size() == 1 && traversal.getEndStep() instanceof ConstantStep) {
+            final ConstantStep stepWithSparql = (ConstantStep) traversal.getEndStep();
+            final Object constant = stepWithSparql.getConstant();
+            if (constant instanceof String) {
+                final String sparql = (String) constant;
+                final Traversal<Vertex, ?> sparqlTraversal = SparqlToGremlinCompiler.convertToGremlinTraversal(
+                        traversal.getGraph().get(), sparql);
+                TraversalHelper.removeAllSteps(traversal);
+                sparqlTraversal.asAdmin().getSteps().forEach(s -> traversal.addStep(s));
+            } else {
+                // The ConstantStep expects a string value
+                throw new IllegalStateException("SparqlStrategy cannot be applied to this traversal");
+            }
+        } else {
+            // SparqlStrategy requires that there be one step and it be a ConstantStep that contains some SPARQL
+            throw new IllegalStateException("SparqlStrategy cannot be applied to this traversal");
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e9f4a89e/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
new file mode 100644
index 0000000..9e5ffc0
--- /dev/null
+++ b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.sparql.process.traversal.dsl.sparql;
+
+import org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy.SparqlStrategy;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
+import org.junit.Test;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class SparqlTraversalSourceTest {
+
+    @Test
+    public void shouldDoStuff() {
+        final Graph graph = TinkerFactory.createModern();
+        final SparqlTraversalSource g = graph.traversal(SparqlTraversalSource.class).
+                                                withStrategies(SparqlStrategy.instance());
+        final Object x = g.sparql("SELECT ?name ?age WHERE { ?person v:name ?name . ?person v:age ?age }").toList();
+        System.out.println(x);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e9f4a89e/sparql-gremlin/src/test/resources/log4j-silent.properties
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/resources/log4j-silent.properties b/sparql-gremlin/src/test/resources/log4j-silent.properties
new file mode 100644
index 0000000..1825bb0
--- /dev/null
+++ b/sparql-gremlin/src/test/resources/log4j-silent.properties
@@ -0,0 +1,23 @@
+# 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.
+
+# this file should always have logging set to OFF.  it seems, however, that an appender of some sort is
+# required or else some logs throw error and use other log4j.properties files on the path.
+log4j.rootLogger=OFF, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e9f4a89e/sparql-gremlin/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/resources/log4j-test.properties b/sparql-gremlin/src/test/resources/log4j-test.properties
new file mode 100644
index 0000000..79038b1
--- /dev/null
+++ b/sparql-gremlin/src/test/resources/log4j-test.properties
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file


[44/50] tinkerpop git commit: TINKERPOP-1878 Code reformatting - bad spacing/tabs or something

Posted by sp...@apache.org.
TINKERPOP-1878 Code reformatting - bad spacing/tabs or something


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

Branch: refs/heads/TINKERPOP-1878
Commit: 03bfa24c9e6331687dcad303241b4bc9eabad24c
Parents: f4b6219
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jan 26 16:03:49 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 .../sparql/SparqlToGremlinTranspiler.java       | 138 +++++++++----------
 1 file changed, 69 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/03bfa24c/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
index c3bc907..1b28a1d 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
@@ -55,59 +55,59 @@ import org.apache.tinkerpop.gremlin.structure.Vertex;
  */
 public class SparqlToGremlinTranspiler {
 
-	private GraphTraversal<Vertex, ?> traversal;
+    private GraphTraversal<Vertex, ?> traversal;
 
     private List<Traversal> traversalList = new ArrayList<>();
 
-	private SparqlToGremlinTranspiler(final GraphTraversal<Vertex, ?> traversal) {
-		this.traversal = traversal;
-	}
+    private SparqlToGremlinTranspiler(final GraphTraversal<Vertex, ?> traversal) {
+        this.traversal = traversal;
+    }
 
-	private SparqlToGremlinTranspiler(final GraphTraversalSource g) {
-		this(g.V());
-	}
+    private SparqlToGremlinTranspiler(final GraphTraversalSource g) {
+        this(g.V());
+    }
 
     /**
      * Converts SPARQL to a Gremlin traversal.
      *
-     * @param graph the {@link Graph} instance to execute the traversal from
+     * @param graph       the {@link Graph} instance to execute the traversal from
      * @param sparqlQuery the query to transpile to Gremlin
      */
     public static GraphTraversal<Vertex, ?> transpile(final Graph graph, final String sparqlQuery) {
-        return transpile(graph.traversal(),	sparqlQuery);
+        return transpile(graph.traversal(), sparqlQuery);
     }
 
     /**
      * Converts SPARQL to a Gremlin traversal.
      *
-     * @param g the {@link GraphTraversalSource} instance to execute the traversal from
+     * @param g           the {@link GraphTraversalSource} instance to execute the traversal from
      * @param sparqlQuery the query to transpile to Gremlin
      */
     public static GraphTraversal<Vertex, ?> transpile(final GraphTraversalSource g, final String sparqlQuery) {
         return transpile(g, QueryFactory.create(Prefixes.prepend(sparqlQuery), Syntax.syntaxSPARQL));
     }
 
-	private GraphTraversal<Vertex, ?> transpile(final Query query) {
-		final Op op = Algebra.compile(query);
-		OpWalker.walk(op, new GremlinOpVisitor());
+    private GraphTraversal<Vertex, ?> transpile(final Query query) {
+        final Op op = Algebra.compile(query);
+        OpWalker.walk(op, new GremlinOpVisitor());
 
-		int traversalIndex = 0;
-		final int numberOfTraversal = traversalList.size();
+        int traversalIndex = 0;
+        final int numberOfTraversal = traversalList.size();
         final Traversal arrayOfAllTraversals[] = new Traversal[numberOfTraversal];
 
-		for (Traversal tempTrav : traversalList) {
-			arrayOfAllTraversals[traversalIndex++] = tempTrav;
-		}
+        for (Traversal tempTrav : traversalList) {
+            arrayOfAllTraversals[traversalIndex++] = tempTrav;
+        }
 
-		// creates a map of ordering keys and their ordering direction
+        // creates a map of ordering keys and their ordering direction
         final Map<String, Order> orderingIndex = createOrderIndexFromQuery(query);
 
-		if (traversalList.size() > 0)
-			traversal = traversal.match(arrayOfAllTraversals);
+        if (traversalList.size() > 0)
+            traversal = traversal.match(arrayOfAllTraversals);
 
-		final List<String> vars = query.getResultVars();
-		if (!query.isQueryResultStar() && !query.hasGroupBy()) {
-		    // the result sizes have special handling to get the right signatures of select() called. perhaps this
+        final List<String> vars = query.getResultVars();
+        if (!query.isQueryResultStar() && !query.hasGroupBy()) {
+            // the result sizes have special handling to get the right signatures of select() called. perhaps this
             // could be refactored to work more nicely
             switch (vars.size()) {
                 case 0:
@@ -116,7 +116,7 @@ public class SparqlToGremlinTranspiler {
                     if (query.isDistinct())
                         traversal = traversal.dedup(vars.get(0));
 
-                    orderingIndex.forEach((k,v) -> traversal = traversal.order().by(__.select(k), v));
+                    orderingIndex.forEach((k, v) -> traversal = traversal.order().by(__.select(k), v));
                     traversal = traversal.select(vars.get(0));
 
                     break;
@@ -124,7 +124,7 @@ public class SparqlToGremlinTranspiler {
                     if (query.isDistinct())
                         traversal = traversal.dedup(vars.get(0), vars.get(1));
 
-                    orderingIndex.forEach((k,v) -> traversal = traversal.order().by(__.select(k), v));
+                    orderingIndex.forEach((k, v) -> traversal = traversal.order().by(__.select(k), v));
                     traversal = traversal.select(vars.get(0), vars.get(1));
 
                     break;
@@ -134,7 +134,7 @@ public class SparqlToGremlinTranspiler {
                     if (query.isDistinct())
                         traversal = traversal.dedup(all);
 
-                    orderingIndex.forEach((k,v) -> traversal = traversal.order().by(__.select(k), v));
+                    orderingIndex.forEach((k, v) -> traversal = traversal.order().by(__.select(k), v));
 
                     // just some shenanigans to get the right signature of select() called
                     final String[] others = Arrays.copyOfRange(all, 2, vars.size());
@@ -142,59 +142,59 @@ public class SparqlToGremlinTranspiler {
 
                     break;
             }
-		}
-
-		if (query.hasGroupBy()) {
-			final VarExprList lstExpr = query.getGroupBy();
-			String grpVar = "";
-			for (Var expr : lstExpr.getVars()) {
-				grpVar = expr.getName();
-			}
-
-			if (!grpVar.isEmpty())
-				traversal = traversal.select(grpVar);
-			if (query.hasAggregators()) {
+        }
+
+        if (query.hasGroupBy()) {
+            final VarExprList lstExpr = query.getGroupBy();
+            String grpVar = "";
+            for (Var expr : lstExpr.getVars()) {
+                grpVar = expr.getName();
+            }
+
+            if (!grpVar.isEmpty())
+                traversal = traversal.select(grpVar);
+            if (query.hasAggregators()) {
                 final List<ExprAggregator> exprAgg = query.getAggregators();
-				for (ExprAggregator expr : exprAgg) {
-					if (expr.getAggregator().getName().contains("COUNT")) {
-						if (!query.toString().contains("GROUP")) {
-							if (expr.getAggregator().toString().contains("DISTINCT"))
-								traversal = traversal.dedup(expr.getAggregator().getExprList().get(0).toString().substring(1));
-							else
-								traversal = traversal.select(expr.getAggregator().getExprList().get(0).toString().substring(1));
-
-							traversal = traversal.count();
-						} else {
+                for (ExprAggregator expr : exprAgg) {
+                    if (expr.getAggregator().getName().contains("COUNT")) {
+                        if (!query.toString().contains("GROUP")) {
+                            if (expr.getAggregator().toString().contains("DISTINCT"))
+                                traversal = traversal.dedup(expr.getAggregator().getExprList().get(0).toString().substring(1));
+                            else
+                                traversal = traversal.select(expr.getAggregator().getExprList().get(0).toString().substring(1));
+
+                            traversal = traversal.count();
+                        } else {
                             traversal = traversal.groupCount();
                         }
-					}
+                    }
 
-					if (expr.getAggregator().getName().contains("MAX")) {
-						traversal = traversal.max();
-					}
-				}
-			} else {
+                    if (expr.getAggregator().getName().contains("MAX")) {
+                        traversal = traversal.max();
+                    }
+                }
+            } else {
                 traversal = traversal.group();
             }
-		}
+        }
 
-		if (query.hasOrderBy() && query.hasGroupBy())
-            orderingIndex.forEach((k,v) -> traversal = traversal.order().by(__.select(k), v));
+        if (query.hasOrderBy() && query.hasGroupBy())
+            orderingIndex.forEach((k, v) -> traversal = traversal.order().by(__.select(k), v));
 
-		if (query.hasLimit()) {
-			long limit = query.getLimit(), offset = 0;
+        if (query.hasLimit()) {
+            long limit = query.getLimit(), offset = 0;
 
-			if (query.hasOffset())
-				offset = query.getOffset();
+            if (query.hasOffset())
+                offset = query.getOffset();
 
-			if (query.hasGroupBy() && query.hasOrderBy())
-				traversal = traversal.range(Scope.local, offset, offset + limit);
-			else
-				traversal = traversal.range(offset, offset + limit);
-		}
+            if (query.hasGroupBy() && query.hasOrderBy())
+                traversal = traversal.range(Scope.local, offset, offset + limit);
+            else
+                traversal = traversal.range(offset, offset + limit);
+        }
 
-		return traversal;
-	}
+        return traversal;
+    }
 
     /**
      * Extracts any {@code SortCondition} instances from the SPARQL query and holds them in an index of their keys


[03/50] tinkerpop git commit: Merge branch 'tp33'

Posted by sp...@apache.org.
Merge branch 'tp33'

Conflicts:
	giraph-gremlin/pom.xml
	gremlin-archetype/gremlin-archetype-dsl/pom.xml
	gremlin-archetype/gremlin-archetype-server/pom.xml
	gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
	gremlin-archetype/pom.xml
	gremlin-console/bin/gremlin.sh
	gremlin-console/pom.xml
	gremlin-core/pom.xml
	gremlin-dotnet/pom.xml
	gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
	gremlin-dotnet/src/pom.xml
	gremlin-dotnet/test/pom.xml
	gremlin-driver/pom.xml
	gremlin-groovy/pom.xml
	gremlin-javascript/pom.xml
	gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
	gremlin-python/pom.xml
	gremlin-server/pom.xml
	gremlin-shaded/pom.xml
	gremlin-test/pom.xml
	gremlin-tools/gremlin-benchmark/pom.xml
	gremlin-tools/gremlin-coverage/pom.xml
	gremlin-tools/gremlin-io-test/pom.xml
	gremlin-tools/pom.xml
	hadoop-gremlin/pom.xml
	neo4j-gremlin/pom.xml
	pom.xml
	spark-gremlin/pom.xml
	tinkergraph-gremlin/pom.xml


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

Branch: refs/heads/TINKERPOP-1878
Commit: bf77d6d1bdd7d81dc0215addaf4fefc304367f99
Parents: 1818c89 2d39f9b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue May 8 14:21:19 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue May 8 14:21:19 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              | 38 ++++++++++++++++++--
 .../upgrade/release-3.2.x-incubating.asciidoc   |  4 +--
 docs/src/upgrade/release-3.3.x.asciidoc         |  2 +-
 3 files changed, 39 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bf77d6d1/CHANGELOG.asciidoc
----------------------------------------------------------------------


[46/50] tinkerpop git commit: testing logo

Posted by sp...@apache.org.
testing logo

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

Branch: refs/heads/TINKERPOP-1878
Commit: 5acc2809e6371ca325c491c2eda4663d0cf0d52f
Parents: 685c711
Author: Harsh Thakkar <ha...@gmail.com>
Authored: Wed Mar 28 10:29:43 2018 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 docs/src/reference/transpilers.asciidoc | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5acc2809/docs/src/reference/transpilers.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/transpilers.asciidoc b/docs/src/reference/transpilers.asciidoc
index 305e3dc..9100f84 100644
--- a/docs/src/reference/transpilers.asciidoc
+++ b/docs/src/reference/transpilers.asciidoc
@@ -17,6 +17,10 @@ limitations under the License.
 [[transpilers]]
 = Gremlin Transpilers
 
+![gremlinator][SPARQL-Gremlin]
+
+[SPARQL-Gremlin]: https://raw.githubusercontent.com/LITMUS-Benchmark-Suite/sparql-to-gremlin/master/docs/images/sparql-gremlin-logo.png
+
 There are many languages built to query data. SQL is typically used to query relational data. There is SPARQL for RDF
 data. Cypher is used to do pattern matching in graph data. The list could go on. Transpilers convert languages like
 these to Gremlin so that it becomes possible to use them in any context that Gremlin is used. In other words, a


[18/50] tinkerpop git commit: This closes #772

Posted by sp...@apache.org.
This closes #772


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

Branch: refs/heads/TINKERPOP-1878
Commit: 173a8b57f9a77c5cb621bc7ae0a227b38a062535
Parents: bcaced4
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 11 14:31:06 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 14:31:06 2018 -0400

----------------------------------------------------------------------

----------------------------------------------------------------------



[37/50] tinkerpop git commit: TINKERPOP-1878 Minor javadoc and code cleanup

Posted by sp...@apache.org.
TINKERPOP-1878 Minor javadoc and code cleanup


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

Branch: refs/heads/TINKERPOP-1878
Commit: ecb81005d516374cb51e3521208f6720056c5b41
Parents: e16fe59
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Jan 25 15:36:53 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 .../process/traversal/dsl/sparql/SparqlTraversal.java   | 12 +++---------
 .../traversal/dsl/sparql/SparqlTraversalSource.java     |  8 +++++++-
 .../process/traversal/strategy/SparqlStrategy.java      | 11 ++++++++---
 3 files changed, 18 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ecb81005/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversal.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversal.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversal.java
index efa9489..843267d 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversal.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversal.java
@@ -22,6 +22,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 
 /**
+ * The {@code SparqlTraversal} has no additional traversal steps. The only step available for "SPARQL" is the
+ * {@link SparqlTraversalSource#sparql(String)} start step.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public interface SparqlTraversal<S, E> extends Traversal<S, E> {
@@ -56,13 +59,4 @@ public interface SparqlTraversal<S, E> extends Traversal<S, E> {
         Traversal.super.iterate();
         return this;
     }
-
-    public static final class Symbols {
-
-        private Symbols() {
-            // static fields only
-        }
-
-        public static final String sparql = "sparql";
-    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ecb81005/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
index 3596716..b156ed1 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java
@@ -25,12 +25,15 @@ import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ConstantStep;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
 /**
+ * A {@link TraversalSource} implementation that spawns {@link SparqlTraversal} instances.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class SparqlTraversalSource implements TraversalSource {
@@ -115,9 +118,12 @@ public class SparqlTraversalSource implements TraversalSource {
         return (SparqlTraversalSource) clone;
     }
 
+    /**
+     * The start step for a SPARQL based traversal that accepts a string representation of the query to execute.
+     */
     public <S> SparqlTraversal<S,String> sparql(final String query) {
         final SparqlTraversalSource clone = this.clone();
-        clone.bytecode.addStep(SparqlTraversal.Symbols.sparql, query);
+        clone.bytecode.addStep(GraphTraversal.Symbols.constant, query);
         final SparqlTraversal.Admin<S, S> traversal = new DefaultSparqlTraversal<>(clone);
         return traversal.addStep(new ConstantStep<S,String>(traversal, query));
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ecb81005/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
index 07ac4cf..bb0b326 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/strategy/SparqlStrategy.java
@@ -22,17 +22,22 @@ import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decorati
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ConstantStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.TraversalMapStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
 import org.apache.tinkerpop.gremlin.sparql.SparqlToGremlinCompiler;
+import org.apache.tinkerpop.gremlin.sparql.process.traversal.dsl.sparql.SparqlTraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 
 import java.util.Collections;
 import java.util.Set;
 
 /**
+ * This {@link TraversalStrategy} is used in conjunction with the {@link SparqlTraversalSource} which has a single
+ * {@code sparql()} start step. That step adds a {@link ConstantStep} to the traversal with the SPARQL query within
+ * it as a string value. This strategy finds that step and transpiles it to a Gremlin traversal which then replaces
+ * the {@link ConstantStep}.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class SparqlStrategy extends AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy>
@@ -69,11 +74,11 @@ public class SparqlStrategy extends AbstractTraversalStrategy<TraversalStrategy.
                 sparqlTraversal.asAdmin().getSteps().forEach(s -> traversal.addStep(s));
             } else {
                 // The ConstantStep expects a string value
-                throw new IllegalStateException("SparqlStrategy cannot be applied to this traversal");
+                throw new IllegalStateException("SparqlStrategy cannot be applied to a traversal that does not consist of a single ConstantStep<?,String>");
             }
         } else {
             // SparqlStrategy requires that there be one step and it be a ConstantStep that contains some SPARQL
-            throw new IllegalStateException("SparqlStrategy cannot be applied to this traversal");
+            throw new IllegalStateException("SparqlStrategy cannot be applied to a traversal that does not consist of a single ConstantStep<?,String>");
         }
     }
 }


[43/50] tinkerpop git commit: TINKERPOP-1878 More tests for ordering

Posted by sp...@apache.org.
TINKERPOP-1878 More tests for ordering

Factored the order index creation into its own method to tidy up a bit.


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

Branch: refs/heads/TINKERPOP-1878
Commit: f4b62195a22d5b5e904bf9cfabaafcb4cca13992
Parents: b8b1e95
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jan 26 15:56:55 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 .../sparql/SparqlToGremlinTranspiler.java       | 29 ++++++++++++++------
 .../dsl/sparql/SparqlTraversalSourceTest.java   |  6 ++++
 2 files changed, 26 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f4b62195/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
index ea3f828..c3bc907 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
@@ -99,15 +99,8 @@ public class SparqlToGremlinTranspiler {
 			arrayOfAllTraversals[traversalIndex++] = tempTrav;
 		}
 
-		final Map<String, Order> orderingIndex = new HashMap<>();
-		if (query.hasOrderBy()) {
-            final List<SortCondition> sortingConditions = query.getOrderBy();
-
-			for (SortCondition sortCondition : sortingConditions) {
-                final Expr expr = sortCondition.getExpression();
-                orderingIndex.put(expr.getVarName(), sortCondition.getDirection() == 1 ? Order.incr : Order.decr);
-			}
-		}
+		// creates a map of ordering keys and their ordering direction
+        final Map<String, Order> orderingIndex = createOrderIndexFromQuery(query);
 
 		if (traversalList.size() > 0)
 			traversal = traversal.match(arrayOfAllTraversals);
@@ -203,6 +196,24 @@ public class SparqlToGremlinTranspiler {
 		return traversal;
 	}
 
+    /**
+     * Extracts any {@code SortCondition} instances from the SPARQL query and holds them in an index of their keys
+     * where the value is that keys sorting direction.
+     */
+    private static Map<String, Order> createOrderIndexFromQuery(final Query query) {
+        final Map<String, Order> orderingIndex = new HashMap<>();
+        if (query.hasOrderBy()) {
+            final List<SortCondition> sortingConditions = query.getOrderBy();
+
+            for (SortCondition sortCondition : sortingConditions) {
+                final Expr expr = sortCondition.getExpression();
+                orderingIndex.put(expr.getVarName(), sortCondition.getDirection() == 1 ? Order.incr : Order.decr);
+            }
+        }
+
+        return orderingIndex;
+    }
+
     private static GraphTraversal<Vertex, ?> transpile(final GraphTraversalSource g, final Query query) {
         return new SparqlToGremlinTranspiler(g).transpile(query);
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f4b62195/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
index 2743255..1b39813 100644
--- a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
+++ b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
@@ -82,4 +82,10 @@ public class SparqlTraversalSourceTest {
                 }}
         ));
     }
+
+    @Test
+    public void shouldFindAllNamesOrdered() {
+        final List<?> x = g.sparql("SELECT ?name WHERE { ?person v:name ?name } ORDER BY DESC(?name)").toList();
+        assertThat(x, contains("vadas", "ripple", "peter", "marko", "lop", "josh"));
+    }
 }


[09/50] tinkerpop git commit: Merge branch 'tp33'

Posted by sp...@apache.org.
Merge branch 'tp33'


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

Branch: refs/heads/TINKERPOP-1878
Commit: 53e59fa0f9bf78bd5d601712e3b7f017c302bd49
Parents: 31d2063 fa5e7af
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 10 11:28:15 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 10 11:28:15 2018 -0400

----------------------------------------------------------------------
 gremlin-console/src/main/static/NOTICE | 2 +-
 gremlin-server/src/main/static/NOTICE  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[13/50] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by sp...@apache.org.
Merge branch 'tp32' into tp33


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

Branch: refs/heads/TINKERPOP-1878
Commit: b63e2f96a88c4c8f811cd12cfdfe5ac63ad2d4bb
Parents: e574906 ac161fa
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 10 11:57:34 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 10 11:57:34 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b63e2f96/CHANGELOG.asciidoc
----------------------------------------------------------------------


[12/50] tinkerpop git commit: Minor fix to formatting of header in CHANGELOG CTR

Posted by sp...@apache.org.
Minor fix to formatting of header in CHANGELOG CTR


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

Branch: refs/heads/TINKERPOP-1878
Commit: ac161fa8cd613f3a0052debd460e5c363777ce2e
Parents: cfbe2ce
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 10 11:57:12 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 10 11:57:12 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ac161fa8/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 18f36ed..62c412e 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -2396,7 +2396,6 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Changed `GIRAPH_GREMLIN_HOME` to `GIRAPH_GREMLIN_LIB` to reference directory where jars are to be loaded.
 * Updated README with release instructions.
 
-TinkerPop 3.0.0.M1 (Release Date: August 12, 2014)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== TinkerPop 3.0.0.M1 (Release Date: August 12, 2014)
 
 * First official release of TinkerPop3 and thus, no changes.


[33/50] tinkerpop git commit: TINKERPOP-1878 sparql-gremlin is now building

Posted by sp...@apache.org.
TINKERPOP-1878 sparql-gremlin is now building

Fixed some basic pom.xml issues and resolved dependency conflicts.


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

Branch: refs/heads/TINKERPOP-1878
Commit: ce2858cec855001175419b93fbee29c38e400b49
Parents: be34396
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jan 24 15:23:57 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 pom.xml                | 18 ++++++++++++++++
 sparql-gremlin/pom.xml | 52 ++++++++++++++++++---------------------------
 2 files changed, 39 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ce2858ce/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 199a4ba..4333d5a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -108,6 +108,18 @@ limitations under the License.
             <email>twilmes@gmail.com</email>
             <url>https://github.com/twilmes</url>
         </contributor>
+        <contributor>
+            <name>Harsh Thakkar</name>
+            <email>harsh9t@gmail.com</email>
+            <organization>University of Bonn</organization>
+            <organizationUrl>http://harshthakkar.in</organizationUrl>
+        </contributor>
+        <contributor>
+            <name>Dharmen Punjani</name>
+            <email>dharmen.punjani@gmail.com</email>
+            <organization>National and Kapodistrian University of Athens</organization>
+            <organizationUrl>http://wdaqua.eu/students/dharmen-punjani</organizationUrl>
+        </contributor>
     </contributors>
     <prerequisites>
         <maven>3.1.0</maven>
@@ -124,6 +136,7 @@ limitations under the License.
         <module>hadoop-gremlin</module>
         <module>spark-gremlin</module>
         <module>neo4j-gremlin</module>
+        <module>sparql-gremlin</module>
         <module>gremlin-driver</module>
         <module>gremlin-console</module>
         <module>gremlin-server</module>
@@ -641,6 +654,11 @@ limitations under the License.
                 </exclusions>
             </dependency>
             <dependency>
+                <groupId>org.apache.httpcomponents</groupId>
+                <artifactId>httpclient</artifactId>
+                <version>4.5.1</version>
+            </dependency>
+            <dependency>
                 <groupId>commons-httpclient</groupId>
                 <artifactId>commons-httpclient</artifactId>
                 <version>3.1</version>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ce2858ce/sparql-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/sparql-gremlin/pom.xml b/sparql-gremlin/pom.xml
index e134d31..d38a85d 100644
--- a/sparql-gremlin/pom.xml
+++ b/sparql-gremlin/pom.xml
@@ -2,55 +2,46 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
     <parent>
         <artifactId>tinkerpop</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
         <version>3.3.2-SNAPSHOT</version>
     </parent>
-    <modelVersion>4.0.0</modelVersion>
-
     <artifactId>sparql-gremlin</artifactId>
-    <organization>
-        <name>WDAQUA-ITN</name>
-        <url>http://wdaqua.eu</url>
-    </organization>
-    <developers>
-        <developer>
-            <name>Harsh Thakkar</name>
-            <email>harsh9t@gmail.com</email>
-            <organization>University of Bonn</organization>
-            <organizationUrl>http://harshthakkar.in</organizationUrl>
-        </developer>
-        <developer>
-            <name>Dharmen Punjani</name>
-            <email>dharmen.punjani@gmail.com</email>
-            <organization>National and Kapodistrian University of Athens</organization>
-            <organizationUrl>http://wdaqua.eu/students/dharmen-punjani</organizationUrl>
-        </developer>
-    </developers>
+    <name>Apache TinkerPop :: SPARQL Gremlin</name>
 
     <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <jena.version>3.0.0</jena.version>
         <query.dir>src/test/resources/sparql/queries</query.dir>
     </properties>
 
     <dependencies>
-    <dependency>
-        <groupId>org.apache.jena</groupId>
-        <artifactId>apache-jena-libs</artifactId>
-        <type>pom</type>
-        <version>${jena.version}</version>
-    </dependency>
+        <dependency>
+            <groupId>org.apache.jena</groupId>
+            <artifactId>apache-jena-libs</artifactId>
+            <type>pom</type>
+            <version>3.0.0</version>
+            <exclusions>
+                <!-- self-conflict -->
+                <exclusion>
+                    <groupId>org.apache.httpcomponents</groupId>
+                    <artifactId>httpclient</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.apache.tinkerpop</groupId>
             <artifactId>gremlin-core</artifactId>
-            <version>3.3.2-SNAPSHOT</version>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.tinkerpop</groupId>
             <artifactId>tinkergraph-gremlin</artifactId>
-            <version>3.3.2-SNAPSHOT</version>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.tinkerpop</groupId>
@@ -59,5 +50,4 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
-
 </project>
\ No newline at end of file


[07/50] tinkerpop git commit: Missed updating NOTICE files for last two bumps of Groovy CTR

Posted by sp...@apache.org.
Missed updating NOTICE files for last two bumps of Groovy CTR


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

Branch: refs/heads/TINKERPOP-1878
Commit: cfbe2ce7fedb7de07e2c0760ee31f9a8d8a4b60c
Parents: 2f8f74a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 10 11:27:30 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 10 11:27:30 2018 -0400

----------------------------------------------------------------------
 gremlin-console/src/main/static/NOTICE | 2 +-
 gremlin-server/src/main/static/NOTICE  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfbe2ce7/gremlin-console/src/main/static/NOTICE
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/static/NOTICE b/gremlin-console/src/main/static/NOTICE
index 4931f7e..f34965b 100644
--- a/gremlin-console/src/main/static/NOTICE
+++ b/gremlin-console/src/main/static/NOTICE
@@ -18,7 +18,7 @@ This product includes software from the Spring Framework,
 under the Apache License 2.0 (see: StringUtils.containsWhitespace())
 
 ------------------------------------------------------------------------
-Apache Groovy 2.4.11 (AL ASF)
+Apache Groovy 2.4.15 (AL ASF)
 ------------------------------------------------------------------------
 This product includes/uses ANTLR (http://www.antlr2.org/)
 developed by Terence Parr 1989-2006

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cfbe2ce7/gremlin-server/src/main/static/NOTICE
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/static/NOTICE b/gremlin-server/src/main/static/NOTICE
index 72c10cc..0883bc4 100644
--- a/gremlin-server/src/main/static/NOTICE
+++ b/gremlin-server/src/main/static/NOTICE
@@ -11,7 +11,7 @@ This product includes software from the Spring Framework,
 under the Apache License 2.0 (see: StringUtils.containsWhitespace())
 
 ------------------------------------------------------------------------
-Apache Groovy 2.4.11 (AL ASF)
+Apache Groovy 2.4.15 (AL ASF)
 ------------------------------------------------------------------------
 This product includes/uses ANTLR (http://www.antlr2.org/)
 developed by Terence Parr 1989-2006


[16/50] tinkerpop git commit: Unify and clean up gmavenplus plugin configurations for GLVs CTR

Posted by sp...@apache.org.
Unify and clean up gmavenplus plugin configurations for GLVs CTR


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

Branch: refs/heads/TINKERPOP-1878
Commit: 8a03d50dedf31e587fb60e0f7735036a1484cfd4
Parents: d995972
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 10 15:13:59 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 14:10:12 2018 -0400

----------------------------------------------------------------------
 gremlin-dotnet/pom.xml     |  5 ++---
 gremlin-javascript/pom.xml | 45 ++++++++---------------------------------
 gremlin-python/pom.xml     |  4 ++--
 pom.xml                    |  3 ++-
 4 files changed, 14 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8a03d50d/gremlin-dotnet/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/pom.xml b/gremlin-dotnet/pom.xml
index fd2d428..fbc97d4 100644
--- a/gremlin-dotnet/pom.xml
+++ b/gremlin-dotnet/pom.xml
@@ -46,9 +46,8 @@ limitations under the License.
                 <dependencies>
                     <dependency>
                         <groupId>org.apache.tinkerpop</groupId>
-                        <artifactId>gremlin-core</artifactId>
+                        <artifactId>gremlin-server</artifactId>
                         <version>${project.version}</version>
-                        <scope>runtime</scope>
                     </dependency>
                     <dependency>
                         <groupId>org.codehaus.groovy</groupId>
@@ -60,7 +59,7 @@ limitations under the License.
                     <dependency>
                         <groupId>log4j</groupId>
                         <artifactId>log4j</artifactId>
-                        <version>1.2.17</version>
+                        <version>${log4j.version}</version>
                         <scope>runtime</scope>
                     </dependency>
                 </dependencies>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8a03d50d/gremlin-javascript/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index 0fe6bf4..f91b749 100644
--- a/gremlin-javascript/pom.xml
+++ b/gremlin-javascript/pom.xml
@@ -25,36 +25,6 @@ limitations under the License.
     </parent>
     <artifactId>gremlin-javascript</artifactId>
     <name>Apache TinkerPop :: Gremlin Javascript</name>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.tinkerpop</groupId>
-            <artifactId>gremlin-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tinkerpop</groupId>
-            <artifactId>tinkergraph-gremlin</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tinkerpop</groupId>
-            <artifactId>gremlin-test</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tinkerpop</groupId>
-            <artifactId>gremlin-server</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
     <properties>
         <maven.test.skip>false</maven.test.skip>
         <skipTests>${maven.test.skip}</skipTests>
@@ -81,21 +51,22 @@ limitations under the License.
                 <artifactId>gmavenplus-plugin</artifactId>
                 <dependencies>
                     <dependency>
-                        <groupId>log4j</groupId>
-                        <artifactId>log4j</artifactId>
-                        <version>1.2.17</version>
-                        <scope>runtime</scope>
-                    </dependency>
-                    <dependency>
                         <groupId>org.apache.tinkerpop</groupId>
                         <artifactId>gremlin-server</artifactId>
                         <version>${project.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>log4j</groupId>
+                        <artifactId>log4j</artifactId>
+                        <version>${log4j.version}</version>
                         <scope>runtime</scope>
                     </dependency>
                     <dependency>
                         <groupId>org.codehaus.groovy</groupId>
-                        <artifactId>groovy-ant</artifactId>
+                        <artifactId>groovy-all</artifactId>
                         <version>${groovy.version}</version>
+                        <classifier>indy</classifier>
+                        <scope>runtime</scope>
                     </dependency>
                 </dependencies>
                 <executions>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8a03d50d/gremlin-python/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index c999877..a2ab516 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -455,14 +455,14 @@ limitations under the License.
                             <dependency>
                                 <groupId>org.codehaus.groovy</groupId>
                                 <artifactId>groovy-all</artifactId>
-                                <version>2.4.11</version>
+                                <version>${groovy.version}</version>
                                 <classifier>indy</classifier>
                                 <scope>runtime</scope>
                             </dependency>
                             <dependency>
                                 <groupId>log4j</groupId>
                                 <artifactId>log4j</artifactId>
-                                <version>1.2.17</version>
+                                <version>${log4j.version}</version>
                                 <scope>runtime</scope>
                             </dependency>
                         </dependencies>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8a03d50d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6b24199..c724e0f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -146,6 +146,7 @@ limitations under the License.
         <java.tuples.version>1.2</java.tuples.version>
         <javadoc-plugin.version>2.10.4</javadoc-plugin.version>
         <jcabi.version>1.1</jcabi.version>
+        <log4j.version>1.2.17</log4j.version>
         <metrics.version>3.0.2</metrics.version>
         <netty.version>4.0.56.Final</netty.version>
         <slf4j.version>1.7.21</slf4j.version>
@@ -659,7 +660,7 @@ limitations under the License.
             <dependency>
                 <groupId>log4j</groupId>
                 <artifactId>log4j</artifactId>
-                <version>1.2.17</version>
+                <version>${log4j.version}</version>
             </dependency>
             <dependency>
                 <groupId>junit</groupId>


[47/50] tinkerpop git commit: TINKERPOP-1878 Added the plugin for sparql-gremlin

Posted by sp...@apache.org.
TINKERPOP-1878 Added the plugin for sparql-gremlin


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

Branch: refs/heads/TINKERPOP-1878
Commit: 4d3bddbb3fb723eb46a32fa2c0e22f3ab6f80235
Parents: 9d93852
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jan 29 09:37:15 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 .../sparql/jsr223/SparqlGremlinPlugin.java      | 63 ++++++++++++++++++++
 ...pache.tinkerpop.gremlin.jsr223.GremlinPlugin |  1 +
 2 files changed, 64 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4d3bddbb/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/jsr223/SparqlGremlinPlugin.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/jsr223/SparqlGremlinPlugin.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/jsr223/SparqlGremlinPlugin.java
new file mode 100644
index 0000000..8d0115b
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/jsr223/SparqlGremlinPlugin.java
@@ -0,0 +1,63 @@
+/*
+ * 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.sparql.jsr223;
+
+import org.apache.tinkerpop.gremlin.jsr223.AbstractGremlinPlugin;
+import org.apache.tinkerpop.gremlin.jsr223.DefaultImportCustomizer;
+import org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin;
+import org.apache.tinkerpop.gremlin.jsr223.ImportCustomizer;
+import org.apache.tinkerpop.gremlin.sparql.process.traversal.dsl.sparql.DefaultSparqlTraversal;
+import org.apache.tinkerpop.gremlin.sparql.process.traversal.dsl.sparql.SparqlTraversal;
+import org.apache.tinkerpop.gremlin.sparql.process.traversal.dsl.sparql.SparqlTraversalSource;
+import org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy.SparqlStrategy;
+
+/**
+ * {@link GremlinPlugin} implementation for {@code sparql-gremlin} that imports the key classes and interfaces required
+ * to use SPARQL in TinkerPop.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public final class SparqlGremlinPlugin extends AbstractGremlinPlugin {
+
+    private static final String NAME = "tinkerpop.sparql";
+
+    private static final ImportCustomizer imports;
+
+    static {
+        try {
+            imports = DefaultImportCustomizer.build().addClassImports(
+                    SparqlTraversalSource.class,
+                    SparqlTraversal.class,
+                    DefaultSparqlTraversal.class,
+                    SparqlStrategy.class).create();
+        } catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    private static final SparqlGremlinPlugin instance = new SparqlGremlinPlugin();
+
+    public SparqlGremlinPlugin() {
+        super(NAME, imports);
+    }
+
+    public static SparqlGremlinPlugin instance() {
+        return instance;
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4d3bddbb/sparql-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin b/sparql-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
new file mode 100644
index 0000000..882054c
--- /dev/null
+++ b/sparql-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
@@ -0,0 +1 @@
+org.apache.tinkerpop.gremlin.sparql.jsr223.SparqlGremlinPlugin
\ No newline at end of file


[40/50] tinkerpop git commit: TINKERPOP-1878 Testing for DISTINCT

Posted by sp...@apache.org.
TINKERPOP-1878 Testing for DISTINCT

Refactoring around the distinct and ordering - much less code there now.


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

Branch: refs/heads/TINKERPOP-1878
Commit: c9e36fb53719fa4df7e2babbe7a2e49fc9166a95
Parents: a16f582
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Jan 26 16:56:14 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 .../sparql/SparqlToGremlinTranspiler.java       | 44 ++++++++------------
 .../dsl/sparql/SparqlTraversalSourceTest.java   | 23 ++++++++++
 2 files changed, 41 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c9e36fb5/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
index 1b28a1d..67ac1e1 100644
--- a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinTranspiler.java
@@ -107,39 +107,28 @@ public class SparqlToGremlinTranspiler {
 
         final List<String> vars = query.getResultVars();
         if (!query.isQueryResultStar() && !query.hasGroupBy()) {
-            // the result sizes have special handling to get the right signatures of select() called. perhaps this
-            // could be refactored to work more nicely
-            switch (vars.size()) {
+            final String[] all = new String[vars.size()];
+            vars.toArray(all);
+            if (query.isDistinct()) {
+                traversal = traversal.dedup(all);
+            }
+
+            // apply ordering from ORDER BY
+            orderingIndex.forEach((k, v) -> traversal = traversal.order().by(__.select(k), v));
+
+            // the result sizes have special handling to get the right signatures of select() called.
+            switch (all.length) {
                 case 0:
                     throw new IllegalStateException();
                 case 1:
-                    if (query.isDistinct())
-                        traversal = traversal.dedup(vars.get(0));
-
-                    orderingIndex.forEach((k, v) -> traversal = traversal.order().by(__.select(k), v));
-                    traversal = traversal.select(vars.get(0));
-
+                    traversal = traversal.select(all[0]);
                     break;
                 case 2:
-                    if (query.isDistinct())
-                        traversal = traversal.dedup(vars.get(0), vars.get(1));
-
-                    orderingIndex.forEach((k, v) -> traversal = traversal.order().by(__.select(k), v));
-                    traversal = traversal.select(vars.get(0), vars.get(1));
-
+                    traversal = traversal.select(all[0], all[1]);
                     break;
                 default:
-                    final String[] all = new String[vars.size()];
-                    vars.toArray(all);
-                    if (query.isDistinct())
-                        traversal = traversal.dedup(all);
-
-                    orderingIndex.forEach((k, v) -> traversal = traversal.order().by(__.select(k), v));
-
-                    // just some shenanigans to get the right signature of select() called
                     final String[] others = Arrays.copyOfRange(all, 2, vars.size());
-                    traversal = traversal.select(vars.get(0), vars.get(1), others);
-
+                    traversal = traversal.select(all[0], all[1], others);
                     break;
             }
         }
@@ -207,7 +196,10 @@ public class SparqlToGremlinTranspiler {
 
             for (SortCondition sortCondition : sortingConditions) {
                 final Expr expr = sortCondition.getExpression();
-                orderingIndex.put(expr.getVarName(), sortCondition.getDirection() == 1 ? Order.incr : Order.decr);
+
+                // by default, the sort will be ascending. getDirection() returns -2 if the DESC/ASC isn't
+                // supplied - weird
+                orderingIndex.put(expr.getVarName(), sortCondition.getDirection() == -1 ? Order.decr : Order.incr);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c9e36fb5/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
index 4092e58..56d62c9 100644
--- a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
+++ b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java
@@ -111,4 +111,27 @@ public class SparqlTraversalSourceTest {
         assertEquals(x.get("b"), _g.V(4).next());
         assertEquals(x.get("c"), _g.V(3).next());
     }
+
+    @Test
+    public void shouldDistinct() {
+        final List<?> x = g.sparql(
+                "SELECT DISTINCT ?name\n" +
+                "WHERE {\n" +
+                "    ?a e:created ?b .\n" +
+                "    ?a v:name ?name .\n" +
+                "}").toList();
+        assertThat(x, containsInAnyOrder("marko", "josh", "peter"));
+    }
+
+    @Test
+    public void shouldDistinctAndOrder() {
+        final List<?> x = g.sparql(
+                "SELECT DISTINCT ?name\n" +
+                        "WHERE {\n" +
+                        "    ?a e:created ?b .\n" +
+                        "    ?a v:name ?name .\n" +
+                        "}" +
+                        "ORDER BY ?name").toList();
+        assertThat(x, contains("josh", "marko", "peter"));
+    }
 }


[15/50] tinkerpop git commit: Bump to 3.2.10-SNAPSHOT - double digits!! CTR

Posted by sp...@apache.org.
Bump to 3.2.10-SNAPSHOT - double digits!! CTR


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

Branch: refs/heads/TINKERPOP-1878
Commit: d995972524cdb168e897cad4e85bb9a1a2310ab9
Parents: ac161fa
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 11 14:09:00 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 14:09:00 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                            | 4 ++++
 docs/src/upgrade/release-3.2.x-incubating.asciidoc            | 7 +++++++
 giraph-gremlin/pom.xml                                        | 2 +-
 gremlin-archetype/gremlin-archetype-dsl/pom.xml               | 2 +-
 gremlin-archetype/gremlin-archetype-server/pom.xml            | 2 +-
 gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml       | 2 +-
 gremlin-archetype/pom.xml                                     | 2 +-
 gremlin-benchmark/pom.xml                                     | 2 +-
 gremlin-console/bin/gremlin.sh                                | 2 +-
 gremlin-console/pom.xml                                       | 2 +-
 gremlin-core/pom.xml                                          | 2 +-
 gremlin-dotnet/pom.xml                                        | 2 +-
 gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj             | 4 ++--
 gremlin-dotnet/src/pom.xml                                    | 2 +-
 gremlin-dotnet/test/pom.xml                                   | 2 +-
 gremlin-driver/pom.xml                                        | 2 +-
 gremlin-groovy-test/pom.xml                                   | 2 +-
 gremlin-groovy/pom.xml                                        | 2 +-
 gremlin-javascript/pom.xml                                    | 2 +-
 .../src/main/javascript/gremlin-javascript/package.json       | 2 +-
 gremlin-python/pom.xml                                        | 2 +-
 gremlin-server/pom.xml                                        | 2 +-
 gremlin-shaded/pom.xml                                        | 2 +-
 gremlin-test/pom.xml                                          | 2 +-
 hadoop-gremlin/pom.xml                                        | 2 +-
 neo4j-gremlin/pom.xml                                         | 2 +-
 pom.xml                                                       | 2 +-
 spark-gremlin/pom.xml                                         | 2 +-
 tinkergraph-gremlin/pom.xml                                   | 2 +-
 29 files changed, 39 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 62c412e..41d83c4 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -20,6 +20,10 @@ limitations under the License.
 
 image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/images/nine-inch-gremlins.png[width=185]
 
+[[release-3-2-10]]
+=== TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET)
+
+
 [[release-3-2-9]]
 === TinkerPop 3.2.9 (Release Date: May 8, 2018)
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 06e4f59..b5eb3b3 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -21,6 +21,13 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 *Nine Inch Gremlins*
 
+== TinkerPop 3.2.10
+
+*Release Date: NOT OFFICIALLY RELEASED YET*
+
+Please see the link:https://github.com/apache/tinkerpop/blob/3.2.10/CHANGELOG.asciidoc#release-3-2-10[changelog] for a complete list of all the modifications that are part of this release.
+
+
 == TinkerPop 3.2.9
 
 *Release Date: May 8, 2018*

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/giraph-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/giraph-gremlin/pom.xml b/giraph-gremlin/pom.xml
index 69355be..21f7389 100644
--- a/giraph-gremlin/pom.xml
+++ b/giraph-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>giraph-gremlin</artifactId>
     <name>Apache TinkerPop :: Giraph Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-archetype/gremlin-archetype-dsl/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-dsl/pom.xml b/gremlin-archetype/gremlin-archetype-dsl/pom.xml
index 4dd6297..9e412b1 100644
--- a/gremlin-archetype/gremlin-archetype-dsl/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-dsl/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-archetype</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-archetype-dsl</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-archetype/gremlin-archetype-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/pom.xml b/gremlin-archetype/gremlin-archetype-server/pom.xml
index eedbd56..5f07170 100644
--- a/gremlin-archetype/gremlin-archetype-server/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-server/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-archetype</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-archetype-server</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml b/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
index ecf5a50..f7b1b5a 100644
--- a/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-archetype</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-archetype-tinkergraph</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/pom.xml b/gremlin-archetype/pom.xml
index 9f929af..81c54ff 100644
--- a/gremlin-archetype/pom.xml
+++ b/gremlin-archetype/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <artifactId>tinkerpop</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-archetype</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-benchmark/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-benchmark/pom.xml b/gremlin-benchmark/pom.xml
index bcce1ef..9405392 100644
--- a/gremlin-benchmark/pom.xml
+++ b/gremlin-benchmark/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <artifactId>tinkerpop</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
 
     <artifactId>gremlin-benchmark</artifactId>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-console/bin/gremlin.sh
----------------------------------------------------------------------
diff --git a/gremlin-console/bin/gremlin.sh b/gremlin-console/bin/gremlin.sh
index cdf1153..14dda62 120000
--- a/gremlin-console/bin/gremlin.sh
+++ b/gremlin-console/bin/gremlin.sh
@@ -1 +1 @@
-../target/apache-tinkerpop-gremlin-console-3.2.9-standalone/bin/gremlin.sh
\ No newline at end of file
+../target/apache-tinkerpop-gremlin-console-3.2.10-SNAPSHOT-standalone/bin/gremlin.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-console/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/pom.xml b/gremlin-console/pom.xml
index 7581397..49e7f4a 100644
--- a/gremlin-console/pom.xml
+++ b/gremlin-console/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <artifactId>tinkerpop</artifactId>
         <groupId>org.apache.tinkerpop</groupId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-console</artifactId>
     <name>Apache TinkerPop :: Gremlin Console</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-core/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml
index 78bffa5..bf81ca1 100644
--- a/gremlin-core/pom.xml
+++ b/gremlin-core/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-core</artifactId>
     <name>Apache TinkerPop :: Gremlin Core</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-dotnet/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/pom.xml b/gremlin-dotnet/pom.xml
index 10f5791..fd2d428 100644
--- a/gremlin-dotnet/pom.xml
+++ b/gremlin-dotnet/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-dotnet</artifactId>
     <name>Apache TinkerPop :: Gremlin.Net</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
index ad85e56..ff3b2a2 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
@@ -25,8 +25,8 @@ limitations under the License.
   </PropertyGroup>
 
   <PropertyGroup Label="Package">
-    <Version>3.2.9</Version>
-    <FileVersion>3.2.9.0</FileVersion>
+    <Version>3.2.10-SNAPSHOT</Version>
+    <FileVersion>3.2.10.0</FileVersion>
     <AssemblyVersion>3.2.0.0</AssemblyVersion>
     <Title>Gremlin.Net</Title>
     <Authors>Apache TinkerPop</Authors>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-dotnet/src/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/pom.xml b/gremlin-dotnet/src/pom.xml
index 9769b62..f913692 100644
--- a/gremlin-dotnet/src/pom.xml
+++ b/gremlin-dotnet/src/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-dotnet</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-dotnet-source</artifactId>
     <name>Apache TinkerPop :: Gremlin.Net - Source</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-dotnet/test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/pom.xml b/gremlin-dotnet/test/pom.xml
index 8c49ae9..db1f8ad 100644
--- a/gremlin-dotnet/test/pom.xml
+++ b/gremlin-dotnet/test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>gremlin-dotnet</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-dotnet-tests</artifactId>
     <name>Apache TinkerPop :: Gremlin.Net - Tests</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-driver/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-driver/pom.xml b/gremlin-driver/pom.xml
index 4ba9339..a7835ab 100644
--- a/gremlin-driver/pom.xml
+++ b/gremlin-driver/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-driver</artifactId>
     <name>Apache TinkerPop :: Gremlin Driver</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-groovy-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/pom.xml b/gremlin-groovy-test/pom.xml
index cc21f8b..a04f3b2 100644
--- a/gremlin-groovy-test/pom.xml
+++ b/gremlin-groovy-test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-groovy-test</artifactId>
     <name>Apache TinkerPop :: Gremlin Groovy Test</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-groovy/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-groovy/pom.xml b/gremlin-groovy/pom.xml
index 627893a..64405f5 100644
--- a/gremlin-groovy/pom.xml
+++ b/gremlin-groovy/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-groovy</artifactId>
     <name>Apache TinkerPop :: Gremlin Groovy</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-javascript/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index 29da33d..0fe6bf4 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.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-javascript</artifactId>
     <name>Apache TinkerPop :: Gremlin Javascript</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/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 aa64bfb..62b53ef 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",
-  "version": "3.2.9",
+  "version": "3.2.10-alpha1",
   "description": "JavaScript Gremlin Language Variant",
   "author": "Apache TinkerPop team",
   "keywords": [

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-python/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index 8340560..c999877 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-python</artifactId>
     <name>Apache TinkerPop :: Gremlin Python</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-server/pom.xml b/gremlin-server/pom.xml
index 1b38dff..68733a9 100644
--- a/gremlin-server/pom.xml
+++ b/gremlin-server/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-server</artifactId>
     <name>Apache TinkerPop :: Gremlin Server</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-shaded/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-shaded/pom.xml b/gremlin-shaded/pom.xml
index f40a3ed..192262d 100644
--- a/gremlin-shaded/pom.xml
+++ b/gremlin-shaded/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-shaded</artifactId>
     <name>Apache TinkerPop :: Gremlin Shaded</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/gremlin-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-test/pom.xml b/gremlin-test/pom.xml
index 66e1a3e..652b346 100644
--- a/gremlin-test/pom.xml
+++ b/gremlin-test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>gremlin-test</artifactId>
     <name>Apache TinkerPop :: Gremlin Test</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/hadoop-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/pom.xml b/hadoop-gremlin/pom.xml
index a596db5..b094470 100644
--- a/hadoop-gremlin/pom.xml
+++ b/hadoop-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>hadoop-gremlin</artifactId>
     <name>Apache TinkerPop :: Hadoop Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/neo4j-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml
index e77f83e..b0a5e5f 100644
--- a/neo4j-gremlin/pom.xml
+++ b/neo4j-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>neo4j-gremlin</artifactId>
     <name>Apache TinkerPop :: Neo4j Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 379db49..6b24199 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ limitations under the License.
     </parent>
     <groupId>org.apache.tinkerpop</groupId>
     <artifactId>tinkerpop</artifactId>
-    <version>3.2.9</version>
+    <version>3.2.10-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>Apache TinkerPop</name>
     <description>A Graph Computing Framework</description>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/spark-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/spark-gremlin/pom.xml b/spark-gremlin/pom.xml
index feb339b..ff0b11d 100644
--- a/spark-gremlin/pom.xml
+++ b/spark-gremlin/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>spark-gremlin</artifactId>
     <name>Apache TinkerPop :: Spark Gremlin</name>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9959725/tinkergraph-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/pom.xml b/tinkergraph-gremlin/pom.xml
index c842275..1ff0aa0 100644
--- a/tinkergraph-gremlin/pom.xml
+++ b/tinkergraph-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
     <parent>
         <groupId>org.apache.tinkerpop</groupId>
         <artifactId>tinkerpop</artifactId>
-        <version>3.2.9</version>
+        <version>3.2.10-SNAPSHOT</version>
     </parent>
     <artifactId>tinkergraph-gremlin</artifactId>
     <name>Apache TinkerPop :: TinkerGraph Gremlin</name>


[24/50] tinkerpop git commit: Merge branch 'tp33'

Posted by sp...@apache.org.
Merge branch 'tp33'

Conflicts:
	giraph-gremlin/pom.xml
	gremlin-archetype/gremlin-archetype-dsl/pom.xml
	gremlin-archetype/gremlin-archetype-server/pom.xml
	gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
	gremlin-archetype/pom.xml
	gremlin-console/bin/gremlin.sh
	gremlin-console/pom.xml
	gremlin-core/pom.xml
	gremlin-dotnet/pom.xml
	gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
	gremlin-dotnet/src/pom.xml
	gremlin-dotnet/test/pom.xml
	gremlin-driver/pom.xml
	gremlin-groovy/pom.xml
	gremlin-javascript/pom.xml
	gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
	gremlin-python/pom.xml
	gremlin-server/pom.xml
	gremlin-shaded/pom.xml
	gremlin-test/pom.xml
	gremlin-tools/gremlin-benchmark/pom.xml
	gremlin-tools/gremlin-coverage/pom.xml
	gremlin-tools/gremlin-io-test/pom.xml
	gremlin-tools/pom.xml
	hadoop-gremlin/pom.xml
	neo4j-gremlin/pom.xml
	pom.xml
	spark-gremlin/pom.xml
	tinkergraph-gremlin/pom.xml


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

Branch: refs/heads/TINKERPOP-1878
Commit: e425f1a6eba019987615dfd10b6d21590c2e45ff
Parents: 757de48 68d39dc
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 11 16:51:33 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 11 16:51:33 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              | 10 +++++
 .../developer/development-environment.asciidoc  |  1 +
 .../upgrade/release-3.2.x-incubating.asciidoc   |  7 +++
 docs/src/upgrade/release-3.3.x.asciidoc         |  7 +++
 gremlin-dotnet/pom.xml                          | 17 +++++--
 gremlin-groovy/pom.xml                          |  6 ---
 gremlin-javascript/pom.xml                      | 47 ++++----------------
 gremlin-python/pom.xml                          |  4 +-
 pom.xml                                         | 19 +++++---
 9 files changed, 61 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e425f1a6/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e425f1a6/gremlin-dotnet/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e425f1a6/gremlin-groovy/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e425f1a6/gremlin-javascript/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e425f1a6/gremlin-python/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e425f1a6/pom.xml
----------------------------------------------------------------------


[32/50] tinkerpop git commit: Initial commit for sparql-gremlin changes

Posted by sp...@apache.org.
Initial commit for sparql-gremlin changes


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

Branch: refs/heads/TINKERPOP-1878
Commit: be34396c530a4a6b47d4cc05899a63f7e31d152c
Parents: 942494e
Author: harsh9t <ha...@gmail.com>
Authored: Thu Jan 18 01:33:29 2018 +0100
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:01 2018 -0400

----------------------------------------------------------------------
 sparql-gremlin/pom.xml                          |  63 +++
 .../gremlin/sparql/ConsoleCompiler.java         | 165 ++++++++
 .../tinkerpop/gremlin/sparql/Prefixes.java      |  64 ++++
 .../gremlin/sparql/SparqlToGremlinCompiler.java | 381 +++++++++++++++++++
 .../gremlin/sparql/TraversalBuilder.java        |  82 ++++
 .../gremlin/sparql/WhereTraversalBuilder.java   | 134 +++++++
 .../tinkerpop/gremlin/sparql/PrefixesTest.java  |  67 ++++
 .../gremlin/sparql/ResourceHelper.java          |  37 ++
 .../sparql/SparqlToGremlinCompilerTest.java     | 223 +++++++++++
 9 files changed, 1216 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be34396c/sparql-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/sparql-gremlin/pom.xml b/sparql-gremlin/pom.xml
new file mode 100644
index 0000000..e134d31
--- /dev/null
+++ b/sparql-gremlin/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>tinkerpop</artifactId>
+        <groupId>org.apache.tinkerpop</groupId>
+        <version>3.3.2-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sparql-gremlin</artifactId>
+    <organization>
+        <name>WDAQUA-ITN</name>
+        <url>http://wdaqua.eu</url>
+    </organization>
+    <developers>
+        <developer>
+            <name>Harsh Thakkar</name>
+            <email>harsh9t@gmail.com</email>
+            <organization>University of Bonn</organization>
+            <organizationUrl>http://harshthakkar.in</organizationUrl>
+        </developer>
+        <developer>
+            <name>Dharmen Punjani</name>
+            <email>dharmen.punjani@gmail.com</email>
+            <organization>National and Kapodistrian University of Athens</organization>
+            <organizationUrl>http://wdaqua.eu/students/dharmen-punjani</organizationUrl>
+        </developer>
+    </developers>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <jena.version>3.0.0</jena.version>
+        <query.dir>src/test/resources/sparql/queries</query.dir>
+    </properties>
+
+    <dependencies>
+    <dependency>
+        <groupId>org.apache.jena</groupId>
+        <artifactId>apache-jena-libs</artifactId>
+        <type>pom</type>
+        <version>${jena.version}</version>
+    </dependency>
+        <dependency>
+            <groupId>org.apache.tinkerpop</groupId>
+            <artifactId>gremlin-core</artifactId>
+            <version>3.3.2-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tinkerpop</groupId>
+            <artifactId>tinkergraph-gremlin</artifactId>
+            <version>3.3.2-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tinkerpop</groupId>
+            <artifactId>gremlin-test</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be34396c/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/ConsoleCompiler.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/ConsoleCompiler.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/ConsoleCompiler.java
new file mode 100644
index 0000000..0d50475
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/ConsoleCompiler.java
@@ -0,0 +1,165 @@
+/*
+ * 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.sparql;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator;
+import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.io.IoCore;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+
+import org.apache.tinkerpop.gremlin.sparql.SparqlToGremlinCompiler;
+
+class ConsoleCompiler {
+
+    public static void main(final String[] args) throws IOException {
+    	//args = "/examples/modern1.sparql";
+        final Options options = new Options();
+        options.addOption("f", "file", true, "a file that contains a SPARQL query");
+        options.addOption("g", "graph", true, "the graph that's used to execute the query [classic|modern|crew|kryo file]");
+        // TODO: add an OLAP option (perhaps: "--olap spark"?)
+
+        final CommandLineParser parser = new DefaultParser();
+        final CommandLine commandLine;
+
+        try {
+            commandLine = parser.parse(options, args);
+        } catch (ParseException e) {
+            System.out.println(e.getMessage());
+            printHelp(1);
+            return;
+        }
+        
+        final InputStream inputStream = commandLine.hasOption("file")
+                ? new FileInputStream(commandLine.getOptionValue("file"))
+                : System.in;
+        final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+        final StringBuilder queryBuilder = new StringBuilder();
+
+        if (!reader.ready()) {
+            printHelp(1);
+        }
+
+        String line;
+        while (null != (line = reader.readLine())) {
+            queryBuilder.append(System.lineSeparator()).append(line);
+        }
+
+        final String queryString = queryBuilder.toString();
+        Graph graph;
+        
+        if (commandLine.hasOption("graph")) {
+            switch (commandLine.getOptionValue("graph").toLowerCase()) {
+                case "classic":
+                    graph = TinkerFactory.createClassic();
+                    break;
+                case "modern":
+                    graph = TinkerFactory.createModern();
+                    System.out.println("Modern Graph Created");
+                    break;
+                case "crew":
+                    graph = TinkerFactory.createTheCrew();
+                    break;
+                default:
+                    graph = TinkerGraph.open();
+                    System.out.println("Graph Created");
+                    String graphName = commandLine.getOptionValue("graph");
+                    long startTime= System.currentTimeMillis();
+                    if(graphName.endsWith(".graphml"))
+                    	graph.io(IoCore.graphml()).readGraph(graphName);
+                    else if(graphName.endsWith(".kryo")||graphName.endsWith("gryo"))
+                    	graph.io(IoCore.gryo()).readGraph(graphName);
+                    long endTime = System.currentTimeMillis();
+                    System.out.println("Time taken to load graph from kyro file: "+ (endTime-startTime)+" mili seconds");
+                    break;
+            }
+        } else {
+ 
+            graph = TinkerFactory.createModern();
+        }
+
+        long startTime = System.currentTimeMillis();
+        final Traversal<Vertex, ?> traversal = SparqlToGremlinCompiler.convertToGremlinTraversal(graph, queryString);
+        long endTime = System.currentTimeMillis();
+        System.out.println("Time traken to convert SPARQL to Gremlin Traversal : "+ (endTime - startTime)+ " miliseconds");
+        
+        printWithHeadline("SPARQL Query", queryString);
+        // printWithHeadline("Traversal (prior execution)", traversal);
+  
+        
+        Bytecode traversalByteCode = traversal.asAdmin().getBytecode();
+        
+        
+//        JavaTranslator.of(graph.traversal()).translate(traversalByteCode);
+//        
+//        System.out.println("the Byte Code : "+ traversalByteCode.toString());
+        printWithHeadline("Result", String.join(System.lineSeparator(),JavaTranslator.of(graph.traversal()).translate(traversalByteCode).toStream().map(Object::toString).collect(Collectors.toList())));
+        // printWithHeadline("Traversal (after execution)", traversal);
+    }
+
+    private static void printHelp(final int exitCode) throws IOException {
+        final Map<String, String> env = System.getenv();
+        final String command = env.containsKey("LAST_COMMAND") ? env.get("LAST_COMMAND") : "sparql-gremlin.sh";
+        printWithHeadline("Usage Examples", String.join("\n",
+                command + " -f examples/modern1.sparql",
+                command + " < examples/modern2.sparql",
+                command + " <<< 'SELECT * WHERE { ?a e:knows ?b }'",
+                command + " -g crew < examples/crew1.sparql"));
+        if (exitCode >= 0) {
+            System.exit(exitCode);
+        }
+    }
+
+    private static void printWithHeadline(final String headline, final Object content) throws IOException {
+        final StringReader sr = new StringReader(content != null ? content.toString() : "null");
+        final BufferedReader br = new BufferedReader(sr);
+        String line;
+        System.out.println();
+        System.out.println( headline ); 
+        System.out.println();
+        boolean skip = true;
+        while (null != (line = br.readLine())) {
+            skip &= line.isEmpty();
+            if (!skip) {
+                System.out.println("  " + line);
+            }
+        }
+        System.out.println();
+        br.close();
+        sr.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be34396c/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/Prefixes.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/Prefixes.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/Prefixes.java
new file mode 100644
index 0000000..452bf68
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/Prefixes.java
@@ -0,0 +1,64 @@
+/*
+ * 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.sparql;
+
+import java.util.Arrays;
+import java.util.List;
+
+
+public class Prefixes {
+
+	// public final static String BASE_URI = "http://northwind.com/model/";
+    public final static String BASE_URI = "http://www.tinkerpop.com/traversal/";
+
+    final static List<String> PREFIXES = Arrays.asList("edge", "property", "value");
+
+    final static String PREFIX_DEFINITIONS;
+
+    static {
+        final StringBuilder builder = new StringBuilder();
+        for (final String prefix : PREFIXES) {
+            builder.append("PREFIX ").append(prefix.substring(0, 1)).append(": <").append(getURI(prefix)).
+                    append(">").append(System.lineSeparator());
+        }
+        PREFIX_DEFINITIONS = builder.toString();
+    }
+
+    public static String getURI(final String prefix) {
+        return BASE_URI + prefix + "#";
+    }
+
+    public static String getURIValue(final String uri) {
+        return uri.substring(uri.indexOf("#") + 1);
+    }
+
+    public static String getPrefix(final String uri) {
+        final String tmp = uri.substring(0, uri.indexOf("#"));
+        return tmp.substring(tmp.lastIndexOf("/") + 1);
+    }
+
+    public static String prepend(final String script) {
+        return PREFIX_DEFINITIONS + script;
+    }
+
+    public static StringBuilder prepend(final StringBuilder scriptBuilder) {
+        return scriptBuilder.insert(0, PREFIX_DEFINITIONS);
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be34396c/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompiler.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompiler.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompiler.java
new file mode 100644
index 0000000..adb36e9
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompiler.java
@@ -0,0 +1,381 @@
+/*
+ * 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.sparql;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.jena.graph.Triple;
+import org.apache.jena.query.Query;
+import org.apache.jena.query.QueryFactory;
+import org.apache.jena.query.SortCondition;
+import org.apache.jena.query.Syntax;
+import org.apache.jena.sparql.algebra.Algebra;
+import org.apache.jena.sparql.algebra.Op;
+import org.apache.jena.sparql.algebra.OpVisitorBase;
+import org.apache.jena.sparql.algebra.OpWalker;
+import org.apache.jena.sparql.algebra.op.OpBGP;
+import org.apache.jena.sparql.algebra.op.OpFilter;
+import org.apache.jena.sparql.algebra.op.OpLeftJoin;
+import org.apache.jena.sparql.algebra.op.OpUnion;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.core.VarExprList;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.expr.ExprAggregator;
+import org.apache.tinkerpop.gremlin.process.traversal.Order;
+import org.apache.tinkerpop.gremlin.process.traversal.Scope;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+
+// TODO: implement OpVisitor, don't extend OpVisitorBase
+public class SparqlToGremlinCompiler extends OpVisitorBase {
+
+	private GraphTraversal<Vertex, ?> traversal;
+
+	List<Traversal> traversalList = new ArrayList<Traversal>();
+
+	String groupVariable = "";
+	int sortingDirection = 0;
+	long offsetLimit = 0;
+	String sortingVariable = "";
+
+	GraphTraversalSource temp;
+	Graph graph;
+
+	private SparqlToGremlinCompiler(final GraphTraversal<Vertex, ?> traversal) {
+		this.traversal = traversal;
+	}
+
+	private SparqlToGremlinCompiler(final GraphTraversalSource g) {
+		this(g.V());
+		temp = g;
+
+	}
+
+	private SparqlToGremlinCompiler(final Graph g) {
+		this.traversal = (GraphTraversal<Vertex, ?>) g.traversal();
+		graph = g;
+	}
+
+	public String createMatchStep(String step) {
+		String st = "";
+		step = step.substring(1, step.length() - 2);
+		String first = step.substring(0, step.indexOf(","));
+		String second = step.substring(step.indexOf(",") + 1);
+		//System.out.println("First : " + first);
+		//System.out.println("Second : " + second);
+		st = first.substring(first.indexOf("["), first.length() - 1);
+		st = "[" + st + "," + second + "]";
+		return st;
+	}
+
+	GraphTraversal<Vertex, ?> convertToGremlinTraversal(final Query query) {
+		
+		// long startTime = System.currentTimeMillis();
+		// long endTime;
+		final Op op = Algebra.compile(query); // SPARQL query compiles here to
+												// OP
+//		System.out.println("OP Tree: " + op.toString());
+
+		
+		OpWalker.walk(op, this); // OP is being walked here
+		
+		
+		
+		
+		//System.out.println("time taken for opWalker:"+ (endTime-startTime));
+		// startTime = System.currentTimeMillis();
+		int traversalIndex = 0;
+		int numberOfTraversal = traversalList.size();
+		Traversal arrayOfAllTraversals[] = new Traversal[numberOfTraversal];
+
+		if (query.hasOrderBy() && !query.hasGroupBy()) {
+			List<SortCondition> sortingConditions = query.getOrderBy();
+			int directionOfSort = 0;
+
+			for (SortCondition sortCondition : sortingConditions) {
+				Expr expr = sortCondition.getExpression();
+				directionOfSort = sortCondition.getDirection();
+				sortingVariable = expr.getVarName();
+
+			}
+
+			Order orderDirection = Order.incr;
+			if (directionOfSort == -1) {
+				orderDirection = Order.decr;
+			}
+		}
+		for (Traversal tempTrav : traversalList) {
+
+			arrayOfAllTraversals[traversalIndex++] = tempTrav;
+		}
+
+		int directionOfSort = 0;
+		Order orderDirection = Order.incr;
+		if (query.hasOrderBy()) {
+			List<SortCondition> sortingConditions = query.getOrderBy();
+
+			//
+			for (SortCondition sortCondition : sortingConditions) {
+				Expr expr = sortCondition.getExpression();
+				directionOfSort = sortCondition.getDirection();
+				sortingVariable = expr.getVarName();
+//				System.out.println("order by var: "+sortingDirection);
+			}
+			//
+
+			if (directionOfSort == -1) {
+				orderDirection = Order.decr;
+			}
+
+		}
+
+		if (traversalList.size() > 0)
+			traversal = traversal.match(arrayOfAllTraversals);
+
+		final List<String> vars = query.getResultVars();
+		List<ExprAggregator> lstexpr = query.getAggregators();
+		if (!query.isQueryResultStar() && !query.hasGroupBy()) {
+
+			switch (vars.size()) {
+			case 0:
+				throw new IllegalStateException();
+			case 1:
+				if (query.isDistinct()) {
+//					System.out.println("Inside ------------------- >Select 1------------------------> Distinct");
+					traversal = traversal.dedup(vars.get(0));
+				}
+				if (query.hasOrderBy()) {
+//					System.out.println("Inside ------------------- >Select 1");
+					traversal = traversal.order().by(sortingVariable, orderDirection);
+				} else {
+
+					traversal = traversal.select(vars.get(0));
+				}
+				break;
+			case 2:
+				if (query.isDistinct()) {
+					traversal = traversal.dedup(vars.get(0), vars.get(1));
+				}
+				if (query.hasOrderBy()) {
+//					System.out.println("Inside ------------------- >Select 1");
+					traversal = traversal.order().by(__.select(vars.get(0)), orderDirection).by(__.select(vars.get(1)));
+				} else
+					traversal = traversal.select(vars.get(0), vars.get(1));
+				break;
+			default:
+				final String[] all = new String[vars.size()];
+				vars.toArray(all);
+				if (query.isDistinct()) {
+
+					traversal = traversal.dedup(all);
+				}
+				final String[] others = Arrays.copyOfRange(all, 2, vars.size());
+				if (query.hasOrderBy()) {
+
+					traversal = traversal.order().by(__.select(vars.get(0)), orderDirection).by(__.select(vars.get(1)));
+
+				} else
+					traversal = traversal.select(vars.get(0), vars.get(1), others);
+
+				break;
+			}
+
+		}
+		
+		
+		if (query.hasGroupBy()) {
+			VarExprList lstExpr = query.getGroupBy();
+			String grpVar = "";
+			Traversal tempTrav;
+			for (Var expr : lstExpr.getVars()) {
+				grpVar = expr.getName();
+				// System.out.println("The Group by var: " + expr.getName());
+			}
+
+			if (query.hasLimit()) {
+				long limit = query.getLimit(), offset = 0;
+
+				if (query.hasOffset()) {
+					offset = query.getOffset();
+
+				}
+				// if (query.hasGroupBy() && query.hasOrderBy())
+				// traversal = traversal.range( offset, offset + limit);
+				// else
+				// traversal = traversal.range(offset, offset + limit);
+
+			}
+
+			if (!grpVar.isEmpty())
+				traversal = traversal.select(grpVar);
+			if (query.hasAggregators()) {
+				List<ExprAggregator> exprAgg = query.getAggregators();
+				for (ExprAggregator expr : exprAgg) {
+
+//					System.out.println("The Aggregator by var: " + expr.getAggregator().getExprList().toString()
+//							+ " is :" + expr.getAggregator().toString());
+					if (expr.getAggregator().getName().contains("COUNT")) {
+						if (!query.toString().contains("GROUP")) {
+							if (expr.getAggregator().toString().contains("DISTINCT")) {
+								traversal = traversal
+										.dedup(expr.getAggregator().getExprList().get(0).toString().substring(1));
+							} else {
+								traversal = traversal
+										.select(expr.getAggregator().getExprList().get(0).toString().substring(1));
+							}
+							traversal = traversal.count();
+						} else
+							traversal = traversal.groupCount();
+					}
+					if (expr.getAggregator().getName().contains("MAX")) {
+						traversal = traversal.max();
+					}
+				}
+
+			} else {
+
+				traversal = traversal.group();
+			}
+			
+			
+		}
+
+
+		if (query.hasOrderBy() && query.hasGroupBy()) {
+
+			traversal = traversal.order().by(sortingVariable, orderDirection);
+		}
+		if (query.hasLimit()) {
+			long limit = query.getLimit(), offset = 0;
+
+			if (query.hasOffset()) {
+				offset = query.getOffset();
+
+			}
+			if (query.hasGroupBy() && query.hasOrderBy())
+				traversal = traversal.range(Scope.local, offset, offset + limit);
+			else
+				traversal = traversal.range(offset, offset + limit);
+
+		}
+		// endTime = System.currentTimeMillis();
+		// System.out.println("time taken for convertToGremlinTraversal Function : "+ (endTime-startTime)+" mili seconds");
+		
+		return traversal;
+	}
+
+	private static GraphTraversal<Vertex, ?> convertToGremlinTraversal(final GraphTraversalSource g,
+			final Query query) {
+		return new SparqlToGremlinCompiler(g).convertToGremlinTraversal(query);
+	}
+
+	public static GraphTraversal<Vertex, ?> convertToGremlinTraversal(final Graph graph, final String query) {
+		return convertToGremlinTraversal(graph.traversal(),	QueryFactory.create(Prefixes.prepend(query)));
+	}
+
+	public static GraphTraversal<Vertex, ?> convertToGremlinTraversal(final GraphTraversalSource g,
+			final String query) {
+		return convertToGremlinTraversal(g, QueryFactory.create(Prefixes.prepend(query), Syntax.syntaxSPARQL));
+	}
+
+	// VISITING SPARQL ALGEBRA OP BASIC TRIPLE PATTERNS - MAYBE
+	@Override
+	public void visit(final OpBGP opBGP) {
+		{
+			
+			// System.out.println("Inside opBGP ---------------------------------------------->");
+			final List<Triple> triples = opBGP.getPattern().getList();
+			final Traversal[] matchTraversals = new Traversal[triples.size()];
+			int i = 0;
+			for (final Triple triple : triples) {
+
+				matchTraversals[i++] = TraversalBuilder.transform(triple);
+				traversalList.add(matchTraversals[i - 1]);
+			}
+
+		}
+
+	}
+
+	// VISITING SPARQL ALGEBRA OP FILTER - MAYBE
+	@Override
+	public void visit(final OpFilter opFilter) {
+
+		// System.out.println("Inside opFilter ---------------------------------------------->");
+		Traversal traversal = null;
+
+		for (Expr expr : opFilter.getExprs().getList()) {
+			if (expr != null) {
+
+				traversal = __.where(WhereTraversalBuilder.transform(expr));
+				traversalList.add(traversal);
+			}
+		}
+
+	}
+	// TODO: add more functions for operators other than FILTER, such as
+	// OPTIONAL
+	// This can be done by understanding how Jena handles these other
+	// operators/filters inherently and then map them to Gremlin
+
+	public void visit(final OpLeftJoin opLeftJoin) {
+
+//		System.out.println("Inside opOptional ---------------------------------------------->");
+//		System.out.println(opLeftJoin.getRight().toString());
+
+	}
+
+	@Override
+	public void visit(final OpUnion opUnion) {
+
+		// System.out.println("Inside opUnion ---------------------------------------------->");
+		Traversal unionTemp[] = new Traversal[2];
+		Traversal unionTemp1[] = new Traversal[traversalList.size() / 2];
+		Traversal unionTemp2[] = new Traversal[traversalList.size() / 2];
+
+		int count = 0;
+
+		for (int i = 0; i < traversalList.size(); i++) {
+
+			if (i < traversalList.size() / 2) {
+
+				unionTemp1[i] = traversalList.get(i);
+			} else {
+				unionTemp2[count++] = traversalList.get(i);
+			}
+		}
+
+		unionTemp[1] = __.match(unionTemp2);
+		unionTemp[0] = __.match(unionTemp1);
+
+		traversalList.clear();
+		traversal = (GraphTraversal<Vertex, ?>) traversal.union(unionTemp);
+		// System.out.println("Getting out from Union -------------------> :
+		// "+traversal);
+		// traversalList.add(__.union(unionTemp));
+		// traversalList.clear();
+	}
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be34396c/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/TraversalBuilder.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/TraversalBuilder.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/TraversalBuilder.java
new file mode 100644
index 0000000..72a32a5
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/TraversalBuilder.java
@@ -0,0 +1,82 @@
+/*
+ * 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.sparql;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.Triple;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.structure.PropertyType;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+
+
+class TraversalBuilder {
+
+    public static GraphTraversal<?, ?> transform(final Triple triple) {
+        final GraphTraversal<Vertex, ?> matchTraversal = __.as(triple.getSubject().getName());
+        
+        final Node predicate = triple.getPredicate();
+        final String uri = predicate.getURI();
+        final String uriValue = Prefixes.getURIValue(uri);
+        final String prefix = Prefixes.getPrefix(uri);
+
+        switch (prefix) {
+            case "edge":
+                return matchTraversal.out(uriValue).as(triple.getObject().getName());
+            case "property":
+                return matchProperty(matchTraversal, uriValue, PropertyType.PROPERTY, triple.getObject());
+            case "value":
+                return matchProperty(matchTraversal, uriValue, PropertyType.VALUE, triple.getObject());
+            default:
+                throw new IllegalStateException(String.format("Unexpected predicate: %s", predicate));
+        }
+    }
+
+    private static GraphTraversal<?, ?> matchProperty(final GraphTraversal<?, ?> traversal, final String propertyName,
+                                                      final PropertyType type, final Node object) {
+        switch (propertyName) {
+            case "id":
+         
+                return object.isConcrete()
+                        ? traversal.hasId(object.getLiteralValue())
+                        : traversal.id().as(object.getName());
+            case "label":
+                return object.isConcrete()
+                        ? traversal.hasLabel(object.getLiteralValue().toString())
+                        : traversal.label().as(object.getName());
+            case "key":
+                return object.isConcrete()
+                        ? traversal.hasKey(object.getLiteralValue().toString())
+                        : traversal.key().as(object.getName());
+            case "value":
+                return object.isConcrete()
+                        ? traversal.hasValue(object.getLiteralValue().toString())
+                        : traversal.value().as(object.getName());
+            default:
+                if (type.equals(PropertyType.PROPERTY)) {
+                    return traversal.properties(propertyName).as(object.getName());
+                } else {
+                    return object.isConcrete()
+                            ? traversal.values(propertyName).is(object.getLiteralValue())
+                            : traversal.values(propertyName).as(object.getName());
+                }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be34396c/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/WhereTraversalBuilder.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/WhereTraversalBuilder.java b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/WhereTraversalBuilder.java
new file mode 100644
index 0000000..f4d49b6
--- /dev/null
+++ b/sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/WhereTraversalBuilder.java
@@ -0,0 +1,134 @@
+/*
+ * 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.sparql;
+
+import java.util.List;
+
+import org.apache.jena.graph.Triple;
+import org.apache.jena.sparql.algebra.op.OpBGP;
+import org.apache.jena.sparql.expr.E_Equals;
+import org.apache.jena.sparql.expr.E_Exists;
+import org.apache.jena.sparql.expr.E_GreaterThan;
+import org.apache.jena.sparql.expr.E_GreaterThanOrEqual;
+import org.apache.jena.sparql.expr.E_LessThan;
+import org.apache.jena.sparql.expr.E_LessThanOrEqual;
+import org.apache.jena.sparql.expr.E_LogicalAnd;
+import org.apache.jena.sparql.expr.E_LogicalOr;
+import org.apache.jena.sparql.expr.E_NotEquals;
+import org.apache.jena.sparql.expr.E_NotExists;
+import org.apache.jena.sparql.expr.E_StrLength;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.tinkerpop.gremlin.process.traversal.P;
+import org.apache.tinkerpop.gremlin.process.traversal.Step;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+
+class WhereTraversalBuilder {
+
+    public static GraphTraversal<?, ?> transform(final E_Equals expression) {
+    //	System.out.println("The aggr one : "+expression.getArg1().getClass().getName() + "The aggr one :"+expression.getArg2().getClass().getName());
+        final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
+        return __.as(expression.getArg1().getVarName()).is(P.eq(value));
+    }
+
+    public static GraphTraversal<?, ?> transform(final E_NotEquals expression) {
+        final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
+        return __.as(expression.getArg1().getVarName()).is(P.neq(value));
+    }
+
+    public static GraphTraversal<?, ?> transform(final E_LessThan expression) {
+    //	System.out.println("The aggr one : "+expression.getArg1().getClass().getName() + "The aggr one :"+expression.getArg2().getClass().getName());
+    	final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
+        return __.as(expression.getArg1().getVarName()).is(P.lt(value));
+    }
+
+    public static GraphTraversal<?, ?> transform(final E_LessThanOrEqual expression) {
+    //	System.out.println("The aggr one : "+expression.getArg1().getClass().getName() + "The aggr one :"+expression.getArg2().getClass().getName());
+        final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
+        return __.as(expression.getArg1().getVarName()).is(P.lte(value));
+    }
+
+    public static GraphTraversal<?, ?> transform(final E_GreaterThan expression) {
+        final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
+        return __.as(expression.getArg1().getVarName()).is(P.gt(value));
+    }
+
+    public static GraphTraversal<?, ?> transform(final E_GreaterThanOrEqual expression) {
+        final Object value = expression.getArg2().getConstant().getNode().getLiteralValue();
+        return __.as(expression.getArg1().getVarName()).is(P.gte(value));
+    }
+
+    public static GraphTraversal<?, ?> transform(final E_LogicalAnd expression) {
+        return __.and(
+                transform(expression.getArg1()),
+                transform(expression.getArg2()));
+    }
+
+    public static GraphTraversal<?, ?> transform(final E_LogicalOr expression) {
+        return __.or(
+                transform(expression.getArg1()),
+                transform(expression.getArg2()));
+    }
+
+    public static GraphTraversal<?, ?> transform(final E_Exists expression) {
+        final OpBGP opBGP = (OpBGP) expression.getGraphPattern();
+        final List<Triple> triples = opBGP.getPattern().getList();
+        if (triples.size() != 1) throw new IllegalStateException("Unhandled EXISTS pattern");
+        final GraphTraversal<?, ?> traversal = TraversalBuilder.transform(triples.get(0));
+        final Step endStep = traversal.asAdmin().getEndStep();
+        final String label = (String) endStep.getLabels().iterator().next();
+        endStep.removeLabel(label);
+        return traversal;
+    }
+    
+
+    public static GraphTraversal<?, ?> transform(final E_NotExists expression) {
+        final OpBGP opBGP = (OpBGP) expression.getGraphPattern();
+        final List<Triple> triples = opBGP.getPattern().getList();
+        if (triples.size() != 1) throw new IllegalStateException("Unhandled NOT EXISTS pattern");
+        final GraphTraversal<?, ?> traversal = TraversalBuilder.transform(triples.get(0));
+        final Step endStep = traversal.asAdmin().getEndStep();
+        final String label = (String) endStep.getLabels().iterator().next();
+        endStep.removeLabel(label);
+        return __.not(traversal);
+    }
+    
+    public static int getStrLength(final E_StrLength expression){
+    	
+    	return expression.getArg().toString().length();
+    	
+    }
+    
+    
+    //what does <?, ?> signify? possibly <S,E>
+    public static GraphTraversal<?, ?> transform(final Expr expression) {
+        if (expression instanceof E_Equals) return transform((E_Equals) expression);
+        if (expression instanceof E_NotEquals) return transform((E_NotEquals) expression);
+        if (expression instanceof E_LessThan) return transform((E_LessThan) expression);
+        if (expression instanceof E_LessThanOrEqual) return transform((E_LessThanOrEqual) expression);
+        if (expression instanceof E_GreaterThan) return transform((E_GreaterThan) expression);
+        if (expression instanceof E_GreaterThanOrEqual) return transform((E_GreaterThanOrEqual) expression);
+        if (expression instanceof E_LogicalAnd) return transform((E_LogicalAnd) expression);
+        if (expression instanceof E_LogicalOr) return transform((E_LogicalOr) expression);
+        if (expression instanceof E_Exists) return transform((E_Exists) expression);
+        if (expression instanceof E_NotExists) return transform((E_NotExists) expression);
+        throw new IllegalStateException(String.format("Unhandled expression: %s", expression));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be34396c/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/PrefixesTest.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/PrefixesTest.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/PrefixesTest.java
new file mode 100644
index 0000000..155680b
--- /dev/null
+++ b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/PrefixesTest.java
@@ -0,0 +1,67 @@
+/*
+ * 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.sparql;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class PrefixesTest {
+
+    final static String TEST_QUERY = String.join(System.lineSeparator(), "SELECT *", "WHERE {}");
+    final static String PREFIXED_QUERY = String.join(System.lineSeparator(),
+            "PREFIX e: <" + Prefixes.BASE_URI + "edge#>",
+            "PREFIX p: <" + Prefixes.BASE_URI + "property#>",
+            "PREFIX v: <" + Prefixes.BASE_URI + "value#>",
+            TEST_QUERY);
+
+    @Test
+    public void testGetURI() throws Exception {
+        final String prefix = "test";
+        final String uri = Prefixes.BASE_URI + prefix + "#";
+        assertEquals(uri, Prefixes.getURI(prefix));
+    }
+
+    @Test
+    public void testGetURIValue() throws Exception {
+        final String prefix = "test";
+        final String value = "value";
+        final String uri = Prefixes.getURI(prefix) + value;
+        assertEquals(value, Prefixes.getURIValue(uri));
+    }
+
+    @Test
+    public void testGetPrefix() throws Exception {
+        final String prefix = "test";
+        final String uri = Prefixes.getURI(prefix);
+        assertEquals(prefix, Prefixes.getPrefix(uri));
+    }
+
+    @Test
+    public void testPrependString() throws Exception {
+        assertEquals(PREFIXED_QUERY, Prefixes.prepend(TEST_QUERY));
+    }
+
+    @Test
+    public void testPrependStringBuilder() throws Exception {
+        final StringBuilder builder = new StringBuilder(TEST_QUERY);
+        assertEquals(PREFIXED_QUERY, Prefixes.prepend(builder).toString());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be34396c/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/ResourceHelper.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/ResourceHelper.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/ResourceHelper.java
new file mode 100644
index 0000000..4f58e61
--- /dev/null
+++ b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/ResourceHelper.java
@@ -0,0 +1,37 @@
+/*
+ * 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.sparql;
+
+import org.apache.commons.io.IOUtils;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author Daniel Kuppitz (http://gremlin.guru)
+ */
+public class ResourceHelper {
+
+    public static String loadQuery(final String prefix, final int number) throws IOException {
+        final String path = "/queries/" + prefix + number + ".sparql";
+        final InputStream stream = ResourceHelper.class.getResourceAsStream(path);
+        return IOUtils.toString(stream, "UTF-8");
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be34396c/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompilerTest.java
----------------------------------------------------------------------
diff --git a/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompilerTest.java b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompilerTest.java
new file mode 100644
index 0000000..3fb49e8
--- /dev/null
+++ b/sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/SparqlToGremlinCompilerTest.java
@@ -0,0 +1,223 @@
+/*
+ * 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.sparql;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.apache.tinkerpop.gremlin.process.computer.Computer;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import static org.apache.tinkerpop.gremlin.sparql.SparqlToGremlinCompiler.convertToGremlinTraversal;
+import static org.junit.Assert.assertEquals;
+
+
+import java.io.IOException;
+
+import static org.apache.tinkerpop.gremlin.sparql.ResourceHelper.loadQuery;
+
+
+public class SparqlToGremlinCompilerTest {
+
+    private Graph modern, crew;
+    private GraphTraversalSource mg, cg;
+    private GraphTraversalSource mc, cc;
+/*
+    @Before
+    public void setUp() throws Exception {
+        modern = TinkerFactory.createModern();
+        mg = modern.traversal();
+        mc = modern.traversal(computer());
+        crew = TinkerFactory.createTheCrew();
+        cg = modern.traversal();
+        cc = modern.traversal(computer());
+    }
+
+    @Ignore
+    @Test
+    public void play() throws IOException {
+        final String query = loadQuery("modern", 11);
+        final Traversal traversal = convertToGremlinTraversal(modern, query);
+        System.out.println(traversal);
+        System.out.println(traversal.toList());
+        System.out.println(traversal);
+    }
+
+    /* Modern */
+
+ /*   @Test
+    public void testModern1() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("a").hasLabel("person"),
+                as("a").out("knows").as("b"),
+                as("a").out("created").as("c"),
+                as("b").out("created").as("c"),
+                as("a").values("age").as("d")).where(as("d").is(lt(30))).
+                select("a", "b", "c");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 1)));
+    }
+
+    @Test
+    public void testModern2() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("a").hasLabel("person"),
+                as("a").out("knows").as("b"),
+                as("a").out("created").as("c"),
+                as("b").out("created").as("c"),
+                as("a").values("age").as("d")).where(as("d").is(lt(30)));
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 2)));
+    }
+
+    @Test
+    public void testModern3() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("person").values("name").as("name"),
+                as("person").values("age").as("age")).select("name", "age");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 3)));
+    }
+
+    @Test
+    public void testModern4() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("person").values("name").as("name"),
+                as("person").values("age").as("age"),
+                as("person").out("created").as("project"),
+                as("project").values("name").is("lop")).select("name", "age");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 4)));
+    }
+
+    @Test
+    public void testModern5() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("person").values("name").as("name"),
+                as("person").values("age").is(29)).select("name");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 5)));
+    }
+
+    @Test
+    public void testModern6() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("person").values("name").as("name"),
+                as("person").values("age").as("age")).where(and(as("age").is(gt(30)), as("age").is(lt(40)))).
+                select("name", "age");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 6)));
+    }
+
+    @Test
+    public void testModern7() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("person").values("name").as("name"),
+                as("person").values("age").as("age")).where(or(as("age").is(lt(30)), as("age").is(gt(40)))).
+                select("name", "age");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 7)));
+    }
+
+    @Test
+    public void testModern8() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("person").values("name").as("name"),
+                as("person").values("age").as("age")).where(
+                or(and(as("age").is(gt(30)), as("age").is(lt(40))), as("name").is("marko"))).
+                select("name", "age");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 8)));
+    }
+
+    @Test
+    public void testModern9() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("a").values("name").as("name")).where(as("a").values("age")).
+                select("name");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 9)));
+    }
+
+    @Test
+    public void testModern10() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("a").values("name").as("name")).where(__.not(as("a").values("age"))).
+                select("name");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 10)));
+    }
+
+    @Test
+    public void testModern11() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("a").out("created").as("b"),
+                as("a").values("name").as("name")).dedup("name").select("name");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 11)));
+    }
+
+    @Test
+    public void testModern12() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("a").out("created").as("b"),
+                as("b").values("name").as("name")).dedup();
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 12)));
+    }
+
+    @Test
+    public void testModern13() throws Exception {
+        final GraphTraversal expected = mg.V().match(
+                as("a").out("created").as("b"),
+                as("a").values("name").as("c")).dedup("a", "b", "c").select("a", "b", "c");
+        assertEquals(expected, convertToGremlinTraversal(modern, loadQuery("modern", 13)));
+    }
+
+    /* The Crew */
+
+ /*   @Test
+    public void testCrew1() throws Exception {
+        final GraphTraversal expected = cg.V().match(
+                as("a").values("name").is("daniel"),
+                as("a").properties("location").as("b"),
+                as("b").value().as("c"),
+                as("b").values("startTime").as("d")).
+                select("c", "d");
+        assertEquals(expected, convertToGremlinTraversal(crew, loadQuery("crew", 1)));
+    }
+
+    /* Computer Mode */
+
+  /*  @Test
+    public void testModernInComputerMode() throws Exception {
+        final GraphTraversal expected = mc.V().match(
+                as("a").hasLabel("person"),
+                as("a").out("knows").as("b"),
+                as("a").out("created").as("c"),
+                as("b").out("created").as("c"),
+                as("a").values("age").as("d")).where(as("d").is(lt(30))).
+                select("a", "b", "c");
+        assertEquals(expected, convertToGremlinTraversal(mc, loadQuery("modern", 1)));
+    }
+
+    @Test
+    public void testCrewInComputerMode() throws Exception {
+        final GraphTraversal expected = cc.V().match(
+                as("a").values("name").is("daniel"),
+                as("a").properties("location").as("b"),
+                as("b").value().as("c"),
+                as("b").values("startTime").as("d")).
+                select("c", "d");
+        assertEquals(expected, convertToGremlinTraversal(crew, loadQuery("crew", 1)));
+    } */
+}
\ No newline at end of file


[50/50] tinkerpop git commit: TINKERPOP-1878 Added basic docs for sparql-gremlin

Posted by sp...@apache.org.
TINKERPOP-1878 Added basic docs for sparql-gremlin


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

Branch: refs/heads/TINKERPOP-1878
Commit: 685c711ee817d102aab5b5655af5c7a5c5c1a328
Parents: 4d3bddb
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jan 29 11:04:23 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sun May 13 10:34:02 2018 -0400

----------------------------------------------------------------------
 docs/preprocessor/install-plugins.sh    |  2 +-
 docs/src/reference/index.asciidoc       |  2 +
 docs/src/reference/transpilers.asciidoc | 66 ++++++++++++++++++++++++++++
 3 files changed, 69 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/685c711e/docs/preprocessor/install-plugins.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/install-plugins.sh b/docs/preprocessor/install-plugins.sh
index 0a7ca31..f1da197 100755
--- a/docs/preprocessor/install-plugins.sh
+++ b/docs/preprocessor/install-plugins.sh
@@ -25,7 +25,7 @@ TMP_DIR=$3
 INSTALL_TEMPLATE="docs/preprocessor/install-plugins.groovy"
 INSTALL_FILE="${TMP_DIR}/install-plugins.groovy"
 
-plugins=("hadoop-gremlin" "spark-gremlin" "neo4j-gremlin")
+plugins=("hadoop-gremlin" "spark-gremlin" "neo4j-gremlin", "sparql-gremlin")
 # plugins=()
 pluginsCount=${#plugins[@]}
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/685c711e/docs/src/reference/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/index.asciidoc b/docs/src/reference/index.asciidoc
index 6e81bf2..02a218b 100644
--- a/docs/src/reference/index.asciidoc
+++ b/docs/src/reference/index.asciidoc
@@ -45,6 +45,8 @@ include::implementations-hadoop-end.asciidoc[]
 
 include::gremlin-variants.asciidoc[]
 
+include::transpilers.asciidoc[]
+
 include::conclusion.asciidoc[]
 
 include::acknowledgements.asciidoc[]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/685c711e/docs/src/reference/transpilers.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/transpilers.asciidoc b/docs/src/reference/transpilers.asciidoc
new file mode 100644
index 0000000..305e3dc
--- /dev/null
+++ b/docs/src/reference/transpilers.asciidoc
@@ -0,0 +1,66 @@
+////
+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.
+////
+[[transpilers]]
+= Gremlin Transpilers
+
+There are many languages built to query data. SQL is typically used to query relational data. There is SPARQL for RDF
+data. Cypher is used to do pattern matching in graph data. The list could go on. Transpilers convert languages like
+these to Gremlin so that it becomes possible to use them in any context that Gremlin is used. In other words, a
+Gremlin Transpiler enables a particular query language to work on any TinkerPop-enabled graph system.
+
+== SPARQL-Gremlin
+
+[source,xml]
+----
+<dependency>
+   <groupId>org.apache.tinkerpop</groupId>
+   <artifactId>sparql-gremlin</artifactId>
+   <version>x.y.z</version>
+</dependency>
+----
+
+The SPARQL-Gremlin transpiler converts link:https://en.wikipedia.org/wiki/SPARQL[SPARQL] queries into Gremlin so that
+they can be executed across any TinkerPop-enabled graph system. To use this transpiler in the Gremlin Console, first
+install and activate the "tinkerpop.sparql" plugin:
+
+[source,text]
+----
+gremlin> :install org.apache.tinkerpop sparql-gremlin x.y.z
+==>Loaded: [org.apache.tinkerpop, sparql-gremlin, x.y.z]
+gremlin> :plugin use tinkerpop.sparql
+==>tinkerpop.sparql activated
+----
+
+Installing this plugin will download appropriate dependencies and import certain classes to the console so that they
+may be used as follows:
+
+[gremlin-groovy,modern]
+----
+graph = TinkerFactory.createModern()
+g = graph.traversal(SparqlTraversalSource)                                                             <1>
+g.sparql("""SELECT ?name ?age
+            WHERE { ?person v:name ?name . ?person v:age ?age }
+            ORDER BY ASC(?age)""")                                                                     <2>
+----
+
+<1> Define `g` as a `TraversalSource` that uses the `SparqlTraversalSource` - by default, the `traversal()` method
+usually returns a `GraphTraversalSource` which includes the standard Gremlin starts steps like `V()` or `E()`. In this
+case, the `SparqlTraversalSource` enables starts steps that are specific to SPARQL only - in this case the `sparql()`
+start step.
+<2> Execute a SPARQL query against the TinkerGraph instance. The `SparqlTraversalSource` uses a
+<<traversalstrategy,TraversalStrategy>> to transparently converts that SPARQL query into a standard Gremlin traversal
+and then when finally iterated, executes that against the TinkerGraph.