You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2015/06/03 02:12:06 UTC

[01/50] [abbrv] incubator-tinkerpop git commit: Update README with neo4j-gremlin instructions.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/preprocessor 130d94556 -> 91c6d02fc


Update README with neo4j-gremlin instructions.


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

Branch: refs/heads/preprocessor
Commit: d43cca7a93b2cdeff5f53260518a3a2b6b472295
Parents: 0285ef6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 07:53:44 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 07:53:44 2015 -0400

----------------------------------------------------------------------
 README.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d43cca7a/README.asciidoc
----------------------------------------------------------------------
diff --git a/README.asciidoc b/README.asciidoc
index c325001..ce76e78 100644
--- a/README.asciidoc
+++ b/README.asciidoc
@@ -41,6 +41,7 @@ mvn -Dmaven.javadoc.skip=true --projects tinkergraph-gremlin test
 ----
 ** Clean the `.groovy/grapes/org.apache.tinkerpop` directory on build: `mvn clean install -DcleanGrapes`
 ** Turn off "heavy" logging in the "process" tests: `mvn clean install -DargLine="-DmuteTestLogs=true"`
+** The test suite for `neo4j-gremlin` is disabled by default - to turn it on: `mvn clean install -DincludeNeo4j`
 * Regenerate test data (only necessary given changes to IO classes): `mvn clean install -Dio` from `tinkergraph-gremlin` directory
 ** If there are changes to the Gryo format, it may be necessary to generate the Grateful Dead dataset from GraphSON (see `IoDataGenerationTest.shouldWriteGratefulDead`)
 * Check license headers are present: `mvn apache-rat:check`


[04/50] [abbrv] incubator-tinkerpop git commit: Added a comment about getting debug info out of ivy when running :install.

Posted by dk...@apache.org.
Added a comment about getting debug info out of ivy when running :install.


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

Branch: refs/heads/preprocessor
Commit: f535f1cd287930d862e954f5855e6b5190d5bffa
Parents: 1f9a69e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 10:51:32 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 10:51:32 2015 -0400

----------------------------------------------------------------------
 gremlin-console/src/main/bin/gremlin.sh | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f535f1cd/gremlin-console/src/main/bin/gremlin.sh
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/bin/gremlin.sh b/gremlin-console/src/main/bin/gremlin.sh
index fee3f5b..c592117 100755
--- a/gremlin-console/src/main/bin/gremlin.sh
+++ b/gremlin-console/src/main/bin/gremlin.sh
@@ -96,5 +96,7 @@ if [ -n "$SCRIPT_DEBUG" ]; then
     set -x
 fi
 
+# include the following in $JAVA_OPTIONS "-Divy.message.logger.level=4 -Dgroovy.grape.report.downloads=true" to debug :install
+
 # Start the JVM, execute the application, and return its exit code
 exec $JAVA $JAVA_OPTIONS $MAIN_CLASS "$@"


[41/50] [abbrv] incubator-tinkerpop git commit: Merge branch 'master' into preprocessor

Posted by dk...@apache.org.
Merge branch 'master' into preprocessor


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

Branch: refs/heads/preprocessor
Commit: 38a073356f66a551d18d6092bfebdde1754307ee
Parents: bb7d249 15d8da0
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Jun 1 19:38:42 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Jun 1 19:38:42 2015 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   8 +-
 README.asciidoc                                 |   3 +
 docs/src/gremlin-applications.asciidoc          |   2 +
 docs/src/implementations.asciidoc               | 171 ++++-
 docs/src/the-graph.asciidoc                     |  30 +-
 gremlin-console/src/assembly/distribution.xml   |   3 +-
 gremlin-console/src/assembly/standalone.xml     |   4 +
 gremlin-console/src/main/bin/gremlin.sh         |   2 +
 .../gremlin/console/GremlinGroovysh.groovy      |   2 +
 .../plugin/gremlin-server-integration.yaml      |   4 +-
 gremlin-core/pom.xml                            |   7 +
 .../traversal/dsl/graph/GraphTraversal.java     | 185 +++--
 .../traversal/lambda/FilterTraversal.java       |  52 --
 .../lambda/FilterTraverserTraversal.java        |  52 --
 .../traversal/lambda/FunctionTraverser.java     |  44 ++
 .../process/traversal/lambda/MapTraversal.java  |  52 --
 .../traversal/lambda/MapTraverserTraversal.java |  52 --
 .../traversal/lambda/PredicateTraverser.java    |  44 ++
 .../tinkerpop/gremlin/structure/Graph.java      |  53 ++
 .../tinkerpop/gremlin/structure/Vertex.java     |   6 +-
 .../structure/io/graphml/GraphMLReader.java     |  18 +-
 .../structure/io/graphson/GraphSONReader.java   |   4 +-
 .../io/graphson/LegacyGraphSONReader.java       |  21 +-
 .../gremlin/structure/io/gryo/GryoReader.java   |   4 +-
 .../gremlin/structure/util/Attachable.java      |  31 +-
 .../gremlin/structure/util/Comparators.java     |  26 +-
 .../gremlin/structure/util/ElementHelper.java   |  74 +-
 .../gremlin/structure/util/GraphFactory.java    |  14 +-
 .../structure/util/GraphVariableHelper.java     |   4 +-
 .../gremlin/structure/util/star/StarGraph.java  | 111 +++
 .../gremlin/util/iterator/IteratorUtils.java    |  13 +-
 .../apache/tinkerpop/gremlin/TestHelper.java    |  20 +
 .../gremlin/structure/util/ComparatorsTest.java | 111 +++
 .../structure/util/ElementHelperTest.java       |  83 ++-
 .../structure/util/GraphFactoryTest.java        | 323 +++++++++
 .../structure/util/GraphVariableHelperTest.java |  72 ++
 .../structure/util/StringFactoryTest.java       |  32 +
 .../structure/util/mockgraph-busted.yaml        |  20 +
 .../gremlin/structure/util/mockgraph.properties |  18 +
 .../gremlin/structure/util/mockgraph.xml        |  22 +
 .../gremlin/structure/util/mockgraph.yaml       |  19 +
 gremlin-driver/pom.xml                          |   6 -
 ...raphSONMessageSerializerGremlinV1d0Test.java | 267 ++++++++
 .../ser/GraphSONMessageSerializerV1d0Test.java  | 357 ++++++++++
 .../JsonMessageSerializerGremlinV1d0Test.java   | 267 --------
 .../ser/JsonMessageSerializerV1d0Test.java      | 354 ----------
 .../step/branch/GroovyChooseTest.groovy         |   9 +-
 .../gremlin/groovy/engine/GremlinExecutor.java  |  44 +-
 .../groovy/engine/GremlinExecutorTest.java      | 113 +++-
 .../groovy/engine/GremlinExecutorInit.groovy    |   5 +-
 .../apache/tinkerpop/gremlin/GraphProvider.java |   4 +-
 .../traversal/step/branch/ChooseTest.java       |  18 +-
 .../gremlin/structure/FeatureSupportTest.java   | 177 ++++-
 .../structure/GraphConstructionTest.java        |   4 +-
 .../tinkerpop/gremlin/structure/io/IoTest.java  |  18 +-
 .../process/computer/spark/SparkExecutor.java   |   9 +-
 .../gremlin/hadoop/structure/HadoopGraph.java   |   5 +
 .../groovy/plugin/HadoopGremlinPluginTest.java  |   5 +-
 neo4j-gremlin/pom.xml                           | 171 +++++
 .../neo4j/groovy/plugin/Neo4jGremlinPlugin.java |  58 ++
 .../step/sideEffect/CypherStartStep.java        |  54 ++
 .../step/sideEffect/Neo4jGraphStep.java         |  69 ++
 .../optimization/Neo4jGraphStepStrategy.java    |  70 ++
 .../neo4j/process/util/Neo4jCypherIterator.java |  64 ++
 .../gremlin/neo4j/structure/Neo4jEdge.java      | 132 ++++
 .../gremlin/neo4j/structure/Neo4jElement.java   |  79 +++
 .../gremlin/neo4j/structure/Neo4jGraph.java     | 549 +++++++++++++++
 .../neo4j/structure/Neo4jGraphVariables.java    | 176 +++++
 .../gremlin/neo4j/structure/Neo4jHelper.java    |  64 ++
 .../gremlin/neo4j/structure/Neo4jProperty.java  |  94 +++
 .../gremlin/neo4j/structure/Neo4jVertex.java    | 177 +++++
 .../neo4j/structure/Neo4jVertexProperty.java    | 121 ++++
 .../structure/trait/MultiMetaNeo4jTrait.java    | 282 ++++++++
 .../neo4j/structure/trait/Neo4jTrait.java       |  75 +++
 .../trait/NoMultiNoMetaNeo4jTrait.java          | 201 ++++++
 ...inkerpop.gremlin.groovy.plugin.GremlinPlugin |   1 +
 .../neo4j/AbstractNeo4jGraphProvider.java       | 158 +++++
 .../gremlin/neo4j/AbstractNeo4jGremlinTest.java |  50 ++
 .../neo4j/MultiMetaNeo4jGraphProvider.java      |  44 ++
 .../gremlin/neo4j/NativeNeo4jSuite.java         |  52 ++
 .../neo4j/NoMultiNoMetaNeo4jGraphProvider.java  |  47 ++
 .../MultiMetaNeo4jGraphProcessStandardTest.java |  36 +
 .../neo4j/process/NativeNeo4jCypherTest.java    | 125 ++++
 ...ultiNoMetaNeo4jGraphProcessStandardTest.java |  36 +
 ...MetaNeo4jGraphGroovyProcessStandardTest.java |  33 +
 ...MetaNeo4jGraphGroovyProcessStandardTest.java |  37 +
 .../MultiMetaNeo4jGraphNativeNeo4jTest.java     |  35 +
 ...ultiMetaNeo4jGraphStructureStandardTest.java |  35 +
 .../neo4j/structure/NativeNeo4jIndexTest.java   |  60 ++
 .../structure/NativeNeo4jStructureTest.java     | 669 +++++++++++++++++++
 .../NoMultiNoMetaNeo4jGraphNativeNeo4jTest.java |  35 +
 ...tiNoMetaNeo4jGraphStructureStandardTest.java |  35 +
 pom.xml                                         |  66 +-
 .../tinkergraph/structure/TinkerFactory.java    |   4 +-
 .../tinkergraph/structure/TinkerGraph.java      | 100 ++-
 .../tinkergraph/structure/TinkerVertex.java     |   5 -
 .../tinkergraph/TinkerGraphProvider.java        |  15 +
 97 files changed, 6494 insertions(+), 1098 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/38a07335/docs/src/implementations.asciidoc
----------------------------------------------------------------------


[19/50] [abbrv] incubator-tinkerpop git commit: commented out neo4j-gremlin module until neo4j pushes apache API to Central Repo.

Posted by dk...@apache.org.
commented out neo4j-gremlin module until neo4j pushes apache API to Central Repo.


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

Branch: refs/heads/preprocessor
Commit: 1e7e1615912daacd5e3d8d6c43232a3b109689bb
Parents: 7b528b2
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 12:43:12 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 12:43:12 2015 -0600

----------------------------------------------------------------------
 pom.xml | 67 ++++++++++++++++++++++++++++++++++++++++++------------------
 1 file changed, 47 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1e7e1615/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 76bccae..501ffe2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,7 +82,8 @@ limitations under the License.
         <module>gremlin-groovy-test</module>
         <module>tinkergraph-gremlin</module>
         <module>hadoop-gremlin</module>
-        <module>neo4j-gremlin</module>
+        <!-- UNCOMMENT WHEN ARTIFACTS ARE PUSHED TO CENTRAL REPO -->
+        <!-- <module>neo4j-gremlin</module> -->
         <module>gremlin-driver</module>
         <module>gremlin-console</module>
         <module>gremlin-server</module>
@@ -761,27 +762,53 @@ limitations under the License.
                                     <quiet>true</quiet>
                                     <sourceFileIncludes>
                                         <!-- structure -->
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/structure/*.java</sourceFileInclude>
-                                          <!-- io -->
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/structure/io/*.java</sourceFileInclude>
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java</sourceFileInclude>
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java</sourceFileInclude>
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java</sourceFileInclude>
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONWrtier.java</sourceFileInclude>
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java</sourceFileInclude>
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWrtier.java</sourceFileInclude>
+                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/structure/*.java
+                                        </sourceFileInclude>
+                                        <!-- io -->
+                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/structure/io/*.java
+                                        </sourceFileInclude>
+                                        <sourceFileInclude>
+                                            org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java
+                                        </sourceFileInclude>
+                                        <sourceFileInclude>
+                                            org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java
+                                        </sourceFileInclude>
+                                        <sourceFileInclude>
+                                            org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
+                                        </sourceFileInclude>
+                                        <sourceFileInclude>
+                                            org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONWrtier.java
+                                        </sourceFileInclude>
+                                        <sourceFileInclude>
+                                            org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
+                                        </sourceFileInclude>
+                                        <sourceFileInclude>
+                                            org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWrtier.java
+                                        </sourceFileInclude>
                                         <!-- process -->
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/process/*.java</sourceFileInclude>
-                                          <!-- computer -->
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/process/computer/*.java</sourceFileInclude>
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java</sourceFileInclude>
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java</sourceFileInclude>
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java</sourceFileInclude>
-                                          <!-- traversal -->
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/process/traversal/*.java</sourceFileInclude>
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java</sourceFileInclude>
+                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/process/*.java
+                                        </sourceFileInclude>
+                                        <!-- computer -->
+                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/process/computer/*.java
+                                        </sourceFileInclude>
+                                        <sourceFileInclude>
+                                            org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
+                                        </sourceFileInclude>
+                                        <sourceFileInclude>
+                                            org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
+                                        </sourceFileInclude>
+                                        <sourceFileInclude>
+                                            org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
+                                        </sourceFileInclude>
+                                        <!-- traversal -->
+                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/process/traversal/*.java
+                                        </sourceFileInclude>
+                                        <sourceFileInclude>
+                                            org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+                                        </sourceFileInclude>
                                         <!-- driver -->
-                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/driver/*.java</sourceFileInclude>
+                                        <sourceFileInclude>org/apache/tinkerpop/gremlin/driver/*.java
+                                        </sourceFileInclude>
                                     </sourceFileIncludes>
                                     <additionalDependencies>
                                         <!-- all that exclusion work in hadoop-gremlin seems to dump dependencies needed for javadoc -->


[33/50] [abbrv] incubator-tinkerpop git commit: Update changelog.

Posted by dk...@apache.org.
Update changelog.


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

Branch: refs/heads/preprocessor
Commit: 96bc1ad21fe0f59361e956ce017f426c1d4264c5
Parents: 08c1e27
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 06:46:20 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 06:46:20 2015 -0400

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


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/96bc1ad2/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 7cbe410..5e707d6 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@ image::http://www.tinkerpop.com/docs/current/images/gremlin-hindu.png[width=225]
 TinkerPop 3.0.0.GA (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Dropped dependency on `org.json:json` - used existing Jackson dependency.
 * Added back neo4j-gremlin as the licensing of the Neo4j API is now Apache2.
 * Added `willAllowId` method to features related to vertices, edges and vertex properties to test if an identifier can be use when `supportsUserSuppliedIds` is `true`.
 * Fixed a bug in `GraphTraversal.choose(predicate,trueTraversal,falseTraversal)`.


[20/50] [abbrv] incubator-tinkerpop git commit: a stub for default cardinality in TinkerGraph. @spmallette.

Posted by dk...@apache.org.
a stub for default cardinality in TinkerGraph. @spmallette.


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

Branch: refs/heads/preprocessor
Commit: 2b3a682f5fd7df8135c5b8f15a6b923c007ca32c
Parents: 1e7e161
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 12:58:35 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 12:58:35 2015 -0600

----------------------------------------------------------------------
 .../gremlin/neo4j/structure/Neo4jGraph.java          | 10 ++++++++++
 .../gremlin/tinkergraph/structure/TinkerGraph.java   | 15 ++++++++++++---
 .../gremlin/tinkergraph/structure/TinkerVertex.java  |  4 ++--
 3 files changed, 24 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b3a682f/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
index 07aa0ef..34a527f 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
@@ -22,11 +22,13 @@ import org.apache.commons.configuration.BaseConfiguration;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationConverter;
 import org.apache.tinkerpop.gremlin.neo4j.process.traversal.step.sideEffect.CypherStartStep;
+import org.apache.tinkerpop.gremlin.neo4j.process.traversal.strategy.optimization.Neo4jGraphStepStrategy;
 import org.apache.tinkerpop.gremlin.neo4j.process.util.Neo4jCypherIterator;
 import org.apache.tinkerpop.gremlin.neo4j.structure.trait.MultiMetaNeo4jTrait;
 import org.apache.tinkerpop.gremlin.neo4j.structure.trait.Neo4jTrait;
 import org.apache.tinkerpop.gremlin.neo4j.structure.trait.NoMultiNoMetaNeo4jTrait;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -67,6 +69,14 @@ import java.util.stream.Stream;
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_PERFORMANCE)
 public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
 
+    static {
+        TraversalStrategies.GlobalCache.registerStrategies(Neo4jGraph.class, TraversalStrategies.GlobalCache.getStrategies(Graph.class).clone().addStrategies(Neo4jGraphStepStrategy.instance()));
+    }
+
+    private static final Configuration EMPTY_CONFIGURATION = new BaseConfiguration() {{
+        this.setProperty(Graph.GRAPH, Neo4jGraph.class.getName());
+    }};
+
     protected Features features = new Neo4jGraphFeatures();
 
     protected Neo4jGraphAPI baseGraph;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b3a682f/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
index bb127c4..f76d8f2 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
@@ -76,6 +76,7 @@ public final class TinkerGraph implements Graph {
     public static final String CONFIG_VERTEX_ID = "gremlin.tinkergraph.vertexIdManager";
     public static final String CONFIG_EDGE_ID = "gremlin.tinkergraph.edgeIdManager";
     public static final String CONFIG_VERTEX_PROPERTY_ID = "gremlin.tinkergraph.vertexPropertyIdManager";
+    public static final String CONFIG_DEFAULT_VERTEX_PROPERTY_CARDINALITY = "gremlin.tinkergraph.defaultVertexPropertyCardinality";
 
     private final TinkerGraphFeatures features = new TinkerGraphFeatures();
 
@@ -91,6 +92,7 @@ public final class TinkerGraph implements Graph {
     protected final IdManager<?> vertexIdManager;
     protected final IdManager<?> edgeIdManager;
     protected final IdManager<?> vertexPropertyIdManager;
+    //protected final VertexProperty.Cardinality defaultVertexPropertyCardinality;
 
     private final Configuration configuration;
 
@@ -99,9 +101,10 @@ public final class TinkerGraph implements Graph {
      */
     private TinkerGraph(final Configuration configuration) {
         this.configuration = configuration;
-        vertexIdManager = selectIdManager(configuration, CONFIG_VERTEX_ID, Vertex.class);
-        edgeIdManager = selectIdManager(configuration, CONFIG_EDGE_ID, Edge.class);
-        vertexPropertyIdManager = selectIdManager(configuration, CONFIG_VERTEX_PROPERTY_ID, VertexProperty.class);
+        this.vertexIdManager = selectIdManager(configuration, CONFIG_VERTEX_ID, Vertex.class);
+        this.edgeIdManager = selectIdManager(configuration, CONFIG_EDGE_ID, Edge.class);
+        this.vertexPropertyIdManager = selectIdManager(configuration, CONFIG_VERTEX_PROPERTY_ID, VertexProperty.class);
+        //this.defaultVertexPropertyCardinality = VertexProperty.Cardinality.valueOf(configuration.getString(CONFIG_DEFAULT_VERTEX_PROPERTY_CARDINALITY, "single"));
     }
 
     /**
@@ -310,6 +313,12 @@ public final class TinkerGraph implements Graph {
         public boolean willAllowId(final Object id) {
             return vertexIdManager.allow(id);
         }
+
+        /*@Override
+        public VertexProperty.Cardinality getCardinality(final String key) {
+            return VertexProperty.Cardinality.single;
+            //return defaultVertexPropertyCardinality;
+        }*/
     }
 
     public class TinkerGraphEdgeFeatures implements Features.EdgeFeatures {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2b3a682f/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
index cd27376..2378e97 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
@@ -82,10 +82,10 @@ public final class TinkerVertex extends TinkerElement implements Vertex {
         }
     }
 
-    @Override
+    /*@Override
     public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
         return this.property(VertexProperty.Cardinality.single, key, value, keyValues);
-    }
+    }*/
 
     @Override
     public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {


[49/50] [abbrv] incubator-tinkerpop git commit: added dynamic code sample for Neo4j

Posted by dk...@apache.org.
added dynamic code sample for Neo4j


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

Branch: refs/heads/preprocessor
Commit: 62e4a1bd5a4eb4a2d1fc885463939e077a2f6687
Parents: 1a60158
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Jun 3 01:51:53 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Jun 3 01:51:53 2015 +0200

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 38 ++++++++++++++++++++++++++++++----
 1 file changed, 34 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/62e4a1bd/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index 2b01353..5c120d1 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -589,6 +589,20 @@ gremlin> g = graph.traversal(standard())
 gremlin> g.V().hasLabel('person').has('name','marko').values('name')
 ==>marko
 
+[gremlin-groovy]
+----
+graph = Neo4jGraph.open('/tmp/neo4j')
+graph.cypher("CREATE INDEX ON :person(name)")
+graph.tx().commit()  <1>
+graph.addVertex(label,'person','name','marko')
+graph.addVertex(label,'dog','name','puppy')
+g = graph.traversal(standard())
+g.V().hasLabel('person').has('name','marko').values('name')
+graph.close()
+----
+
+<1> schema mutations must happen in a different tx than graph mutations
+
 Below demonstrates the runtime benefits of indices and demonstrates how if there is no defined index (only vertex labels), a linear scan of the vertex-label partition is still faster than a linear scan of all vertices.
 
 [source,groovy]
@@ -613,6 +627,22 @@ gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').next()} <5>
 gremlin> clock(1000){g.V().has('name','Garcia').next()} <6>
 ==>0.6293959999999993
 
+[gremlin-groovy]
+----
+graph = Neo4jGraph.open('/tmp/neo4j')
+graph.cypher("CREATE INDEX ON :artist(name)") <1>
+graph.tx().commit()
+graph.io(graphml()).readGraph('data/grateful-dead.xml')
+g = graph.traversal(standard())
+clock(1000) {g.V().hasLabel('artist').has('name','Garcia').next()}  <2>
+clock(1000) {g.V().has('name','Garcia').next()} <3>
+graph.cypher("DROP INDEX ON :artist(name)") <4>
+g.tx().commit()
+clock(1000) {g.V().hasLabel('artist').has('name','Garcia').next()} <5>
+clock(1000) {g.V().has('name','Garcia').next()} <6>
+graph.close()
+----
+
 <1> Create an index for all artist vertices on their name property.
 <2> Find all artists whose name is Garcia which uses the pre-defined schema index.
 <3> Find all vertices whose name is Garcia which requires a linear scan of all the data in the graph.
@@ -731,7 +761,7 @@ gremlin>
 Properties Files
 ~~~~~~~~~~~~~~~~
 
-`HadoopGraph` makes heavy use of properties files which ultimately get turned into Apache configurations and Hadoop configurations. The example properties file presented below is located at `conf/hadoop-gryo.properties`.
+`HadoopGraph` makes heavy use of properties files which ultimately get turned into Apache configurations and Hadoop configurations. The example properties file presented below is located at `conf/hadoop/hadoop-gryo.properties`.
 
 [source,text]
 gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph
@@ -807,7 +837,7 @@ gremlin> g.V().group().by{it.value('name')[1]}.by('name').next()
 ----
 hdfs.copyFromLocal('data/tinkerpop-modern.kryo', 'tinkerpop-modern.kryo')
 hdfs.ls()
-graph = GraphFactory.open('conf/hadoop-gryo.properties')
+graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
 g = graph.traversal(standard())
 g.V().count()
 g.V().out().out().values('name')
@@ -871,7 +901,7 @@ INFO  org.apache.hadoop.mapred.JobClient  -  map 0% reduce 0%
 
 [gremlin-groovy]
 ----
-graph = GraphFactory.open('conf/hadoop-gryo.properties')
+graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
 g = graph.traversal(computer())
 g.V().count()
 g.V().out().out().values('name')
@@ -924,7 +954,7 @@ gremlin> g.V().out().out().values('name')
 
 [gremlin-groovy]
 ----
-graph = GraphFactory.open('conf/hadoop-gryo.properties')
+graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
 g = graph.traversal(computer(SparkGraphComputer))
 g.V().count()
 g.V().out().out().values('name')


[40/50] [abbrv] incubator-tinkerpop git commit: removed unnecessary code

Posted by dk...@apache.org.
removed unnecessary code


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

Branch: refs/heads/preprocessor
Commit: bb7d24936d430dee6c6153dccd7880f515a16db7
Parents: 130d945
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Jun 1 19:38:19 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Jun 1 19:38:19 2015 +0200

----------------------------------------------------------------------
 docs/preprocessor/processor.groovy | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb7d2493/docs/preprocessor/processor.groovy
----------------------------------------------------------------------
diff --git a/docs/preprocessor/processor.groovy b/docs/preprocessor/processor.groovy
index 37b88ab..d4831d6 100644
--- a/docs/preprocessor/processor.groovy
+++ b/docs/preprocessor/processor.groovy
@@ -54,7 +54,6 @@ stringify = { def string ->
     "\"ΒΆ" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll(/"/, "\\\\\"").replaceAll(/\$/, "\\\\\\\$") + "\""
 }
 
-//println "try {"
 println stringify("START")
 
 new File(this.args[0]).withReader { reader ->
@@ -149,6 +148,3 @@ new File(this.args[0]).withReader { reader ->
 }
 
 println "System.exit(0)"
-//println "} catch (Exception e) {"
-//println "  System.exit(1)"
-//println "}"


[14/50] [abbrv] incubator-tinkerpop git commit: fixed a bug in Exception throwing.

Posted by dk...@apache.org.
fixed a bug in Exception throwing.


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

Branch: refs/heads/preprocessor
Commit: 24c88a0b94042f0e3c243e42bf7d24c8bdcbb974
Parents: 364a243
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 11:07:22 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 11:07:22 2015 -0600

----------------------------------------------------------------------
 .../structure/trait/MultiMetaNeo4jTrait.java    | 21 ++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/24c88a0b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
index 9133921..6b4b2a3 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
@@ -26,6 +26,7 @@ import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jProperty;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
+import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.T;
@@ -216,19 +217,19 @@ public class MultiMetaNeo4jTrait implements Neo4jTrait {
 
     @Override
     public <V> Property<V> getProperty(final Neo4jVertexProperty vertexProperty, final String key) {
-        //try {
-        final Neo4jNode vertexPropertyNode = Neo4jHelper.getVertexPropertyNode(vertexProperty);
-        if (null != vertexPropertyNode && vertexPropertyNode.hasProperty(key))
-            return new Neo4jProperty<>(vertexProperty, key, (V) vertexPropertyNode.getProperty(key));
-        else
-            return Property.empty();
-        /*} catch (IllegalStateException ex) {
-            throw Element.Exceptions.elementAlreadyRemoved(this.getClass(), this.id());
+        try {
+            final Neo4jNode vertexPropertyNode = Neo4jHelper.getVertexPropertyNode(vertexProperty);
+            if (null != vertexPropertyNode && vertexPropertyNode.hasProperty(key))
+                return new Neo4jProperty<>(vertexProperty, key, (V) vertexPropertyNode.getProperty(key));
+            else
+                return Property.empty();
+        } catch (IllegalStateException ex) {
+            throw Element.Exceptions.elementAlreadyRemoved(vertexProperty.getClass(), vertexProperty.id());
         } catch (RuntimeException ex) {
             if (Neo4jHelper.isNotFound(ex))
-                throw Element.Exceptions.elementAlreadyRemoved(this.getClass(), this.id());
+                throw Element.Exceptions.elementAlreadyRemoved(vertexProperty.getClass(), vertexProperty.id());
             throw ex;
-        }*/
+        }
     }
 
     @Override


[44/50] [abbrv] incubator-tinkerpop git commit: Finalize classes in GraphSON.

Posted by dk...@apache.org.
Finalize classes in GraphSON.


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

Branch: refs/heads/preprocessor
Commit: 67ad95ec8d06160bfed00e4b1163edf74cc8d007
Parents: 1dd487c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 14:40:24 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 14:40:24 2015 -0400

----------------------------------------------------------------------
 .../structure/io/graphson/GraphSONIo.java       |  6 +-
 .../structure/io/graphson/GraphSONModule.java   |  2 +-
 .../structure/io/graphson/GraphSONReader.java   |  9 ++-
 .../io/graphson/GraphSONSerializers.java        | 14 ++--
 .../structure/io/graphson/GraphSONVersion.java  |  2 +-
 .../structure/io/graphson/GraphSONWriter.java   |  2 +-
 .../io/graphson/LegacyGraphSONReader.java       | 73 ++++++++++----------
 7 files changed, 55 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/67ad95ec/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONIo.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONIo.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONIo.java
index 57cfc62..29d14cf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONIo.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONIo.java
@@ -34,11 +34,11 @@ import java.io.OutputStream;
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class GraphSONIo implements Io<GraphSONReader.Builder, GraphSONWriter.Builder, GraphSONMapper.Builder> {
+public final class GraphSONIo implements Io<GraphSONReader.Builder, GraphSONWriter.Builder, GraphSONMapper.Builder> {
     private final IoRegistry registry;
     private final Graph graph;
 
-    public GraphSONIo(final IoRegistry registry, final Graph graph) {
+    private GraphSONIo(final IoRegistry registry, final Graph graph) {
         this.registry = registry;
         this.graph = graph;
     }
@@ -91,7 +91,7 @@ public class GraphSONIo implements Io<GraphSONReader.Builder, GraphSONWriter.Bui
         return new Builder();
     }
 
-    public static class Builder implements Io.Builder<GraphSONIo> {
+    public final static class Builder implements Io.Builder<GraphSONIo> {
 
         private IoRegistry registry = null;
         private Graph graph;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/67ad95ec/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
index 4161faf..b53427b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
@@ -51,7 +51,7 @@ abstract class GraphSONModule extends SimpleModule {
         /**
          * Constructs a new object.
          */
-        GraphSONModuleV1d0(final boolean normalize) {
+        protected GraphSONModuleV1d0(final boolean normalize) {
             super("graphson-1.0");
             addSerializer(Edge.class, new GraphSONSerializers.EdgeJacksonSerializer(normalize));
             addSerializer(Vertex.class, new GraphSONSerializers.VertexJacksonSerializer(normalize));

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/67ad95ec/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
index 76594ab..311463f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReader.java
@@ -63,14 +63,14 @@ import java.util.function.Function;
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class GraphSONReader implements GraphReader {
+public final class GraphSONReader implements GraphReader {
     private final ObjectMapper mapper;
     private final long batchSize;
 
     final TypeReference<Map<String, Object>> mapTypeReference = new TypeReference<Map<String, Object>>() {
     };
 
-    public GraphSONReader(final GraphSONMapper mapper, final long batchSize) {
+    private GraphSONReader(final GraphSONMapper mapper, final long batchSize) {
         this.mapper = mapper.createMapper();
         this.batchSize = batchSize;
     }
@@ -248,13 +248,12 @@ public class GraphSONReader implements GraphReader {
         return new Builder();
     }
 
-    public static class Builder implements ReaderBuilder<GraphSONReader> {
+    public final static class Builder implements ReaderBuilder<GraphSONReader> {
         private long batchSize = 10000;
 
         private GraphSONMapper mapper = GraphSONMapper.build().create();
 
-        private Builder() {
-        }
+        private Builder() {}
 
         /**
          * Number of mutations to perform before a commit is executed when using

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/67ad95ec/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializers.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializers.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializers.java
index 9d637b2..bd43417 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializers.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializers.java
@@ -56,7 +56,7 @@ final class GraphSONSerializers {
 
     private GraphSONSerializers() {}
 
-    static class VertexPropertyJacksonSerializer extends StdSerializer<VertexProperty> {
+    final static class VertexPropertyJacksonSerializer extends StdSerializer<VertexProperty> {
 
         private final boolean normalize;
 
@@ -78,7 +78,7 @@ final class GraphSONSerializers {
         }
     }
 
-    static class PropertyJacksonSerializer extends StdSerializer<Property> {
+    final static class PropertyJacksonSerializer extends StdSerializer<Property> {
 
         public PropertyJacksonSerializer() {
             super(Property.class);
@@ -105,7 +105,7 @@ final class GraphSONSerializers {
         }
     }
 
-    static class EdgeJacksonSerializer extends StdSerializer<Edge> {
+    final static class EdgeJacksonSerializer extends StdSerializer<Edge> {
 
         private final boolean normalize;
 
@@ -160,7 +160,7 @@ final class GraphSONSerializers {
 
     }
 
-    static class VertexJacksonSerializer extends StdSerializer<Vertex> {
+    final static class VertexJacksonSerializer extends StdSerializer<Vertex> {
 
         private final boolean normalize;
 
@@ -226,7 +226,7 @@ final class GraphSONSerializers {
 
     }
 
-    static class PathJacksonSerializer extends StdSerializer<Path> {
+    final static class PathJacksonSerializer extends StdSerializer<Path> {
 
         public PathJacksonSerializer() {
             super(Path.class);
@@ -257,7 +257,7 @@ final class GraphSONSerializers {
     /**
      * Maps in the JVM can have {@link Object} as a key, but in JSON they must be a {@link String}.
      */
-    static class GraphSONKeySerializer extends StdKeySerializer {
+    final static class GraphSONKeySerializer extends StdKeySerializer {
 
         @Override
         public void serialize(final Object o, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) throws IOException {
@@ -278,7 +278,7 @@ final class GraphSONSerializers {
         }
     }
 
-    static class TraversalMetricsJacksonSerializer extends StdSerializer<TraversalMetrics> {
+    final static class TraversalMetricsJacksonSerializer extends StdSerializer<TraversalMetrics> {
         public TraversalMetricsJacksonSerializer() {
             super(TraversalMetrics.class);
         }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/67ad95ec/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONVersion.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONVersion.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONVersion.java
index fef6df6..628ea22 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONVersion.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONVersion.java
@@ -29,7 +29,7 @@ public enum GraphSONVersion {
     private final GraphSONModule.GraphSONModuleBuilder builder;
     private final String versionNumber;
 
-    private GraphSONVersion(final GraphSONModule.GraphSONModuleBuilder builder, final String versionNumber) {
+    GraphSONVersion(final GraphSONModule.GraphSONModuleBuilder builder, final String versionNumber) {
         this.builder = builder;
         this.versionNumber = versionNumber;
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/67ad95ec/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONWriter.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONWriter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONWriter.java
index bbbfb3b..a531012 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONWriter.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONWriter.java
@@ -42,7 +42,7 @@ import java.util.Iterator;
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class GraphSONWriter implements GraphWriter {
+public final class GraphSONWriter implements GraphWriter {
     private final ObjectMapper mapper;
 
     private GraphSONWriter(final GraphSONMapper mapper) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/67ad95ec/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader.java
index a8d1929..ba8255a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/LegacyGraphSONReader.java
@@ -53,11 +53,11 @@ import java.util.function.Function;
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class LegacyGraphSONReader implements GraphReader {
+public final class LegacyGraphSONReader implements GraphReader {
     private final ObjectMapper mapper;
     private final long batchSize;
 
-    public LegacyGraphSONReader(final ObjectMapper mapper, final long batchSize) {
+    private LegacyGraphSONReader(final ObjectMapper mapper, final long batchSize) {
         this.mapper = mapper;
         this.batchSize = batchSize;
     }
@@ -80,13 +80,13 @@ public class LegacyGraphSONReader implements GraphReader {
             while (parser.nextToken() != JsonToken.END_OBJECT) {
                 final String fieldName = parser.getCurrentName() == null ? "" : parser.getCurrentName();
                 switch (fieldName) {
-                    case GraphSONTokens.MODE:
+                    case GraphSONTokensTP2.MODE:
                         parser.nextToken();
                         final String mode = parser.getText();
                         if (!mode.equals("EXTENDED"))
                             throw new IllegalStateException("The legacy GraphSON must be generated with GraphSONMode.EXTENDED");
                         break;
-                    case GraphSONTokens.VERTICES:
+                    case GraphSONTokensTP2.VERTICES:
                         parser.nextToken();
                         while (parser.nextToken() != JsonToken.END_ARRAY) {
                             final JsonNode node = parser.readValueAsTree();
@@ -96,12 +96,12 @@ public class LegacyGraphSONReader implements GraphReader {
                                 graphToWriteTo.tx().commit();
                         }
                         break;
-                    case GraphSONTokens.EDGES:
+                    case GraphSONTokensTP2.EDGES:
                         parser.nextToken();
                         while (parser.nextToken() != JsonToken.END_ARRAY) {
                             final JsonNode node = parser.readValueAsTree();
-                            final Vertex inV = cache.get(LegacyGraphSONUtility.getTypedValueFromJsonNode(node.get(GraphSONTokens._IN_V)));
-                            final Vertex outV = cache.get(LegacyGraphSONUtility.getTypedValueFromJsonNode(node.get(GraphSONTokens._OUT_V)));
+                            final Vertex inV = cache.get(LegacyGraphSONUtility.getTypedValueFromJsonNode(node.get(GraphSONTokensTP2._IN_V)));
+                            final Vertex outV = cache.get(LegacyGraphSONUtility.getTypedValueFromJsonNode(node.get(GraphSONTokensTP2._OUT_V)));
                             graphson.edgeFromJson(node, outV, inV);
 
                             if (supportsTx && counter.incrementAndGet() % batchSize == 0)
@@ -201,7 +201,7 @@ public class LegacyGraphSONReader implements GraphReader {
         return new Builder();
     }
 
-    public static class Builder {
+    public final static class Builder {
         private boolean loadCustomModules = false;
         private List<SimpleModule> customModules = new ArrayList<>();
         private long batchSize = 10000;
@@ -263,7 +263,7 @@ public class LegacyGraphSONReader implements GraphReader {
         public Vertex vertexFromJson(final JsonNode json) throws IOException {
             final Map<String, Object> props = readProperties(json);
 
-            final Object vertexId = getTypedValueFromJsonNode(json.get(GraphSONTokens._ID));
+            final Object vertexId = getTypedValueFromJsonNode(json.get(GraphSONTokensTP2._ID));
             final Vertex v = vertexFeatures.willAllowId(vertexId) ? g.addVertex(T.id, vertexId) : g.addVertex();
             cache.put(vertexId, v);
 
@@ -277,8 +277,8 @@ public class LegacyGraphSONReader implements GraphReader {
         public Edge edgeFromJson(final JsonNode json, final Vertex out, final Vertex in) throws IOException {
             final Map<String, Object> props = LegacyGraphSONUtility.readProperties(json);
 
-            final Object edgeId = getTypedValueFromJsonNode(json.get(GraphSONTokens._ID));
-            final JsonNode nodeLabel = json.get(GraphSONTokens._LABEL);
+            final Object edgeId = getTypedValueFromJsonNode(json.get(GraphSONTokensTP2._ID));
+            final JsonNode nodeLabel = json.get(GraphSONTokensTP2._LABEL);
             final String label = nodeLabel == null ? EMPTY_STRING : nodeLabel.textValue();
 
             final Edge e = edgeFeatures.willAllowId(edgeId) ? out.addEdge(label, in, T.id, edgeId) : out.addEdge(label, in) ;
@@ -310,35 +310,35 @@ public class LegacyGraphSONReader implements GraphReader {
         }
 
         private static boolean isReservedKey(final String key) {
-            return key.equals(GraphSONTokens._ID) || key.equals(GraphSONTokens._TYPE) || key.equals(GraphSONTokens._LABEL)
-                    || key.equals(GraphSONTokens._OUT_V) || key.equals(GraphSONTokens._IN_V);
+            return key.equals(GraphSONTokensTP2._ID) || key.equals(GraphSONTokensTP2._TYPE) || key.equals(GraphSONTokensTP2._LABEL)
+                    || key.equals(GraphSONTokensTP2._OUT_V) || key.equals(GraphSONTokensTP2._IN_V);
         }
 
         private static Object readProperty(final JsonNode node) {
             final Object propertyValue;
 
-            if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_UNKNOWN)) {
+            if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_UNKNOWN)) {
                 propertyValue = null;
-            } else if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_BOOLEAN)) {
-                propertyValue = node.get(GraphSONTokens.VALUE).booleanValue();
-            } else if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_FLOAT)) {
-                propertyValue = Float.parseFloat(node.get(GraphSONTokens.VALUE).asText());
-            } else if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_BYTE)) {
-                propertyValue = Byte.parseByte(node.get(GraphSONTokens.VALUE).asText());
-            } else if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_SHORT)) {
-                propertyValue = Short.parseShort(node.get(GraphSONTokens.VALUE).asText());
-            } else if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_DOUBLE)) {
-                propertyValue = node.get(GraphSONTokens.VALUE).doubleValue();
-            } else if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_INTEGER)) {
-                propertyValue = node.get(GraphSONTokens.VALUE).intValue();
-            } else if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_LONG)) {
-                propertyValue = node.get(GraphSONTokens.VALUE).longValue();
-            } else if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_STRING)) {
-                propertyValue = node.get(GraphSONTokens.VALUE).textValue();
-            } else if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_LIST)) {
-                propertyValue = readProperties(node.get(GraphSONTokens.VALUE).elements());
-            } else if (node.get(GraphSONTokens.TYPE).textValue().equals(GraphSONTokens.TYPE_MAP)) {
-                propertyValue = readProperties(node.get(GraphSONTokens.VALUE));
+            } else if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_BOOLEAN)) {
+                propertyValue = node.get(GraphSONTokensTP2.VALUE).booleanValue();
+            } else if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_FLOAT)) {
+                propertyValue = Float.parseFloat(node.get(GraphSONTokensTP2.VALUE).asText());
+            } else if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_BYTE)) {
+                propertyValue = Byte.parseByte(node.get(GraphSONTokensTP2.VALUE).asText());
+            } else if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_SHORT)) {
+                propertyValue = Short.parseShort(node.get(GraphSONTokensTP2.VALUE).asText());
+            } else if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_DOUBLE)) {
+                propertyValue = node.get(GraphSONTokensTP2.VALUE).doubleValue();
+            } else if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_INTEGER)) {
+                propertyValue = node.get(GraphSONTokensTP2.VALUE).intValue();
+            } else if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_LONG)) {
+                propertyValue = node.get(GraphSONTokensTP2.VALUE).longValue();
+            } else if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_STRING)) {
+                propertyValue = node.get(GraphSONTokensTP2.VALUE).textValue();
+            } else if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_LIST)) {
+                propertyValue = readProperties(node.get(GraphSONTokensTP2.VALUE).elements());
+            } else if (node.get(GraphSONTokensTP2.TYPE).textValue().equals(GraphSONTokensTP2.TYPE_MAP)) {
+                propertyValue = readProperties(node.get(GraphSONTokensTP2.VALUE));
             } else {
                 propertyValue = node.textValue();
             }
@@ -389,7 +389,10 @@ public class LegacyGraphSONReader implements GraphReader {
         }
     }
 
-    public static class GraphSONTokens {
+    public final static class GraphSONTokensTP2 {
+
+        private GraphSONTokensTP2() {}
+
         public static final String _ID = "_id";
         public static final String _LABEL = "_label";
         public static final String _TYPE = "_type";


[32/50] [abbrv] incubator-tinkerpop git commit: fix for TINKERPOP3-711 Use Jackson in JsonMessageSerializerV1d0Test.java

Posted by dk...@apache.org.
fix for TINKERPOP3-711 Use Jackson in JsonMessageSerializerV1d0Test.java


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

Branch: refs/heads/preprocessor
Commit: 08c1e27a7a2c16a20dd95a7c069aa0d8aa1e2340
Parents: 50bd297
Author: Jason Plurad <pl...@users.noreply.github.com>
Authored: Mon Jun 1 02:06:32 2015 -0400
Committer: Jason Plurad <pl...@users.noreply.github.com>
Committed: Mon Jun 1 02:06:32 2015 -0400

----------------------------------------------------------------------
 .../plugin/gremlin-server-integration.yaml      |   4 +-
 gremlin-driver/pom.xml                          |   6 -
 ...raphSONMessageSerializerGremlinV1d0Test.java | 267 ++++++++++++++
 .../ser/GraphSONMessageSerializerV1d0Test.java  | 357 +++++++++++++++++++
 .../JsonMessageSerializerGremlinV1d0Test.java   | 267 --------------
 .../ser/JsonMessageSerializerV1d0Test.java      | 354 ------------------
 6 files changed, 626 insertions(+), 629 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/08c1e27a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/gremlin-server-integration.yaml b/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/gremlin-server-integration.yaml
index f861d5f..ad50a30 100644
--- a/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/gremlin-server-integration.yaml
+++ b/gremlin-console/src/test/resources/org/apache/tinkerpop/gremlin/console/groovy/plugin/gremlin-server-integration.yaml
@@ -35,8 +35,8 @@ scriptEngines: {
 serializers:
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}}
   - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true}}
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.JsonMessageSerializerGremlinV1d0 }
-  - { className: org.apache.tinkerpop.gremlin.driver.ser.JsonMessageSerializerV1d0 }
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0 }
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0 }
 processors:
   - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
 metrics: {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/08c1e27a/gremlin-driver/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-driver/pom.xml b/gremlin-driver/pom.xml
index ad55be3..c9f1deb 100644
--- a/gremlin-driver/pom.xml
+++ b/gremlin-driver/pom.xml
@@ -58,12 +58,6 @@ limitations under the License.
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.json</groupId>
-            <artifactId>json</artifactId>
-            <version>20131018</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.tinkerpop</groupId>
             <artifactId>tinkergraph-gremlin</artifactId>
             <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/08c1e27a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerGremlinV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerGremlinV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerGremlinV1d0Test.java
new file mode 100644
index 0000000..018d6da
--- /dev/null
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerGremlinV1d0Test.java
@@ -0,0 +1,267 @@
+/*
+ * 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.driver.ser;
+
+import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
+import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
+import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.ByteBufAllocator;
+import io.netty.buffer.UnpooledByteBufAllocator;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import static org.junit.Assert.*;
+
+/**
+ * Serializer tests that cover non-lossy serialization/deserialization methods.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class GraphSONMessageSerializerGremlinV1d0Test {
+    private UUID requestId = UUID.fromString("6457272A-4018-4538-B9AE-08DD5DDC0AA1");
+    private ResponseMessage.Builder responseMessageBuilder = ResponseMessage.build(requestId);
+    private static ByteBufAllocator allocator = UnpooledByteBufAllocator.DEFAULT;
+
+    public MessageSerializer serializer = new GraphSONMessageSerializerGremlinV1d0();
+
+    @Test
+    public void serializeIterable() throws Exception {
+        final ArrayList<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(100);
+
+        final ResponseMessage response = convert(list);
+        assertCommon(response);
+
+        final List<Integer> deserializedFunList = (List<Integer>) response.getResult().getData();
+        assertEquals(2, deserializedFunList.size());
+        assertEquals(new Integer(1), deserializedFunList.get(0));
+        assertEquals(new Integer(100), deserializedFunList.get(1));
+    }
+
+    @Test
+    public void serializeIterableWithNull() throws Exception {
+        final ArrayList<Integer> list = new ArrayList<>();
+        list.add(1);
+        list.add(null);
+        list.add(100);
+
+        final ResponseMessage response = convert(list);
+        assertCommon(response);
+
+        final List<Integer> deserializedFunList = (List<Integer>) response.getResult().getData();
+        assertEquals(3, deserializedFunList.size());
+        assertEquals(new Integer(1), deserializedFunList.get(0));
+        assertNull(deserializedFunList.get(1));
+        assertEquals(new Integer(100), deserializedFunList.get(2));
+    }
+
+    @Test
+    public void serializeMap() throws Exception {
+        final Map<String, Object> map = new HashMap<>();
+        final Map<String, String> innerMap = new HashMap<>();
+        innerMap.put("a", "b");
+
+        map.put("x", 1);
+        map.put("y", "some");
+        map.put("z", innerMap);
+
+        final ResponseMessage response = convert(map);
+        assertCommon(response);
+
+        final Map<String, Object> deserializedMap = (Map<String, Object>) response.getResult().getData();
+        assertEquals(3, deserializedMap.size());
+        assertEquals(1, deserializedMap.get("x"));
+        assertEquals("some", deserializedMap.get("y"));
+
+        final Map<String, String> deserializedInnerMap = (Map<String, String>) deserializedMap.get("z");
+        assertEquals(1, deserializedInnerMap.size());
+        assertEquals("b", deserializedInnerMap.get("a"));
+    }
+
+    @Test
+    public void serializeEdge() throws Exception {
+        final Graph graph = TinkerGraph.open();
+        final Vertex v1 = graph.addVertex();
+        final Vertex v2 = graph.addVertex();
+        final Edge e = v1.addEdge("test", v2);
+        e.property("abc", 123);
+
+        final Iterable<Edge> iterable = IteratorUtils.list(graph.edges());
+
+        final ResponseMessage response = convert(iterable);
+        assertCommon(response);
+
+        final List<Map<String, Object>> edgeList = (List<Map<String, Object>>) response.getResult().getData();
+        assertEquals(1, edgeList.size());
+
+        final Map<String, Object> deserializedEdge = edgeList.get(0);
+        assertEquals(e.id(), deserializedEdge.get(GraphSONTokens.ID));
+        assertEquals(v1.id(), deserializedEdge.get(GraphSONTokens.OUT));
+        assertEquals(v2.id(), deserializedEdge.get(GraphSONTokens.IN));
+        assertEquals(v1.label(), deserializedEdge.get(GraphSONTokens.OUT_LABEL));
+        assertEquals(v2.label(), deserializedEdge.get(GraphSONTokens.IN_LABEL));
+        assertEquals(e.label(), deserializedEdge.get(GraphSONTokens.LABEL));
+        assertEquals(GraphSONTokens.EDGE, deserializedEdge.get(GraphSONTokens.TYPE));
+
+        final Map<String, Object> properties = (Map<String, Object>) deserializedEdge.get(GraphSONTokens.PROPERTIES);
+        assertNotNull(properties);
+        assertEquals(123, properties.get("abc"));
+
+    }
+
+    @Test
+    public void serializeEdgeProperty() throws Exception {
+        final Graph graph = TinkerGraph.open();
+        final Vertex v1 = graph.addVertex();
+        final Vertex v2 = graph.addVertex();
+        final Edge e = v1.addEdge("test", v2);
+        e.property("abc", 123);
+
+        final Iterable<Property<Object>> iterable = IteratorUtils.list(e.properties("abc"));
+        final ResponseMessage response = convert(iterable);
+        assertCommon(response);
+
+        final List<Map<String, Object>> propertyList = (List<Map<String, Object>>) response.getResult().getData();
+        assertEquals(1, propertyList.size());
+        assertEquals(123, propertyList.get(0).get("value"));
+    }
+
+    @Test
+    public void serializeVertexWithEmbeddedMap() throws Exception {
+        final Graph graph = TinkerGraph.open();
+        final Vertex v = graph.addVertex();
+        final Map<String, Object> map = new HashMap<>();
+        map.put("x", 500);
+        map.put("y", "some");
+
+        final ArrayList<Object> friends = new ArrayList<>();
+        friends.add("x");
+        friends.add(5);
+        friends.add(map);
+
+        v.property(VertexProperty.Cardinality.single, "friends", friends);
+
+        final List list = IteratorUtils.list(graph.vertices());
+
+        final ResponseMessage response = convert(list);
+        assertCommon(response);
+
+        final List<Map<String, Object>> vertexList = (List<Map<String, Object>>) response.getResult().getData();
+        assertEquals(1, vertexList.size());
+
+        final Map<String, Object> deserializedVertex = vertexList.get(0);
+        assertEquals(v.id(), deserializedVertex.get(GraphSONTokens.ID));
+        assertEquals(Vertex.DEFAULT_LABEL, deserializedVertex.get(GraphSONTokens.LABEL));
+
+        final Map<String, Object> properties = ((Map<String, Object>) deserializedVertex.get(GraphSONTokens.PROPERTIES));
+        assertEquals(1, properties.size());
+
+        final List<Map<String,Object>> friendsProperties = (List<Map<String,Object>>) properties.get("friends");
+        assertEquals(1, friendsProperties.size());
+
+        final List<Object> deserializedInnerList = (List<Object>) friendsProperties.get(0).get(GraphSONTokens.VALUE);
+        assertEquals(3, deserializedInnerList.size());
+        assertEquals("x", deserializedInnerList.get(0));
+        assertEquals(5, deserializedInnerList.get(1));
+
+        final Map<String, Object> deserializedInnerInnerMap = (Map<String, Object>) deserializedInnerList.get(2);
+        assertEquals(2, deserializedInnerInnerMap.size());
+        assertEquals(500, deserializedInnerInnerMap.get("x"));
+        assertEquals("some", deserializedInnerInnerMap.get("y"));
+    }
+
+    @Test
+    public void serializeToJsonMapWithElementForKey() throws Exception {
+        final TinkerGraph graph = TinkerFactory.createClassic();
+        final GraphTraversalSource g = graph.traversal();
+        final Map<Vertex, Integer> map = new HashMap<>();
+        map.put(g.V().has("name", "marko").next(), 1000);
+
+        final ResponseMessage response = convert(map);
+        assertCommon(response);
+
+        final Map<String, Integer> deserializedMap = (Map<String, Integer>) response.getResult().getData();
+        assertEquals(1, deserializedMap.size());
+
+        // with no embedded types the key (which is a vertex) simply serializes out to an id
+        // {"result":{"1":1000},"code":200,"requestId":"2d62161b-9544-4f39-af44-62ec49f9a595","type":0}
+        assertEquals(new Integer(1000), deserializedMap.get("1"));
+    }
+
+
+    @Test
+    public void serializeFullResponseMessage() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final Map<String, Object> metaData = new HashMap<>();
+        metaData.put("test", "this");
+        metaData.put("one", 1);
+
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put("test", "that");
+        attributes.put("two", 2);
+
+        final ResponseMessage response = ResponseMessage.build(id)
+                .responseMetaData(metaData)
+                .code(ResponseStatusCode.SUCCESS)
+                .result("some-result")
+                .statusAttributes(attributes)
+                .statusMessage("worked")
+                .create();
+
+        final ByteBuf bb = serializer.serializeResponseAsBinary(response, allocator);
+        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
+
+        assertEquals(id, deserialized.getRequestId());
+        assertEquals("this", deserialized.getResult().getMeta().get("test"));
+        assertEquals(1, deserialized.getResult().getMeta().get("one"));
+        assertEquals("some-result", deserialized.getResult().getData());
+        assertEquals("that", deserialized.getStatus().getAttributes().get("test"));
+        assertEquals(2, deserialized.getStatus().getAttributes().get("two"));
+        assertEquals(ResponseStatusCode.SUCCESS.getValue(), deserialized.getStatus().getCode().getValue());
+        assertEquals("worked", deserialized.getStatus().getMessage());
+    }
+
+    private void assertCommon(final ResponseMessage response) {
+        assertEquals(requestId, response.getRequestId());
+        assertEquals(ResponseStatusCode.SUCCESS, response.getStatus().getCode());
+    }
+
+    private ResponseMessage convert(final Object toSerialize) throws SerializationException {
+        final ByteBuf bb = serializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
+        return serializer.deserializeResponse(bb);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/08c1e27a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV1d0Test.java
new file mode 100644
index 0000000..721222d
--- /dev/null
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/GraphSONMessageSerializerV1d0Test.java
@@ -0,0 +1,357 @@
+/*
+ * 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.driver.ser;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.NullNode;
+import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
+import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
+import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * These tests focus on message serialization and not "result" serialization as test specific to results (e.g.
+ * vertices, edges, annotated values, etc.) are handled in the IO packages.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class GraphSONMessageSerializerV1d0Test {
+
+    public static final GraphSONMessageSerializerV1d0 SERIALIZER = new GraphSONMessageSerializerV1d0();
+    private static final RequestMessage msg = RequestMessage.build("op")
+            .overrideRequestId(UUID.fromString("2D62161B-9544-4F39-AF44-62EC49F9A595")).create();
+    private static final ObjectMapper mapper = new ObjectMapper();
+
+    @Test
+    public void serializeToJsonNullResultReturnsNull() throws Exception {
+        final ResponseMessage message = ResponseMessage.build(msg).create();
+        final String results = SERIALIZER.serializeResponseAsString(message);
+        final JsonNode json = mapper.readTree(results);
+        assertNotNull(json);
+        assertEquals(msg.getRequestId().toString(), json.path(SerTokens.TOKEN_REQUEST).asText());
+        assertEquals(NullNode.getInstance(), json.get(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA));
+    }
+
+    @Test
+    public void serializeToJsonIterable() throws Exception {
+        final ArrayList<FunObject> funList = new ArrayList<>();
+        funList.add(new FunObject("x"));
+        funList.add(new FunObject("y"));
+
+        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(funList).create());
+        final JsonNode json = mapper.readTree(results);
+
+        assertNotNull(json);
+        assertEquals(msg.getRequestId().toString(), json.get(SerTokens.TOKEN_REQUEST).asText());
+        final JsonNode converted = json.get(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA);
+
+        assertEquals(2, converted.size());
+
+        assertEquals("x", converted.get(0).asText());
+        assertEquals("y", converted.get(1).asText());
+    }
+
+    @Test
+    public void serializeToJsonIterator() throws Exception {
+        final ArrayList<FunObject> funList = new ArrayList<>();
+        funList.add(new FunObject("x"));
+        funList.add(new FunObject("y"));
+
+        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(funList.iterator()).create());
+        final JsonNode json = mapper.readTree(results);
+
+        assertNotNull(json);
+        assertEquals(msg.getRequestId().toString(), json.get(SerTokens.TOKEN_REQUEST).asText());
+        final JsonNode converted = json.get(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA);
+
+        assertEquals(2, converted.size());
+
+        assertEquals("x", converted.get(0).asText());
+        assertEquals("y", converted.get(1).asText());
+    }
+
+    @Test
+    public void serializeToJsonIteratorNullElement() throws Exception {
+
+        final ArrayList<FunObject> funList = new ArrayList<>();
+        funList.add(new FunObject("x"));
+        funList.add(null);
+        funList.add(new FunObject("y"));
+
+        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(funList.iterator()).create());
+        final JsonNode json = mapper.readTree(results);
+
+        assertNotNull(json);
+        assertEquals(msg.getRequestId().toString(), json.get(SerTokens.TOKEN_REQUEST).asText());
+        final JsonNode converted = json.get(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA);
+
+        assertEquals(3, converted.size());
+
+        assertEquals("x", converted.get(0).asText());
+        assertEquals(NullNode.getInstance(), converted.get(1));
+        assertEquals("y", converted.get(2).asText());
+    }
+
+    @Test
+    public void serializeToJsonMap() throws Exception {
+        final Map<String, Object> map = new HashMap<>();
+        final Map<String, String> innerMap = new HashMap<>();
+        innerMap.put("a", "b");
+
+        map.put("x", new FunObject("x"));
+        map.put("y", "some");
+        map.put("z", innerMap);
+
+        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(map).create());
+        final JsonNode json = mapper.readTree(results);
+
+        assertNotNull(json);
+        assertEquals(msg.getRequestId().toString(), json.get(SerTokens.TOKEN_REQUEST).asText());
+        final JsonNode jsonObject = json.get(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA);
+
+        assertNotNull(jsonObject);
+        assertEquals("some", jsonObject.get("y").asText());
+        assertEquals("x", jsonObject.get("x").asText());
+
+        final JsonNode innerJsonObject = jsonObject.get("z");
+        assertNotNull(innerJsonObject);
+        assertEquals("b", innerJsonObject.get("a").asText());
+    }
+
+    @Test
+    public void serializeEdge() throws Exception {
+        final Graph g = TinkerGraph.open();
+        final Vertex v1 = g.addVertex();
+        final Vertex v2 = g.addVertex();
+        final Edge e = v1.addEdge("test", v2);
+        e.property("abc", 123);
+
+        final Iterable<Edge> iterable = IteratorUtils.list(g.edges());
+        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(iterable).create());
+
+        final JsonNode json = mapper.readTree(results);
+
+        assertNotNull(json);
+        assertEquals(msg.getRequestId().toString(), json.get(SerTokens.TOKEN_REQUEST).asText());
+        final JsonNode converted = json.get(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA);
+
+        assertNotNull(converted);
+        assertEquals(1, converted.size());
+
+        final JsonNode edgeAsJson = converted.get(0);
+        assertNotNull(edgeAsJson);
+
+        assertEquals(((Long) e.id()).intValue(), edgeAsJson.get(GraphSONTokens.ID).asLong());  // lossy
+        assertEquals(((Long) v1.id()).intValue(), edgeAsJson.get(GraphSONTokens.OUT).asLong());// lossy
+        assertEquals(((Long) v2.id()).intValue(), edgeAsJson.get(GraphSONTokens.IN).asLong()); // lossy
+        assertEquals(e.label(), edgeAsJson.get(GraphSONTokens.LABEL).asText());
+        assertEquals(GraphSONTokens.EDGE, edgeAsJson.get(GraphSONTokens.TYPE).asText());
+
+        final JsonNode properties = edgeAsJson.get(GraphSONTokens.PROPERTIES);
+        assertNotNull(properties);
+        assertEquals(123, properties.get("abc").asInt());
+    }
+
+    @Test
+    public void serializeEdgeProperty() throws Exception {
+        final Graph g = TinkerGraph.open();
+        final Vertex v1 = g.addVertex();
+        final Vertex v2 = g.addVertex();
+        final Edge e = v1.addEdge("test", v2);
+        e.property("abc", 123);
+
+        final Iterable<Property<Object>> iterable = IteratorUtils.list(e.properties("abc"));
+        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(iterable).create());
+
+        final JsonNode json = mapper.readTree(results);
+
+        assertNotNull(json);
+        assertEquals(msg.getRequestId().toString(), json.get(SerTokens.TOKEN_REQUEST).asText());
+        final JsonNode converted = json.get(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA);
+
+        assertNotNull(converted);
+        assertEquals(1, converted.size());
+
+        final JsonNode propertyAsJson = converted.get(0);
+        assertNotNull(propertyAsJson);
+
+        assertEquals(123, propertyAsJson.get("value").asInt());
+    }
+
+    @Test
+    public void serializeToJsonIteratorWithEmbeddedMap() throws Exception {
+        final Graph g = TinkerGraph.open();
+        final Vertex v = g.addVertex();
+        final Map<String, Object> map = new HashMap<>();
+        map.put("x", 500);
+        map.put("y", "some");
+
+        final ArrayList<Object> friends = new ArrayList<>();
+        friends.add("x");
+        friends.add(5);
+        friends.add(map);
+
+        v.property(VertexProperty.Cardinality.single, "friends", friends);
+
+        final Iterable iterable = IteratorUtils.list(g.vertices());
+        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(iterable).create());
+        final JsonNode json = mapper.readTree(results);
+
+        assertNotNull(json);
+        assertEquals(msg.getRequestId().toString(), json.get(SerTokens.TOKEN_REQUEST).asText());
+        final JsonNode converted = json.get(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA);
+
+        assertNotNull(converted);
+        assertEquals(1, converted.size());
+
+        final JsonNode vertexAsJson = converted.get(0);
+        assertNotNull(vertexAsJson);
+
+        final JsonNode properties = vertexAsJson.get(GraphSONTokens.PROPERTIES);
+        assertNotNull(properties);
+        assertEquals(1, properties.size());
+
+        final JsonNode friendProperties = properties.get("friends");
+        assertEquals(1, friendProperties.size());
+        final JsonNode friendsProperty = friendProperties.get(0);
+        assertNotNull(friendsProperty);
+        assertEquals(3, friends.size());
+
+        final String object1 = friendsProperty.get(GraphSONTokens.VALUE).get(0).asText();
+        assertEquals("x", object1);
+
+        final int object2 = friendsProperty.get(GraphSONTokens.VALUE).get(1).asInt();
+        assertEquals(5, object2);
+
+        final JsonNode object3 = friendsProperty.get(GraphSONTokens.VALUE).get(2);
+        assertEquals(500, object3.get("x").asInt());
+        assertEquals("some", object3.get("y").asText());
+    }
+
+    @Test
+    public void serializeToJsonMapWithElementForKey() throws Exception {
+        final TinkerGraph graph = TinkerFactory.createClassic();
+        final GraphTraversalSource g = graph.traversal();
+        final Map<Vertex, Integer> map = new HashMap<>();
+        map.put(g.V().has("name", "marko").next(), 1000);
+
+        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(map).create());
+        final JsonNode json = mapper.readTree(results);
+
+        assertNotNull(json);
+        assertEquals(msg.getRequestId().toString(), json.get(SerTokens.TOKEN_REQUEST).asText());
+        final JsonNode converted = json.get(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA);
+
+        assertNotNull(converted);
+
+        // with no embedded types the key (which is a vertex) simply serializes out to an id
+        // {"result":{"1":1000},"code":200,"requestId":"2d62161b-9544-4f39-af44-62ec49f9a595","type":0}
+        assertEquals(1000, converted.get("1").asInt());
+    }
+
+    @Test
+    public void deserializeRequestNicelyWithNoArgs() throws Exception {
+        final UUID request = UUID.fromString("011CFEE9-F640-4844-AC93-034448AC0E80");
+        final RequestMessage m = SERIALIZER.deserializeRequest(String.format("{\"requestId\":\"%s\",\"op\":\"eval\"}", request));
+        assertEquals(request, m.getRequestId());
+        assertEquals("eval", m.getOp());
+        assertNotNull(m.getArgs());
+        assertEquals(0, m.getArgs().size());
+    }
+
+    @Test
+    public void deserializeRequestNicelyWithArgs() throws Exception {
+        final UUID request = UUID.fromString("011CFEE9-F640-4844-AC93-034448AC0E80");
+        final RequestMessage m = SERIALIZER.deserializeRequest(String.format("{\"requestId\":\"%s\",\"op\":\"eval\",\"args\":{\"x\":\"y\"}}", request));
+        assertEquals(request, m.getRequestId());
+        assertEquals("eval", m.getOp());
+        assertNotNull(m.getArgs());
+        assertEquals("y", m.getArgs().get("x"));
+    }
+
+    @Test(expected = SerializationException.class)
+    public void deserializeRequestParseMessage() throws Exception {
+        SERIALIZER.deserializeRequest("{\"requestId\":\"%s\",\"op\":\"eval\",\"args\":{\"x\":\"y\"}}");
+    }
+
+    @Test
+    public void serializeFullResponseMessage() throws Exception {
+        final UUID id = UUID.randomUUID();
+
+        final Map<String, Object> metaData = new HashMap<>();
+        metaData.put("test", "this");
+        metaData.put("one", 1);
+
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put("test", "that");
+        attributes.put("two", 2);
+
+        final ResponseMessage response = ResponseMessage.build(id)
+                .responseMetaData(metaData)
+                .code(ResponseStatusCode.SUCCESS)
+                .result("some-result")
+                .statusAttributes(attributes)
+                .statusMessage("worked")
+                .create();
+
+        final String results = SERIALIZER.serializeResponseAsString(response);
+        final ResponseMessage deserialized = SERIALIZER.deserializeResponse(results);
+
+        assertEquals(id, deserialized.getRequestId());
+        assertEquals("this", deserialized.getResult().getMeta().get("test"));
+        assertEquals(1, deserialized.getResult().getMeta().get("one"));
+        assertEquals("some-result", deserialized.getResult().getData());
+        assertEquals("that", deserialized.getStatus().getAttributes().get("test"));
+        assertEquals(2, deserialized.getStatus().getAttributes().get("two"));
+        assertEquals(ResponseStatusCode.SUCCESS.getValue(), deserialized.getStatus().getCode().getValue());
+        assertEquals("worked", deserialized.getStatus().getMessage());
+    }
+
+    private class FunObject {
+        private String val;
+
+        public FunObject(String val) {
+            this.val = val;
+        }
+
+        public String toString() {
+            return this.val;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/08c1e27a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerGremlinV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerGremlinV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerGremlinV1d0Test.java
deleted file mode 100644
index a7f214b..0000000
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerGremlinV1d0Test.java
+++ /dev/null
@@ -1,267 +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.driver.ser;
-
-import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
-import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
-import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufAllocator;
-import io.netty.buffer.UnpooledByteBufAllocator;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import static org.junit.Assert.*;
-
-/**
- * Serializer tests that cover non-lossy serialization/deserialization methods.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class JsonMessageSerializerGremlinV1d0Test {
-    private UUID requestId = UUID.fromString("6457272A-4018-4538-B9AE-08DD5DDC0AA1");
-    private ResponseMessage.Builder responseMessageBuilder = ResponseMessage.build(requestId);
-    private static ByteBufAllocator allocator = UnpooledByteBufAllocator.DEFAULT;
-
-    public MessageSerializer serializer = new GraphSONMessageSerializerGremlinV1d0();
-
-    @Test
-    public void serializeIterable() throws Exception {
-        final ArrayList<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(100);
-
-        final ResponseMessage response = convert(list);
-        assertCommon(response);
-
-        final List<Integer> deserializedFunList = (List<Integer>) response.getResult().getData();
-        assertEquals(2, deserializedFunList.size());
-        assertEquals(new Integer(1), deserializedFunList.get(0));
-        assertEquals(new Integer(100), deserializedFunList.get(1));
-    }
-
-    @Test
-    public void serializeIterableWithNull() throws Exception {
-        final ArrayList<Integer> list = new ArrayList<>();
-        list.add(1);
-        list.add(null);
-        list.add(100);
-
-        final ResponseMessage response = convert(list);
-        assertCommon(response);
-
-        final List<Integer> deserializedFunList = (List<Integer>) response.getResult().getData();
-        assertEquals(3, deserializedFunList.size());
-        assertEquals(new Integer(1), deserializedFunList.get(0));
-        assertNull(deserializedFunList.get(1));
-        assertEquals(new Integer(100), deserializedFunList.get(2));
-    }
-
-    @Test
-    public void serializeMap() throws Exception {
-        final Map<String, Object> map = new HashMap<>();
-        final Map<String, String> innerMap = new HashMap<>();
-        innerMap.put("a", "b");
-
-        map.put("x", 1);
-        map.put("y", "some");
-        map.put("z", innerMap);
-
-        final ResponseMessage response = convert(map);
-        assertCommon(response);
-
-        final Map<String, Object> deserializedMap = (Map<String, Object>) response.getResult().getData();
-        assertEquals(3, deserializedMap.size());
-        assertEquals(1, deserializedMap.get("x"));
-        assertEquals("some", deserializedMap.get("y"));
-
-        final Map<String, String> deserializedInnerMap = (Map<String, String>) deserializedMap.get("z");
-        assertEquals(1, deserializedInnerMap.size());
-        assertEquals("b", deserializedInnerMap.get("a"));
-    }
-
-    @Test
-    public void serializeEdge() throws Exception {
-        final Graph graph = TinkerGraph.open();
-        final Vertex v1 = graph.addVertex();
-        final Vertex v2 = graph.addVertex();
-        final Edge e = v1.addEdge("test", v2);
-        e.property("abc", 123);
-
-        final Iterable<Edge> iterable = IteratorUtils.list(graph.edges());
-
-        final ResponseMessage response = convert(iterable);
-        assertCommon(response);
-
-        final List<Map<String, Object>> edgeList = (List<Map<String, Object>>) response.getResult().getData();
-        assertEquals(1, edgeList.size());
-
-        final Map<String, Object> deserializedEdge = edgeList.get(0);
-        assertEquals(e.id(), deserializedEdge.get(GraphSONTokens.ID));
-        assertEquals(v1.id(), deserializedEdge.get(GraphSONTokens.OUT));
-        assertEquals(v2.id(), deserializedEdge.get(GraphSONTokens.IN));
-        assertEquals(v1.label(), deserializedEdge.get(GraphSONTokens.OUT_LABEL));
-        assertEquals(v2.label(), deserializedEdge.get(GraphSONTokens.IN_LABEL));
-        assertEquals(e.label(), deserializedEdge.get(GraphSONTokens.LABEL));
-        assertEquals(GraphSONTokens.EDGE, deserializedEdge.get(GraphSONTokens.TYPE));
-
-        final Map<String, Object> properties = (Map<String, Object>) deserializedEdge.get(GraphSONTokens.PROPERTIES);
-        assertNotNull(properties);
-        assertEquals(123, properties.get("abc"));
-
-    }
-
-    @Test
-    public void serializeEdgeProperty() throws Exception {
-        final Graph graph = TinkerGraph.open();
-        final Vertex v1 = graph.addVertex();
-        final Vertex v2 = graph.addVertex();
-        final Edge e = v1.addEdge("test", v2);
-        e.property("abc", 123);
-
-        final Iterable<Property<Object>> iterable = IteratorUtils.list(e.properties("abc"));
-        final ResponseMessage response = convert(iterable);
-        assertCommon(response);
-
-        final List<Map<String, Object>> propertyList = (List<Map<String, Object>>) response.getResult().getData();
-        assertEquals(1, propertyList.size());
-        assertEquals(123, propertyList.get(0).get("value"));
-    }
-
-    @Test
-    public void serializeVertexWithEmbeddedMap() throws Exception {
-        final Graph graph = TinkerGraph.open();
-        final Vertex v = graph.addVertex();
-        final Map<String, Object> map = new HashMap<>();
-        map.put("x", 500);
-        map.put("y", "some");
-
-        final ArrayList<Object> friends = new ArrayList<>();
-        friends.add("x");
-        friends.add(5);
-        friends.add(map);
-
-        v.property(VertexProperty.Cardinality.single, "friends", friends);
-
-        final List list = IteratorUtils.list(graph.vertices());
-
-        final ResponseMessage response = convert(list);
-        assertCommon(response);
-
-        final List<Map<String, Object>> vertexList = (List<Map<String, Object>>) response.getResult().getData();
-        assertEquals(1, vertexList.size());
-
-        final Map<String, Object> deserializedVertex = vertexList.get(0);
-        assertEquals(v.id(), deserializedVertex.get(GraphSONTokens.ID));
-        assertEquals(Vertex.DEFAULT_LABEL, deserializedVertex.get(GraphSONTokens.LABEL));
-
-        final Map<String, Object> properties = ((Map<String, Object>) deserializedVertex.get(GraphSONTokens.PROPERTIES));
-        assertEquals(1, properties.size());
-
-        final List<Map<String,Object>> friendsProperties = (List<Map<String,Object>>) properties.get("friends");
-        assertEquals(1, friendsProperties.size());
-
-        final List<Object> deserializedInnerList = (List<Object>) friendsProperties.get(0).get(GraphSONTokens.VALUE);
-        assertEquals(3, deserializedInnerList.size());
-        assertEquals("x", deserializedInnerList.get(0));
-        assertEquals(5, deserializedInnerList.get(1));
-
-        final Map<String, Object> deserializedInnerInnerMap = (Map<String, Object>) deserializedInnerList.get(2);
-        assertEquals(2, deserializedInnerInnerMap.size());
-        assertEquals(500, deserializedInnerInnerMap.get("x"));
-        assertEquals("some", deserializedInnerInnerMap.get("y"));
-    }
-
-    @Test
-    public void serializeToJsonMapWithElementForKey() throws Exception {
-        final TinkerGraph graph = TinkerFactory.createClassic();
-        final GraphTraversalSource g = graph.traversal();
-        final Map<Vertex, Integer> map = new HashMap<>();
-        map.put(g.V().has("name", "marko").next(), 1000);
-
-        final ResponseMessage response = convert(map);
-        assertCommon(response);
-
-        final Map<String, Integer> deserializedMap = (Map<String, Integer>) response.getResult().getData();
-        assertEquals(1, deserializedMap.size());
-
-        // with no embedded types the key (which is a vertex) simply serializes out to an id
-        // {"result":{"1":1000},"code":200,"requestId":"2d62161b-9544-4f39-af44-62ec49f9a595","type":0}
-        assertEquals(new Integer(1000), deserializedMap.get("1"));
-    }
-
-
-    @Test
-    public void serializeFullResponseMessage() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final Map<String, Object> metaData = new HashMap<>();
-        metaData.put("test", "this");
-        metaData.put("one", 1);
-
-        final Map<String, Object> attributes = new HashMap<>();
-        attributes.put("test", "that");
-        attributes.put("two", 2);
-
-        final ResponseMessage response = ResponseMessage.build(id)
-                .responseMetaData(metaData)
-                .code(ResponseStatusCode.SUCCESS)
-                .result("some-result")
-                .statusAttributes(attributes)
-                .statusMessage("worked")
-                .create();
-
-        final ByteBuf bb = serializer.serializeResponseAsBinary(response, allocator);
-        final ResponseMessage deserialized = serializer.deserializeResponse(bb);
-
-        assertEquals(id, deserialized.getRequestId());
-        assertEquals("this", deserialized.getResult().getMeta().get("test"));
-        assertEquals(1, deserialized.getResult().getMeta().get("one"));
-        assertEquals("some-result", deserialized.getResult().getData());
-        assertEquals("that", deserialized.getStatus().getAttributes().get("test"));
-        assertEquals(2, deserialized.getStatus().getAttributes().get("two"));
-        assertEquals(ResponseStatusCode.SUCCESS.getValue(), deserialized.getStatus().getCode().getValue());
-        assertEquals("worked", deserialized.getStatus().getMessage());
-    }
-
-    private void assertCommon(final ResponseMessage response) {
-        assertEquals(requestId, response.getRequestId());
-        assertEquals(ResponseStatusCode.SUCCESS, response.getStatus().getCode());
-    }
-
-    private ResponseMessage convert(final Object toSerialize) throws SerializationException {
-        final ByteBuf bb = serializer.serializeResponseAsBinary(responseMessageBuilder.result(toSerialize).create(), allocator);
-        return serializer.deserializeResponse(bb);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/08c1e27a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
deleted file mode 100644
index fe81f70..0000000
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
+++ /dev/null
@@ -1,354 +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.driver.ser;
-
-import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
-import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
-import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONTokens;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-/**
- * These tests focus on message serialization and not "result" serialization as test specific to results (e.g.
- * vertices, edges, annotated values, etc.) are handled in the IO packages.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class JsonMessageSerializerV1d0Test {
-
-    public static final GraphSONMessageSerializerV1d0 SERIALIZER = new GraphSONMessageSerializerV1d0();
-    private static final RequestMessage msg = RequestMessage.build("op")
-            .overrideRequestId(UUID.fromString("2D62161B-9544-4F39-AF44-62EC49F9A595")).create();
-
-    @Test
-    public void serializeToJsonNullResultReturnsNull() throws Exception {
-        final ResponseMessage message = ResponseMessage.build(msg).create();
-        final String results = SERIALIZER.serializeResponseAsString(message);
-        final JSONObject json = new JSONObject(results);
-        assertNotNull(json);
-        assertEquals(msg.getRequestId().toString(), json.getString(SerTokens.TOKEN_REQUEST));
-        assertEquals(JSONObject.NULL, json.getJSONObject(SerTokens.TOKEN_RESULT).get(SerTokens.TOKEN_DATA));
-    }
-
-    @Test
-    public void serializeToJsonIterable() throws Exception {
-        final ArrayList<FunObject> funList = new ArrayList<>();
-        funList.add(new FunObject("x"));
-        funList.add(new FunObject("y"));
-
-        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(funList).create());
-        final JSONObject json = new JSONObject(results);
-
-        assertNotNull(json);
-        assertEquals(msg.getRequestId().toString(), json.getString(SerTokens.TOKEN_REQUEST));
-        final JSONArray converted = json.getJSONObject(SerTokens.TOKEN_RESULT).getJSONArray(SerTokens.TOKEN_DATA);
-
-        assertEquals(2, converted.length());
-
-        assertEquals("x", converted.get(0));
-        assertEquals("y", converted.get(1));
-    }
-
-    @Test
-    public void serializeToJsonIterator() throws Exception {
-        final ArrayList<FunObject> funList = new ArrayList<>();
-        funList.add(new FunObject("x"));
-        funList.add(new FunObject("y"));
-
-        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(funList.iterator()).create());
-        final JSONObject json = new JSONObject(results);
-
-        assertNotNull(json);
-        assertEquals(msg.getRequestId().toString(), json.getString(SerTokens.TOKEN_REQUEST));
-        final JSONArray converted = json.getJSONObject(SerTokens.TOKEN_RESULT).getJSONArray(SerTokens.TOKEN_DATA);
-
-        assertEquals(2, converted.length());
-
-        assertEquals("x", converted.get(0));
-        assertEquals("y", converted.get(1));
-    }
-
-    @Test
-    public void serializeToJsonIteratorNullElement() throws Exception {
-
-        final ArrayList<FunObject> funList = new ArrayList<>();
-        funList.add(new FunObject("x"));
-        funList.add(null);
-        funList.add(new FunObject("y"));
-
-        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(funList.iterator()).create());
-        final JSONObject json = new JSONObject(results);
-
-        assertNotNull(json);
-        assertEquals(msg.getRequestId().toString(), json.getString(SerTokens.TOKEN_REQUEST));
-        final JSONArray converted = json.getJSONObject(SerTokens.TOKEN_RESULT).getJSONArray(SerTokens.TOKEN_DATA);
-
-        assertEquals(3, converted.length());
-
-        assertEquals("x", converted.get(0));
-        assertEquals(JSONObject.NULL, converted.opt(1));
-        assertEquals("y", converted.get(2));
-    }
-
-    @Test
-    public void serializeToJsonMap() throws Exception {
-        final Map<String, Object> map = new HashMap<>();
-        final Map<String, String> innerMap = new HashMap<>();
-        innerMap.put("a", "b");
-
-        map.put("x", new FunObject("x"));
-        map.put("y", "some");
-        map.put("z", innerMap);
-
-        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(map).create());
-        final JSONObject json = new JSONObject(results);
-
-        assertNotNull(json);
-        assertEquals(msg.getRequestId().toString(), json.getString(SerTokens.TOKEN_REQUEST));
-        final JSONObject jsonObject = json.getJSONObject(SerTokens.TOKEN_RESULT).getJSONObject(SerTokens.TOKEN_DATA);
-
-        assertNotNull(jsonObject);
-        assertEquals("some", jsonObject.optString("y"));
-        assertEquals("x", jsonObject.optString("x"));
-
-        final JSONObject innerJsonObject = jsonObject.optJSONObject("z");
-        assertNotNull(innerJsonObject);
-        assertEquals("b", innerJsonObject.optString("a"));
-    }
-
-    @Test
-    public void serializeEdge() throws Exception {
-        final Graph g = TinkerGraph.open();
-        final Vertex v1 = g.addVertex();
-        final Vertex v2 = g.addVertex();
-        final Edge e = v1.addEdge("test", v2);
-        e.property("abc", 123);
-
-        final Iterable<Edge> iterable = IteratorUtils.list(g.edges());
-        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(iterable).create());
-
-        final JSONObject json = new JSONObject(results);
-
-        assertNotNull(json);
-        assertEquals(msg.getRequestId().toString(), json.getString(SerTokens.TOKEN_REQUEST));
-        final JSONArray converted = json.getJSONObject(SerTokens.TOKEN_RESULT).getJSONArray(SerTokens.TOKEN_DATA);
-
-        assertNotNull(converted);
-        assertEquals(1, converted.length());
-
-        final JSONObject edgeAsJson = converted.optJSONObject(0);
-        assertNotNull(edgeAsJson);
-
-        assertEquals(((Long) e.id()).intValue(), edgeAsJson.get(GraphSONTokens.ID));  // lossy
-        assertEquals(((Long) v1.id()).intValue(), edgeAsJson.get(GraphSONTokens.OUT));// lossy
-        assertEquals(((Long) v2.id()).intValue(), edgeAsJson.get(GraphSONTokens.IN)); // lossy
-        assertEquals(e.label(), edgeAsJson.get(GraphSONTokens.LABEL));
-        assertEquals(GraphSONTokens.EDGE, edgeAsJson.get(GraphSONTokens.TYPE));
-
-        final JSONObject properties = edgeAsJson.optJSONObject(GraphSONTokens.PROPERTIES);
-        assertNotNull(properties);
-        assertEquals(123, properties.getInt("abc"));
-    }
-
-    @Test
-    public void serializeEdgeProperty() throws Exception {
-        final Graph g = TinkerGraph.open();
-        final Vertex v1 = g.addVertex();
-        final Vertex v2 = g.addVertex();
-        final Edge e = v1.addEdge("test", v2);
-        e.property("abc", 123);
-
-        final Iterable<Property<Object>> iterable = IteratorUtils.list(e.properties("abc"));
-        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(iterable).create());
-
-        final JSONObject json = new JSONObject(results);
-
-        assertNotNull(json);
-        assertEquals(msg.getRequestId().toString(), json.getString(SerTokens.TOKEN_REQUEST));
-        final JSONArray converted = json.getJSONObject(SerTokens.TOKEN_RESULT).getJSONArray(SerTokens.TOKEN_DATA);
-
-        assertNotNull(converted);
-        assertEquals(1, converted.length());
-
-        final JSONObject propertyAsJson = converted.optJSONObject(0);
-        assertNotNull(propertyAsJson);
-
-        assertEquals(123, propertyAsJson.getInt("value"));
-    }
-
-    @Test
-    public void serializeToJsonIteratorWithEmbeddedMap() throws Exception {
-        final Graph g = TinkerGraph.open();
-        final Vertex v = g.addVertex();
-        final Map<String, Object> map = new HashMap<>();
-        map.put("x", 500);
-        map.put("y", "some");
-
-        final ArrayList<Object> friends = new ArrayList<>();
-        friends.add("x");
-        friends.add(5);
-        friends.add(map);
-
-        v.property(VertexProperty.Cardinality.single, "friends", friends);
-
-        final Iterable iterable = IteratorUtils.list(g.vertices());
-        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(iterable).create());
-        final JSONObject json = new JSONObject(results);
-
-        assertNotNull(json);
-        assertEquals(msg.getRequestId().toString(), json.getString(SerTokens.TOKEN_REQUEST));
-        final JSONArray converted = json.getJSONObject(SerTokens.TOKEN_RESULT).getJSONArray(SerTokens.TOKEN_DATA);
-
-        assertNotNull(converted);
-        assertEquals(1, converted.length());
-
-        final JSONObject vertexAsJson = converted.optJSONObject(0);
-        assertNotNull(vertexAsJson);
-
-        final JSONObject properties = vertexAsJson.optJSONObject(GraphSONTokens.PROPERTIES);
-        assertNotNull(properties);
-        assertEquals(1, properties.length());
-
-        final JSONArray friendProperties = properties.getJSONArray("friends");
-        assertEquals(1, friendProperties.length());
-        final JSONObject friendsProperty = friendProperties.getJSONObject(0);
-        assertNotNull(friendsProperty);
-        assertEquals(3, friends.size());
-
-        final String object1 = friendsProperty.getJSONArray(GraphSONTokens.VALUE).getString(0);
-        assertEquals("x", object1);
-
-        final int object2 = friendsProperty.getJSONArray(GraphSONTokens.VALUE).getInt(1);
-        assertEquals(5, object2);
-
-        final JSONObject object3 = friendsProperty.getJSONArray(GraphSONTokens.VALUE).getJSONObject(2);
-        assertEquals(500, object3.getInt("x"));
-        assertEquals("some", object3.getString("y"));
-    }
-
-    @Test
-    public void serializeToJsonMapWithElementForKey() throws Exception {
-        final TinkerGraph graph = TinkerFactory.createClassic();
-        final GraphTraversalSource g = graph.traversal();
-        final Map<Vertex, Integer> map = new HashMap<>();
-        map.put(g.V().has("name", "marko").next(), 1000);
-
-        final String results = SERIALIZER.serializeResponseAsString(ResponseMessage.build(msg).result(map).create());
-        final JSONObject json = new JSONObject(results);
-
-        assertNotNull(json);
-        assertEquals(msg.getRequestId().toString(), json.getString(SerTokens.TOKEN_REQUEST));
-        final JSONObject converted = json.getJSONObject(SerTokens.TOKEN_RESULT).getJSONObject(SerTokens.TOKEN_DATA);
-
-        assertNotNull(converted);
-
-        // with no embedded types the key (which is a vertex) simply serializes out to an id
-        // {"result":{"1":1000},"code":200,"requestId":"2d62161b-9544-4f39-af44-62ec49f9a595","type":0}
-        assertEquals(1000, converted.optInt("1"));
-    }
-
-    @Test
-    public void deserializeRequestNicelyWithNoArgs() throws Exception {
-        final UUID request = UUID.fromString("011CFEE9-F640-4844-AC93-034448AC0E80");
-        final RequestMessage m = SERIALIZER.deserializeRequest(String.format("{\"requestId\":\"%s\",\"op\":\"eval\"}", request));
-        assertEquals(request, m.getRequestId());
-        assertEquals("eval", m.getOp());
-        assertNotNull(m.getArgs());
-        assertEquals(0, m.getArgs().size());
-    }
-
-    @Test
-    public void deserializeRequestNicelyWithArgs() throws Exception {
-        final UUID request = UUID.fromString("011CFEE9-F640-4844-AC93-034448AC0E80");
-        final RequestMessage m = SERIALIZER.deserializeRequest(String.format("{\"requestId\":\"%s\",\"op\":\"eval\",\"args\":{\"x\":\"y\"}}", request));
-        assertEquals(request, m.getRequestId());
-        assertEquals("eval", m.getOp());
-        assertNotNull(m.getArgs());
-        assertEquals("y", m.getArgs().get("x"));
-    }
-
-    @Test(expected = SerializationException.class)
-    public void deserializeRequestParseMessage() throws Exception {
-        SERIALIZER.deserializeRequest("{\"requestId\":\"%s\",\"op\":\"eval\",\"args\":{\"x\":\"y\"}}");
-    }
-
-    @Test
-    public void serializeFullResponseMessage() throws Exception {
-        final UUID id = UUID.randomUUID();
-
-        final Map<String, Object> metaData = new HashMap<>();
-        metaData.put("test", "this");
-        metaData.put("one", 1);
-
-        final Map<String, Object> attributes = new HashMap<>();
-        attributes.put("test", "that");
-        attributes.put("two", 2);
-
-        final ResponseMessage response = ResponseMessage.build(id)
-                .responseMetaData(metaData)
-                .code(ResponseStatusCode.SUCCESS)
-                .result("some-result")
-                .statusAttributes(attributes)
-                .statusMessage("worked")
-                .create();
-
-        final String results = SERIALIZER.serializeResponseAsString(response);
-        final ResponseMessage deserialized = SERIALIZER.deserializeResponse(results);
-
-        assertEquals(id, deserialized.getRequestId());
-        assertEquals("this", deserialized.getResult().getMeta().get("test"));
-        assertEquals(1, deserialized.getResult().getMeta().get("one"));
-        assertEquals("some-result", deserialized.getResult().getData());
-        assertEquals("that", deserialized.getStatus().getAttributes().get("test"));
-        assertEquals(2, deserialized.getStatus().getAttributes().get("two"));
-        assertEquals(ResponseStatusCode.SUCCESS.getValue(), deserialized.getStatus().getCode().getValue());
-        assertEquals("worked", deserialized.getStatus().getMessage());
-    }
-
-    private class FunObject {
-        private String val;
-
-        public FunObject(String val) {
-            this.val = val;
-        }
-
-        public String toString() {
-            return this.val;
-        }
-    }
-}


[03/50] [abbrv] incubator-tinkerpop git commit: Fixed test to ensure a VertexProperty with an endTime was selected.

Posted by dk...@apache.org.
Fixed test to ensure a VertexProperty with an endTime was selected.

Without this adjustment, the test will randomly work as a graph could return a VertexProperty without an endTime and when that property is asserted it will fail.


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

Branch: refs/heads/preprocessor
Commit: 1f9a69eb8cf2c0f788609e0cf7c7455551f8f968
Parents: d2fd291
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 08:42:20 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 08:42:20 2015 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/structure/io/IoTest.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1f9a69eb/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index ae4b32d..3ed7e54 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -1798,7 +1798,9 @@ public class IoTest extends AbstractGremlinTest {
     public void shouldReadWriteVertexPropertyWithMetaPropertiesGraphSON() throws Exception {
         try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
             final GraphSONWriter writer = graph.io(graphson).writer().create();
-            final VertexProperty p = g.V(convertToVertexId("marko")).next().properties("location").next();
+
+            // select any vertexproperty that has both start/end time
+            final VertexProperty p = (VertexProperty) g.V(convertToVertexId("marko")).properties("location").as("p").has("endTime").select("p").next();
             writer.writeVertexProperty(os, p);
 
             final AtomicBoolean called = new AtomicBoolean(false);
@@ -1871,7 +1873,9 @@ public class IoTest extends AbstractGremlinTest {
     public void shouldReadWriteVertexPropertyWithMetaPropertiesGryo() throws Exception {
         try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) {
             final GryoWriter writer = graph.io(gryo).writer().create();
-            final VertexProperty p = g.V(convertToVertexId("marko")).next().properties("location").next();
+
+            // select any vertexproperty that has both start/end time
+            final VertexProperty p = (VertexProperty) g.V(convertToVertexId("marko")).properties("location").as("p").has("endTime").select("p").next();
             writer.writeVertexProperty(os, p);
 
             final AtomicBoolean called = new AtomicBoolean(false);


[45/50] [abbrv] incubator-tinkerpop git commit: Finalize some classes in gryo.

Posted by dk...@apache.org.
Finalize some classes in gryo.


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

Branch: refs/heads/preprocessor
Commit: f3e4d54fa37cf3d18f3023eacd9ce5fadfbb2815
Parents: 67ad95e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 14:58:25 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 14:58:25 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/io/gryo/EntrySerializer.java      |  2 +-
 .../tinkerpop/gremlin/structure/io/gryo/GryoIo.java     |  6 +++---
 .../tinkerpop/gremlin/structure/io/gryo/GryoMapper.java |  2 +-
 .../tinkerpop/gremlin/structure/io/gryo/GryoPool.java   |  2 +-
 .../tinkerpop/gremlin/structure/io/gryo/GryoReader.java |  4 ++--
 .../gremlin/structure/io/gryo/GryoSerializers.java      | 12 ++++++------
 .../tinkerpop/gremlin/structure/io/gryo/GryoWriter.java |  4 ++--
 .../gremlin/structure/io/gryo/URISerializer.java        |  2 +-
 .../gremlin/structure/io/gryo/UUIDSerializer.java       |  2 +-
 .../structure/io/gryo/VertexByteArrayInputStream.java   |  2 +-
 .../gremlin/structure/io/gryo/VertexTerminator.java     |  2 +-
 11 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/EntrySerializer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/EntrySerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/EntrySerializer.java
index 41d4fd5..00215e0 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/EntrySerializer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/EntrySerializer.java
@@ -29,7 +29,7 @@ import java.util.Map;
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-class EntrySerializer extends Serializer<Map.Entry> {
+final class EntrySerializer extends Serializer<Map.Entry> {
     @Override
     public void write(final Kryo kryo, final Output output, final Map.Entry entry) {
         kryo.writeClassAndObject(output, entry.getKey());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoIo.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoIo.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoIo.java
index 01ba531..bc4b6aa 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoIo.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoIo.java
@@ -34,12 +34,12 @@ import java.io.OutputStream;
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class GryoIo implements Io<GryoReader.Builder, GryoWriter.Builder, GryoMapper.Builder> {
+public final class GryoIo implements Io<GryoReader.Builder, GryoWriter.Builder, GryoMapper.Builder> {
 
     private final IoRegistry registry;
     private final Graph graph;
 
-    public GryoIo(final IoRegistry registry, final Graph graph) {
+    private GryoIo(final IoRegistry registry, final Graph graph) {
         this.registry = registry;
         this.graph = graph;
     }
@@ -91,7 +91,7 @@ public class GryoIo implements Io<GryoReader.Builder, GryoWriter.Builder, GryoMa
         return new Builder();
     }
 
-    public static class Builder implements Io.Builder<GryoIo> {
+    public final static class Builder implements Io.Builder<GryoIo> {
 
         private IoRegistry registry = null;
         private Graph graph;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
index bb36fbb..8d88f93 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
@@ -152,7 +152,7 @@ public final class GryoMapper implements Mapper<Kryo> {
     /**
      * A builder to construct a {@link GryoMapper} instance.
      */
-    public static class Builder implements Mapper.Builder<Builder> {
+    public final static class Builder implements Mapper.Builder<Builder> {
 
         /**
          * Map with one entry that is used so that it is possible to get the class of LinkedHashMap.Entry.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
index bb38ca9..2641e56 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoPool.java
@@ -35,7 +35,7 @@ import java.util.function.Function;
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class GryoPool {
+public final class GryoPool {
     public static final String CONFIG_IO_REGISTRY = "gremlin.io.registry";
     public static final String CONFIG_IO_GRYO_POOL_SIZE = "gremlin.io.gryo.poolSize";
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
index a208e2f..234a04e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoReader.java
@@ -58,7 +58,7 @@ import java.util.function.Function;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public class GryoReader implements GraphReader {
+public final class GryoReader implements GraphReader {
     private final Kryo kryo;
 
     private final long batchSize;
@@ -246,7 +246,7 @@ public class GryoReader implements GraphReader {
         return new Builder();
     }
 
-    public static class Builder implements ReaderBuilder<GryoReader> {
+    public final static class Builder implements ReaderBuilder<GryoReader> {
 
         private long batchSize = 10000;
         /**

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
index fd63426..42ab74b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java
@@ -42,12 +42,12 @@ import org.apache.tinkerpop.shaded.kryo.io.Output;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-class GryoSerializers {
+final class GryoSerializers {
 
     /**
      * Serializes any {@link Edge} implementation encountered to a {@link DetachedEdge}.
      */
-    static class EdgeSerializer extends Serializer<Edge> {
+    final static class EdgeSerializer extends Serializer<Edge> {
         @Override
         public void write(final Kryo kryo, final Output output, final Edge edge) {
             kryo.writeClassAndObject(output, DetachedFactory.detach(edge, true));
@@ -63,7 +63,7 @@ class GryoSerializers {
     /**
      * Serializes any {@link Vertex} implementation encountered to an {@link DetachedVertex}.
      */
-    static class VertexSerializer extends Serializer<Vertex> {
+    final static class VertexSerializer extends Serializer<Vertex> {
         public VertexSerializer() {
         }
 
@@ -81,7 +81,7 @@ class GryoSerializers {
     /**
      * Serializes any {@link Property} implementation encountered to an {@link DetachedProperty}.
      */
-    static class PropertySerializer extends Serializer<Property> {
+    final static class PropertySerializer extends Serializer<Property> {
         public PropertySerializer() {
         }
 
@@ -99,7 +99,7 @@ class GryoSerializers {
     /**
      * Serializes any {@link VertexProperty} implementation encountered to an {@link DetachedVertexProperty}.
      */
-    static class VertexPropertySerializer extends Serializer<VertexProperty> {
+    final static class VertexPropertySerializer extends Serializer<VertexProperty> {
         public VertexPropertySerializer() {
         }
 
@@ -117,7 +117,7 @@ class GryoSerializers {
     /**
      * Serializes any {@link Path} implementation encountered to an {@link DetachedPath}.
      */
-    static class PathSerializer extends Serializer<Path> {
+    final static class PathSerializer extends Serializer<Path> {
         public PathSerializer() {
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
index 3435718..d98b8c2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
@@ -44,7 +44,7 @@ import java.util.Iterator;
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class GryoWriter implements GraphWriter {
+public final class GryoWriter implements GraphWriter {
     private Kryo kryo;
 
     private GryoWriter(final GryoMapper gryoMapper) {
@@ -158,7 +158,7 @@ public class GryoWriter implements GraphWriter {
         return new Builder();
     }
 
-    public static class Builder implements WriterBuilder<GryoWriter> {
+    public final static class Builder implements WriterBuilder<GryoWriter> {
         /**
          * Always creates the most current version available.
          */

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/URISerializer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/URISerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/URISerializer.java
index a19857d..7b6cfec 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/URISerializer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/URISerializer.java
@@ -28,7 +28,7 @@ import java.net.URI;
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-class URISerializer extends Serializer<URI> {
+final class URISerializer extends Serializer<URI> {
 
     public URISerializer() {
         setImmutable(true);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/UUIDSerializer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/UUIDSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/UUIDSerializer.java
index 0be904b..e694e38 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/UUIDSerializer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/UUIDSerializer.java
@@ -28,7 +28,7 @@ import java.util.UUID;
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-class UUIDSerializer extends Serializer<UUID> {
+final class UUIDSerializer extends Serializer<UUID> {
     public UUIDSerializer() {
         setImmutable(true);
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexByteArrayInputStream.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexByteArrayInputStream.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexByteArrayInputStream.java
index b6ba796..fa34e33 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexByteArrayInputStream.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexByteArrayInputStream.java
@@ -34,7 +34,7 @@ import java.util.List;
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class VertexByteArrayInputStream extends FilterInputStream {
+public final class VertexByteArrayInputStream extends FilterInputStream {
 
     private static final byte[] vertexTerminatorClass = new byte[]{15, 1, 1, 9};
     private static final byte[] pattern = ByteBuffer.allocate(vertexTerminatorClass.length + 8).put(vertexTerminatorClass).putLong(4185403236219066774L).array();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f3e4d54f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexTerminator.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexTerminator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexTerminator.java
index 64c96d7..2028459 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexTerminator.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/VertexTerminator.java
@@ -26,7 +26,7 @@ import java.util.Arrays;
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class VertexTerminator {
+public final class VertexTerminator {
     public static final VertexTerminator INSTANCE = new VertexTerminator();
 
     public final byte[] terminal;


[22/50] [abbrv] incubator-tinkerpop git commit: clean ups in Neo4j -- making things really nice.

Posted by dk...@apache.org.
clean ups in Neo4j -- making things really nice.


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

Branch: refs/heads/preprocessor
Commit: 7441b6be99e323ba945fe77d4be33ad39bc497ff
Parents: bbc6a0e
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 14:15:16 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 14:15:16 2015 -0600

----------------------------------------------------------------------
 .../gremlin/neo4j/structure/Neo4jEdge.java      | 25 ++++++++++++++++++++
 .../gremlin/neo4j/structure/Neo4jElement.java   | 25 --------------------
 .../gremlin/neo4j/structure/Neo4jGraph.java     |  4 +---
 .../gremlin/neo4j/structure/Neo4jHelper.java    | 23 ------------------
 .../neo4j/structure/Neo4jVertexProperty.java    |  1 -
 .../structure/trait/MultiMetaNeo4jTrait.java    |  4 ++--
 .../trait/NoMultiNoMetaNeo4jTrait.java          |  5 ++--
 7 files changed, 31 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7441b6be/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
index f0a5139..71e36eb 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
@@ -104,4 +104,29 @@ public final class Neo4jEdge extends Neo4jElement implements Edge, WrappedEdge<N
         return IteratorUtils.map(filter,
                 key -> new Neo4jProperty<>(this, key, (V) this.baseElement.getProperty(key)));
     }
+
+    @Override
+    public <V> Property<V> property(final String key) {
+        this.graph.tx().readWrite();
+        try {
+            if (this.baseElement.hasProperty(key))
+                return new Neo4jProperty<>(this, key, (V) this.baseElement.getProperty(key));
+            else
+                return Property.empty();
+        } catch (final IllegalStateException e) {
+            throw Element.Exceptions.elementAlreadyRemoved(this.getClass(), this.id());
+        }
+    }
+
+    @Override
+    public <V> Property<V> property(final String key, final V value) {
+        ElementHelper.validateProperty(key, value);
+        this.graph.tx().readWrite();
+        try {
+            this.baseElement.setProperty(key, value);
+            return new Neo4jProperty<>(this, key, value);
+        } catch (final IllegalArgumentException e) {
+            throw Property.Exceptions.dataTypeOfPropertyValueNotSupported(value);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7441b6be/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
index 7dfc9a8..28644b6 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
@@ -60,31 +60,6 @@ public abstract class Neo4jElement implements Element, WrappedElement<Neo4jEntit
     }
 
     @Override
-    public <V> Property<V> property(final String key) {
-        this.graph.tx().readWrite();
-        try {
-            if (this.baseElement.hasProperty(key))
-                return new Neo4jProperty<>(this, key, (V) this.baseElement.getProperty(key));
-            else
-                return Property.empty();
-        } catch (final IllegalStateException e) {
-            throw Element.Exceptions.elementAlreadyRemoved(this.getClass(), this.id());
-        }
-    }
-
-    @Override
-    public <V> Property<V> property(final String key, final V value) {
-        ElementHelper.validateProperty(key, value);
-        this.graph.tx().readWrite();
-        try {
-            this.baseElement.setProperty(key, value);
-            return new Neo4jProperty<>(this, key, value);
-        } catch (final IllegalArgumentException e) {
-            throw Property.Exceptions.dataTypeOfPropertyValueNotSupported(value);
-        }
-    }
-
-    @Override
     public boolean equals(final Object object) {
         return ElementHelper.areEqual(this, object);
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7441b6be/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
index a289bb9..2aeab7a 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
@@ -170,7 +170,6 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
         if (0 == vertexIds.length) {
             final Predicate<Neo4jNode> nodePredicate = this.trait.getNodePredicate();
             return IteratorUtils.stream(this.getBaseGraph().allNodes())
-                    //.filter(node -> !Neo4jHelper.isDeleted(node))
                     .filter(nodePredicate)
                     .map(node -> (Vertex) new Neo4jVertex(node, this)).iterator();
         } else {
@@ -203,7 +202,6 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
         if (0 == edgeIds.length) {
             final Predicate<Neo4jRelationship> relationshipPredicate = this.trait.getRelationshipPredicate();
             return IteratorUtils.stream(this.getBaseGraph().allRelationships())
-                    //.filter(relationship -> !Neo4jHelper.isDeleted(relationship))
                     .filter(relationshipPredicate)
                     .map(relationship -> (Edge) new Neo4jEdge(relationship, this)).iterator();
         } else {
@@ -217,7 +215,7 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
                         else if (id instanceof Neo4jEdge) {
                             return (Long) ((Neo4jEdge) id).id();
                         } else
-                            throw new IllegalArgumentException("Unknown vertex id type: " + id);
+                            throw new IllegalArgumentException("Unknown edge id type: " + id);
                     })
                     .flatMap(id -> {
                         try {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7441b6be/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
index 524a089..7c8c0d0 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
@@ -50,33 +50,10 @@ public final class Neo4jHelper {
         }
     }
 
-    /*public static boolean isDeleted(final Neo4jRelationship relationship) {
-        try {
-            relationship.type();
-            return false;
-        } catch (final IllegalStateException e) {
-            return true;
-        }
-    }*/
-
     public static boolean isNotFound(RuntimeException ex) {
         return ex.getClass().getSimpleName().equals("NotFoundException");
     }
 
-    /*public static boolean keyExistsInNeo4j(final Neo4jNode node, final String key) {
-        try {
-            return node.hasProperty(key);
-        } catch (IllegalStateException ex) {
-            // if vertex is removed before/after transaction close
-            throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, node.getId());
-        } catch (RuntimeException ex) {
-            // if vertex is removed before/after transaction close
-            if (Neo4jHelper.isNotFound(ex))
-                throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, node.getId());
-            throw ex;
-        }
-    }*/
-
     public static Neo4jNode getVertexPropertyNode(final Neo4jVertexProperty vertexProperty) {
         return vertexProperty.vertexPropertyNode;
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7441b6be/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
index 9c85dfc..74ff281 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
@@ -40,7 +40,6 @@ public final class Neo4jVertexProperty<V> implements VertexProperty<V> {
     protected Neo4jNode vertexPropertyNode;
     protected boolean removed = false;
 
-
     public Neo4jVertexProperty(final Neo4jVertex vertex, final String key, final V value) {
         this.vertex = vertex;
         this.key = key;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7441b6be/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
index fb2e8c2..336858c 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
@@ -72,10 +72,10 @@ public class MultiMetaNeo4jTrait implements Neo4jTrait {
     public void removeVertex(final Neo4jVertex vertex) {
         try {
             final Neo4jNode node = vertex.getBaseVertex();
-            for (final Neo4jRelationship relationship : node.relationships(Neo4jDirection.BOTH)) {
+            for (final Neo4jRelationship relationship : node.relationships(Neo4jDirection.OUTGOING)) {
                 final Neo4jNode otherNode = relationship.other(node);
                 if (otherNode.hasLabel(VERTEX_PROPERTY_LABEL)) {
-                    otherNode.relationships(null).forEach(Neo4jRelationship::delete);
+                    otherNode.relationships(Neo4jDirection.BOTH).forEach(Neo4jRelationship::delete);
                     otherNode.delete(); // meta property node
                 } else
                     relationship.delete();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7441b6be/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
index 25be842..d1647ad 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
@@ -111,8 +111,9 @@ public class NoMultiNoMetaNeo4jTrait implements Neo4jTrait {
 
     @Override
     public void removeVertexProperty(final Neo4jVertexProperty vertexProperty) {
-        if ((((Neo4jVertex) vertexProperty.element()).getBaseVertex().hasProperty(vertexProperty.key())))
-            ((Neo4jVertex) vertexProperty.element()).getBaseVertex().removeProperty(vertexProperty.key());
+        final Neo4jNode node = ((Neo4jVertex) vertexProperty.element()).getBaseVertex();
+        if (node.hasProperty(vertexProperty.key()))
+            node.removeProperty(vertexProperty.key());
     }
 
     @Override


[07/50] [abbrv] incubator-tinkerpop git commit: Finalize a variable.

Posted by dk...@apache.org.
Finalize a variable.


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

Branch: refs/heads/preprocessor
Commit: da00130c63a89792bc8c69a3b7a1458fe7103165
Parents: 0b4e555
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 12:22:06 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 12:22:06 2015 -0400

----------------------------------------------------------------------
 .../gremlin/driver/ser/JsonMessageSerializerV1d0Test.java          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/da00130c/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
index ef7dcc2..fe81f70 100644
--- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
+++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/ser/JsonMessageSerializerV1d0Test.java
@@ -106,7 +106,7 @@ public class JsonMessageSerializerV1d0Test {
     @Test
     public void serializeToJsonIteratorNullElement() throws Exception {
 
-        ArrayList<FunObject> funList = new ArrayList<>();
+        final ArrayList<FunObject> funList = new ArrayList<>();
         funList.add(new FunObject("x"));
         funList.add(null);
         funList.add(new FunObject("y"));


[18/50] [abbrv] incubator-tinkerpop git commit: merged master.

Posted by dk...@apache.org.
merged master.


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

Branch: refs/heads/preprocessor
Commit: 7b528b218b98eefd95f979525850800985bf8e9f
Parents: c19398c a1d26be
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 12:41:20 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 12:41:20 2015 -0600

----------------------------------------------------------------------
 .../gremlin/structure/util/Comparators.java     |  26 ++++-
 .../gremlin/structure/util/ElementHelper.java   |  53 +++++----
 .../gremlin/structure/util/ComparatorsTest.java | 111 +++++++++++++++++++
 .../structure/util/ElementHelperTest.java       |  79 ++++++++++---
 .../ser/JsonMessageSerializerV1d0Test.java      |   2 +-
 5 files changed, 224 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7b528b21/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
----------------------------------------------------------------------
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
index b5aa7f3,0245086..9f2a19a
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
@@@ -66,35 -65,6 +65,16 @@@ public final class ElementHelper 
              throw Element.Exceptions.labelCanNotBeAHiddenKey(label);
      }
  
-     /*public static void validateLabels(final String... labels) throws IllegalArgumentException {
-         for (final String label : labels) {
-             validateLabel(label);
-         }
-     }*/
- 
-     /**
-      * Check if the vertex, by ID, exists. If it does return it, else create it and return it.
-      *
-      * @param graph the graph to check for the existence of the vertex
-      * @param id    the id of the vertex to look for
-      * @param label the label of the vertex to set if the vertex does not exist
-      * @return a pre-existing vertex or a newly created vertex
-      */
-     public static Vertex getOrAddVertex(final Graph graph, final Object id, final String label) {
-         final Iterator<Vertex> iterator = graph.vertices(id);
-         return iterator.hasNext() ? iterator.next() : graph.addVertex(T.id, id, T.label, label);
-     }
- 
 +    public static void validateMixedElementIds(final Class<? extends Element> clazz, final Object... ids) {
 +        if (ids.length > 1) {
 +            final boolean element = clazz.isAssignableFrom(ids[0].getClass());
 +            for (int i = 1; i < ids.length; i++) {
 +                if (clazz.isAssignableFrom(ids[i].getClass()) != element)
 +                    throw Graph.Exceptions.idArgsMustBeEitherIdOrElement();
 +            }
 +        }
 +    }
 +
      /**
       * Determines whether the property key/value for the specified thing can be legally set. This is typically used as
       * a pre-condition check prior to setting a property.
@@@ -276,27 -265,8 +275,28 @@@
      }
  
      /**
 -     * Assign key/value pairs as properties to a {@link Vertex}.  If the value of {@link T#id} or
 +     * Assign key/value pairs as properties to an {@link org.apache.tinkerpop.gremlin.structure.Vertex}.  If the value of {@link T#id} or
-      * {@link T#label} is in the set of pairs, then they are ignored. The {@link org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality} of the key is determined from the {@link org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexFeatures}.
+      * {@link T#label} is in the set of pairs, then they are ignored.
++     * The {@link org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality} of the key is determined from the {@link org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexFeatures}.
 +     *
 +     * @param vertex            the graph vertex to assign the {@code propertyKeyValues}
 +     * @param propertyKeyValues the key/value pairs to assign to the {@code element}
 +     * @throws ClassCastException       if the value of the key is not a {@link String}
 +     * @throws IllegalArgumentException if the value of {@code element} is null
 +     */
 +    public static void attachProperties(final Vertex vertex, final Object... propertyKeyValues) {
 +        if (null == vertex)
 +            throw Graph.Exceptions.argumentCanNotBeNull("vertex");
 +
 +        for (int i = 0; i < propertyKeyValues.length; i = i + 2) {
 +            if (!propertyKeyValues[i].equals(T.id) && !propertyKeyValues[i].equals(T.label))
 +                vertex.property(vertex.graph().features().vertex().getCardinality((String) propertyKeyValues[i]), (String) propertyKeyValues[i], propertyKeyValues[i + 1]);
 +        }
 +    }
 +
 +    /**
-      * Assign key/value pairs as properties to a {@link org.apache.tinkerpop.gremlin.structure.Vertex}.  If the value of {@link T#id} or
-      * {@link T#label} is in the set of pairs, then they are ignored.
++     * Assign key/value pairs as properties to a {@link org.apache.tinkerpop.gremlin.structure.Vertex}.
++     * If the value of {@link T#id} or {@link T#label} is in the set of pairs, then they are ignored.
       *
       * @param vertex            the vertex to attach the properties to
       * @param cardinality       the cardinality of the key value pair settings

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7b528b21/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
----------------------------------------------------------------------
diff --cc gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
index 0ca3814,0c8dd4a..e8ec27c
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
@@@ -18,12 -18,14 +18,14 @@@
   */
  package org.apache.tinkerpop.gremlin.structure.util;
  
+ import org.apache.tinkerpop.gremlin.TestHelper;
 -import org.apache.tinkerpop.gremlin.structure.T;
  import org.apache.tinkerpop.gremlin.structure.Edge;
  import org.apache.tinkerpop.gremlin.structure.Element;
  import org.apache.tinkerpop.gremlin.structure.Graph;
  import org.apache.tinkerpop.gremlin.structure.Property;
 +import org.apache.tinkerpop.gremlin.structure.T;
  import org.apache.tinkerpop.gremlin.structure.Vertex;
+ import org.apache.tinkerpop.gremlin.structure.VertexProperty;
  import org.javatuples.Pair;
  import org.junit.Test;
  


[31/50] [abbrv] incubator-tinkerpop git commit: Neo4jGraphStep is now uses Neo4j schema indices appropriately. Much simpler Neo4jGraphStep without having to think about automatic indices.

Posted by dk...@apache.org.
Neo4jGraphStep is now uses Neo4j schema indices appropriately. Much simpler Neo4jGraphStep without having to think about automatic indices.


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

Branch: refs/heads/preprocessor
Commit: 50bd2973d81d1fd1d478da6ff565f841a542c48a
Parents: 486bc3b
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Sat May 30 13:45:40 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Sat May 30 13:45:40 2015 -0600

----------------------------------------------------------------------
 .../step/sideEffect/Neo4jGraphStep.java         | 111 +++++++------------
 .../gremlin/neo4j/structure/Neo4jGraph.java     |   1 +
 .../neo4j/AbstractNeo4jGraphProvider.java       |  28 +++++
 .../gremlin/neo4j/NativeNeo4jSuite.java         |   8 +-
 .../neo4j/structure/NativeNeo4jIndexTest.java   |  60 ++++++++++
 .../structure/NativeNeo4jStructureTest.java     |   2 -
 6 files changed, 137 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/50bd2973/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
index 949a22a..f274e32 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
@@ -20,30 +20,21 @@ package org.apache.tinkerpop.gremlin.neo4j.process.traversal.step.sideEffect;
 
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
-import org.apache.tinkerpop.gremlin.neo4j.structure.trait.MultiMetaNeo4jTrait;
 import org.apache.tinkerpop.gremlin.process.traversal.Compare;
-import org.apache.tinkerpop.gremlin.process.traversal.Contains;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GraphStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.javatuples.Pair;
-import org.neo4j.tinkerpop.api.Neo4jDirection;
-import org.neo4j.tinkerpop.api.Neo4jGraphAPI;
-import org.neo4j.tinkerpop.api.Neo4jNode;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import java.util.function.Predicate;
-import java.util.stream.Stream;
+import java.util.Optional;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -73,76 +64,56 @@ public final class Neo4jGraphStep<S extends Element> extends GraphStep<S> {
             return IteratorUtils.filter(graph.vertices(this.ids), vertex -> HasContainer.testAll((Vertex) vertex, this.hasContainers));
         ////// do index lookups //////
         graph.tx().readWrite();
-        // a label and a property
-        final Pair<String, HasContainer> labelHasPair = this.getHasContainerForLabelIndex();
-        if (null != labelHasPair)
-            return this.getVerticesUsingLabelAndProperty(labelHasPair.getValue0(), labelHasPair.getValue1())
-                    .filter(vertex -> HasContainer.testAll((Vertex) vertex, this.hasContainers)).iterator();
-        // only labels
-        final List<String> labels = this.getInternalLabels();
-        if (null != labels)
-            return this.getVerticesUsingOnlyLabels(labels).filter(vertex -> HasContainer.testAll((Vertex) vertex, this.hasContainers)).iterator();
-        // linear scan
-        return IteratorUtils.filter(graph.vertices(), vertex -> HasContainer.testAll((Vertex) vertex, this.hasContainers));
-    }
-
-
-    private Stream<Neo4jVertex> getVerticesUsingLabelAndProperty(final String label, final HasContainer hasContainer) {
-        final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
-        final Iterable<Neo4jNode> iterator1 = graph.getBaseGraph().findNodes(label, hasContainer.getKey(), hasContainer.getValue());
-        final Iterable<Neo4jNode> iterator2 = graph.getBaseGraph().findNodes(hasContainer.getKey(), T.value.getAccessor(), hasContainer.getValue());
-        final Stream<Neo4jVertex> stream1 = IteratorUtils.stream(iterator1)
-                .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
-                .map(node -> new Neo4jVertex(node, graph));
-        final Stream<Neo4jVertex> stream2 = IteratorUtils.stream(iterator2)
-                .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
-                .filter(node -> node.getProperty(T.key.getAccessor()).equals(hasContainer.getKey()))
-                .map(node -> node.relationships(Neo4jDirection.INCOMING).iterator().next().start())
-                .map(node -> new Neo4jVertex(node, graph));
-        return Stream.concat(stream1, stream2);
-    }
-
-    private Stream<Neo4jVertex> getVerticesUsingOnlyLabels(final List<String> labels) {
-        final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
-        final Predicate<Neo4jNode> nodePredicate = graph.getTrait().getNodePredicate();
-        return labels.stream()
-                .flatMap(label -> IteratorUtils.stream(graph.getBaseGraph().findNodes(label)))
-                .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
-                .filter(nodePredicate)
-                .map(node -> new Neo4jVertex(node, graph));
-    }
-
-    private Pair<String, HasContainer> getHasContainerForLabelIndex() {
-        final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
-        Neo4jGraphAPI baseGraph = graph.getBaseGraph();
-        for (final HasContainer hasContainer : this.hasContainers) {
-            if (hasContainer.getKey().equals(T.label.getAccessor()) && hasContainer.getBiPredicate().equals(Compare.eq)) {
-                if (baseGraph.hasSchemaIndex(
-                        (String) hasContainer.getValue(), hasContainer.getKey())) {
-                    return Pair.with((String) hasContainer.getValue(), hasContainer);
+        // get a label being search on
+        final Optional<String> label = this.hasContainers.stream()
+                .filter(hasContainer -> hasContainer.getKey().equals(T.label.getAccessor()))
+                .filter(hasContainer -> hasContainer.getPredicate().equals(Compare.eq))
+                .map(hasContainer -> (String) hasContainer.getValue())
+                .findAny();
+        if (label.isPresent()) {
+            // find a vertex by label and key/value
+            for (final HasContainer hasContainer : this.hasContainers) {
+                if (hasContainer.getPredicate().equals(Compare.eq)) {
+                    return IteratorUtils.filter(
+                            IteratorUtils.map(
+                                    graph.getBaseGraph().findNodes(label.get(), hasContainer.getKey(), hasContainer.getValue()).iterator(),
+                                    node -> new Neo4jVertex(node, graph)),
+                            vertex -> HasContainer.testAll(vertex, this.hasContainers));
+                }
+            }
+        } else {
+            // find a vertex by key/value
+            for (final HasContainer hasContainer : this.hasContainers) {
+                if (hasContainer.getPredicate().equals(Compare.eq)) {
+                    return IteratorUtils.filter(
+                            IteratorUtils.map(
+                                    graph.getBaseGraph().findNodes(hasContainer.getKey(), hasContainer.getValue()).iterator(),
+                                    node -> new Neo4jVertex(node, graph)),
+                            vertex -> HasContainer.testAll(vertex, this.hasContainers));
                 }
             }
         }
-        return null;
-    }
-
-    private List<String> getInternalLabels() {
-        for (final HasContainer hasContainer : this.hasContainers) {
-            if (hasContainer.getKey().equals(T.label.getAccessor()) && hasContainer.getBiPredicate().equals(Compare.eq))
-                return Arrays.asList(((String) hasContainer.getValue()));
-            else if (hasContainer.getKey().equals(T.label.getAccessor()) && hasContainer.getBiPredicate().equals(Contains.within))
-                return new ArrayList<>((Collection<String>) hasContainer.getValue());
+        if (label.isPresent()) {
+            // find a vertex by label
+            return IteratorUtils.filter(
+                    IteratorUtils.map(
+                            graph.getBaseGraph().findNodes(label.get()).iterator(),
+                            node -> new Neo4jVertex(node, graph)),
+                    vertex -> HasContainer.testAll(vertex, this.hasContainers));
+        } else {
+            // linear scan
+            return IteratorUtils.filter(graph.vertices(), vertex -> HasContainer.testAll((Vertex) vertex, this.hasContainers));
         }
-        return null;
     }
 
-    @Override
+    // TODO: move all this to the traits!
+
     public String toString() {
         if (this.hasContainers.isEmpty())
             return super.toString();
         else
             return 0 == this.ids.length ?
-                    StringFactory.stepString(this, this.hasContainers) :
-                    StringFactory.stepString(this, Arrays.toString(this.ids), this.hasContainers);
+                    StringFactory.stepString(this, this.returnClass.getSimpleName().toLowerCase(), this.hasContainers) :
+                    StringFactory.stepString(this, this.returnClass.getSimpleName().toLowerCase(), Arrays.toString(this.ids), this.hasContainers);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/50bd2973/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
index 31aa0c5..8a7060c 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
@@ -68,6 +68,7 @@ import java.util.stream.Stream;
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT)
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_INTEGRATE)
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_PERFORMANCE)
+@Graph.OptIn("org.apache.tinkerpop.gremlin.neo4j.NativeNeo4jSuite")
 public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
 
     static {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/50bd2973/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
index 41b6d0f..c59ad3f 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
@@ -75,6 +75,34 @@ public abstract class AbstractNeo4jGraphProvider extends AbstractGraphProvider {
         super.loadGraphData(graph, loadGraphWith, testClass, testName);
     }
 
+    public static void dropIndices(final Neo4jGraph graph, final LoadGraphWith.GraphData graphData) {
+        if (graphData.equals(LoadGraphWith.GraphData.GRATEFUL)) {
+            graph.tx().readWrite();
+            graph.cypher("DROP INDEX ON :artist(name)").iterate();
+            graph.cypher("DROP INDEX ON :song(name)").iterate();
+            graph.cypher("DROP INDEX ON :song(songType)").iterate();
+            graph.cypher("DROP INDEX ON :song(performances)").iterate();
+            graph.tx().commit();
+        } else if (graphData.equals(LoadGraphWith.GraphData.MODERN)) {
+            graph.tx().readWrite();
+            graph.cypher("DROP INDEX ON :person(name)").iterate();
+            graph.cypher("DROP INDEX ON :person(age)").iterate();
+            graph.cypher("DROP INDEX ON :software(name)").iterate();
+            graph.cypher("DROP INDEX ON :software(lang)").iterate();
+            graph.tx().commit();
+        } else if (graphData.equals(LoadGraphWith.GraphData.CLASSIC)) {
+            graph.tx().readWrite();
+            graph.cypher("DROP INDEX ON :vertex(name)").iterate();
+            graph.cypher("DROP INDEX ON :vertex(age)").iterate();
+            graph.cypher("DROP INDEX ON :vertex(lang)").iterate();
+            graph.tx().commit();
+        } else {
+            // TODO: add CREW work here.
+            // TODO: add meta_property indices when meta_property graph is provided
+            //throw new RuntimeException("Could not load graph with " + graphData);
+        }
+    }
+
     private void createIndices(final Neo4jGraph graph, final LoadGraphWith.GraphData graphData) {
         final Random random = new Random();
         final boolean pick = random.nextBoolean();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/50bd2973/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NativeNeo4jSuite.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NativeNeo4jSuite.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NativeNeo4jSuite.java
index cf23fda..58da3cf 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NativeNeo4jSuite.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NativeNeo4jSuite.java
@@ -23,6 +23,7 @@ package org.apache.tinkerpop.gremlin.neo4j;
 
 import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
 import org.apache.tinkerpop.gremlin.neo4j.process.NativeNeo4jCypherTest;
+import org.apache.tinkerpop.gremlin.neo4j.structure.NativeNeo4jIndexTest;
 import org.apache.tinkerpop.gremlin.neo4j.structure.NativeNeo4jStructureTest;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.junit.runners.model.InitializationError;
@@ -37,10 +38,15 @@ public class NativeNeo4jSuite extends AbstractGremlinSuite {
         super(klass, builder,
                 new Class<?>[]{
                         NativeNeo4jStructureTest.class,
+                        NativeNeo4jIndexTest.class,
                         NativeNeo4jCypherTest.class,
                 }, new Class<?>[]{
                         NativeNeo4jStructureTest.class,
-                        NativeNeo4jCypherTest.class}, true, TraversalEngine.Type.STANDARD);
+                        NativeNeo4jIndexTest.class,
+                        NativeNeo4jCypherTest.class
+                },
+                false,
+                TraversalEngine.Type.STANDARD);
     }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/50bd2973/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jIndexTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jIndexTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jIndexTest.java
new file mode 100644
index 0000000..0df3cf2
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jIndexTest.java
@@ -0,0 +1,60 @@
+/*
+ *
+ *  * 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.neo4j.structure;
+
+import org.apache.tinkerpop.gremlin.neo4j.AbstractNeo4jGremlinTest;
+import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.util.TimeUtil;
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class NativeNeo4jIndexTest extends AbstractNeo4jGremlinTest {
+
+    @Test
+    public void shouldHaveFasterRuntimeWithLabelKeyValueIndex() throws Exception {
+        final Neo4jGraph neo4j = (Neo4jGraph) this.graph;
+        for (int i = 0; i < 10000; i++) {
+            if (i % 2 == 0)
+                this.graph.addVertex(T.label, "something", "myId", i);
+            else
+                this.graph.addVertex(T.label, "nothing", "myId", i);
+        }
+        this.graph.tx().commit();
+        final Runnable traversal = () -> g.V().hasLabel("something").has("myId", 2000).tryNext().get();
+
+        // no index
+        TimeUtil.clock(10, traversal);
+        final double noIndexTime = TimeUtil.clock(20, traversal);
+        // index time
+        neo4j.cypher("CREATE INDEX ON :something(myId)").iterate();
+        this.graph.tx().commit();
+        Thread.sleep(5000); // wait for index to be build just in case
+        TimeUtil.clock(10, traversal);
+        final double indexTime = TimeUtil.clock(20, traversal);
+        //System.out.println(noIndexTime + "----" + indexTime);
+        assertTrue(noIndexTime > indexTime);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/50bd2973/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
index dc29a91..75e5d80 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
@@ -21,9 +21,7 @@
 
 package org.apache.tinkerpop.gremlin.neo4j.structure;
 
-import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.FeatureRequirement;
-import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 import org.apache.tinkerpop.gremlin.neo4j.AbstractNeo4jGremlinTest;
 import org.apache.tinkerpop.gremlin.neo4j.structure.trait.MultiMetaNeo4jTrait;


[46/50] [abbrv] incubator-tinkerpop git commit: Finalize all the Builder classes.

Posted by dk...@apache.org.
Finalize all the Builder classes.


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

Branch: refs/heads/preprocessor
Commit: 4a0bf78f55eb703de2cd832b879f683db3c3cff5
Parents: f3e4d54
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 15:42:45 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 15:42:45 2015 -0400

----------------------------------------------------------------------
 .../computer/clustering/peerpressure/ClusterCountMapReduce.java  | 2 +-
 .../clustering/peerpressure/ClusterPopulationMapReduce.java      | 2 +-
 .../clustering/peerpressure/PeerPressureVertexProgram.java       | 2 +-
 .../process/computer/ranking/pagerank/PageRankMapReduce.java     | 2 +-
 .../process/computer/ranking/pagerank/PageRankVertexProgram.java | 2 +-
 .../process/computer/traversal/TraversalVertexProgram.java       | 4 ++--
 .../process/traversal/dsl/graph/GraphTraversalSource.java        | 2 +-
 .../process/traversal/engine/ComputerTraversalEngine.java        | 2 +-
 .../process/traversal/engine/StandardTraversalEngine.java        | 2 +-
 .../process/traversal/strategy/decoration/ElementIdStrategy.java | 2 +-
 .../process/traversal/strategy/decoration/EventStrategy.java     | 2 +-
 .../process/traversal/strategy/decoration/PartitionStrategy.java | 2 +-
 .../process/traversal/strategy/decoration/SubgraphStrategy.java  | 2 +-
 .../main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java   | 2 +-
 .../apache/tinkerpop/gremlin/driver/message/ResponseMessage.java | 2 +-
 .../apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java  | 2 +-
 .../gremlin/algorithm/generator/CommunityGenerator.java          | 2 +-
 .../gremlin/algorithm/generator/DistributionGenerator.java       | 2 +-
 18 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/ClusterCountMapReduce.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/ClusterCountMapReduce.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/ClusterCountMapReduce.java
index 4b391ed..1112a46 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/ClusterCountMapReduce.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/ClusterCountMapReduce.java
@@ -109,7 +109,7 @@ public class ClusterCountMapReduce extends StaticMapReduce<MapReduce.NullObject,
         return new Builder();
     }
 
-    public static class Builder {
+    public final static class Builder {
 
         private String memoryKey = DEFAULT_MEMORY_KEY;
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/ClusterPopulationMapReduce.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/ClusterPopulationMapReduce.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/ClusterPopulationMapReduce.java
index c87926c..0318ad6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/ClusterPopulationMapReduce.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/ClusterPopulationMapReduce.java
@@ -109,7 +109,7 @@ public class ClusterPopulationMapReduce extends StaticMapReduce<Serializable, Lo
         return new Builder();
     }
 
-    public static class Builder {
+    public final static class Builder {
 
         private String memoryKey = DEFAULT_MEMORY_KEY;
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
index 2b9b972..f0e4448 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/clustering/peerpressure/PeerPressureVertexProgram.java
@@ -198,7 +198,7 @@ public class PeerPressureVertexProgram extends StaticVertexProgram<Pair<Serializ
         return new Builder();
     }
 
-    public static class Builder extends AbstractVertexProgramBuilder<Builder> {
+    public static final class Builder extends AbstractVertexProgramBuilder<Builder> {
 
 
         private Builder() {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankMapReduce.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankMapReduce.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankMapReduce.java
index 00e211d..cff5e39 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankMapReduce.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankMapReduce.java
@@ -91,7 +91,7 @@ public class PageRankMapReduce extends StaticMapReduce<Object, Double, Object, D
         return new Builder();
     }
 
-    public static class Builder {
+    public final static class Builder {
 
         private String memoryKey = DEFAULT_MEMORY_KEY;
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
index d469544..efb38ac 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/pagerank/PageRankVertexProgram.java
@@ -163,7 +163,7 @@ public class PageRankVertexProgram extends StaticVertexProgram<Double> {
         return new Builder();
     }
 
-    public static class Builder extends AbstractVertexProgramBuilder<Builder> {
+    public final static class Builder extends AbstractVertexProgramBuilder<Builder> {
 
         private Builder() {
             super(PageRankVertexProgram.class);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
index 1f079ec..31a5e96 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
@@ -276,9 +276,9 @@ public final class TraversalVertexProgram implements VertexProgram<TraverserSet<
         return new Builder();
     }
 
-    public static class Builder extends AbstractVertexProgramBuilder<Builder> {
+    public final static class Builder extends AbstractVertexProgramBuilder<Builder> {
 
-        public Builder() {
+        private Builder() {
             super(TraversalVertexProgram.class);
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
index c6e3baa..0bbbf6f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
@@ -179,7 +179,7 @@ public class GraphTraversalSource implements TraversalSource {
 
     //////
 
-    public static class Builder implements TraversalSource.Builder<GraphTraversalSource> {
+    public final static class Builder implements TraversalSource.Builder<GraphTraversalSource> {
 
         private TraversalEngine.Builder engineBuilder = StandardTraversalEngine.build();
         private List<TraversalStrategy> withStrategies = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java
index 8ef79f2..1f2bc7c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/ComputerTraversalEngine.java
@@ -65,7 +65,7 @@ public final class ComputerTraversalEngine implements TraversalEngine {
         return new Builder();
     }
 
-    public static class Builder implements TraversalEngine.Builder {
+    public final static class Builder implements TraversalEngine.Builder {
 
         private Class<? extends GraphComputer> graphComputerClass;
         private static final List<TraversalStrategy> WITH_STRATEGIES = Collections.singletonList(ComputerResultStrategy.instance());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java
index a3e4570..d2a62f1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/engine/StandardTraversalEngine.java
@@ -60,7 +60,7 @@ public final class StandardTraversalEngine implements TraversalEngine {
         return StringFactory.traversalEngineString(this);
     }
 
-    public static class Builder implements TraversalEngine.Builder {
+    public final static class Builder implements TraversalEngine.Builder {
 
         private static final Builder INSTANCE = new Builder();
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
index 7b18b83..eb5e866 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
@@ -152,7 +152,7 @@ public final class ElementIdStrategy extends AbstractTraversalStrategy<Traversal
         return StringFactory.traversalStrategyString(this);
     }
 
-    public static class Builder {
+    public final static class Builder {
         private String idPropertyKey = "__id";
 
         private Supplier<Object> idMaker = () -> UUID.randomUUID().toString();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
index 7910e81..30530b1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
@@ -80,7 +80,7 @@ public final class EventStrategy extends AbstractTraversalStrategy<TraversalStra
         }
     }
 
-    public static class Builder {
+    public final static class Builder {
         private final List<MutationListener> listeners = new ArrayList<>();
 
         Builder() {}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
index 69155e6..fc7a310 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
@@ -104,7 +104,7 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
         return Stream.concat(Stream.of(propertyKeyValues), Stream.of(partitionKey, writePartition)).toArray();
     }
 
-    public static class Builder {
+    public final static class Builder {
         private String writePartition;
         private String partitionKey;
         private Set<String> readPartitions = new HashSet<>();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
index b59c5d4..c04daa6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
@@ -136,7 +136,7 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS
         return new Builder();
     }
 
-    public static class Builder {
+    public final static class Builder {
 
         private Traversal<Vertex, ?> vertexCriterion = null;
         private Traversal<Edge, ?> edgeCriterion = null;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
index af6c850..574cedd 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
@@ -187,7 +187,7 @@ public class Cluster {
         return manager.allHosts();
     }
 
-    public static class Builder {
+    public final static class Builder {
         private List<InetAddress> addresses = new ArrayList<>();
         private int port = 8182;
         private MessageSerializer serializer = Serializers.GRYO_V1D0.simpleInstance();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/message/ResponseMessage.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/message/ResponseMessage.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/message/ResponseMessage.java
index f43f56e..b8af742 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/message/ResponseMessage.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/message/ResponseMessage.java
@@ -70,7 +70,7 @@ public class ResponseMessage {
         return new Builder(requestId);
     }
 
-    public static class Builder {
+    public final static class Builder {
 
         private final UUID requestId;
         private ResponseStatusCode code = ResponseStatusCode.SUCCESS;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
index 7489b22..e5914e7 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java
@@ -457,7 +457,7 @@ public class GremlinExecutor implements AutoCloseable {
         return new Builder().addEngineSettings(engineName, imports, staticImports, scripts, config);
     }
 
-    public static class Builder {
+    public final static class Builder {
         private long scriptEvaluationTimeout = 8000;
         private Map<String, EngineSettings> settings = new HashMap<>();
         private ExecutorService executorService = null;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/CommunityGenerator.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/CommunityGenerator.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/CommunityGenerator.java
index 18748c5..43d50e0 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/CommunityGenerator.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/CommunityGenerator.java
@@ -161,7 +161,7 @@ public class CommunityGenerator extends AbstractGenerator {
         return new Builder(g);
     }
 
-    public static class Builder extends AbstractGeneratorBuilder<Builder> {
+    public final static class Builder extends AbstractGeneratorBuilder<Builder> {
         private final Graph g;
         private Distribution communitySize = null;
         private Distribution edgeDegree = null;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4a0bf78f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/DistributionGenerator.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/DistributionGenerator.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/DistributionGenerator.java
index e57dbec..2ea906b 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/DistributionGenerator.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/DistributionGenerator.java
@@ -106,7 +106,7 @@ public class DistributionGenerator extends AbstractGenerator {
         return new Builder(g);
     }
 
-    public static class Builder extends AbstractGeneratorBuilder<Builder> {
+    public final static class Builder extends AbstractGeneratorBuilder<Builder> {
         private final Graph g;
         private Distribution outDistribution;
         private Distribution inDistribution;


[11/50] [abbrv] incubator-tinkerpop git commit: trying to fix a lowercase git bug.

Posted by dk...@apache.org.
trying to fix a lowercase git bug.


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

Branch: refs/heads/preprocessor
Commit: 364a2434505663857d18b39337ae692325d8a72d
Parents: 1cbad48
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 10:43:27 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 10:43:27 2015 -0600

----------------------------------------------------------------------
 ...MetaNeo4jGraphGroovyProcessStandardTest.java | 37 ++++++++++++++++++++
 1 file changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/364a2434/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest.java
new file mode 100644
index 0000000..1a7bcef
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest.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.neo4j.process.groovy;
+
+import org.apache.tinkerpop.gremlin.GraphProviderClass;
+import org.apache.tinkerpop.gremlin.neo4j.NoMultiNoMetaNeo4jGraphProvider;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
+import org.apache.tinkerpop.gremlin.process.GroovyProcessStandardSuite;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+@RunWith(GroovyProcessStandardSuite.class)
+@GraphProviderClass(provider = NoMultiNoMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class)
+public class NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest {
+
+}
\ No newline at end of file


[06/50] [abbrv] incubator-tinkerpop git commit: Add some notes to the docs about ivy settings.

Posted by dk...@apache.org.
Add some notes to the docs about ivy settings.


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

Branch: refs/heads/preprocessor
Commit: 4db0e1cd38fe0849523a5876302afe4d2f0a8532
Parents: efc143b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 11:02:24 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 11:02:24 2015 -0400

----------------------------------------------------------------------
 docs/src/gremlin-applications.asciidoc | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4db0e1cd/docs/src/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/gremlin-applications.asciidoc b/docs/src/gremlin-applications.asciidoc
index 4d4b377..ea3742a 100644
--- a/docs/src/gremlin-applications.asciidoc
+++ b/docs/src/gremlin-applications.asciidoc
@@ -54,6 +54,8 @@ Additionally, the Graph configuration can also be modified to include the local
 [source,xml]
 <ibiblio name="local" root="file:${user.home}/.m2/repository/" m2compatible="true"/>
 
+This configuration is useful during development (i.e. if one is working with locally built artifacts) of TinkerPop Plugins.  Consider adding the "local" reference first in the set of `<ibilio>` resolvers, as putting it after "apache-snapshots" will likely resolve dependencies from that repository before looking locally.  If it does that, then it's possible that the artifact from the newer local build will not be used.
+
 CAUTION: If building TinkerPop from source, be sure to clear TinkerPop-related jars from the `~/.groovy/grapes` directory as they can become stale on some systems and not re-import properly from the local `.m2` after fresh rebuilds.
 
 [[gremlin-console]]


[12/50] [abbrv] incubator-tinkerpop git commit: Add unit tests to Comparators.

Posted by dk...@apache.org.
Add unit tests to Comparators.


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

Branch: refs/heads/preprocessor
Commit: 530c63e82d491f636a75a8cbd41a3b6ec3063c7e
Parents: da00130
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 12:46:09 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 12:46:09 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/util/Comparators.java     | 26 +++++-
 .../gremlin/structure/util/ComparatorsTest.java | 93 ++++++++++++++++++++
 .../structure/util/ElementHelperTest.java       |  5 ++
 3 files changed, 122 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/530c63e8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Comparators.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Comparators.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Comparators.java
index 657c9c7..86ceb27 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Comparators.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/Comparators.java
@@ -27,13 +27,35 @@ import java.util.Comparator;
 import java.util.Map;
 
 /**
+ * A collection of commonly used {@link Comparator} instances.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class Comparators {
+
+    private Comparators() {}
+
+    /**
+     * Sorts {@link Element} objects  by the {@code toString()} value of {@link Element#id()} using
+     * {@link String#CASE_INSENSITIVE_ORDER}.
+     */
     public static final Comparator<Element> ELEMENT_COMPARATOR = Comparator.comparing(e -> e.id().toString(), String.CASE_INSENSITIVE_ORDER);
+
+    /**
+     * Sorts {@link Vertex} objects  by the {@code toString()} value of {@link Vertex#id()} using
+     * {@link String#CASE_INSENSITIVE_ORDER}.
+     */
     public static final Comparator<Vertex> VERTEX_COMPARATOR = Comparator.comparing(e -> e.id().toString(), String.CASE_INSENSITIVE_ORDER);
+
+    /**
+     * Sorts {@link Edge} objects  by the {@code toString()} value of {@link Edge#id()} using
+     * {@link String#CASE_INSENSITIVE_ORDER}.
+     */
     public static final Comparator<Edge> EDGE_COMPARATOR = Comparator.comparing(e -> e.id().toString(), String.CASE_INSENSITIVE_ORDER);
+
+    /**
+     * Sorts {@link Property} objects  by the value of {@link Property#key()} using
+     * {@link String#CASE_INSENSITIVE_ORDER}.
+     */
     public static final Comparator<Property> PROPERTY_COMPARATOR = Comparator.comparing(Property::key, String.CASE_INSENSITIVE_ORDER);
-    public static final Comparator<Map.Entry<String, Property>> PROPERTY_ENTRY_COMPARATOR = Comparator.comparing(Map.Entry::getKey, String.CASE_INSENSITIVE_ORDER);
-    public static final Comparator<Map.Entry<String, Object>> OBJECT_ENTRY_COMPARATOR = Comparator.comparing(Map.Entry::getKey, String.CASE_INSENSITIVE_ORDER);
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/530c63e8/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ComparatorsTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ComparatorsTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ComparatorsTest.java
new file mode 100644
index 0000000..d42a8e5
--- /dev/null
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ComparatorsTest.java
@@ -0,0 +1,93 @@
+package org.apache.tinkerpop.gremlin.structure.util;
+
+import org.apache.tinkerpop.gremlin.TestHelper;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Element;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class ComparatorsTest {
+    @Test
+    public void shouldBeUtilityClass() throws Exception {
+        TestHelper.assertIsUtilityClass(Comparators.class);
+    }
+
+    @Test
+    public void shouldSortElement() {
+        final Element a = mock(Element.class);
+        when(a.id()).thenReturn("Ant");
+        final Element b = mock(Element.class);
+        when(b.id()).thenReturn("Bat");
+        final Element c = mock(Element.class);
+        when(c.id()).thenReturn("Cat");
+
+        final List<Element> l = Arrays.asList(c, b, a);
+        l.sort(Comparators.ELEMENT_COMPARATOR);
+
+        assertEquals(a.id(), l.get(0).id());
+        assertEquals(b.id(), l.get(1).id());
+        assertEquals(c.id(), l.get(2).id());
+    }
+
+    @Test
+    public void shouldSortVertex() {
+        final Vertex a = mock(Vertex.class);
+        when(a.id()).thenReturn("Ant");
+        final Vertex b = mock(Vertex.class);
+        when(b.id()).thenReturn("Bat");
+        final Vertex c = mock(Vertex.class);
+        when(c.id()).thenReturn("Cat");
+
+        final List<Vertex> l = Arrays.asList(c, b, a);
+        l.sort(Comparators.VERTEX_COMPARATOR);
+
+        assertEquals(a.id(), l.get(0).id());
+        assertEquals(b.id(), l.get(1).id());
+        assertEquals(c.id(), l.get(2).id());
+    }
+
+    @Test
+    public void shouldSortEdge() {
+        final Edge a = mock(Edge.class);
+        when(a.id()).thenReturn("Ant");
+        final Edge b = mock(Edge.class);
+        when(b.id()).thenReturn("Bat");
+        final Edge c = mock(Edge.class);
+        when(c.id()).thenReturn("Cat");
+
+        final List<Edge> l = Arrays.asList(c, b, a);
+        l.sort(Comparators.EDGE_COMPARATOR);
+
+        assertEquals(a.id(), l.get(0).id());
+        assertEquals(b.id(), l.get(1).id());
+        assertEquals(c.id(), l.get(2).id());
+    }
+
+    @Test
+    public void shouldSortProperty() {
+        final Property a = mock(Property.class);
+        when(a.key()).thenReturn("Ant");
+        final Property b = mock(Property.class);
+        when(b.key()).thenReturn("Bat");
+        final Property c = mock(Property.class);
+        when(c.key()).thenReturn("Cat");
+
+        final List<Property> l = Arrays.asList(c, b, a);
+        l.sort(Comparators.PROPERTY_COMPARATOR);
+
+        assertEquals(a.key(), l.get(0).key());
+        assertEquals(b.key(), l.get(1).key());
+        assertEquals(c.key(), l.get(2).key());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/530c63e8/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
index 452a15b..2187298 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.structure.util;
 
+import org.apache.tinkerpop.gremlin.TestHelper;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Element;
@@ -40,6 +41,10 @@ import static org.mockito.Mockito.*;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class ElementHelperTest {
+    @Test
+    public void shouldBeUtilityClass() throws Exception {
+        TestHelper.assertIsUtilityClass(ElementHelper.class);
+    }
 
     @Test
     public void shouldValidatePropertyAndNotAllowNullValue() {


[47/50] [abbrv] incubator-tinkerpop git commit: Merge branch 'master' into preprocessor

Posted by dk...@apache.org.
Merge branch 'master' into preprocessor


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

Branch: refs/heads/preprocessor
Commit: 774100e2de0e6f42e197912935071ed9f2a54b62
Parents: 38a0733 4a0bf78
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Jun 1 22:27:41 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Jun 1 22:27:41 2015 +0200

----------------------------------------------------------------------
 .../peerpressure/ClusterCountMapReduce.java     |  2 +-
 .../ClusterPopulationMapReduce.java             |  2 +-
 .../peerpressure/PeerPressureVertexProgram.java |  2 +-
 .../ranking/pagerank/PageRankMapReduce.java     |  2 +-
 .../ranking/pagerank/PageRankVertexProgram.java |  2 +-
 .../traversal/TraversalVertexProgram.java       |  4 +-
 .../dsl/graph/GraphTraversalSource.java         |  2 +-
 .../engine/ComputerTraversalEngine.java         |  2 +-
 .../engine/StandardTraversalEngine.java         |  2 +-
 .../strategy/decoration/ElementIdStrategy.java  |  2 +-
 .../strategy/decoration/EventStrategy.java      |  2 +-
 .../strategy/decoration/PartitionStrategy.java  |  2 +-
 .../strategy/decoration/SubgraphStrategy.java   |  2 +-
 .../tinkerpop/gremlin/structure/Vertex.java     | 25 ++++---
 .../gremlin/structure/io/GraphMigrator.java     |  3 +
 .../tinkerpop/gremlin/structure/io/IoCore.java  |  3 +
 .../gremlin/structure/io/graphml/GraphMLIo.java |  6 +-
 .../structure/io/graphml/GraphMLMapper.java     |  6 +-
 .../structure/io/graphml/GraphMLReader.java     |  2 +-
 .../structure/io/graphml/GraphMLTokens.java     |  4 +-
 .../structure/io/graphml/GraphMLWriter.java     |  2 +-
 .../io/graphml/GraphMLWriterHelper.java         |  7 +-
 .../structure/io/graphson/GraphSONIo.java       |  6 +-
 .../structure/io/graphson/GraphSONModule.java   |  2 +-
 .../structure/io/graphson/GraphSONReader.java   |  9 ++-
 .../io/graphson/GraphSONSerializers.java        | 14 ++--
 .../structure/io/graphson/GraphSONVersion.java  |  2 +-
 .../structure/io/graphson/GraphSONWriter.java   |  2 +-
 .../io/graphson/LegacyGraphSONReader.java       | 73 ++++++++++----------
 .../structure/io/gryo/EntrySerializer.java      |  2 +-
 .../gremlin/structure/io/gryo/GryoIo.java       |  6 +-
 .../gremlin/structure/io/gryo/GryoMapper.java   |  2 +-
 .../gremlin/structure/io/gryo/GryoPool.java     |  2 +-
 .../gremlin/structure/io/gryo/GryoReader.java   |  4 +-
 .../structure/io/gryo/GryoSerializers.java      | 12 ++--
 .../gremlin/structure/io/gryo/GryoWriter.java   |  4 +-
 .../structure/io/gryo/URISerializer.java        |  2 +-
 .../structure/io/gryo/UUIDSerializer.java       |  2 +-
 .../io/gryo/VertexByteArrayInputStream.java     |  2 +-
 .../structure/io/gryo/VertexTerminator.java     |  2 +-
 .../gremlin/structure/io/GraphMigratorTest.java | 32 +++++++++
 .../gremlin/structure/io/IoCoreTest.java        | 53 ++++++++++++++
 .../tinkerpop/gremlin/driver/Cluster.java       |  2 +-
 .../gremlin/driver/message/ResponseMessage.java |  2 +-
 .../gremlin/groovy/engine/GremlinExecutor.java  |  2 +-
 .../algorithm/generator/CommunityGenerator.java |  2 +-
 .../generator/DistributionGenerator.java        |  2 +-
 47 files changed, 216 insertions(+), 113 deletions(-)
----------------------------------------------------------------------



[36/50] [abbrv] incubator-tinkerpop git commit: fixed a Vertex.remove() bug that showed up in VertexTest for Neo4jGraph. Neo4jGraphStep now relies on the Neo4jTrait for index lookups. Added a WARNING to docs about Neo4j and multi- meta- properties.

Posted by dk...@apache.org.
fixed a Vertex.remove() bug that showed up in VertexTest for Neo4jGraph. Neo4jGraphStep now relies on the Neo4jTrait for index lookups. Added a WARNING to docs about Neo4j and multi- meta- properties.


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

Branch: refs/heads/preprocessor
Commit: 8250a2f9155b20c8132770eef40867ca9722dd47
Parents: c520013
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jun 1 09:33:38 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jun 1 09:33:38 2015 -0600

----------------------------------------------------------------------
 docs/src/implementations.asciidoc               |  6 +-
 .../step/sideEffect/Neo4jGraphStep.java         | 52 +--------------
 .../gremlin/neo4j/structure/Neo4jGraph.java     | 22 ++++---
 .../structure/trait/MultiMetaNeo4jTrait.java    | 24 +++++--
 .../neo4j/structure/trait/Neo4jTrait.java       |  8 +++
 .../trait/NoMultiNoMetaNeo4jTrait.java          | 68 ++++++++++++++++++++
 6 files changed, 114 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8250a2f9/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index 3bad2a9..d759742 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -556,9 +556,11 @@ gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
 
 For those leveraging Neo4j High Availability, configure `Neo4jGraph` for "HA mode" by setting the `gremlin.neo4j.ha` flag to `true` in the `Configuration` object passed to `Neo4jGraph.open()`.  Note that when the flag is set (by default it is `false`), the `Neo4jGraph` instance expects HA configuration settings to be present.  As with embedded Neo4j, HA configuration keys should be prefixed with `gremlin.neo4j.conf`.  Please consult Neo4j documentation for more information on link:http://docs.neo4j.org/chunked/stable/ha.html[High Availability] configuration.
 
-IMPORTANT: `Neo4jGraph` supports both meta- and multi-properties (see <<_vertex_properties,vertex properties>>). However, these are implemented by making use of "hidden" Neo4j nodes. For example, when a vertex has multiple "name" properties, each property is a new node (multi-properties) which can have properties attached to it (meta-properties). As such, the underlying representation may become difficult to query directly using another graph language such as Cypher. The default setting is to disable multi- and meta-properties. However, if this feature is desired, then it can be activated via `gremlin.neo4j.metaProperties` and `gremlin.neo4j.multiProperties` configurations being set to `true`. Once the configuration is set, it can not be changed for the lifetime of the graph.
+IMPORTANT: `Neo4jGraph` supports both multi- and meta-properties (see <<_vertex_properties,vertex properties>>). This is not a native feature of Neo4j and is implemented by making use of "hidden" Neo4j nodes. For example, when a vertex has multiple "name" properties, each property is a new node (multi-properties) which can have properties attached to it (meta-properties). As such, the native, underlying representation may become difficult to query directly using another graph language such as Cypher. The default setting is to disable multi- and meta-properties. However, if this feature is desired, then it can be activated via `gremlin.neo4j.metaProperties` and `gremlin.neo4j.multiProperties` configurations being set to `true`. Once the configuration is set, it can not be changed for the lifetime of the graph.
 
-TIP: To host Neo4j in Gremlin Server, the dependencies must first be "installed" or otherwise copied to the Gremlin Server path.  The automated method for doing this would be to execute `bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin x.y.z`.
+WARNING: `Neo4jGraph` without multi- and meta-properties is in 1-to-1 correspondence with the native, underlying Neo4j representation. It is recommended that if the user does not require these features, then they should not enable them. Without multi- and meta-properties enabled, Neo4j can be interacted with with other tools and technologies that do not leverage TinkerPop.
+
+TIP: To host Neo4j in Gremlin Server, the dependencies must first be "installed" or otherwise copied to the Gremlin Server path. The automated method for doing this would be to execute `bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin x.y.z`.
 
 Indices
 ~~~~~~~

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8250a2f9/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
index f274e32..4d25c13 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
@@ -19,13 +19,10 @@
 package org.apache.tinkerpop.gremlin.neo4j.process.traversal.step.sideEffect;
 
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
-import org.apache.tinkerpop.gremlin.process.traversal.Compare;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GraphStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Element;
-import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
@@ -34,7 +31,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Optional;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -59,55 +55,9 @@ public final class Neo4jGraphStep<S extends Element> extends GraphStep<S> {
 
     private Iterator<? extends Vertex> vertices() {
         final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
-        // ids are present, filter on them first
-        if (this.ids != null && this.ids.length > 0)
-            return IteratorUtils.filter(graph.vertices(this.ids), vertex -> HasContainer.testAll((Vertex) vertex, this.hasContainers));
-        ////// do index lookups //////
-        graph.tx().readWrite();
-        // get a label being search on
-        final Optional<String> label = this.hasContainers.stream()
-                .filter(hasContainer -> hasContainer.getKey().equals(T.label.getAccessor()))
-                .filter(hasContainer -> hasContainer.getPredicate().equals(Compare.eq))
-                .map(hasContainer -> (String) hasContainer.getValue())
-                .findAny();
-        if (label.isPresent()) {
-            // find a vertex by label and key/value
-            for (final HasContainer hasContainer : this.hasContainers) {
-                if (hasContainer.getPredicate().equals(Compare.eq)) {
-                    return IteratorUtils.filter(
-                            IteratorUtils.map(
-                                    graph.getBaseGraph().findNodes(label.get(), hasContainer.getKey(), hasContainer.getValue()).iterator(),
-                                    node -> new Neo4jVertex(node, graph)),
-                            vertex -> HasContainer.testAll(vertex, this.hasContainers));
-                }
-            }
-        } else {
-            // find a vertex by key/value
-            for (final HasContainer hasContainer : this.hasContainers) {
-                if (hasContainer.getPredicate().equals(Compare.eq)) {
-                    return IteratorUtils.filter(
-                            IteratorUtils.map(
-                                    graph.getBaseGraph().findNodes(hasContainer.getKey(), hasContainer.getValue()).iterator(),
-                                    node -> new Neo4jVertex(node, graph)),
-                            vertex -> HasContainer.testAll(vertex, this.hasContainers));
-                }
-            }
-        }
-        if (label.isPresent()) {
-            // find a vertex by label
-            return IteratorUtils.filter(
-                    IteratorUtils.map(
-                            graph.getBaseGraph().findNodes(label.get()).iterator(),
-                            node -> new Neo4jVertex(node, graph)),
-                    vertex -> HasContainer.testAll(vertex, this.hasContainers));
-        } else {
-            // linear scan
-            return IteratorUtils.filter(graph.vertices(), vertex -> HasContainer.testAll((Vertex) vertex, this.hasContainers));
-        }
+        return graph.getTrait().lookupVertices(graph, this.hasContainers, this.ids);
     }
 
-    // TODO: move all this to the traits!
-
     public String toString() {
         if (this.hasContainers.isEmpty())
             return super.toString();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8250a2f9/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
index 8a7060c..c4dac93 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
@@ -109,7 +109,7 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
             this.neo4jGraphVariables.set(Graph.Hidden.hide(CONFIG_MULTI_PROPERTIES), supportsMultiProperties);
         if (!hasMetaProperties.isPresent())
             this.neo4jGraphVariables.set(Graph.Hidden.hide(CONFIG_META_PROPERTIES), supportsMetaProperties);
-        this.trait = supportsMultiProperties ? new MultiMetaNeo4jTrait() : new NoMultiNoMetaNeo4jTrait();
+        this.trait = supportsMultiProperties ? MultiMetaNeo4jTrait.instance() : NoMultiNoMetaNeo4jTrait.instance();
         this.tx().commit();
     }
 
@@ -168,14 +168,14 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
     @Override
     public Iterator<Vertex> vertices(final Object... vertexIds) {
         this.tx().readWrite();
+        final Predicate<Neo4jNode> nodePredicate = this.trait.getNodePredicate();
         if (0 == vertexIds.length) {
-            final Predicate<Neo4jNode> nodePredicate = this.trait.getNodePredicate();
             return IteratorUtils.stream(this.getBaseGraph().allNodes())
                     .filter(nodePredicate)
                     .map(node -> (Vertex) new Neo4jVertex(node, this)).iterator();
         } else {
             ElementHelper.validateMixedElementIds(Vertex.class, vertexIds);
-            return Stream.of(vertexIds)
+            return (Iterator) Stream.of(vertexIds)
                     .map(id -> {
                         if (id instanceof Number)
                             return ((Number) id).longValue();
@@ -188,26 +188,28 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
                     })
                     .flatMap(id -> {
                         try {
-                            return Stream.of((Vertex) new Neo4jVertex(this.baseGraph.getNodeById(id), this));
+                            return Stream.of(this.baseGraph.getNodeById(id));
                         } catch (final RuntimeException e) {
                             if (Neo4jHelper.isNotFound(e)) return Stream.empty();
                             throw e;
                         }
-                    }).iterator();
+                    })
+                    .filter(nodePredicate)
+                    .map(node -> new Neo4jVertex(node, this)).iterator();
         }
     }
 
     @Override
     public Iterator<Edge> edges(final Object... edgeIds) {
         this.tx().readWrite();
+        final Predicate<Neo4jRelationship> relationshipPredicate = this.trait.getRelationshipPredicate();
         if (0 == edgeIds.length) {
-            final Predicate<Neo4jRelationship> relationshipPredicate = this.trait.getRelationshipPredicate();
             return IteratorUtils.stream(this.getBaseGraph().allRelationships())
                     .filter(relationshipPredicate)
                     .map(relationship -> (Edge) new Neo4jEdge(relationship, this)).iterator();
         } else {
             ElementHelper.validateMixedElementIds(Edge.class, edgeIds);
-            return Stream.of(edgeIds)
+            return (Iterator) Stream.of(edgeIds)
                     .map(id -> {
                         if (id instanceof Number)
                             return ((Number) id).longValue();
@@ -220,12 +222,14 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
                     })
                     .flatMap(id -> {
                         try {
-                            return Stream.of((Edge) new Neo4jEdge(this.baseGraph.getRelationshipById(id), this));
+                            return Stream.of(this.baseGraph.getRelationshipById(id));
                         } catch (final RuntimeException e) {
                             if (Neo4jHelper.isNotFound(e)) return Stream.empty();
                             throw e;
                         }
-                    }).iterator();
+                    })
+                    .filter(relationshipPredicate)
+                    .map(relationship -> new Neo4jEdge(relationship, this)).iterator();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8250a2f9/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
index 336858c..bd6142d 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
@@ -26,6 +26,7 @@ import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jProperty;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
 import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Property;
@@ -42,6 +43,7 @@ import org.neo4j.tinkerpop.api.Neo4jRelationship;
 
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Optional;
 import java.util.function.Predicate;
 import java.util.stream.Stream;
@@ -51,6 +53,8 @@ import java.util.stream.Stream;
  */
 public class MultiMetaNeo4jTrait implements Neo4jTrait {
 
+    private static final MultiMetaNeo4jTrait INSTANCE = new MultiMetaNeo4jTrait();
+
     public static final String VERTEX_PROPERTY_LABEL = "vertexProperty";
     public static final String VERTEX_PROPERTY_PREFIX = Graph.Hidden.hide("");
     public static final String VERTEX_PROPERTY_TOKEN = Graph.Hidden.hide("vertexProperty");
@@ -58,6 +62,14 @@ public class MultiMetaNeo4jTrait implements Neo4jTrait {
     private static final Predicate<Neo4jNode> NODE_PREDICATE = node -> !node.hasLabel(VERTEX_PROPERTY_LABEL);
     private static final Predicate<Neo4jRelationship> RELATIONSHIP_PREDICATE = relationship -> !relationship.type().startsWith(VERTEX_PROPERTY_PREFIX);
 
+    private MultiMetaNeo4jTrait() {
+
+    }
+
+    public static MultiMetaNeo4jTrait instance() {
+        return INSTANCE;
+    }
+
     @Override
     public Predicate<Neo4jNode> getNodePredicate() {
         return NODE_PREDICATE;
@@ -72,13 +84,12 @@ public class MultiMetaNeo4jTrait implements Neo4jTrait {
     public void removeVertex(final Neo4jVertex vertex) {
         try {
             final Neo4jNode node = vertex.getBaseVertex();
-            for (final Neo4jRelationship relationship : node.relationships(Neo4jDirection.OUTGOING)) {
+            for (final Neo4jRelationship relationship : node.relationships(Neo4jDirection.BOTH)) {
                 final Neo4jNode otherNode = relationship.other(node);
                 if (otherNode.hasLabel(VERTEX_PROPERTY_LABEL)) {
-                    otherNode.relationships(Neo4jDirection.BOTH).forEach(Neo4jRelationship::delete);
                     otherNode.delete(); // meta property node
-                } else
-                    relationship.delete();
+                }
+                relationship.delete();
             }
             node.delete();
         } catch (final IllegalStateException ignored) {
@@ -247,6 +258,11 @@ public class MultiMetaNeo4jTrait implements Neo4jTrait {
                     key -> (Property<V>) new Neo4jProperty<>(vertexProperty, key, (V) vertexPropertyNode.getProperty(key)));
     }
 
+    @Override
+    public Iterator<Vertex> lookupVertices(final Neo4jGraph graph, final List<HasContainer> hasContainers, final Object... ids) {
+        return NoMultiNoMetaNeo4jTrait.instance().lookupVertices(graph, hasContainers, ids);
+    }
+
     /*
      @Override
     public Set<String> keys() {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8250a2f9/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/Neo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/Neo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/Neo4jTrait.java
index 9bb79ec..acfa0c6 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/Neo4jTrait.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/Neo4jTrait.java
@@ -21,14 +21,18 @@
 
 package org.apache.tinkerpop.gremlin.neo4j.structure.trait;
 
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
 import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.neo4j.tinkerpop.api.Neo4jNode;
 import org.neo4j.tinkerpop.api.Neo4jRelationship;
 
 import java.util.Iterator;
+import java.util.List;
 import java.util.function.Predicate;
 
 /**
@@ -64,4 +68,8 @@ public interface Neo4jTrait {
 
     public <V> Iterator<Property<V>> getProperties(final Neo4jVertexProperty vertexProperty, final String... keys);
 
+    ////
+
+    public Iterator<Vertex> lookupVertices(final Neo4jGraph graph, final List<HasContainer> hasContainers, final Object... ids);
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8250a2f9/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
index d1647ad..8961dba 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
@@ -21,10 +21,15 @@
 
 package org.apache.tinkerpop.gremlin.neo4j.structure.trait;
 
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
+import org.apache.tinkerpop.gremlin.process.traversal.Compare;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
 import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
@@ -33,6 +38,8 @@ import org.neo4j.tinkerpop.api.Neo4jNode;
 import org.neo4j.tinkerpop.api.Neo4jRelationship;
 
 import java.util.Iterator;
+import java.util.List;
+import java.util.Optional;
 import java.util.function.Predicate;
 
 /**
@@ -40,8 +47,18 @@ import java.util.function.Predicate;
  */
 public class NoMultiNoMetaNeo4jTrait implements Neo4jTrait {
 
+    private static final NoMultiNoMetaNeo4jTrait INSTANCE = new NoMultiNoMetaNeo4jTrait();
+
     private final static Predicate TRUE_PREDICATE = x -> true;
 
+    public static NoMultiNoMetaNeo4jTrait instance() {
+        return INSTANCE;
+    }
+
+    private NoMultiNoMetaNeo4jTrait() {
+
+    }
+
     @Override
     public Predicate<Neo4jNode> getNodePredicate() {
         return TRUE_PREDICATE;
@@ -130,4 +147,55 @@ public class NoMultiNoMetaNeo4jTrait implements Neo4jTrait {
     public <V> Iterator<Property<V>> getProperties(final Neo4jVertexProperty vertexProperty, final String... keys) {
         throw VertexProperty.Exceptions.metaPropertiesNotSupported();
     }
+
+    @Override
+    public Iterator<Vertex> lookupVertices(final Neo4jGraph graph, final List<HasContainer> hasContainers, final Object... ids) {
+        // ids are present, filter on them first
+        if (ids.length > 0)
+            return IteratorUtils.filter(graph.vertices(ids), vertex -> HasContainer.testAll(vertex, hasContainers));
+        ////// do index lookups //////
+        graph.tx().readWrite();
+        // get a label being search on
+        final Optional<String> label = hasContainers.stream()
+                .filter(hasContainer -> hasContainer.getKey().equals(T.label.getAccessor()))
+                .filter(hasContainer -> hasContainer.getPredicate().equals(Compare.eq))
+                .map(hasContainer -> (String) hasContainer.getValue())
+                .findAny();
+        if (label.isPresent()) {
+            // find a vertex by label and key/value
+            for (final HasContainer hasContainer : hasContainers) {
+                if (hasContainer.getPredicate().equals(Compare.eq)) {
+                    if (graph.getBaseGraph().hasSchemaIndex(label.get(), hasContainer.getKey())) {
+                        return IteratorUtils.filter(
+                                IteratorUtils.map(
+                                        IteratorUtils.filter(graph.getBaseGraph().findNodes(label.get(), hasContainer.getKey(), hasContainer.getValue()).iterator(), getNodePredicate()),
+                                        node -> new Neo4jVertex(node, graph)),
+                                vertex -> HasContainer.testAll(vertex, hasContainers));
+                    }
+                }
+            }
+        } else {
+            // find a vertex by key/value
+            for (final HasContainer hasContainer : hasContainers) {
+                if (hasContainer.getPredicate().equals(Compare.eq)) {
+                    return IteratorUtils.filter(
+                            IteratorUtils.map(
+                                    IteratorUtils.filter(graph.getBaseGraph().findNodes(hasContainer.getKey(), hasContainer.getValue()).iterator(), getNodePredicate()),
+                                    node -> new Neo4jVertex(node, graph)),
+                            vertex -> HasContainer.testAll(vertex, hasContainers));
+                }
+            }
+        }
+        if (label.isPresent()) {
+            // find a vertex by label
+            return IteratorUtils.filter(
+                    IteratorUtils.map(
+                            IteratorUtils.filter(graph.getBaseGraph().findNodes(label.get()).iterator(), getNodePredicate()),
+                            node -> new Neo4jVertex(node, graph)),
+                    vertex -> HasContainer.testAll(vertex, hasContainers));
+        } else {
+            // linear scan
+            return IteratorUtils.filter(graph.vertices(), vertex -> HasContainer.testAll(vertex, hasContainers));
+        }
+    }
 }


[48/50] [abbrv] incubator-tinkerpop git commit: a lot of work for the AsciiDocs preprocessor

Posted by dk...@apache.org.
a lot of work for the AsciiDocs preprocessor


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

Branch: refs/heads/preprocessor
Commit: 1a6015818cdd118e7d2ac29da57bac15de87e755
Parents: 774100e
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Jun 3 01:51:19 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Jun 3 01:51:19 2015 +0200

----------------------------------------------------------------------
 bin/process-docs.sh                      |  6 +--
 docs/preprocessor/install-plugins.groovy | 41 +++++++++++++++
 docs/preprocessor/install-plugins.sh     | 68 +++++++++++++++++++++++++
 docs/preprocessor/preprocess-file.sh     | 15 ++++--
 docs/preprocessor/preprocess.sh          | 64 ++++++++++++------------
 docs/preprocessor/processor.groovy       | 72 ++++++++++++---------------
 docs/preprocessor/uninstall-plugins.sh   | 36 ++++++++++++++
 7 files changed, 221 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/bin/process-docs.sh
----------------------------------------------------------------------
diff --git a/bin/process-docs.sh b/bin/process-docs.sh
index 2876328..1a62ca2 100755
--- a/bin/process-docs.sh
+++ b/bin/process-docs.sh
@@ -19,9 +19,5 @@
 #
 
 pushd "$(dirname $0)/.." > /dev/null
-
-docs/preprocessor/preprocess.sh
-mvn process-resources -Dasciidoc
-docs/postprocessor/postprocess.sh
-
+docs/preprocessor/preprocess.sh && mvn process-resources -Dasciidoc && docs/postprocessor/postprocess.sh
 popd > /dev/null

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/install-plugins.groovy
----------------------------------------------------------------------
diff --git a/docs/preprocessor/install-plugins.groovy b/docs/preprocessor/install-plugins.groovy
new file mode 100644
index 0000000..cc5b232
--- /dev/null
+++ b/docs/preprocessor/install-plugins.groovy
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+/**
+ * @author Daniel Kuppitz (http://gremlin.guru)
+ */
+import org.apache.tinkerpop.gremlin.groovy.plugin.Artifact
+import org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber
+
+installPlugin = { def artifact ->
+  def classLoader = new groovy.lang.GroovyClassLoader()
+  def extensionPath = System.getProperty("user.dir") + System.getProperty("file.separator") + "ext"
+  try {
+    System.err.print(" * ${artifact.getArtifact()} ... ")
+    new DependencyGrabber(classLoader, extensionPath).copyDependenciesToPath(artifact)
+    System.err.println("done")
+  } catch (Exception e) {
+    System.err.println("failed")
+    System.err.println()
+    System.err.println(e.getMessage())
+    e.printStackTrace()
+    System.exit(1)
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/install-plugins.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/install-plugins.sh b/docs/preprocessor/install-plugins.sh
new file mode 100755
index 0000000..a9a6497
--- /dev/null
+++ b/docs/preprocessor/install-plugins.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+#
+#
+# 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.
+#
+
+CONSOLE_HOME=$1
+TP_VERSION=$2
+TMP_DIR=$3
+INSTALL_TEMPLATE="docs/preprocessor/install-plugins.groovy"
+INSTALL_FILE="${TMP_DIR}/install-plugins.groovy"
+
+plugins=("hadoop-gremlin" "neo4j-gremlin")
+pluginsCount=${#plugins[@]}
+
+i=0
+
+cp ${INSTALL_TEMPLATE} ${INSTALL_FILE}
+
+while [ ${i} -lt ${pluginsCount} ]; do
+  pluginName=${plugins[$i]}
+  className=""
+  for part in $(tr '-' '\n' <<< ${pluginName}); do
+    className="${className}$(tr '[:lower:]' '[:upper:]' <<< ${part:0:1})${part:1}"
+  done
+  pluginClassFile=$(find . -name "${className}Plugin.java")
+  pluginClass=`sed -e 's@.*src/main/java/@@' -e 's/\.java$//' <<< ${pluginClassFile} | tr '/' '.'`
+  installed=`grep -c "${pluginClass}" ${CONSOLE_HOME}/ext/plugins.txt`
+  if [ ${installed} -eq 0 ]; then
+    echo "installPlugin(new Artifact(\"org.apache.tinkerpop\", \"${pluginName}\", \"${TP_VERSION}\"))" >> ${INSTALL_FILE}
+    echo "${pluginName}" >> ${TMP_DIR}/plugins.dir
+    echo "${pluginClass}" >> ${TMP_DIR}/plugins.txt
+  else
+    echo " * skipping ${pluginName} (already installed)"
+  fi
+  ((i++))
+done
+
+echo "System.exit(0)" >> ${INSTALL_FILE}
+
+pushd ${CONSOLE_HOME} > /dev/null
+bin/gremlin.sh ${INSTALL_FILE} > /dev/null
+
+if [ ${PIPESTATUS[0]} -ne 0 ]; then
+  popd > /dev/null
+  exit 1
+fi
+
+if [ -f "${TMP_DIR}/plugins.txt" ]; then
+  cat ${TMP_DIR}/plugins.txt >> ${CONSOLE_HOME}/ext/plugins.txt
+fi
+
+popd > /dev/null

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/preprocess-file.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess-file.sh b/docs/preprocessor/preprocess-file.sh
index 0bb621d..2bd66d3 100755
--- a/docs/preprocessor/preprocess-file.sh
+++ b/docs/preprocessor/preprocess-file.sh
@@ -26,20 +26,27 @@ input=$2
 name=`basename ${input}`
 output="${TP_HOME}/target/postprocess-asciidoc/${name}"
 
-echo "${input} > ${output}"
+echo
+echo " * source:   ${input}"
+echo "   target:   ${output}"
+echo -ne "   progress: initializing"
 
 if [ $(grep -c '^\[gremlin' ${input}) -gt 0 ]; then
   pushd "${CONSOLE_HOME}" > /dev/null
-  bin/gremlin.sh -e ${TP_HOME}/docs/preprocessor/processor.groovy ${input} > ${input}.groovy
+  bin/gremlin.sh -e ${TP_HOME}/docs/preprocessor/processor.groovy ${input} > ${input}.part2.groovy
+  cat ${input}.part2.groovy | grep -o '^pb([0-9][0-9]*' | tail -n1 | grep -o '[0-9]*' | xargs echo "TOTAL_LINES =" > ${input}.part1.groovy
+  cat ${input}.part?.groovy > ${input}.groovy && rm -f ${input}.part?.groovy
   ec=${PIPESTATUS[0]}
   if [ ${ec} -eq 0 ]; then
     HADOOP_GREMLIN_LIBS="${CONSOLE_HOME}/ext/hadoop-gremlin/lib" bin/gremlin.sh ${input}.groovy | awk 'BEGIN {b=1} /ΒΆIGNORE/ {b=!b} !/ΒΆIGNORE/ {if(a&&b)print} /ΒΆSTART/ {a=1}' | grep -v '^WARN ' | sed 's/^==>ΒΆ//' > ${output}
     ec=${PIPESTATUS[0]}
-    rm -f ${input}.groovy
   fi
   rm -f ${input}.groovy
   popd > /dev/null
-  exit ${ec}
+  if [ ${ec} -ne 0 ]; then
+    exit 255
+  fi
 else
   cp ${input} ${output}
+  echo -ne "\r   progress: [====================================================================================================] 100%\n"
 fi

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index 66f3367..18427a1 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -44,49 +44,47 @@ TP_HOME=`pwd`
 CONSOLE_HOME=`directory "${TP_HOME}/gremlin-console/target/apache-gremlin-console-*-standalone"`
 PLUGIN_DIR="${CONSOLE_HOME}/ext"
 TP_VERSION=$(cat pom.xml | grep -A1 '<artifactId>tinkerpop</artifactId>' | grep -o 'version>[^<]*' | grep -o '>.*' | grep -o '[^>]*')
-
-# install Hadoop plugin
-hadoopPlugin=$(find . -name "HadoopGremlinPlugin.java")
-hadoopPluginName=`echo ${hadoopPlugin} | cut -d '/' -f2`
-hadoopPluginClass=`echo ${hadoopPlugin} | sed -e 's@.*src/main/java/@@' -e 's/\.java$//' | tr '/' '.'`
-hadoopPluginDirectory="${PLUGIN_DIR}/${hadoopPluginName}"
-match=`grep -c "$hadoopPluginClass" ${PLUGIN_DIR}/plugins.txt`
+TMP_DIR="/tmp/tp-docs-preprocessor"
 
 trap cleanup INT
 
 function cleanup() {
-  # remove Hadoop plugin if it wasn't installed prior pre-processing
-  if [ "${rmHadoopPlugin}" == "1" ]; then
-    rm -rf "${PLUGIN_DIR}/${hadoopPluginName}"
-    sed -e "/${hadoopPluginClass}/d" "${PLUGIN_DIR}/plugins.txt" > "${PLUGIN_DIR}/plugins.txt."
-    mv "${PLUGIN_DIR}/plugins.txt." "${PLUGIN_DIR}/plugins.txt"
-  fi
+  echo -ne "\r\n\n"
+  docs/preprocessor/uninstall-plugins.sh "${CONSOLE_HOME}" "${TMP_DIR}"
   find "${TP_HOME}/docs/src/" -name "*.asciidoc.groovy" | xargs rm -f
+  rm -rf ${TMP_DIR}
 }
 
-if [ ! -z "${hadoopPluginName}" ] && [ ! -d "${hadoopPluginDirectory}" ] && [ ${match} -eq 0 ]; then
-  rmHadoopPlugin=1
-  echo -e "\n${hadoopPluginClass}" >> "${PLUGIN_DIR}/plugins.txt"
-  mkdir -p "${PLUGIN_DIR}/${hadoopPluginName}/"{lib,plugin}
-  cp ${hadoopPluginName}/target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/plugin"
-  libdir=`directory "${hadoopPluginName}/target/*-standalone/lib/"`
-  if [ -d "${libdir}" ]; then
-    cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/plugin"
-  fi
-  cp */target/*${TP_VERSION}.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
-  for libdir in $(find . -name lib | grep -v ext); do
-    cp ${libdir}/*.jar "${PLUGIN_DIR}/${hadoopPluginName}/lib"
-  done
-  rm -f "${PLUGIN_DIR}/hadoop-gremlin"/plugin/slf4j-*.jar
-  echo "System.exit(0)" > "${PLUGIN_DIR}/${hadoopPluginName}/init.groovy"
-  ${CONSOLE_HOME}/bin/gremlin.sh "${PLUGIN_DIR}/${hadoopPluginName}/init.groovy" > /dev/null 2> /dev/null
-fi
+mkdir -p ${TMP_DIR}
 
-# copy Gremlin-Hadoop configuration files
-cp ${TP_HOME}/hadoop-gremlin/conf/* "${CONSOLE_HOME}/conf/"
+# install plugins
+echo
+echo "=========================="
+echo "+   Installing Plugins   +"
+echo "=========================="
+echo
+docs/preprocessor/install-plugins.sh "${CONSOLE_HOME}" "${TP_VERSION}" "${TMP_DIR}"
+
+if [ ${PIPESTATUS[0]} -ne 0 ]; then
+  cleanup
+  exit 1
+else
+  echo
+fi
 
 # process *.asciidoc files
-find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 -P4 "${TP_HOME}/docs/preprocessor/preprocess-file.sh" "${CONSOLE_HOME}"
+echo
+echo "============================"
+echo "+   Processing AsciiDocs   +"
+echo "============================"
+find "${TP_HOME}/docs/src/" -name "*.asciidoc" | xargs -n1 ${TP_HOME}/docs/preprocessor/preprocess-file.sh "${CONSOLE_HOME}"
+
+if [ ${PIPESTATUS[1]} -ne 0 ]; then
+  cleanup
+  exit 1
+else
+  echo
+fi
 
 cleanup
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/processor.groovy
----------------------------------------------------------------------
diff --git a/docs/preprocessor/processor.groovy b/docs/preprocessor/processor.groovy
index d4831d6..3c3b3b6 100644
--- a/docs/preprocessor/processor.groovy
+++ b/docs/preprocessor/processor.groovy
@@ -38,9 +38,8 @@ def imports = new org.apache.tinkerpop.gremlin.console.ConsoleImportCustomizerPr
 def skipNextRead = false
 def inCodeSection = false
 def engine
-def lineNumber = 0;
-def line = "";
-def plugins = []
+def lineNumber = 0
+def line = ""
 
 sanitize = { def codeLine ->
     codeLine.replaceAll(/\s*(\<\d+\>\s*)*\<\d+\>\s*$/, "").replaceAll(/\s*\/\/.*$/, "").trim()
@@ -50,11 +49,27 @@ format = { def codeLine ->
     codeLine.replaceAll(/\s*((\s\<\d+\>\s*)*\s\<\d+\>)\s*$/, '   ////$1').replaceAll(/(\.\.\/){3}[^\/]+\//, "")
 }
 
-stringify = { def string ->
-    "\"ΒΆ" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll(/"/, "\\\\\"").replaceAll(/\$/, "\\\\\\\$") + "\""
+stringify = { def string, def lineNum = -1 ->
+    //def result = lineNum >= 0 ? "pb(${System.env['PREPROCESSOR_TOTAL_LINES']}, ${lineNum});" : ""
+    def result = lineNum >= 0 ? "pb(${lineNum});" : ""
+    "${result}\"ΒΆ" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll(/"/, "\\\\\"").replaceAll(/\$/, "\\\\\\\$") + "\""
 }
 
-println stringify("START")
+println """pb = { def progress ->
+  def barLength = 100
+  def ratio = barLength / 100
+  def builder = new StringBuilder()
+  def percent = (int) ((progress / TOTAL_LINES) * 100)
+  def progressLength = (int) ((progress / TOTAL_LINES) * (100 * ratio))
+  builder.append('=' * progressLength)
+  if (progressLength < barLength) {
+    builder.append('>')
+    builder.append(' ' * (barLength - progressLength - 1))
+  }
+  System.err.print(String.format("\\r   progress: [%s] %s", builder, "\${percent}%"))
+}"""
+
+println stringify("START", 0)
 
 new File(this.args[0]).withReader { reader ->
     try {
@@ -64,13 +79,10 @@ new File(this.args[0]).withReader { reader ->
             if (inCodeSection) {
                 inCodeSection = !line.equals(BLOCK_DELIMITER)
                 if (inCodeSection) {
-                    /*def script = new StringBuilder(header.toString())
-                    imports.getCombinedImports().each { script.append("import ${it}\n") }
-                    imports.getCombinedStaticImports().each { script.append("import static ${it}\n") }*/
                     def script = new StringBuilder()
                     def sanitizedLine = sanitize(line)
                     script.append(sanitizedLine)
-                    println stringify(STATEMENT_PREFIX + format(line))
+                    println stringify(STATEMENT_PREFIX + format(line), lineNumber)
                     if (!sanitizedLine.isEmpty() && sanitizedLine[-1] in STATEMENT_CONTINUATION_CHARACTERS) {
                         while (true) {
                             line = reader.readLine()
@@ -80,38 +92,17 @@ new File(this.args[0]).withReader { reader ->
                             }
                             sanitizedLine = sanitize(line)
                             script.append(sanitizedLine)
-                            println stringify(STATEMENT_CONTINUATION_PREFIX + format(line))
+                            println stringify(STATEMENT_CONTINUATION_PREFIX + format(line), lineNumber)
                         }
                     }
-                    if (line.startsWith("import ")) {
-                        println "..."
-                    } else {
-                        if (line.equals(BLOCK_DELIMITER)) {
-                            skipNextRead = false
-                            inCodeSection = false
-                        }
-                        //def res = engine.eval(script.toString())
-                        println script.toString()
-/*
-                        if (res instanceof Map) {
-                            res = res.entrySet()
-                        }
-                        if (res instanceof Iterable) {
-                            res = res.iterator()
-                        }
-                        if (res instanceof Iterator) {
-                            while (res.hasNext()) {
-                                def current = res.next()
-                                println RESULT_PREFIX + (current ?: "null")
-                            }
-                        } else if (!line.isEmpty() && !line.startsWith("//")) {
-                            println RESULT_PREFIX + (res ?: "null")
-                        }
-*/
+                    if (line.equals(BLOCK_DELIMITER)) {
+                        skipNextRead = false
+                        inCodeSection = false
                     }
+                    println script.toString()
                 }
                 if (!inCodeSection) {
-                    println stringify(BLOCK_DELIMITER)
+                    println stringify(BLOCK_DELIMITER, lineNumber)
                 }
             } else {
                 if (line.startsWith("[gremlin-")) {
@@ -128,16 +119,19 @@ new File(this.args[0]).withReader { reader ->
                     }
                     println "g = graph.traversal(standard())"
                     println "marko = g.V().has(\"name\", \"marko\").tryNext().orElse(null)"
+                    println "f = new File('/tmp/neo4j')"
+                    println "if (f.exists()) f.deleteDir()"
                     println stringify("IGNORE")
                     reader.readLine()
                     inCodeSection = true
                     println stringify("[source,${lang}]")
                     println stringify(BLOCK_DELIMITER)
-                } else println stringify(line)
+                } else println stringify(line, lineNumber)
             }
         }
     } catch (final Throwable e) {
         try {
+            System.err.println()
             e.printStackTrace()
             throw new IllegalArgumentException("The script that failed:\n(${lineNumber}) ${line}");
         } catch (final Exception e1) {
@@ -147,4 +141,4 @@ new File(this.args[0]).withReader { reader ->
     }
 }
 
-println "System.exit(0)"
+println "System.err.println(); System.exit(0)"

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1a601581/docs/preprocessor/uninstall-plugins.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/uninstall-plugins.sh b/docs/preprocessor/uninstall-plugins.sh
new file mode 100755
index 0000000..6353fe5
--- /dev/null
+++ b/docs/preprocessor/uninstall-plugins.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+#
+# 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.
+#
+
+CONSOLE_HOME=$1
+TMP_DIR=$2
+
+if [ -f "${TMP_DIR}/plugins.dir" ]; then
+  for pluginDirectory in $(cat ${TMP_DIR}/plugins.dir); do
+    rm -rf ${CONSOLE_HOME}/ext/${pluginDirectory}
+  done
+fi
+
+if [ -f "${TMP_DIR}/plugins.txt" ]; then
+  for className in $(cat ${TMP_DIR}/plugins.txt); do
+    sed -e "/${className}/d" ${CONSOLE_HOME}/ext/plugins.txt > ${CONSOLE_HOME}/ext/plugins.txt.
+    mv ${CONSOLE_HOME}/ext/plugins.txt. ${CONSOLE_HOME}/ext/plugins.txt
+  done
+fi


[09/50] [abbrv] incubator-tinkerpop git commit: Neo4jTrait now exists -- NoMultiNoMetaNeo4jTrait and MultiMetaNeo4jTrait. Simpler code.

Posted by dk...@apache.org.
Neo4jTrait now exists -- NoMultiNoMetaNeo4jTrait and MultiMetaNeo4jTrait. Simpler code.


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

Branch: refs/heads/preprocessor
Commit: b88768191e4d6b77ff4923c392e0dcc64d2662db
Parents: 4db0e1c
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 10:39:00 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 10:39:17 2015 -0600

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/Vertex.java     |   6 +-
 .../step/sideEffect/Neo4jGraphStep.java         |  21 +-
 .../neo4j/process/util/Neo4jCypherIterator.java |   6 +-
 .../gremlin/neo4j/structure/Neo4jEdge.java      |  12 +-
 .../gremlin/neo4j/structure/Neo4jElement.java   |   1 -
 .../gremlin/neo4j/structure/Neo4jGraph.java     |  64 +++--
 .../gremlin/neo4j/structure/Neo4jHelper.java    |  24 ++
 .../gremlin/neo4j/structure/Neo4jProperty.java  |   2 +-
 .../gremlin/neo4j/structure/Neo4jVertex.java    |  55 ++--
 .../neo4j/structure/Neo4jVertexProperty.java    |  54 +++-
 .../neo4j/structure/full/FullNeo4jGraph.java    |  80 ------
 .../neo4j/structure/full/FullNeo4jProperty.java |  56 ----
 .../neo4j/structure/full/FullNeo4jVertex.java   | 162 ------------
 .../structure/full/FullNeo4jVertexProperty.java | 151 -----------
 .../structure/simple/SimpleNeo4jGraph.java      | 109 --------
 .../structure/simple/SimpleNeo4jVertex.java     | 101 -------
 .../simple/SimpleNeo4jVertexProperty.java       |  67 -----
 .../structure/trait/MultiMetaNeo4jTrait.java    | 261 +++++++++++++++++++
 .../neo4j/structure/trait/Neo4jTrait.java       |  67 +++++
 .../trait/NoMultiNoMetaNeo4jTrait.java          | 134 ++++++++++
 .../gremlin/neo4j/FullNeo4jGraphProvider.java   |  45 ----
 .../neo4j/MultiMetaNeo4jGraphProvider.java      |  45 ++++
 .../neo4j/NoMultiNoMetaNeo4jGraphProvider.java  |  48 ++++
 .../gremlin/neo4j/SimpleNeo4jGraphProvider.java |  48 ----
 .../FullNeo4jGraphProcessStandardTest.java      |  37 ---
 .../MultiMetaNeo4jGraphProcessStandardTest.java |  36 +++
 ...ultiNoMetaNeo4jGraphProcessStandardTest.java |  36 +++
 .../SimpleNeo4jGraphProcessStandardTest.java    |  36 ---
 ...FullNeo4jGraphGroovyProcessStandardTest.java |  33 ---
 ...MetaNeo4jGraphGroovyProcessStandardTest.java |  33 +++
 ...metaNeo4jGraphGroovyProcessStandardTest.java |  36 +++
 ...mpleNeo4jGraphGroovyProcessStandardTest.java |  36 ---
 .../FullNeo4jGraphNativeNeo4jTest.java          |  36 ---
 .../FullNeo4jGraphStructureStandardTest.java    |  36 ---
 .../MultiMetaNeo4jGraphNativeNeo4jTest.java     |  35 +++
 ...ultiMetaNeo4jGraphStructureStandardTest.java |  35 +++
 .../structure/NativeNeo4jStructureTest.java     |  24 +-
 .../NoMultiNoMetaNeo4jGraphNativeNeo4jTest.java |  35 +++
 ...tiNoMetaNeo4jGraphStructureStandardTest.java |  35 +++
 .../SimpleNeo4jGraphNativeNeo4jTest.java        |  36 ---
 .../SimpleNeo4jGraphStructureStandardTest.java  |  36 ---
 41 files changed, 996 insertions(+), 1214 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
index 934000a..a26d1d8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
@@ -94,7 +94,7 @@ public interface Vertex extends Element, Host {
     /**
      * Set the provided key to the provided value using default {@link VertexProperty.Cardinality} for that key.
      * The default cardinality can be vendor defined and is usually tied to the graph schema.
-     * If the vendor does not have a preference, then the default cardinality should be {@link VertexProperty.Cardinality#single}.
+     * The default implementation of this method determines the cardinality {@code graph().features().vertex().getCardinality(key)}.
      * The provided key/values are the properties of the newly created {@link VertexProperty}.
      * These key/values must be provided in an even number where the odd numbered arguments are {@link String}.
      *
@@ -104,7 +104,9 @@ public interface Vertex extends Element, Host {
      * @param <V>       the type of the value of the vertex property
      * @return the newly created vertex property
      */
-    public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues);
+    public default <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
+        return this.property(graph().features().vertex().getCardinality(key), key, value, keyValues);
+    }
 
     /**
      * Create a new vertex property.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
index 9d215f8..dbc5a32 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
@@ -21,8 +21,7 @@ package org.apache.tinkerpop.gremlin.neo4j.process.traversal.step.sideEffect;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jEdge;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
-import org.apache.tinkerpop.gremlin.neo4j.structure.full.FullNeo4jVertexProperty;
+import org.apache.tinkerpop.gremlin.neo4j.structure.trait.MultiMetaNeo4jTrait;
 import org.apache.tinkerpop.gremlin.process.traversal.Compare;
 import org.apache.tinkerpop.gremlin.process.traversal.Contains;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GraphStep;
@@ -107,12 +106,12 @@ public final class Neo4jGraphStep<S extends Element> extends GraphStep<S> {
         final Iterable<Neo4jNode> iterator2 = graph.getBaseGraph().findNodes(hasContainer.getKey(), T.value.getAccessor(), hasContainer.getValue());
         final Stream<Neo4jVertex> stream1 = IteratorUtils.stream(iterator1)
                 .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
-                .map(node -> graph.createVertex(node));
+                .map(node -> new Neo4jVertex(node,graph));
         final Stream<Neo4jVertex> stream2 = IteratorUtils.stream(iterator2)
                 .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
                 .filter(node -> node.getProperty(T.key.getAccessor()).equals(hasContainer.getKey()))
                 .map(node -> node.relationships(Neo4jDirection.INCOMING).iterator().next().start())
-                .map(node -> graph.createVertex(node));
+                .map(node -> new Neo4jVertex(node,graph));
         return Stream.concat(stream1, stream2);
     }
 
@@ -120,30 +119,30 @@ public final class Neo4jGraphStep<S extends Element> extends GraphStep<S> {
         //System.out.println("labels: " + labels);
         final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
         return labels.stream()
-                .filter(label -> !label.equals(FullNeo4jVertexProperty.VERTEX_PROPERTY_LABEL))
+                .filter(label -> !label.equals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_LABEL))      // TODO: use predicates
                 .flatMap(label -> IteratorUtils.stream(graph.getBaseGraph().findNodes(label)))
-                .filter(node -> !node.hasLabel(FullNeo4jVertexProperty.VERTEX_PROPERTY_LABEL))
+                .filter(node -> !node.hasLabel(MultiMetaNeo4jTrait.VERTEX_PROPERTY_LABEL))
                 .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
-                .map(node -> graph.createVertex(node));
+                .map(node -> new Neo4jVertex(node,graph));
     }
 
     private Stream<Neo4jVertex> getVerticesUsingAutomaticIndex(final HasContainer hasContainer) {
         //System.out.println("automatic index: " + hasContainer);
         final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
         return IteratorUtils.stream(graph.getBaseGraph().findNodes(hasContainer.getKey(), hasContainer.getValue()).iterator())
-                .map(node -> node.hasLabel(FullNeo4jVertexProperty.VERTEX_PROPERTY_LABEL) ?
+                .map(node -> node.hasLabel(MultiMetaNeo4jTrait.VERTEX_PROPERTY_LABEL) ?
                         node.relationships(Neo4jDirection.INCOMING).iterator().next().start() :
                         node)
                 .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
-                .map(node -> graph.createVertex(node));
+                .map(node -> new Neo4jVertex(node,graph));
     }
 
     private Stream<Neo4jEdge> getEdgesUsingAutomaticIndex(final HasContainer hasContainer) {
         final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
         return IteratorUtils.stream(graph.getBaseGraph().findRelationships(hasContainer.getKey(), hasContainer.getValue()).iterator())
                 .filter(relationship -> ElementHelper.idExists(relationship.getId(), this.ids))
-                .filter(relationship -> !relationship.type().startsWith(FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX))
-                .map(relationship -> graph.createEdge(relationship));
+                .filter(relationship -> !relationship.type().startsWith(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX))
+                .map(relationship -> new Neo4jEdge(relationship,graph));
     }
 
     private Pair<String, HasContainer> getHasContainerForLabelIndex() {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/util/Neo4jCypherIterator.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/util/Neo4jCypherIterator.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/util/Neo4jCypherIterator.java
index c54d901..9117ab2 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/util/Neo4jCypherIterator.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/util/Neo4jCypherIterator.java
@@ -18,7 +18,9 @@
  */
 package org.apache.tinkerpop.gremlin.neo4j.process.util;
 
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jEdge;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
 import org.neo4j.tinkerpop.api.Neo4jNode;
 import org.neo4j.tinkerpop.api.Neo4jRelationship;
 
@@ -51,9 +53,9 @@ public final class Neo4jCypherIterator<T> implements Iterator<Map<String, T>> {
                 entry -> {
                     final T val = entry.getValue();
                     if (Neo4jNode.class.isAssignableFrom(val.getClass())) {
-                        return (T) this.graph.createVertex((Neo4jNode) val);
+                        return (T) new Neo4jVertex((Neo4jNode) val, this.graph);
                     } else if (Neo4jRelationship.class.isAssignableFrom(val.getClass())) {
-                        return (T) this.graph.createEdge((Neo4jRelationship) val);
+                        return (T) new Neo4jEdge((Neo4jRelationship) val, this.graph);
                     } else {
                         return val;
                     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
index 0de9e97..c2bbd6b 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
@@ -33,7 +33,7 @@ import java.util.Iterator;
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class Neo4jEdge extends Neo4jElement implements Edge, WrappedEdge<Neo4jRelationship> {
+public final class Neo4jEdge extends Neo4jElement implements Edge, WrappedEdge<Neo4jRelationship> {
 
     public Neo4jEdge(final Neo4jRelationship relationship, final Neo4jGraph graph) {
         super(relationship, graph);
@@ -41,12 +41,12 @@ public class Neo4jEdge extends Neo4jElement implements Edge, WrappedEdge<Neo4jRe
 
     @Override
     public Vertex outVertex() {
-        return this.graph.createVertex(this.getBaseEdge().start());
+        return new Neo4jVertex(this.getBaseEdge().start(), this.graph);
     }
 
     @Override
     public Vertex inVertex() {
-        return this.graph.createVertex(this.getBaseEdge().end());
+        return new Neo4jVertex(this.getBaseEdge().end(), this.graph);
     }
 
     @Override
@@ -54,11 +54,11 @@ public class Neo4jEdge extends Neo4jElement implements Edge, WrappedEdge<Neo4jRe
         this.graph.tx().readWrite();
         switch (direction) {
             case OUT:
-                return IteratorUtils.of(this.graph.createVertex(this.getBaseEdge().start()));
+                return IteratorUtils.of(new Neo4jVertex(this.getBaseEdge().start(), this.graph));
             case IN:
-                return IteratorUtils.of(this.graph.createVertex(this.getBaseEdge().end()));
+                return IteratorUtils.of(new Neo4jVertex(this.getBaseEdge().end(), this.graph));
             default:
-                return IteratorUtils.of(this.graph.createVertex(this.getBaseEdge().start()), this.graph.createVertex(this.getBaseEdge().end()));
+                return IteratorUtils.of(new Neo4jVertex(this.getBaseEdge().start(), this.graph), new Neo4jVertex(this.getBaseEdge().end(), this.graph));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
index 770d763..9e9bdb7 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
@@ -76,7 +76,6 @@ public abstract class Neo4jElement implements Element, WrappedElement<Neo4jEntit
     public <V> Property<V> property(final String key, final V value) {
         ElementHelper.validateProperty(key, value);
         this.graph.tx().readWrite();
-
         try {
             this.baseElement.setProperty(key, value);
             return new Neo4jProperty<>(this, key, value);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
index 82510e7..898286d 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
@@ -23,8 +23,9 @@ import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationConverter;
 import org.apache.tinkerpop.gremlin.neo4j.process.traversal.step.sideEffect.CypherStartStep;
 import org.apache.tinkerpop.gremlin.neo4j.process.util.Neo4jCypherIterator;
-import org.apache.tinkerpop.gremlin.neo4j.structure.full.FullNeo4jGraph;
-import org.apache.tinkerpop.gremlin.neo4j.structure.simple.SimpleNeo4jGraph;
+import org.apache.tinkerpop.gremlin.neo4j.structure.trait.MultiMetaNeo4jTrait;
+import org.apache.tinkerpop.gremlin.neo4j.structure.trait.Neo4jTrait;
+import org.apache.tinkerpop.gremlin.neo4j.structure.trait.NoMultiNoMetaNeo4jTrait;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
@@ -32,6 +33,7 @@ import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Transaction;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction;
 import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
@@ -63,7 +65,7 @@ import java.util.stream.Stream;
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT)
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_INTEGRATE)
 @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_PERFORMANCE)
-public abstract class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
+public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
 
     protected Features features = new Neo4jGraphFeatures();
 
@@ -80,18 +82,22 @@ public abstract class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
     private Neo4jGraphVariables neo4jGraphVariables;
 
     protected boolean checkElementsInTransaction = false;
-    protected boolean supportsMetaProperties = false;
-    protected boolean supportsMultiProperties = false;
+
+    protected Neo4jTrait trait;
 
     private void initialize(final Neo4jGraphAPI baseGraph, final Configuration configuration) {
         this.configuration.copy(configuration);
         this.baseGraph = baseGraph;
         this.checkElementsInTransaction = this.configuration.getBoolean(CONFIG_CHECK_ELEMENTS_IN_TRANSACTION, false);
-        this.supportsMetaProperties = this.configuration.getBoolean(CONFIG_META_PROPERTIES, false);
-        this.supportsMultiProperties = this.configuration.getBoolean(CONFIG_MULTI_PROPERTIES, false);
-        if (this.supportsMultiProperties != this.supportsMetaProperties)
+        boolean supportsMetaProperties = this.configuration.getBoolean(CONFIG_META_PROPERTIES, false);
+        boolean supportsMultiProperties = this.configuration.getBoolean(CONFIG_MULTI_PROPERTIES, false);
+        if (supportsMultiProperties != supportsMetaProperties)
             throw new IllegalArgumentException(this.getClass().getSimpleName() + " currently supports either both meta-properties and multi-properties or neither");
         this.neo4jGraphVariables = new Neo4jGraphVariables(this);
+        if (supportsMultiProperties)
+            this.trait = new MultiMetaNeo4jTrait();
+        else
+            this.trait = new NoMultiNoMetaNeo4jTrait();
     }
 
     protected Neo4jGraph(final Neo4jGraphAPI baseGraph, final Configuration configuration) {
@@ -116,16 +122,7 @@ public abstract class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
         if (null == configuration) throw Graph.Exceptions.argumentCanNotBeNull("configuration");
         if (!configuration.containsKey(CONFIG_DIRECTORY))
             throw new IllegalArgumentException(String.format("Neo4j configuration requires that the %s be set", CONFIG_DIRECTORY));
-
-        final boolean supportsMetaProperties = configuration.getBoolean(CONFIG_META_PROPERTIES, false);
-        final boolean supportsMultiProperties = configuration.getBoolean(CONFIG_MULTI_PROPERTIES, false);
-        if (supportsMultiProperties != supportsMetaProperties)
-            throw new IllegalArgumentException(Neo4jGraph.class.getSimpleName() + " currently supports either both meta-properties and multi-properties or neither");
-        if (supportsMetaProperties) {
-            return new FullNeo4jGraph(configuration);
-        } else {
-            return new SimpleNeo4jGraph(configuration);
-        }
+        return new Neo4jGraph(configuration);
     }
 
     /**
@@ -137,21 +134,13 @@ public abstract class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
         return open(config);
     }
 
-    public abstract Neo4jVertex createVertex(final Neo4jNode node);
-
-    public abstract Neo4jEdge createEdge(final Neo4jRelationship relationship);
-
-    public abstract Predicate<Neo4jNode> getNodePredicate();
-
-    public abstract Predicate<Neo4jRelationship> getRelationshipPredicate();
-
     @Override
     public Vertex addVertex(final Object... keyValues) {
         ElementHelper.legalPropertyKeyValueArray(keyValues);
         if (ElementHelper.getIdValue(keyValues).isPresent())
             throw Vertex.Exceptions.userSuppliedIdsNotSupported();
         this.tx().readWrite();
-        final Neo4jVertex vertex = this.createVertex(this.baseGraph.createNode(ElementHelper.getLabelValue(keyValues).orElse(Vertex.DEFAULT_LABEL).split(Neo4jVertex.LABEL_DELIMINATOR)));
+        final Neo4jVertex vertex = new Neo4jVertex(this.baseGraph.createNode(ElementHelper.getLabelValue(keyValues).orElse(Vertex.DEFAULT_LABEL).split(Neo4jVertex.LABEL_DELIMINATOR)), this);
         ElementHelper.attachProperties(vertex, keyValues);
         return vertex;
     }
@@ -160,11 +149,11 @@ public abstract class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
     public Iterator<Vertex> vertices(final Object... vertexIds) {
         this.tx().readWrite();
         if (0 == vertexIds.length) {
-            final Predicate<Neo4jNode> nodePredicate = this.getNodePredicate();
+            final Predicate<Neo4jNode> nodePredicate = this.trait.getNodePredicate();
             return IteratorUtils.stream(this.getBaseGraph().allNodes())
                     .filter(node -> !this.checkElementsInTransaction || !Neo4jHelper.isDeleted(node))
                     .filter(nodePredicate)
-                    .map(node -> (Vertex) this.createVertex(node)).iterator();
+                    .map(node -> (Vertex) new Neo4jVertex(node, this)).iterator();
         } else {
             ElementHelper.validateMixedElementIds(Vertex.class, vertexIds);
             return Stream.of(vertexIds)
@@ -180,7 +169,7 @@ public abstract class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
                     })
                     .flatMap(id -> {
                         try {
-                            return Stream.of((Vertex) this.createVertex(this.getBaseGraph().getNodeById(id)));
+                            return Stream.of((Vertex) new Neo4jVertex(this.baseGraph.getNodeById(id), this));
                         } catch (final RuntimeException e) {
                             if (Neo4jHelper.isNotFound(e)) return Stream.empty();
                             throw e;
@@ -193,11 +182,11 @@ public abstract class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
     public Iterator<Edge> edges(final Object... edgeIds) {
         this.tx().readWrite();
         if (0 == edgeIds.length) {
-            final Predicate<Neo4jRelationship> relationshipPredicate = this.getRelationshipPredicate();
+            final Predicate<Neo4jRelationship> relationshipPredicate = this.trait.getRelationshipPredicate();
             return IteratorUtils.stream(this.getBaseGraph().allRelationships())
                     .filter(relationship -> !this.checkElementsInTransaction || !Neo4jHelper.isDeleted(relationship))
                     .filter(relationshipPredicate)
-                    .map(relationship -> (Edge) this.createEdge(relationship)).iterator();
+                    .map(relationship -> (Edge) new Neo4jEdge(relationship, this)).iterator();
         } else {
             ElementHelper.validateMixedElementIds(Edge.class, edgeIds);
             return Stream.of(edgeIds)
@@ -213,7 +202,7 @@ public abstract class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
                     })
                     .flatMap(id -> {
                         try {
-                            return Stream.of((Edge) this.createEdge(this.getBaseGraph().getRelationshipById(id)));
+                            return Stream.of((Edge) new Neo4jEdge(this.baseGraph.getRelationshipById(id), this));
                         } catch (final RuntimeException e) {
                             if (Neo4jHelper.isNotFound(e)) return Stream.empty();
                             throw e;
@@ -432,18 +421,23 @@ public abstract class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
 
             @Override
             public boolean supportsMetaProperties() {
-                return Neo4jGraph.this.supportsMetaProperties;
+                return trait.supportsMetaProperties();
             }
 
             @Override
             public boolean supportsMultiProperties() {
-                return Neo4jGraph.this.supportsMultiProperties;
+                return trait.supportsMultiProperties();
             }
 
             @Override
             public boolean supportsUserSuppliedIds() {
                 return false;
             }
+
+            @Override
+            public VertexProperty.Cardinality getCardinality(final String key) {
+                return trait.getCardinality(key);
+            }
         }
 
         public class Neo4jEdgeFeatures extends Neo4jElementFeatures implements EdgeFeatures {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
index e5de427..d6679dd 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
@@ -19,6 +19,8 @@
 package org.apache.tinkerpop.gremlin.neo4j.structure;
 
 import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.Element;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.neo4j.tinkerpop.api.Neo4jNode;
 import org.neo4j.tinkerpop.api.Neo4jRelationship;
 
@@ -60,4 +62,26 @@ public final class Neo4jHelper {
     public static boolean isNotFound(RuntimeException ex) {
         return ex.getClass().getSimpleName().equals("NotFoundException");
     }
+
+    public static boolean keyExistsInNeo4j(final Neo4jNode node, final String key) {
+        try {
+            return node.hasProperty(key);
+        } catch (IllegalStateException ex) {
+            // if vertex is removed before/after transaction close
+            throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, node.getId());
+        } catch (RuntimeException ex) {
+            // if vertex is removed before/after transaction close
+            if (Neo4jHelper.isNotFound(ex))
+                throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, node.getId());
+            throw ex;
+        }
+    }
+
+    public static Neo4jNode getVertexPropertyNode(final Neo4jVertexProperty vertexProperty) {
+        return vertexProperty.vertexPropertyNode;
+    }
+
+    public static void setVertexPropertyNode(final Neo4jVertexProperty vertexProperty, final Neo4jNode node) {
+        vertexProperty.vertexPropertyNode = node;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java
index 14c5a34..d283269 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java
@@ -27,7 +27,7 @@ import org.neo4j.tinkerpop.api.Neo4jEntity;
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class Neo4jProperty<V> implements Property<V> {
+public final class Neo4jProperty<V> implements Property<V> {
 
     protected final Element element;
     protected final String key;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java
index b9c216e..d7bdf4f 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java
@@ -18,7 +18,6 @@
  */
 package org.apache.tinkerpop.gremlin.neo4j.structure;
 
-import org.apache.tinkerpop.gremlin.neo4j.structure.full.FullNeo4jVertexProperty;
 import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Element;
@@ -36,12 +35,11 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.function.Predicate;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public abstract class Neo4jVertex extends Neo4jElement implements Vertex, WrappedVertex<Neo4jNode> {
+public final class Neo4jVertex extends Neo4jElement implements Vertex, WrappedVertex<Neo4jNode> {
 
     public static final String LABEL_DELIMINATOR = "::";
 
@@ -52,7 +50,7 @@ public abstract class Neo4jVertex extends Neo4jElement implements Vertex, Wrappe
     @Override
     public Edge addEdge(final String label, final Vertex inVertex, final Object... keyValues) {
         if (null == inVertex) throw Graph.Exceptions.argumentCanNotBeNull("inVertex");
-        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.getBaseVertex().getId());
+        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.id());
         ElementHelper.validateLabel(label);
         ElementHelper.legalPropertyKeyValueArray(keyValues);
         if (ElementHelper.getIdValue(keyValues).isPresent())
@@ -60,7 +58,7 @@ public abstract class Neo4jVertex extends Neo4jElement implements Vertex, Wrappe
 
         this.graph.tx().readWrite();
         final Neo4jNode node = (Neo4jNode) this.baseElement;
-        final Neo4jEdge edge = this.graph.createEdge(node.connectTo(((Neo4jVertex) inVertex).getBaseVertex(), label));
+        final Neo4jEdge edge = new Neo4jEdge(node.connectTo(((Neo4jVertex) inVertex).getBaseVertex(), label), this.graph);
         ElementHelper.attachProperties(edge, keyValues);
         return edge;
     }
@@ -71,15 +69,33 @@ public abstract class Neo4jVertex extends Neo4jElement implements Vertex, Wrappe
     }
 
     @Override
-    public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
-        return this.property(this.graph.features().vertex().getCardinality(key), key, value, keyValues);
+    public void remove() {
+        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.id());
+        this.removed = true;
+        this.graph.tx().readWrite();
+        this.graph.trait.removeVertex(this);
+    }
+
+    @Override
+    public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
+        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.id());
+        this.graph.tx().readWrite();
+        return this.graph.trait.setVertexProperty(this, cardinality, key, value, keyValues);
     }
 
     @Override
-    public abstract <V> VertexProperty<V> property(final String key);
+    public <V> VertexProperty<V> property(final String key) {
+        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.id());
+        this.graph.tx().readWrite();
+        return this.graph.trait.getVertexProperty(this, key);
+    }
 
     @Override
-    public abstract <V> Iterator<VertexProperty<V>> properties(final String... propertyKeys);
+    public <V> Iterator<VertexProperty<V>> properties(final String... propertyKeys) {
+        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.id());
+        this.graph.tx().readWrite();
+        return this.graph.trait.getVertexProperties(this, propertyKeys);
+    }
 
     @Override
     public Neo4jNode getBaseVertex() {
@@ -98,7 +114,7 @@ public abstract class Neo4jVertex extends Neo4jElement implements Vertex, Wrappe
         return new Iterator<Vertex>() {
             final Iterator<Neo4jRelationship> relationshipIterator = IteratorUtils.filter(0 == edgeLabels.length ?
                     getBaseVertex().relationships(Neo4jHelper.mapDirection(direction)).iterator() :
-                    getBaseVertex().relationships(Neo4jHelper.mapDirection(direction), (edgeLabels)).iterator(), graph.getRelationshipPredicate());
+                    getBaseVertex().relationships(Neo4jHelper.mapDirection(direction), (edgeLabels)).iterator(), graph.trait.getRelationshipPredicate());
 
             @Override
             public boolean hasNext() {
@@ -107,7 +123,7 @@ public abstract class Neo4jVertex extends Neo4jElement implements Vertex, Wrappe
 
             @Override
             public Neo4jVertex next() {
-                return graph.createVertex(this.relationshipIterator.next().other(getBaseVertex()));
+                return new Neo4jVertex(this.relationshipIterator.next().other(getBaseVertex()), graph);
             }
         };
     }
@@ -118,7 +134,7 @@ public abstract class Neo4jVertex extends Neo4jElement implements Vertex, Wrappe
         return new Iterator<Edge>() {
             final Iterator<Neo4jRelationship> relationshipIterator = IteratorUtils.filter(0 == edgeLabels.length ?
                     getBaseVertex().relationships(Neo4jHelper.mapDirection(direction)).iterator() :
-                    getBaseVertex().relationships(Neo4jHelper.mapDirection(direction), (edgeLabels)).iterator(), graph.getRelationshipPredicate());
+                    getBaseVertex().relationships(Neo4jHelper.mapDirection(direction), (edgeLabels)).iterator(), graph.trait.getRelationshipPredicate());
 
             @Override
             public boolean hasNext() {
@@ -127,7 +143,7 @@ public abstract class Neo4jVertex extends Neo4jElement implements Vertex, Wrappe
 
             @Override
             public Neo4jEdge next() {
-                return graph.createEdge(this.relationshipIterator.next());
+                return new Neo4jEdge(this.relationshipIterator.next(), graph);
             }
         };
     }
@@ -155,17 +171,4 @@ public abstract class Neo4jVertex extends Neo4jElement implements Vertex, Wrappe
         return StringFactory.vertexString(this);
     }
 
-    protected boolean existsInNeo4j(final String key) {
-        try {
-            return this.getBaseVertex().hasProperty(key);
-        } catch (IllegalStateException ex) {
-            // if vertex is removed before/after transaction close
-            throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.id());
-        } catch (RuntimeException ex) {
-            // if vertex is removed before/after transaction close
-            if (Neo4jHelper.isNotFound(ex))
-                throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.id());
-            throw ex;
-        }
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
index c8f818b..12e55e1 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
@@ -19,27 +19,40 @@
 package org.apache.tinkerpop.gremlin.neo4j.structure;
 
 import org.apache.tinkerpop.gremlin.structure.Element;
+import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
+import org.neo4j.tinkerpop.api.Neo4jNode;
 
+import java.util.Iterator;
 import java.util.NoSuchElementException;
+import java.util.Optional;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public abstract class Neo4jVertexProperty<V> implements VertexProperty<V> {
+public final class Neo4jVertexProperty<V> implements VertexProperty<V> {
 
     protected final Neo4jVertex vertex;
     protected final String key;
     protected final V value;
+    protected Neo4jNode vertexPropertyNode;
 
 
     public Neo4jVertexProperty(final Neo4jVertex vertex, final String key, final V value) {
         this.vertex = vertex;
         this.key = key;
         this.value = value;
+        this.vertexPropertyNode = null;
+    }
+
+    public Neo4jVertexProperty(final Neo4jVertex vertex, final String key, final V value, final Neo4jNode vertexPropertyNode) {
+        this.vertex = vertex;
+        this.key = key;
+        this.value = value;
+        this.vertexPropertyNode = vertexPropertyNode;
     }
 
     @Override
@@ -54,16 +67,6 @@ public abstract class Neo4jVertexProperty<V> implements VertexProperty<V> {
     }
 
     @Override
-    public boolean equals(final Object object) {
-        return ElementHelper.areEqual(this, object);
-    }
-
-    @Override
-    public int hashCode() {
-        return ElementHelper.hashCode((Element) this);
-    }
-
-    @Override
     public String key() {
         return this.key;
     }
@@ -76,13 +79,38 @@ public abstract class Neo4jVertexProperty<V> implements VertexProperty<V> {
     @Override
     public boolean isPresent() {
         return null != this.value;
+    }
 
+    @Override
+    public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
+        this.vertex.graph.tx().readWrite();
+        return this.vertex.graph.trait.getProperties(this, propertyKeys);
     }
 
     @Override
-    public String toString() {
-        return StringFactory.propertyString(this);
+    public <U> Property<U> property(final String key, final U value) {
+        this.vertex.graph.tx().readWrite();
+        return this.vertex.graph.trait.setProperty(this, key, value);
     }
 
+    @Override
+    public void remove() {
+        this.vertex.graph.tx().readWrite();
+        this.vertex.graph.trait.removeVertexProperty(this);
+    }
 
+    @Override
+    public boolean equals(final Object object) {
+        return ElementHelper.areEqual(this, object);
+    }
+
+    @Override
+    public int hashCode() {
+        return ElementHelper.hashCode((Element) this);
+    }
+
+    @Override
+    public String toString() {
+        return StringFactory.propertyString(this);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jGraph.java
deleted file mode 100644
index c959ddd..0000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jGraph.java
+++ /dev/null
@@ -1,80 +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.neo4j.structure.full;
-
-import org.apache.commons.configuration.BaseConfiguration;
-import org.apache.commons.configuration.Configuration;
-import org.apache.tinkerpop.gremlin.neo4j.process.traversal.strategy.optimization.Neo4jGraphStepStrategy;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jEdge;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.neo4j.tinkerpop.api.Neo4jGraphAPI;
-import org.neo4j.tinkerpop.api.Neo4jNode;
-import org.neo4j.tinkerpop.api.Neo4jRelationship;
-
-import java.util.function.Predicate;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class FullNeo4jGraph extends Neo4jGraph {
-
-    private static final Configuration EMPTY_CONFIGURATION = new BaseConfiguration() {{
-        this.setProperty(Graph.GRAPH, FullNeo4jGraph.class.getName());
-        this.setProperty(Neo4jGraph.CONFIG_META_PROPERTIES, true);
-        this.setProperty(Neo4jGraph.CONFIG_MULTI_PROPERTIES, true);
-    }};
-
-    static {
-        TraversalStrategies.GlobalCache.registerStrategies(FullNeo4jGraph.class, TraversalStrategies.GlobalCache.getStrategies(Graph.class).clone().addStrategies(Neo4jGraphStepStrategy.instance()));
-    }
-
-    public FullNeo4jGraph(final Configuration configuration) {
-        super(configuration);
-    }
-
-    public FullNeo4jGraph(final Neo4jGraphAPI baseGraph) {
-        super(baseGraph, EMPTY_CONFIGURATION);
-    }
-
-    @Override
-    public Neo4jVertex createVertex(final Neo4jNode node) {
-        return new FullNeo4jVertex(node, this);
-    }
-
-    @Override
-    public Neo4jEdge createEdge(final Neo4jRelationship relationship) {
-        return new Neo4jEdge(relationship, this);
-    }
-
-    @Override
-    public Predicate<Neo4jNode> getNodePredicate() {
-        return node -> !node.hasLabel(FullNeo4jVertexProperty.VERTEX_PROPERTY_LABEL);
-    }
-
-    @Override
-    public Predicate<Neo4jRelationship> getRelationshipPredicate() {
-        return relationship -> !relationship.type().startsWith(FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jProperty.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jProperty.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jProperty.java
deleted file mode 100644
index 4952240..0000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jProperty.java
+++ /dev/null
@@ -1,56 +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.neo4j.structure.full;
-
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jElement;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jProperty;
-import org.apache.tinkerpop.gremlin.structure.Element;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.neo4j.tinkerpop.api.Neo4jEntity;
-import org.neo4j.tinkerpop.api.Neo4jNode;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-final class FullNeo4jProperty<V> extends Neo4jProperty {
-
-    public FullNeo4jProperty(final Element element, final String key, final V value) {
-        super(element, key, value);
-    }
-
-    @Override
-    public void remove() {
-        this.graph.tx().readWrite();
-        if (this.element instanceof VertexProperty) {
-            final Neo4jNode node = ((FullNeo4jVertexProperty) this.element).getBaseVertexProperty();
-            if (null != node && node.hasProperty(this.key)) {
-                node.removeProperty(this.key);
-            }
-        } else {
-            final Neo4jEntity entity = ((Neo4jElement) this.element).getBaseElement();
-            if (entity.hasProperty(this.key)) {
-                entity.removeProperty(this.key);
-            }
-        }
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jVertex.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jVertex.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jVertex.java
deleted file mode 100644
index 07d24ad..0000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jVertex.java
+++ /dev/null
@@ -1,162 +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.neo4j.structure.full;
-
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jEdge;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
-import org.apache.tinkerpop.gremlin.structure.Direction;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Element;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.T;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.neo4j.tinkerpop.api.Neo4jDirection;
-import org.neo4j.tinkerpop.api.Neo4jNode;
-import org.neo4j.tinkerpop.api.Neo4jRelationship;
-
-import java.util.Iterator;
-import java.util.Optional;
-import java.util.stream.Stream;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-final class FullNeo4jVertex extends Neo4jVertex {
-
-    public FullNeo4jVertex(final Neo4jNode node, final Neo4jGraph neo4jGraph) {
-        super(node, neo4jGraph);
-    }
-
-
-
-    @Override
-    public <V> VertexProperty<V> property(final String key) {
-        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.getBaseVertex().getId());
-        this.graph.tx().readWrite();
-        if (existsInNeo4j(key)) {
-            if (this.getBaseVertex().getProperty(key).equals(FullNeo4jVertexProperty.VERTEX_PROPERTY_TOKEN)) {
-                if (this.getBaseVertex().degree(Neo4jDirection.OUTGOING, FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX.concat(key)) > 1)
-                    throw Vertex.Exceptions.multiplePropertiesExistForProvidedKey(key);
-                else
-                    return new FullNeo4jVertexProperty<>(this, this.getBaseVertex().relationships(
-                            Neo4jDirection.OUTGOING,
-                            FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX.concat(key))
-                            .iterator().next().end());
-            } else {
-                return new FullNeo4jVertexProperty<>(this, key, (V) this.getBaseVertex().getProperty(key));
-            }
-        } else
-            return VertexProperty.<V>empty();
-
-    }
-
-    @Override
-    public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
-        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.getBaseVertex().getId());
-        ElementHelper.validateProperty(key, value);
-        if (ElementHelper.getIdValue(keyValues).isPresent())
-            throw VertexProperty.Exceptions.userSuppliedIdsNotSupported();
-        this.graph.tx().readWrite();
-        try {
-            final Optional<VertexProperty<V>> optionalVertexProperty = ElementHelper.stageVertexProperty(this, cardinality, key, value, keyValues);
-            if (optionalVertexProperty.isPresent()) return optionalVertexProperty.get();
-
-            final String prefixedKey = FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX.concat(key);
-            if (this.getBaseVertex().hasProperty(key)) {
-                if (this.getBaseVertex().getProperty(key).equals(FullNeo4jVertexProperty.VERTEX_PROPERTY_TOKEN)) {
-                    final Neo4jNode node = this.graph.getBaseGraph().createNode(FullNeo4jVertexProperty.VERTEX_PROPERTY_LABEL, key);
-                    node.setProperty(T.key.getAccessor(), key);
-                    node.setProperty(T.value.getAccessor(), value);
-                    this.getBaseVertex().connectTo(node, prefixedKey);
-                    final Neo4jVertexProperty<V> property = new FullNeo4jVertexProperty<>(this, node);
-                    ElementHelper.attachProperties(property, keyValues); // TODO: make this inlined
-                    return property;
-                } else {
-                    Neo4jNode node = this.graph.getBaseGraph().createNode(FullNeo4jVertexProperty.VERTEX_PROPERTY_LABEL, key);
-                    node.setProperty(T.key.getAccessor(), key);
-                    node.setProperty(T.value.getAccessor(), this.getBaseVertex().removeProperty(key));
-                    this.getBaseVertex().connectTo(node, prefixedKey);
-                    this.getBaseVertex().setProperty(key, FullNeo4jVertexProperty.VERTEX_PROPERTY_TOKEN);
-                    node = this.graph.getBaseGraph().createNode(FullNeo4jVertexProperty.VERTEX_PROPERTY_LABEL, key);
-                    node.setProperty(T.key.getAccessor(), key);
-                    node.setProperty(T.value.getAccessor(), value);
-                    this.getBaseVertex().connectTo(node, prefixedKey);
-                    final Neo4jVertexProperty<V> property = new FullNeo4jVertexProperty<>(this, node);
-                    ElementHelper.attachProperties(property, keyValues); // TODO: make this inlined
-                    return property;
-                }
-            } else {
-                this.getBaseVertex().setProperty(key, value);
-                final Neo4jVertexProperty<V> property = new FullNeo4jVertexProperty<>(this, key, value);
-                ElementHelper.attachProperties(property, keyValues); // TODO: make this inlined
-                return property;
-            }
-        } catch (IllegalArgumentException iae) {
-            throw Property.Exceptions.dataTypeOfPropertyValueNotSupported(value);
-        }
-    }
-
-    @Override
-    public <V> Iterator<VertexProperty<V>> properties(final String... propertyKeys) {
-        this.graph.tx().readWrite();
-        return IteratorUtils.stream(getBaseVertex().getKeys())
-                .filter(key -> ElementHelper.keyExists(key, propertyKeys))
-                .flatMap(key -> {
-                    if (getBaseVertex().getProperty(key).equals(FullNeo4jVertexProperty.VERTEX_PROPERTY_TOKEN))
-                        return IteratorUtils.stream(getBaseVertex().relationships(Neo4jDirection.OUTGOING, (FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX.concat(key))))
-                                .map(relationship -> (VertexProperty<V>) new FullNeo4jVertexProperty(FullNeo4jVertex.this, relationship.end()));
-                    else
-                        return Stream.of(new FullNeo4jVertexProperty<>(FullNeo4jVertex.this, key, (V) this.getBaseVertex().getProperty(key)));
-                }).iterator();
-    }
-
-    @Override
-    public void remove() {
-        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.getBaseVertex().getId());
-        this.removed = true;
-        this.graph.tx().readWrite();
-        try {
-            final Neo4jNode node = this.getBaseVertex();
-            for (final Neo4jRelationship relationship : node.relationships(Neo4jDirection.BOTH)) {
-                final Neo4jNode otherNode = relationship.other(node);
-                if (otherNode.hasLabel(FullNeo4jVertexProperty.VERTEX_PROPERTY_LABEL)) {
-                    otherNode.relationships(null).forEach(Neo4jRelationship::delete);
-                    otherNode.delete(); // meta property node
-                } else
-                    relationship.delete();
-            }
-            node.delete();
-        } catch (final IllegalStateException ignored) {
-            // this one happens if the vertex is still chilling in the tx
-        } catch (final RuntimeException ex) {
-            if (!Neo4jHelper.isNotFound(ex)) throw ex;
-            // this one happens if the vertex is committed
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jVertexProperty.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jVertexProperty.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jVertexProperty.java
deleted file mode 100644
index 2f48841..0000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/full/FullNeo4jVertexProperty.java
+++ /dev/null
@@ -1,151 +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.neo4j.structure.full;
-
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
-import org.apache.tinkerpop.gremlin.structure.Element;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.T;
-import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
-import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedGraph;
-import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedVertexProperty;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.neo4j.tinkerpop.api.Neo4jDirection;
-import org.neo4j.tinkerpop.api.Neo4jGraphAPI;
-import org.neo4j.tinkerpop.api.Neo4jNode;
-import org.neo4j.tinkerpop.api.Neo4jRelationship;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class FullNeo4jVertexProperty<V> extends Neo4jVertexProperty<V> implements WrappedVertexProperty<Neo4jNode> {
-
-    public static final String VERTEX_PROPERTY_LABEL = "vertexProperty";
-    public static final String VERTEX_PROPERTY_PREFIX = Graph.Hidden.hide("");
-    public static final String VERTEX_PROPERTY_TOKEN = Graph.Hidden.hide("vertexProperty");
-
-
-    private Neo4jNode node;
-
-    public FullNeo4jVertexProperty(final Neo4jVertex vertex, final String key, final V value) {
-        super(vertex, key, value);
-    }
-
-    public FullNeo4jVertexProperty(final Neo4jVertex vertex, final Neo4jNode node) {
-        super(vertex, (String) node.getProperty(T.key.getAccessor()), (V) node.getProperty(T.value.getAccessor()));
-        this.node = node;
-    }
-
-    @Override
-    public Set<String> keys() {
-        if (isNode()) {
-            this.vertex.graph().tx().readWrite();
-            final Set<String> keys = new HashSet<>();
-            for (final String key : this.node.getKeys()) {
-                if (!Graph.Hidden.isHidden(key))
-                    keys.add(key);
-            }
-            return keys;
-        } else {
-            return Collections.emptySet();
-        }
-    }
-
-    @Override
-    public <U> Property<U> property(String key, U value) {
-        ElementHelper.validateProperty(key, value);
-        this.vertex.graph().tx().readWrite();
-        if (isNode()) {
-            this.node.setProperty(key, value);
-            return new FullNeo4jProperty<>(this, key, value);
-        } else {
-            this.node = ((WrappedGraph<Neo4jGraphAPI>) this.vertex.graph()).getBaseGraph().createNode(VERTEX_PROPERTY_LABEL, this.label());
-            this.node.setProperty(T.key.getAccessor(), this.key);
-            this.node.setProperty(T.value.getAccessor(), this.value);
-            this.node.setProperty(key, value);
-            this.vertex.getBaseVertex().connectTo(this.node, VERTEX_PROPERTY_PREFIX.concat(this.key));
-            this.vertex.getBaseVertex().setProperty(this.key, VERTEX_PROPERTY_TOKEN);
-            return new FullNeo4jProperty<>(this, key, value);
-        }
-    }
-
-    @Override
-    public <U> Property<U> property(final String key) {
-        this.vertex.graph().tx().readWrite();
-        try {
-            if (isNode() && this.node.hasProperty(key))
-                return new FullNeo4jProperty<>(this, key, (U) this.node.getProperty(key));
-            else
-                return Property.empty();
-        } catch (IllegalStateException ex) {
-            throw Element.Exceptions.elementAlreadyRemoved(this.getClass(), this.id());
-        } catch (RuntimeException ex) {
-            if (Neo4jHelper.isNotFound(ex))
-                throw Element.Exceptions.elementAlreadyRemoved(this.getClass(), this.id());
-            throw ex;
-        }
-    }
-
-    @Override
-    public void remove() {
-        this.vertex.graph().tx().readWrite();
-        if (isNode()) {
-            this.node.relationships(null).forEach(Neo4jRelationship::delete);
-            this.node.delete();
-            if (this.vertex.getBaseVertex().degree(Neo4jDirection.OUTGOING, VERTEX_PROPERTY_PREFIX.concat(this.key)) == 0) {
-                if (this.vertex.getBaseVertex().hasProperty(this.key))
-                    this.vertex.getBaseVertex().removeProperty(this.key);
-            }
-        } else {
-            if (this.vertex.getBaseVertex().degree(Neo4jDirection.OUTGOING, VERTEX_PROPERTY_PREFIX.concat(this.key)) == 0) {
-                if (this.vertex.getBaseVertex().hasProperty(this.key))
-                    this.vertex.getBaseVertex().removeProperty(this.key);
-            }
-        }
-    }
-
-    protected boolean isNode() {
-        return null != this.node;
-    }
-
-    @Override
-    public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
-        if (!isNode()) return Collections.emptyIterator();
-        else {
-            this.vertex.graph().tx().readWrite();
-            return IteratorUtils.map(IteratorUtils.filter(this.node.getKeys().iterator(), key -> !key.equals(T.key.getAccessor()) && !key.equals(T.value.getAccessor()) && ElementHelper.keyExists(key, propertyKeys)), key -> (Property<U>) new FullNeo4jProperty<>(FullNeo4jVertexProperty.this, key, (V) this.node.getProperty(key)));
-        }
-    }
-
-    @Override
-    public Neo4jNode getBaseVertexProperty() {
-        return this.node;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jGraph.java
deleted file mode 100644
index 50d14cc..0000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jGraph.java
+++ /dev/null
@@ -1,109 +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.neo4j.structure.simple;
-
-import org.apache.commons.configuration.BaseConfiguration;
-import org.apache.commons.configuration.Configuration;
-import org.apache.tinkerpop.gremlin.neo4j.process.traversal.strategy.optimization.Neo4jGraphStepStrategy;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jEdge;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.neo4j.tinkerpop.api.Neo4jGraphAPI;
-import org.neo4j.tinkerpop.api.Neo4jNode;
-import org.neo4j.tinkerpop.api.Neo4jRelationship;
-
-import java.util.Iterator;
-import java.util.function.Predicate;
-import java.util.stream.Stream;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class SimpleNeo4jGraph extends Neo4jGraph {
-
-    private static final Configuration EMPTY_CONFIGURATION = new BaseConfiguration() {{
-        this.setProperty(Graph.GRAPH, SimpleNeo4jGraph.class.getName());
-        this.setProperty(Neo4jGraph.CONFIG_META_PROPERTIES, false);
-        this.setProperty(Neo4jGraph.CONFIG_MULTI_PROPERTIES, false);
-    }};
-
-    static {
-        TraversalStrategies.GlobalCache.registerStrategies(SimpleNeo4jGraph.class, TraversalStrategies.GlobalCache.getStrategies(Graph.class).clone().addStrategies(Neo4jGraphStepStrategy.instance()));
-    }
-
-    public SimpleNeo4jGraph(final Configuration configuration) {
-        super(configuration);
-        this.features = new SimpleNeo4jGraphFeatures();
-    }
-
-    public SimpleNeo4jGraph(final Neo4jGraphAPI baseGraph) {
-        super(baseGraph, EMPTY_CONFIGURATION);
-        this.features = new SimpleNeo4jGraphFeatures();
-    }
-
-    @Override
-    public Neo4jVertex createVertex(final Neo4jNode node) {
-        return new SimpleNeo4jVertex(node, this);
-    }
-
-    @Override
-    public Neo4jEdge createEdge(final Neo4jRelationship relationship) {
-        return new Neo4jEdge(relationship, this);
-    }
-
-    @Override
-    public Predicate<Neo4jNode> getNodePredicate() {
-        return node -> true;
-    }
-
-    @Override
-    public Predicate<Neo4jRelationship> getRelationshipPredicate() {
-        return relationship -> true;
-    }
-
-    ////////////////////////
-
-    public class SimpleNeo4jGraphFeatures extends Neo4jGraphFeatures {
-
-        public SimpleNeo4jGraphFeatures() {
-            this.vertexFeatures = new SimpleNeo4jVertexFeatures();
-        }
-
-        public class SimpleNeo4jVertexFeatures extends Neo4jVertexFeatures {
-
-            SimpleNeo4jVertexFeatures() {
-                super();
-            }
-
-            public VertexProperty.Cardinality getCardinality(final String key) {
-                return VertexProperty.Cardinality.single;
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jVertex.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jVertex.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jVertex.java
deleted file mode 100644
index b4cb95f..0000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jVertex.java
+++ /dev/null
@@ -1,101 +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.neo4j.structure.simple;
-
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
-import org.apache.tinkerpop.gremlin.structure.Element;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.neo4j.tinkerpop.api.Neo4jDirection;
-import org.neo4j.tinkerpop.api.Neo4jNode;
-import org.neo4j.tinkerpop.api.Neo4jRelationship;
-
-import java.util.Iterator;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-final class SimpleNeo4jVertex extends Neo4jVertex {
-
-    public SimpleNeo4jVertex(final Neo4jNode node, final Neo4jGraph neo4jGraph) {
-        super(node, neo4jGraph);
-    }
-
-    @Override
-    public <V> VertexProperty<V> property(final String key) {
-        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.getBaseVertex().getId());
-        this.graph.tx().readWrite();
-        if (existsInNeo4j(key)) {
-            return new SimpleNeo4jVertexProperty<>(this, key, (V) this.getBaseVertex().getProperty(key));
-        } else
-            return VertexProperty.<V>empty();
-
-    }
-
-    @Override
-    public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
-        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.getBaseVertex().getId());
-        if (cardinality != VertexProperty.Cardinality.single)
-            throw VertexProperty.Exceptions.multiPropertiesNotSupported();
-        if (keyValues.length > 0)
-            throw VertexProperty.Exceptions.metaPropertiesNotSupported();
-        ElementHelper.validateProperty(key, value);
-        try {
-            this.getBaseVertex().setProperty(key, value);
-            return new SimpleNeo4jVertexProperty<>(this, key, value);
-        } catch (final IllegalArgumentException iae) {
-            throw Property.Exceptions.dataTypeOfPropertyValueNotSupported(value);
-        }
-    }
-
-    @Override
-    public <V> Iterator<VertexProperty<V>> properties(final String... propertyKeys) {
-        this.graph.tx().readWrite();
-        return (Iterator) IteratorUtils.stream(getBaseVertex().getKeys())
-                .filter(key -> ElementHelper.keyExists(key, propertyKeys))
-                .map(key -> new SimpleNeo4jVertexProperty<>(SimpleNeo4jVertex.this, key, (V) this.getBaseVertex().getProperty(key))).iterator();
-    }
-
-    @Override
-    public void remove() {
-        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.getBaseVertex().getId());
-        this.removed = true;
-        this.graph.tx().readWrite();
-        try {
-            final Neo4jNode node = this.getBaseVertex();
-            for (final Neo4jRelationship relationship : node.relationships(Neo4jDirection.BOTH)) {
-                relationship.delete();
-            }
-            node.delete();
-        } catch (final IllegalStateException ignored) {
-            // this one happens if the vertex is still chilling in the tx
-        } catch (final RuntimeException ex) {
-            if (!Neo4jHelper.isNotFound(ex)) throw ex;
-            // this one happens if the vertex is committed
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jVertexProperty.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jVertexProperty.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jVertexProperty.java
deleted file mode 100644
index 4de7462..0000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/simple/SimpleNeo4jVertexProperty.java
+++ /dev/null
@@ -1,67 +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.neo4j.structure.simple;
-
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-final class SimpleNeo4jVertexProperty<V> extends Neo4jVertexProperty<V> {
-
-    public SimpleNeo4jVertexProperty(final Neo4jVertex vertex, final String key, final V value) {
-        super(vertex, key, value);
-    }
-
-    @Override
-    public Set<String> keys() {
-        throw VertexProperty.Exceptions.metaPropertiesNotSupported();
-    }
-
-    @Override
-    public <U> Property<U> property(String key, U value) {
-        throw VertexProperty.Exceptions.metaPropertiesNotSupported();
-    }
-
-    @Override
-    public <U> Property<U> property(final String key) {
-        throw VertexProperty.Exceptions.metaPropertiesNotSupported();
-    }
-
-    @Override
-    public void remove() {
-        this.vertex.graph().tx().readWrite();
-        if (this.vertex.getBaseVertex().hasProperty(this.key))
-            this.vertex.getBaseVertex().removeProperty(this.key);
-    }
-
-    @Override
-    public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
-        throw VertexProperty.Exceptions.metaPropertiesNotSupported();
-    }
-}


[16/50] [abbrv] incubator-tinkerpop git commit: Add license header.

Posted by dk...@apache.org.
Add license header.


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

Branch: refs/heads/preprocessor
Commit: a1d26bede1f3ad564a1c3478b72ff1ffa78791da
Parents: 5a41ae8
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 14:01:57 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 14:01:57 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/util/ComparatorsTest.java   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/a1d26bed/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ComparatorsTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ComparatorsTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ComparatorsTest.java
index d42a8e5..eb182fd 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ComparatorsTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ComparatorsTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.structure.util;
 
 import org.apache.tinkerpop.gremlin.TestHelper;


[23/50] [abbrv] incubator-tinkerpop git commit: Make it so that the default cardinality for TinkerGraph is a config.

Posted by dk...@apache.org.
Make it so that the default cardinality for TinkerGraph is a config.


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

Branch: refs/heads/preprocessor
Commit: d9e1932a046603a6e73414d4e66bc18a92d2f64b
Parents: 7441b6b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 16:16:12 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 16:17:28 2015 -0400

----------------------------------------------------------------------
 .../gremlin/tinkergraph/structure/TinkerGraph.java   | 13 +++++++------
 .../gremlin/tinkergraph/structure/TinkerVertex.java  |  5 -----
 .../gremlin/tinkergraph/TinkerGraphProvider.java     | 15 +++++++++++++++
 3 files changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d9e1932a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
index f76d8f2..37bafb5 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
@@ -92,7 +92,7 @@ public final class TinkerGraph implements Graph {
     protected final IdManager<?> vertexIdManager;
     protected final IdManager<?> edgeIdManager;
     protected final IdManager<?> vertexPropertyIdManager;
-    //protected final VertexProperty.Cardinality defaultVertexPropertyCardinality;
+    protected final VertexProperty.Cardinality defaultVertexPropertyCardinality;
 
     private final Configuration configuration;
 
@@ -104,7 +104,8 @@ public final class TinkerGraph implements Graph {
         this.vertexIdManager = selectIdManager(configuration, CONFIG_VERTEX_ID, Vertex.class);
         this.edgeIdManager = selectIdManager(configuration, CONFIG_EDGE_ID, Edge.class);
         this.vertexPropertyIdManager = selectIdManager(configuration, CONFIG_VERTEX_PROPERTY_ID, VertexProperty.class);
-        //this.defaultVertexPropertyCardinality = VertexProperty.Cardinality.valueOf(configuration.getString(CONFIG_DEFAULT_VERTEX_PROPERTY_CARDINALITY, "single"));
+        this.defaultVertexPropertyCardinality = VertexProperty.Cardinality.valueOf(
+                configuration.getString(CONFIG_DEFAULT_VERTEX_PROPERTY_CARDINALITY, VertexProperty.Cardinality.single.name()));
     }
 
     /**
@@ -314,11 +315,11 @@ public final class TinkerGraph implements Graph {
             return vertexIdManager.allow(id);
         }
 
-        /*@Override
+        @Override
         public VertexProperty.Cardinality getCardinality(final String key) {
-            return VertexProperty.Cardinality.single;
-            //return defaultVertexPropertyCardinality;
-        }*/
+            //return VertexProperty.Cardinality.single;
+            return defaultVertexPropertyCardinality;
+        }
     }
 
     public class TinkerGraphEdgeFeatures implements Features.EdgeFeatures {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d9e1932a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
index 2378e97..ca3a35b 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerVertex.java
@@ -82,11 +82,6 @@ public final class TinkerVertex extends TinkerElement implements Vertex {
         }
     }
 
-    /*@Override
-    public <V> VertexProperty<V> property(final String key, final V value, final Object... keyValues) {
-        return this.property(VertexProperty.Cardinality.single, key, value, keyValues);
-    }*/
-
     @Override
     public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
         if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.id);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d9e1932a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java
index dd53dde..f970214 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphProvider.java
@@ -23,7 +23,10 @@ import org.apache.tinkerpop.gremlin.AbstractGraphProvider;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.GraphTest;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.io.IoTest;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedGraphTest;
+import org.apache.tinkerpop.gremlin.structure.util.star.StarGraphTest;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerEdge;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
@@ -62,6 +65,8 @@ public class TinkerGraphProvider extends AbstractGraphProvider {
             put(TinkerGraph.CONFIG_VERTEX_ID, idMaker);
             put(TinkerGraph.CONFIG_EDGE_ID, idMaker);
             put(TinkerGraph.CONFIG_VERTEX_PROPERTY_ID, idMaker);
+            if (requiresListCardinalityAsDefault(loadGraphWith, test, testMethodName))
+                put(TinkerGraph.CONFIG_DEFAULT_VERTEX_PROPERTY_CARDINALITY, VertexProperty.Cardinality.list.name());
         }};
     }
 
@@ -77,6 +82,16 @@ public class TinkerGraphProvider extends AbstractGraphProvider {
     }
 
     /**
+     * Determines if a test requires a different cardinality as the default or not.
+     */
+    private static boolean requiresListCardinalityAsDefault(final LoadGraphWith.GraphData loadGraphWith,
+                                                            final Class<?> test, final String testMethodName) {
+        return loadGraphWith == LoadGraphWith.GraphData.CREW
+                || (test == StarGraphTest.class && testMethodName.equals("shouldAttachWithCreateMethod"))
+                || (test == DetachedGraphTest.class && testMethodName.equals("testAttachableCreateMethod"));
+    }
+
+    /**
      * Some tests require special configuration for TinkerGraph to properly configure the id manager.
      */
     private TinkerGraph.DefaultIdManager selectIdMakerFromTest(final Class<?> test, final String testMethodName) {


[21/50] [abbrv] incubator-tinkerpop git commit: Neo4j multi-meta settings are now part of Neo4jGraphVariables as hiddens. Its important that once set, a user can not change these as the underlying topology would differ.

Posted by dk...@apache.org.
Neo4j multi-meta settings are now part of Neo4jGraphVariables as hiddens. Its important that once set, a user can not change these as the underlying topology would differ.


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

Branch: refs/heads/preprocessor
Commit: bbc6a0ed6eafe72e895f8d18c0a7c8ec07d8680d
Parents: 2b3a682
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 13:25:55 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 13:25:55 2015 -0600

----------------------------------------------------------------------
 .../gremlin/neo4j/structure/Neo4jGraph.java     | 34 ++++++++++++--------
 1 file changed, 20 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bbc6a0ed/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
index 34a527f..a289bb9 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
@@ -50,6 +50,7 @@ import org.neo4j.tinkerpop.api.Neo4jTx;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Optional;
 import java.util.function.Predicate;
 import java.util.stream.Stream;
 
@@ -95,15 +96,20 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
     private void initialize(final Neo4jGraphAPI baseGraph, final Configuration configuration) {
         this.configuration.copy(configuration);
         this.baseGraph = baseGraph;
-        boolean supportsMetaProperties = this.configuration.getBoolean(CONFIG_META_PROPERTIES, false);
-        boolean supportsMultiProperties = this.configuration.getBoolean(CONFIG_MULTI_PROPERTIES, false);
+        this.neo4jGraphVariables = new Neo4jGraphVariables(this);
+        this.tx().readWrite();
+        final Optional<Boolean> hasMultiProperties = this.neo4jGraphVariables.get(Graph.Hidden.hide(CONFIG_MULTI_PROPERTIES));
+        final Optional<Boolean> hasMetaProperties = this.neo4jGraphVariables.get(Graph.Hidden.hide(CONFIG_META_PROPERTIES));
+        boolean supportsMetaProperties = hasMetaProperties.orElse(this.configuration.getBoolean(CONFIG_META_PROPERTIES, false));
+        boolean supportsMultiProperties = hasMultiProperties.orElse(this.configuration.getBoolean(CONFIG_MULTI_PROPERTIES, false));
         if (supportsMultiProperties != supportsMetaProperties)
             throw new IllegalArgumentException(this.getClass().getSimpleName() + " currently supports either both meta-properties and multi-properties or neither");
-        this.neo4jGraphVariables = new Neo4jGraphVariables(this);
-        if (supportsMultiProperties)
-            this.trait = new MultiMetaNeo4jTrait();
-        else
-            this.trait = new NoMultiNoMetaNeo4jTrait();
+        if (!hasMultiProperties.isPresent())
+            this.neo4jGraphVariables.set(Graph.Hidden.hide(CONFIG_MULTI_PROPERTIES), supportsMultiProperties);
+        if (!hasMetaProperties.isPresent())
+            this.neo4jGraphVariables.set(Graph.Hidden.hide(CONFIG_META_PROPERTIES), supportsMetaProperties);
+        this.trait = supportsMultiProperties ? new MultiMetaNeo4jTrait() : new NoMultiNoMetaNeo4jTrait();
+        this.tx().commit();
     }
 
     protected Neo4jGraph(final Neo4jGraphAPI baseGraph, final Configuration configuration) {
@@ -140,6 +146,13 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
         return open(config);
     }
 
+    /**
+     * Construct a Neo4jGraph instance using an existing Neo4j raw instance.
+     */
+    public static Neo4jGraph open(final Neo4jGraphAPI baseGraph) {
+        return new Neo4jGraph(baseGraph, EMPTY_CONFIGURATION);
+    }
+
     @Override
     public Vertex addVertex(final Object... keyValues) {
         ElementHelper.legalPropertyKeyValueArray(keyValues);
@@ -217,13 +230,6 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
         }
     }
 
-
-    /**
-     * Construct a Neo4jGraph instance using an existing Neo4j raw instance.
-     */
-    /*public static Neo4jGraph open(final Neo4jGraphAPI baseGraph) {
-        return new Neo4jGraph(Optional.ofNullable(baseGraph).orElseThrow(() -> Graph.Exceptions.argumentCanNotBeNull("baseGraph")));
-    }*/
     @Override
     public <C extends GraphComputer> C compute(final Class<C> graphComputerClass) {
         throw Graph.Exceptions.graphComputerNotSupported();


[38/50] [abbrv] incubator-tinkerpop git commit: Minor adjustments to javadoc.

Posted by dk...@apache.org.
Minor adjustments to javadoc.


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

Branch: refs/heads/preprocessor
Commit: 5ffdc7e34b1e1fbe0bba17876a83085b4d1351cc
Parents: 15d8da0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 12:59:25 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 12:59:25 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/Vertex.java     | 25 +++++++++++---------
 1 file changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5ffdc7e3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
index a26d1d8..7b0d2a5 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Vertex.java
@@ -57,8 +57,9 @@ public interface Vertex extends Element, Host {
     public Edge addEdge(final String label, final Vertex inVertex, final Object... keyValues);
 
     /**
-     * Get the {@link VertexProperty} for the provided key. If the property does not exist, return {@link VertexProperty#empty}.
-     * If there are more than one verte properties for the provided key, then throw {@link Vertex.Exceptions#multiplePropertiesExistForProvidedKey}.
+     * Get the {@link VertexProperty} for the provided key. If the property does not exist, return
+     * {@link VertexProperty#empty}. If there are more than one vertex properties for the provided
+     * key, then throw {@link Vertex.Exceptions#multiplePropertiesExistForProvidedKey}.
      *
      * @param key the key of the vertex property to get
      * @param <V> the expected type of the vertex property value
@@ -94,9 +95,10 @@ public interface Vertex extends Element, Host {
     /**
      * Set the provided key to the provided value using default {@link VertexProperty.Cardinality} for that key.
      * The default cardinality can be vendor defined and is usually tied to the graph schema.
-     * The default implementation of this method determines the cardinality {@code graph().features().vertex().getCardinality(key)}.
-     * The provided key/values are the properties of the newly created {@link VertexProperty}.
-     * These key/values must be provided in an even number where the odd numbered arguments are {@link String}.
+     * The default implementation of this method determines the cardinality
+     * {@code graph().features().vertex().getCardinality(key)}. The provided key/values are the properties of the
+     * newly created {@link VertexProperty}. These key/values must be provided in an even number where the odd
+     * numbered arguments are {@link String}.
      *
      * @param key       the key of the vertex property
      * @param value     The value of the vertex property
@@ -109,11 +111,11 @@ public interface Vertex extends Element, Host {
     }
 
     /**
-     * Create a new vertex property.
-     * If the cardinality is {@link VertexProperty.Cardinality#single}, then set the key to the value.
-     * If the cardinality is {@link VertexProperty.Cardinality#list}, then add a new value to the key.
-     * If the cardinality is {@link VertexProperty.Cardinality#set}, then only add a new value if that value doesn't already exist for the key.
-     * If the value already exists for the key, add the provided key value vertex property properties to it.
+     * Create a new vertex property. If the cardinality is {@link VertexProperty.Cardinality#single}, then set the key
+     * to the value. If the cardinality is {@link VertexProperty.Cardinality#list}, then add a new value to the key.
+     * If the cardinality is {@link VertexProperty.Cardinality#set}, then only add a new value if that value doesn't
+     * already exist for the key. If the value already exists for the key, add the provided key value vertex property
+     * properties to it.
      *
      * @param cardinality the desired cardinality of the property key
      * @param key         the key of the vertex property
@@ -137,7 +139,8 @@ public interface Vertex extends Element, Host {
      * Gets an {@link Iterator} of adjacent vertices.
      *
      * @param direction  The adjacency direction of the vertices to retrieve off this vertex
-     * @param edgeLabels The labels of the edges associated with the vertices to retrieve. If no labels are provided, then get all edges.
+     * @param edgeLabels The labels of the edges associated with the vertices to retrieve. If no labels are provided,
+     *                   then get all edges.
      * @return An iterator of vertices meeting the provided specification
      */
     public Iterator<Vertex> vertices(final Direction direction, final String... edgeLabels);


[10/50] [abbrv] incubator-tinkerpop git commit: trying to fix a lowercase git bug.

Posted by dk...@apache.org.
trying to fix a lowercase git bug.


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

Branch: refs/heads/preprocessor
Commit: 1cbad4808ae7023a59b6e418499f18037c70ac34
Parents: b887681
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 10:42:55 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 10:42:55 2015 -0600

----------------------------------------------------------------------
 ...metaNeo4jGraphGroovyProcessStandardTest.java | 36 --------------------
 1 file changed, 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1cbad480/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNometaNeo4jGraphGroovyProcessStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNometaNeo4jGraphGroovyProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNometaNeo4jGraphGroovyProcessStandardTest.java
deleted file mode 100644
index 3bc5aa1..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNometaNeo4jGraphGroovyProcessStandardTest.java
+++ /dev/null
@@ -1,36 +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.neo4j.process.groovy;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.NoMultiNoMetaNeo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.process.GroovyProcessStandardSuite;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(GroovyProcessStandardSuite.class)
-@GraphProviderClass(provider = NoMultiNoMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class)
-public class NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest {
-}


[02/50] [abbrv] incubator-tinkerpop git commit: Add info to readme about intellij setup for neo4j-gremlin.

Posted by dk...@apache.org.
Add info to readme about intellij setup for neo4j-gremlin.


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

Branch: refs/heads/preprocessor
Commit: d2fd29162eb7a4d680491c6a8fc77609e19a81a0
Parents: d43cca7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 07:59:09 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 07:59:09 2015 -0400

----------------------------------------------------------------------
 README.asciidoc | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d2fd2916/README.asciidoc
----------------------------------------------------------------------
diff --git a/README.asciidoc b/README.asciidoc
index ce76e78..81cce5f 100644
--- a/README.asciidoc
+++ b/README.asciidoc
@@ -65,6 +65,8 @@ This section refers specifically to setup within Intellij.  TinkerPop has a modu
 
 Note that it maybe be necessary to re-execute these steps if the `gremlin-shaded` `pom.xml` is ever updated.
 
+Developers working on the `neo4j-gremlin` module should enabled the `include-neo4j` Maven profile in Intellij.  This will ensure that tests will properly execute within the IDE.
+
 Get Started
 ~~~~~~~~~~~
 


[50/50] [abbrv] incubator-tinkerpop git commit: removed dynamic code sample for Spark

Posted by dk...@apache.org.
removed dynamic code sample for Spark


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

Branch: refs/heads/preprocessor
Commit: 91c6d02fcc0fdb77181f3e08629e55760a1239d5
Parents: 62e4a1b
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Jun 3 02:11:34 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Jun 3 02:11:34 2015 +0200

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 8 --------
 1 file changed, 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/91c6d02f/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index 5c120d1..5cdc105 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -952,14 +952,6 @@ gremlin> g.V().out().out().values('name')
 ==>lop
 ==>ripple
 
-[gremlin-groovy]
-----
-graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
-g = graph.traversal(computer(SparkGraphComputer))
-g.V().count()
-g.V().out().out().values('name')
-----
-
 For using lambdas in Gremlin-Groovy, simply provide `:remote connect` a `TraversalSource` which leverages SparkGraphComputer.
 
 [source,test]


[39/50] [abbrv] incubator-tinkerpop git commit: Add test for IoCore

Posted by dk...@apache.org.
Add test for IoCore


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

Branch: refs/heads/preprocessor
Commit: d096ac2faf713bd7beed776f2417d3f672a99186
Parents: 5ffdc7e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 13:13:35 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 13:13:35 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/io/IoCore.java  |  3 ++
 .../gremlin/structure/io/IoCoreTest.java        | 53 ++++++++++++++++++++
 2 files changed, 56 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d096ac2f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCore.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCore.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCore.java
index 993124e..00af37e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCore.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoCore.java
@@ -29,6 +29,9 @@ import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class IoCore {
+
+    private IoCore() {}
+
     public static Io.Builder<GraphMLIo> graphml() {
         return GraphMLIo.build();
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d096ac2f/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/IoCoreTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/IoCoreTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/IoCoreTest.java
new file mode 100644
index 0000000..235942d
--- /dev/null
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/IoCoreTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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.structure.io;
+
+import org.apache.tinkerpop.gremlin.TestHelper;
+import org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo;
+import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo;
+import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class IoCoreTest {
+    @Test
+    public void shouldBeUtilityClass() throws Exception {
+        TestHelper.assertIsUtilityClass(IoCore.class);
+    }
+
+    @Test
+    public void shouldCreateAnIoBuilderforGraphML() {
+        assertThat(IoCore.graphml(), instanceOf(GraphMLIo.Builder.class));
+    }
+
+    @Test
+    public void shouldCreateAnIoBuilderforGraphSON() {
+        assertThat(IoCore.graphson(), instanceOf(GraphSONIo.Builder.class));
+    }
+
+    @Test
+    public void shouldCreateAnIoBuilderforGryo() {
+        assertThat(IoCore.gryo(), instanceOf(GryoIo.Builder.class));
+    }
+}


[15/50] [abbrv] incubator-tinkerpop git commit: Add tests for ElementHelper.

Posted by dk...@apache.org.
Add tests for ElementHelper.


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

Branch: refs/heads/preprocessor
Commit: 5a41ae8c67141ad1cd7a48128ff378bfad8edfb3
Parents: c1d15ca
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 13:38:58 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 13:38:58 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/util/ElementHelper.java   | 26 +++++--
 .../structure/util/ElementHelperTest.java       | 74 +++++++++++++++-----
 2 files changed, 79 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5a41ae8c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
index 024e07f..0245086 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
@@ -117,19 +117,31 @@ public final class ElementHelper {
     }
 
     /**
-     * Remove a key from the set of key value pairs. Assumes that validations have already taken place to
+     * Remove a key from the set of key/value pairs. Assumes that validations have already taken place to
      * assure that key positions contain strings and that there are an even number of elements. If after removal
      * there are no values left, the key value list is returned as empty.
+     *
+     * @param keyToRemove the key to remove
+     * @param keyValues the list to remove the accessor from
+     * @return the key/values without the specified accessor or an empty array if no values remain after removal
      */
     public static Optional<Object[]> remove(final String keyToRemove, final Object... keyValues) {
         return ElementHelper.remove((Object) keyToRemove, keyValues);
     }
 
+    /**
+     * Removes an accessor from the set of key/value pairs. Assumes that validations have already taken place to
+     * assure that key positions contain strings and that there are an even number of elements. If after removal
+     * there are no values left, the key value list is returned as empty.
+     *
+     * @param accessor to remove
+     * @param keyValues the list to remove the accessor from
+     * @return the key/values without the specified accessor or an empty array if no values remain after removal
+     */
     public static Optional<Object[]> remove(final T accessor, final Object... keyValues) {
         return ElementHelper.remove((Object) accessor, keyValues);
     }
 
-
     private static Optional<Object[]> remove(final Object keyToRemove, final Object... keyValues) {
         final List list = Arrays.asList(keyValues);
         final List revised = IntStream.range(0, list.size())
@@ -162,6 +174,13 @@ public final class ElementHelper {
         }
     }
 
+    /**
+     * Replaces one key with a different key.
+     *
+     * @param keyValues the list of key/values to alter
+     * @param oldKey the key to replace
+     * @param newKey the new key
+     */
     public static Object[] replaceKey(final Object[] keyValues, final Object oldKey, final Object newKey) {
         final Object[] kvs = new Object[keyValues.length];
         for (int i = 0; i < keyValues.length; i = i + 2) {
@@ -246,7 +265,7 @@ public final class ElementHelper {
     }
 
     /**
-     * Assign key/value pairs as properties to a {@link org.apache.tinkerpop.gremlin.structure.Vertex}.  If the value of {@link T#id} or
+     * Assign key/value pairs as properties to a {@link Vertex}.  If the value of {@link T#id} or
      * {@link T#label} is in the set of pairs, then they are ignored.
      *
      * @param vertex            the vertex to attach the properties to
@@ -331,7 +350,6 @@ public final class ElementHelper {
      * @param a The first {@link org.apache.tinkerpop.gremlin.structure.Element}
      * @param b The second {@link org.apache.tinkerpop.gremlin.structure.Element} (as an {@link Object})
      * @return true if elements and equal and false otherwise
-     * @throws IllegalArgumentException if either argument is null
      */
     public static boolean areEqual(final Element a, final Object b) {
         if (null == b || null == a)

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5a41ae8c/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
index 2187298..0c8dd4a 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelperTest.java
@@ -25,6 +25,7 @@ import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.javatuples.Pair;
 import org.junit.Test;
 
@@ -77,6 +78,17 @@ public class ElementHelperTest {
     }
 
     @Test
+    public void shouldValidatePropertyAndNotAllowHiddenKey() {
+        final String key = Graph.Hidden.hide("key");
+        try {
+            ElementHelper.validateProperty(key, "test");
+            fail("Should fail as property key cannot be hidden");
+        } catch (IllegalArgumentException iae) {
+            assertEquals(Property.Exceptions.propertyKeyCanNotBeAHiddenKey(key).getMessage(), iae.getMessage());
+        }
+    }
+
+    @Test
     public void shouldHaveValidProperty() {
         ElementHelper.validateProperty("aKey", "value");
     }
@@ -162,7 +174,7 @@ public class ElementHelperTest {
     }
 
     @Test
-    public void shouldAttachKeyValuesButNotLabelsOrId() {
+    public void shouldAttachPropertiesButNotLabelsOrId() {
         final Element mockElement = mock(Element.class);
         ElementHelper.attachProperties(mockElement, "test", 123, T.id, 321, T.label, "friends");
         verify(mockElement, times(1)).property("test", 123);
@@ -171,13 +183,13 @@ public class ElementHelperTest {
     }
 
     @Test(expected = ClassCastException.class)
-    public void shouldFailTryingToAttachNonStringKey() {
+    public void shouldFailTryingToAttachPropertiesNonStringKey() {
         final Element mockElement = mock(Element.class);
         ElementHelper.attachProperties(mockElement, "test", 123, 321, "test");
     }
 
     @Test
-    public void shouldFailTryingToAttachKeysToNullElement() {
+    public void shouldFailTryingToAttachPropertiesToNullElement() {
         try {
             ElementHelper.attachProperties(null, "test", 123, 321, "test");
             fail("Should throw exception since the element argument is null");
@@ -186,26 +198,30 @@ public class ElementHelperTest {
         }
     }
 
-    /*@Test
-    public void shouldFailElementAreEqualTestBecauseFirstArgumentIsNull() {
-        try {
-            ElementHelper.areEqual((Element) null, "some object");
-            fail("Should throw exception since the first argument is null");
-        } catch (IllegalArgumentException iae) {
-            assertEquals(Graph.Exceptions.argumentCanNotBeNull("a").getMessage(), iae.getMessage());
-        }
+    @Test
+    public void shouldAttachPropertiesWithCardinalityButNotLabelsOrId() {
+        final Vertex mockElement = mock(Vertex.class);
+        ElementHelper.attachProperties(mockElement, VertexProperty.Cardinality.single, "test", 123, T.id, 321, T.label, "friends");
+        verify(mockElement, times(1)).property(VertexProperty.Cardinality.single, "test", 123);
+        verify(mockElement, times(0)).property(VertexProperty.Cardinality.single, T.id.getAccessor(), 321);
+        verify(mockElement, times(0)).property(VertexProperty.Cardinality.single, T.label.getAccessor(), "friends");
+    }
+
+    @Test(expected = ClassCastException.class)
+    public void shouldFailTryingToAttachPropertiesWithCardinalityNonStringKey() {
+        final Element mockElement = mock(Vertex.class);
+        ElementHelper.attachProperties(mockElement, VertexProperty.Cardinality.single, "test", 123, 321, "test");
     }
 
     @Test
-    public void shouldFailElementAreEqualTestBecauseSecondArgumentIsNull() {
-        final Element mockElement = mock(Element.class);
+    public void shouldFailTryingToAttachPropertiesWithCardinalityToNullElement() {
         try {
-            ElementHelper.areEqual(mockElement, null);
-            fail("Should throw exception since the second argument is null");
+            ElementHelper.attachProperties((Vertex) null, VertexProperty.Cardinality.single, "test", 123, 321, "test");
+            fail("Should throw exception since the element argument is null");
         } catch (IllegalArgumentException iae) {
-            assertEquals(Graph.Exceptions.argumentCanNotBeNull("b").getMessage(), iae.getMessage());
+            assertEquals(Graph.Exceptions.argumentCanNotBeNull("vertex").getMessage(), iae.getMessage());
         }
-    }*/
+    }
 
     @Test
     public void shouldDetermineElementsAreEqualAsTheyAreSameObject() {
@@ -437,6 +453,19 @@ public class ElementHelperTest {
     }
 
     @Test
+    public void shouldRemoveAccessor() {
+        final Optional<Object[]> kvs = ElementHelper.remove(T.id, "1", "this", T.id, 6l, "3", "other", "4", 1);
+        assertEquals(6, kvs.get().length);
+        assertTrue(Stream.of(kvs.get()).noneMatch(kv -> kv.equals("2") || kv.equals(6l)));
+    }
+
+    @Test
+    public void shouldRemoveAccessorAndReturnEmpty() {
+        final Optional<Object[]> kvs = ElementHelper.remove(T.id, T.id, "this");
+        assertEquals(Optional.empty(), kvs);
+    }
+
+    @Test
     public void shouldUpsertKeyValueByAddingIt() {
         final Object[] oldKvs = new Object[]{"k", "v"};
         final Object[] newKvs = ElementHelper.upsert(oldKvs, "k1", "v1");
@@ -452,4 +481,15 @@ public class ElementHelperTest {
         assertEquals(4, newKvs.length);
         assertEquals("v1", newKvs[3]);
     }
+
+    @Test
+    public void shouldReplaceKey() {
+        final Object[] oldKvs = new Object[]{"k", "v", "k1", "v0"};
+        final Object[] newKvs = ElementHelper.replaceKey(oldKvs, "k", "k2");
+        assertEquals(4, newKvs.length);
+        assertEquals("k2", newKvs[0]);
+        assertEquals("v", newKvs[1]);
+        assertEquals("k1", newKvs[2]);
+        assertEquals("v0", newKvs[3]);
+    }
 }


[25/50] [abbrv] incubator-tinkerpop git commit: added Neo4jGremlin back to the AsciiDocs.

Posted by dk...@apache.org.
added Neo4jGremlin back to the AsciiDocs.


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

Branch: refs/heads/preprocessor
Commit: ff6067d6d645020252d7c1ab0bd9cb64d3d2bd1b
Parents: 00fc75d
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 14:34:57 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 14:34:57 2015 -0600

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 186 +++++++++++++++++++++++++++++++++
 1 file changed, 186 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ff6067d6/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index e61fefb..c4a087a 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -508,6 +508,192 @@ TinkerGraph has several settings that can be provided on creation via `Configura
 
 The `IdManager` settings above refer to how TinkerGraph will control identifiers for vertices, edges and vertex properties.  There are several options for each of these settings: `ANY`, `LONG`, `INTEGER`, `UUID`, or the fully qualified class name of an `IdManager` implementation on the classpath.  When not specified, the default values for all settings is `ANY`, meaning that the graph will work with any object on the JVM as the identifier and will generate new identifiers from `Long` when the identifier is not user supplied.  TinkerGraph will also expect the user to understand the types used for identifiers when querying, meaning that `g.V(1)` and `g.V(1L)` could return two different vertices.  `LONG`, `INTEGER` and `UUID` settings will try to coerce identifier values to the expected type as well as generate new identifiers with that specified type.
 
+[[neo4j-gremlin]]
+Neo4j-Gremlin
+-------------
+
+[source,xml]
+----
+<dependency>
+   <groupId>org.apache.tinkerpop</groupId>
+   <artifactId>neo4j-gremlin</artifactId>
+   <version>x.y.z</version>
+</dependency>
+----
+
+link:http://neotechnology.com[Neo Technology] are the developers of the OLTP-based link:http://neo4j.org[Neo4j graph database].
+
+CAUTION: Unless under a commercial agreement with Neo Technology, Neo4j is licensed as link:http://en.wikipedia.org/wiki/Affero_General_Public_License[AGPL]. The `neo4j-gremlin` module is licensed Apache2 because it only references the Apache2-licensed Neo4j API (not implementation). Note that neither the <<gremlin-console,Gremlin Console>> nor <<gremlin-server,Gremlin Server>> distribute with the Neo4j binaries. To access the Neo4j binaries, use the `:install` command to download binaries from link:http://search.maven.org/[Maven Central Repository].
+
+[source,groovy]
+----
+gremlin> :install org.apache.tinkerpop neo4j-gremlin x.y.z
+==>loaded: [org.apache.tinkerpop, neo4j-gremlin, x.y.z]
+gremlin> :plugin use tinkerpop.neo4j
+==>tinkerpop.neo4j activated
+gremlin> g = Neo4jGraph.open('/tmp/neo4j')
+==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
+----
+
+For those leveraging Neo4j High Availability, configure `Neo4jGraph` for "HA mode" by setting the `gremlin.neo4j.ha` flag to `true` in the `Configuration` object passed to `Neo4jGraph.open()`.  Note that when the flag is set (by default it is `false`), the `Neo4jGraph` instance expects HA configuration settings to be present.  As with embedded Neo4j, HA configuration keys should be prefixed with `gremlin.neo4j.conf`.  Please consult Neo4j documentation for more information on link:http://docs.neo4j.org/chunked/stable/ha.html[High Availability] configuration.
+
+IMPORTANT: `Neo4jGraph` supports both meta- and multi-properties (see <<_vertex_properties,vertex properties>>). However, these are implemented by making use of "hidden" Neo4j nodes. For example, when a vertex has multiple "name" properties, each property is a new node (multi-properties) which can have properties attached to it (meta-properties). As such, the underlying representation may become difficult to query directly using another graph language such as Cypher. The default setting is to disable multi- and meta-properties. However, if this feature is desired, then it can be activated via `gremlin.neo4j.metaProperties` and `gremlin.neo4j.multiProperties` configurations being set to `true`. Once the configuration is set, it can not be changed for the lifetime of the graph.
+
+TIP: To host Neo4j in Gremlin Server, the dependencies must first be "installed" or otherwise copied to the Gremlin Server path.  The automated method for doing this would be to execute `bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin x.y.z`.
+
+Indices
+~~~~~~~
+
+Neo4j 2.x supports two types of indices: link:http://docs.neo4j.org/chunked/stable/query-schema-index.html[schema indices] and link:http://docs.neo4j.org/chunked/stable/auto-indexing.html[automatic indices]. Automatic indices have been around since Neo4j 1.x and automatically index an element based on a pre-defined property keys. Schema indices are new to Neo4j 2.x and leverage vertex labels to partition the index space. TinkerPop3 does not provide method interfaces for defining schemas/indices for the underlying graph system. Thus, in order to create indices, the Neo4j API is leveraged.
+
+NOTE: `Neo4jGraph` will attempt to discern which indices to use when executing a traversal of the form `g.V().has()`. The general order of checking is: schema indices, automatic indices, label grouping linear-scan iteration, full linear-scan iteration.
+
+Using Schema Indices
+^^^^^^^^^^^^^^^^^^^^
+
+The Gremlin-Console session below demonstrates schema indices. For more information, please refer to the Neo4j documentation:
+
+* Manipulating schema indices with link:http://docs.neo4j.org/chunked/stable/query-schema-index.html[Cypher].
+* Manipulating schema indices with the Neo4j link:http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-new-index.html[Java API].
+
+[source,groovy]
+gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
+==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
+gremlin> graph.tx().open() // direct Neo4j access requires explicit transaction creation
+==>null
+gremlin> import org.neo4j.graphdb.*
+...
+gremlin> graph.getBaseGraph().schema().indexFor(DynamicLabel.label('person')).on('name').create()
+==>IndexDefinition[label:person, on:name]
+gremlin> graph.tx().commit()
+==>null
+gremlin> graph.addVertex(label,'person','name','marko')
+==>v[0]
+gremlin> graph.addVertex(label,'dog','name','puppy')
+==>v[1]
+gremlin> g = graph.traversal(standard())
+==>graphtraversalsource[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]], standard]
+gremlin> g.V().hasLabel('person').has('name','marko').values('name')
+==>marko
+
+Below demonstrates the runtime benefits of indices and demonstrates how if there is no defined schema index (only vertex labels), a linear scan of the vertex-label partition is still faster than a linear scan of all vertices.
+
+[source,groovy]
+gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
+==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
+gremlin> graph.tx().open()
+==>null
+gremlin> import org.neo4j.graphdb.*
+...
+gremlin> graph.getBaseGraph().schema().indexFor(DynamicLabel.label('artist')).on('name').create() <1>
+==>IndexDefinition[label:artist, on:name]
+gremlin> graph.tx().commit()
+==>null
+gremlin> graph.io().readGraphML('data/grateful-dead.xml')
+==>null
+gremlin> g = graph.traversal(standard())
+==>graphtraversalsource[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]], standard]
+gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').next()}  <2>
+==>0.0585639999999997
+gremlin> clock(1000){g.V().has('name','Garcia').next()} <3>
+==>0.6039889999999992
+gremlin> g.getBaseGraph().schema().getIndexes(DynamicLabel.label('artist')).iterator().next().drop() <4>
+==>null
+gremlin> g.tx().commit()
+==>null
+gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').next()} <5>
+==>0.26470499999999936
+gremlin> clock(1000){g.V().has('name','Garcia').next()} <6>
+==>0.6293959999999993
+
+<1> Create a schema index for all artist vertices on their name property.
+<2> Find all artists whose name is Garcia which uses the pre-defined schema index.
+<3> Find all vertices whose name is Garcia which requires a linear scan of all the data in the graph.
+<4> Drop the created index schema.
+<5> Find all artists whose name is Garcia which does a linear scan of the artist vertex-label partition.
+<6> Find all vertices whose name is Garcia which requires a linear scan of all the data in the graph.
+
+
+Using Automatic Indices
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The Gremlin-Console session below demonstrates automatic indices. For more information, please refer to the Neo4j documentation:
+
+* Manipulating automatic indices with the Neo4j link:http://docs.neo4j.org/chunked/stable/auto-indexing.html[Java API].
+
+[source,groovy]
+gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
+==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
+gremlin> graph.getBaseGraph().index().getNodeAutoIndexer().startAutoIndexingProperty('name')
+==>null
+gremlin> graph.getBaseGraph().index().getNodeAutoIndexer().setEnabled(true)
+==>null
+gremlin> graph.addVertex(label,'person','name','marko')
+==>v[0]
+gremlin> graph.addVertex(label,'dog','name','puppy')
+==>v[1]
+gremlin> g = graph.traversal(standard())
+==>graphtraversalsource[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]], standard]
+gremlin> g.V().hasLabel('person').has('name','marko').values('name')
+==>marko
+
+WARNING: The preferred method for dealing with automatic indices in Neo4j is via `Neo4jGraph.open()` configuration as opposed to runtime updating as demonstrated above. This is because with runtime updating, index information is not propagated across Neo4j connections.
+
+Cypher
+~~~~~~
+
+image::gremlin-loves-cypher.png[width=400]
+
+NeoTechnology are the creators of the graph pattern-match query language link:http://www.neo4j.org/learn/cypher[Cypher]. It is possible to leverage Cypher from within Gremlin by using the `Neo4jGraph.cypher()` graph traversal method.
+
+[source,groovy]
+gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
+==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
+gremlin> graph.io().readGryo('data/tinkerpop-modern.kryo')
+==>null
+gremlin> graph.cypher('MATCH (a {name:"marko"}) RETURN a')
+==>[a:v[0]]
+gremlin> graph.cypher('MATCH (a {name:"marko"}) RETURN a').select('a').out('knows').values('name')
+==>vadas
+==>josh
+
+Thus, like <<match-step,`match()`>>-step in Gremlin, it is possible to do a declarative pattern match and then move back into imperative Gremlin.
+
+IMPORTANT: For those developers using <<gremlin-server,Gremlin Server>> against Neo4j, it is possible to do Cypher queries by simply placing the Cypher string in `graph.cypher(...)` before submission to the server.
+
+Multi-Label
+~~~~~~~~~~~
+
+TinkerPop3 requires every `Element` to have a single, immutable string label (i.e. a `Vertex`, `Edge`, and `VertexProperty`). In Neo4j, a `Node` (vertex) can have an link:http://neo4j.com/docs/stable/graphdb-neo4j-labels.html[arbitrary number of labels] while a `Relationship` (edge) can have one and only one. Furthermore, in Neo4j, `Node` labels are mutable while `Relationship` labels are not. In order to handle this mismatch, three `Neo4jVertex` specific methods exist in Neo4j-Gremlin.
+
+[source,java]
+public Set<String> labels() // get all the labels of the vertex
+public void addLabel(final String label) // add a label to the vertex
+public void removeLabel(final String label) // remove a label from the vertex
+
+An example use case is presented below.
+
+[source,java]
+----
+Neo4jVertex v = (Neo4jVertex) graph.addVertex("human::animal");
+assertEquals("animal::human",v.label()) // standard Vertex.label() method (note that labels are alphabetically sorted)
+assertEquals(2, v.labels().size()) // specific Neo4jVertex.labels() method
+assertTrue(v.labels().contains("human"))
+assertTrue(v.labels().contains("animal"))
+
+v.addLabel("organism") // specific Neo4jVertex.addLabel() method
+v.removeLabel("human") // specific Neo4jVertex.removeLabel() method
+assertEquals(2, v.labels().size()) // specific Neo4jVertex.labels() method
+assertTrue(v.labels().contains("animal"))
+assertTrue(v.labels().contains("organism"))
+
+v.addLabel("organism") // add a repeat
+v.addLabel("human") // remove a label that doesn't exist
+assertEquals(2, v.labels().size()) // specific Neo4jVertex.labels() method
+assertTrue(v.labels().contains("animal"))
+assertTrue(v.labels().contains("organism"))
+----
+
 [[hadoop-gremlin]]
 Hadoop-Gremlin
 --------------


[13/50] [abbrv] incubator-tinkerpop git commit: Removed ElementHelper.getOrCreate()

Posted by dk...@apache.org.
Removed ElementHelper.getOrCreate()

The method wasn't in use and it seemed a bit naive in its implementation.  It assumed that the user was working with a Graph that supportsUserSuppliedIds and only involved id lookup.  Real-world getOrCreate tends to be more complex.


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

Branch: refs/heads/preprocessor
Commit: c1d15cad58860f35ce53039cd5f425f9f4f3212e
Parents: 530c63e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 12:52:59 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 12:52:59 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/util/ElementHelper.java   | 22 +-------------------
 1 file changed, 1 insertion(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c1d15cad/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
index 931f1ae..024e07f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java
@@ -48,8 +48,7 @@ import java.util.stream.Stream;
  */
 public final class ElementHelper {
 
-    private ElementHelper() {
-    }
+    private ElementHelper() {}
 
     /**
      * Determine whether the Element label can be legally set. This is typically used as a pre-condition check.
@@ -66,25 +65,6 @@ public final class ElementHelper {
             throw Element.Exceptions.labelCanNotBeAHiddenKey(label);
     }
 
-    /*public static void validateLabels(final String... labels) throws IllegalArgumentException {
-        for (final String label : labels) {
-            validateLabel(label);
-        }
-    }*/
-
-    /**
-     * Check if the vertex, by ID, exists. If it does return it, else create it and return it.
-     *
-     * @param graph the graph to check for the existence of the vertex
-     * @param id    the id of the vertex to look for
-     * @param label the label of the vertex to set if the vertex does not exist
-     * @return a pre-existing vertex or a newly created vertex
-     */
-    public static Vertex getOrAddVertex(final Graph graph, final Object id, final String label) {
-        final Iterator<Vertex> iterator = graph.vertices(id);
-        return iterator.hasNext() ? iterator.next() : graph.addVertex(T.id, id, T.label, label);
-    }
-
     /**
      * Determines whether the property key/value for the specified thing can be legally set. This is typically used as
      * a pre-condition check prior to setting a property.


[28/50] [abbrv] incubator-tinkerpop git commit: gutted automatic indices for Neo4jGraph. Gutted it from the docs.

Posted by dk...@apache.org.
gutted automatic indices for Neo4jGraph. Gutted it from the docs.


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

Branch: refs/heads/preprocessor
Commit: 38a225edd1ae104868c5edde6bc1ebea191b9197
Parents: e4a4d52
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 14:56:45 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 14:56:45 2015 -0600

----------------------------------------------------------------------
 docs/src/implementations.asciidoc               | 41 ++-------
 .../step/sideEffect/Neo4jGraphStep.java         | 96 ++------------------
 .../gremlin/neo4j/structure/Neo4jGraph.java     |  4 +
 .../neo4j/AbstractNeo4jGraphProvider.java       | 36 +-------
 .../structure/NativeNeo4jStructureTest.java     | 46 ----------
 5 files changed, 23 insertions(+), 200 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/38a225ed/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index 061f06a..d5f5632 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -561,17 +561,14 @@ TIP: To host Neo4j in Gremlin Server, the dependencies must first be "installed"
 Indices
 ~~~~~~~
 
-Neo4j 2.x supports two types of indices: link:http://docs.neo4j.org/chunked/stable/query-schema-index.html[schema indices] and link:http://docs.neo4j.org/chunked/stable/auto-indexing.html[automatic indices]. Automatic indices have been around since Neo4j 1.x and automatically index an element based on a pre-defined property keys. Schema indices are new to Neo4j 2.x and leverage vertex labels to partition the index space. TinkerPop3 does not provide method interfaces for defining schemas/indices for the underlying graph system. Thus, in order to create indices, the Neo4j API is leveraged.
+Neo4j 2.x indices leverage vertex labels to partition the index space. TinkerPop3 does not provide method interfaces for defining schemas/indices for the underlying graph system. Thus, in order to create indices, it is important to call the Neo4j API directly.
 
-NOTE: `Neo4jGraph` will attempt to discern which indices to use when executing a traversal of the form `g.V().has()`. The general order of checking is: schema indices, automatic indices, label grouping linear-scan iteration, full linear-scan iteration.
+NOTE: `Neo4jGraphStep` will attempt to discern which indices to use when executing a traversal of the form `g.V().has()`. The general order of checking is: indices, label grouping linear-scan iteration, full linear-scan iteration.
 
-Using Schema Indices
-^^^^^^^^^^^^^^^^^^^^
-
-The Gremlin-Console session below demonstrates schema indices. For more information, please refer to the Neo4j documentation:
+The Gremlin-Console session below demonstrates Neo4j indices. For more information, please refer to the Neo4j documentation:
 
-* Manipulating schema indices with link:http://docs.neo4j.org/chunked/stable/query-schema-index.html[Cypher].
-* Manipulating schema indices with the Neo4j link:http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-new-index.html[Java API].
+* Manipulating indices with link:http://docs.neo4j.org/chunked/stable/query-schema-index.html[Cypher].
+* Manipulating indices with the Neo4j link:http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-new-index.html[Java API].
 
 [source,groovy]
 gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
@@ -593,7 +590,7 @@ gremlin> g = graph.traversal(standard())
 gremlin> g.V().hasLabel('person').has('name','marko').values('name')
 ==>marko
 
-Below demonstrates the runtime benefits of indices and demonstrates how if there is no defined schema index (only vertex labels), a linear scan of the vertex-label partition is still faster than a linear scan of all vertices.
+Below demonstrates the runtime benefits of indices and demonstrates how if there is no defined index (only vertex labels), a linear scan of the vertex-label partition is still faster than a linear scan of all vertices.
 
 [source,groovy]
 gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
@@ -630,32 +627,6 @@ gremlin> clock(1000){g.V().has('name','Garcia').next()} <6>
 <5> Find all artists whose name is Garcia which does a linear scan of the artist vertex-label partition.
 <6> Find all vertices whose name is Garcia which requires a linear scan of all the data in the graph.
 
-
-Using Automatic Indices
-^^^^^^^^^^^^^^^^^^^^^^^
-
-The Gremlin-Console session below demonstrates automatic indices. For more information, please refer to the Neo4j documentation:
-
-* Manipulating automatic indices with the Neo4j link:http://docs.neo4j.org/chunked/stable/auto-indexing.html[Java API].
-
-[source,groovy]
-gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
-==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
-gremlin> graph.getBaseGraph().index().getNodeAutoIndexer().startAutoIndexingProperty('name')
-==>null
-gremlin> graph.getBaseGraph().index().getNodeAutoIndexer().setEnabled(true)
-==>null
-gremlin> graph.addVertex(label,'person','name','marko')
-==>v[0]
-gremlin> graph.addVertex(label,'dog','name','puppy')
-==>v[1]
-gremlin> g = graph.traversal(standard())
-==>graphtraversalsource[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]], standard]
-gremlin> g.V().hasLabel('person').has('name','marko').values('name')
-==>marko
-
-WARNING: The preferred method for dealing with automatic indices in Neo4j is via `Neo4jGraph.open()` configuration as opposed to runtime updating as demonstrated above. This is because with runtime updating, index information is not propagated across Neo4j connections.
-
 Cypher
 ~~~~~~
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/38a225ed/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
index dbc5a32..949a22a 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
@@ -18,7 +18,6 @@
  */
 package org.apache.tinkerpop.gremlin.neo4j.process.traversal.step.sideEffect;
 
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jEdge;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
 import org.apache.tinkerpop.gremlin.neo4j.structure.trait.MultiMetaNeo4jTrait;
@@ -43,6 +42,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
+import java.util.function.Predicate;
 import java.util.stream.Stream;
 
 /**
@@ -63,33 +63,21 @@ public final class Neo4jGraphStep<S extends Element> extends GraphStep<S> {
     }
 
     private Iterator<? extends Edge> edges() {
-        final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
-        graph.tx().readWrite();
-        // ids are present, filter on them first
-        if (this.ids != null && this.ids.length > 0)
-            return IteratorUtils.filter(graph.edges(this.ids), edge -> HasContainer.testAll((Edge) edge, this.hasContainers));
-        final HasContainer hasContainer = this.getHasContainerForAutomaticIndex(Edge.class);
-        return (null == hasContainer) ?
-                IteratorUtils.filter(graph.edges(), edge -> HasContainer.testAll((Edge) edge, this.hasContainers)) :
-                getEdgesUsingAutomaticIndex(hasContainer).filter(edge -> HasContainer.testAll((Edge) edge, this.hasContainers)).iterator();
+        return IteratorUtils.filter(this.getTraversal().getGraph().get().edges(this.ids), edge -> HasContainer.testAll((Edge) edge, this.hasContainers));
     }
 
     private Iterator<? extends Vertex> vertices() {
         final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
-        graph.tx().readWrite();
         // ids are present, filter on them first
         if (this.ids != null && this.ids.length > 0)
             return IteratorUtils.filter(graph.vertices(this.ids), vertex -> HasContainer.testAll((Vertex) vertex, this.hasContainers));
+        ////// do index lookups //////
+        graph.tx().readWrite();
         // a label and a property
         final Pair<String, HasContainer> labelHasPair = this.getHasContainerForLabelIndex();
         if (null != labelHasPair)
             return this.getVerticesUsingLabelAndProperty(labelHasPair.getValue0(), labelHasPair.getValue1())
                     .filter(vertex -> HasContainer.testAll((Vertex) vertex, this.hasContainers)).iterator();
-        // use automatic indices
-        final HasContainer hasContainer = this.getHasContainerForAutomaticIndex(Vertex.class);
-        if (null != hasContainer)
-            return this.getVerticesUsingAutomaticIndex(hasContainer)
-                    .filter(vertex -> HasContainer.testAll((Vertex) vertex, this.hasContainers)).iterator();
         // only labels
         final List<String> labels = this.getInternalLabels();
         if (null != labels)
@@ -100,49 +88,28 @@ public final class Neo4jGraphStep<S extends Element> extends GraphStep<S> {
 
 
     private Stream<Neo4jVertex> getVerticesUsingLabelAndProperty(final String label, final HasContainer hasContainer) {
-        //System.out.println("labelProperty: " + label + ":" + hasContainer);
         final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
         final Iterable<Neo4jNode> iterator1 = graph.getBaseGraph().findNodes(label, hasContainer.getKey(), hasContainer.getValue());
         final Iterable<Neo4jNode> iterator2 = graph.getBaseGraph().findNodes(hasContainer.getKey(), T.value.getAccessor(), hasContainer.getValue());
         final Stream<Neo4jVertex> stream1 = IteratorUtils.stream(iterator1)
                 .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
-                .map(node -> new Neo4jVertex(node,graph));
+                .map(node -> new Neo4jVertex(node, graph));
         final Stream<Neo4jVertex> stream2 = IteratorUtils.stream(iterator2)
                 .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
                 .filter(node -> node.getProperty(T.key.getAccessor()).equals(hasContainer.getKey()))
                 .map(node -> node.relationships(Neo4jDirection.INCOMING).iterator().next().start())
-                .map(node -> new Neo4jVertex(node,graph));
+                .map(node -> new Neo4jVertex(node, graph));
         return Stream.concat(stream1, stream2);
     }
 
     private Stream<Neo4jVertex> getVerticesUsingOnlyLabels(final List<String> labels) {
-        //System.out.println("labels: " + labels);
         final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
+        final Predicate<Neo4jNode> nodePredicate = graph.getTrait().getNodePredicate();
         return labels.stream()
-                .filter(label -> !label.equals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_LABEL))      // TODO: use predicates
                 .flatMap(label -> IteratorUtils.stream(graph.getBaseGraph().findNodes(label)))
-                .filter(node -> !node.hasLabel(MultiMetaNeo4jTrait.VERTEX_PROPERTY_LABEL))
                 .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
-                .map(node -> new Neo4jVertex(node,graph));
-    }
-
-    private Stream<Neo4jVertex> getVerticesUsingAutomaticIndex(final HasContainer hasContainer) {
-        //System.out.println("automatic index: " + hasContainer);
-        final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
-        return IteratorUtils.stream(graph.getBaseGraph().findNodes(hasContainer.getKey(), hasContainer.getValue()).iterator())
-                .map(node -> node.hasLabel(MultiMetaNeo4jTrait.VERTEX_PROPERTY_LABEL) ?
-                        node.relationships(Neo4jDirection.INCOMING).iterator().next().start() :
-                        node)
-                .filter(node -> ElementHelper.idExists(node.getId(), this.ids))
-                .map(node -> new Neo4jVertex(node,graph));
-    }
-
-    private Stream<Neo4jEdge> getEdgesUsingAutomaticIndex(final HasContainer hasContainer) {
-        final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
-        return IteratorUtils.stream(graph.getBaseGraph().findRelationships(hasContainer.getKey(), hasContainer.getValue()).iterator())
-                .filter(relationship -> ElementHelper.idExists(relationship.getId(), this.ids))
-                .filter(relationship -> !relationship.type().startsWith(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX))
-                .map(relationship -> new Neo4jEdge(relationship,graph));
+                .filter(nodePredicate)
+                .map(node -> new Neo4jVertex(node, graph));
     }
 
     private Pair<String, HasContainer> getHasContainerForLabelIndex() {
@@ -169,19 +136,6 @@ public final class Neo4jGraphStep<S extends Element> extends GraphStep<S> {
         return null;
     }
 
-    private HasContainer getHasContainerForAutomaticIndex(final Class<? extends Element> elementClass) {
-        final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
-        Neo4jGraphAPI baseGraph = graph.getBaseGraph();
-        boolean isNode = elementClass.equals(Vertex.class);
-        for (final HasContainer hasContainer : this.hasContainers) {
-            if (hasContainer.getBiPredicate().equals(Compare.eq) &&
-                    baseGraph.hasAutoIndex(isNode, hasContainer.getKey())) {
-                return hasContainer;
-            }
-        }
-        return null;
-    }
-
     @Override
     public String toString() {
         if (this.hasContainers.isEmpty())
@@ -191,36 +145,4 @@ public final class Neo4jGraphStep<S extends Element> extends GraphStep<S> {
                     StringFactory.stepString(this, this.hasContainers) :
                     StringFactory.stepString(this, Arrays.toString(this.ids), this.hasContainers);
     }
-
-    /*private String makeCypherQuery() {
-        final StringBuilder builder = new StringBuilder("MATCH node WHERE ");
-        int counter = 0;
-        for (final HasContainer hasContainer : this.hasContainers) {
-            if (hasContainer.key.equals(T.label.getAccessor()) && hasContainer.predicate.equals(Compare.EQUAL)) {
-                if (counter++ > 0) builder.append(" AND ");
-                builder.append("node:").append(hasContainer.value);
-            } else {
-                if (counter++ > 0) builder.append(" AND ");
-                builder.append("node.").append(hasContainer.key).append(" ");
-                if (hasContainer.predicate instanceof Compare) {
-                    builder.append(((Compare) hasContainer.predicate).asString()).append(" ").append(toStringOfValue(hasContainer.value));
-                } else if (hasContainer.predicate.equals(Contains.IN)) {
-                    builder.append("IN [");
-                    for (Object object : (Collection) hasContainer.value) {
-                        builder.append(toStringOfValue(object)).append(",");
-                    }
-                    builder.replace(builder.length() - 1, builder.length(), "").append("]");
-                }
-            }
-
-        }
-        System.out.println(builder);
-        return builder.toString();
-    }
-
-    private String toStringOfValue(final Object value) {
-        if (value instanceof String)
-            return "'" + value + "'";
-        else return value.toString();
-    }*/
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/38a225ed/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
index 2aeab7a..ae83677 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
@@ -228,6 +228,10 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
         }
     }
 
+    public Neo4jTrait getTrait() {
+        return this.trait;
+    }
+
     @Override
     public <C extends GraphComputer> C compute(final Class<C> graphComputerClass) {
         throw Graph.Exceptions.graphComputerNotSupported();

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/38a225ed/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
index e61440d..c243957 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
@@ -75,8 +75,7 @@ public abstract class AbstractNeo4jGraphProvider extends AbstractGraphProvider {
 
     private void createIndices(final Neo4jGraph g, final LoadGraphWith.GraphData graphData) {
         final Random random = new Random();
-        final int pick = random.nextInt(3);
-        //final int pick = 2;
+        final int pick = random.nextInt(2);
         if (graphData.equals(LoadGraphWith.GraphData.GRATEFUL)) {
             if (pick == 1) {
                 g.tx().readWrite();
@@ -89,16 +88,7 @@ public abstract class AbstractNeo4jGraphProvider extends AbstractGraphProvider {
                 if (random.nextBoolean())
                     createIndex(g, "CREATE INDEX ON :song(performances)");
                 g.tx().commit();
-            } else if (pick == 2) {
-                g.tx().readWrite();
-                if (random.nextBoolean())
-                    g.getBaseGraph().autoIndexProperties(true, "name");
-                if (random.nextBoolean())
-                    g.getBaseGraph().autoIndexProperties(true, "songType");
-                if (random.nextBoolean())
-                    g.getBaseGraph().autoIndexProperties(true, "performances");
-                g.tx().commit();
-            }
+            } // else no indices
         } else if (graphData.equals(LoadGraphWith.GraphData.MODERN)) {
             if (pick == 1) {
                 g.tx().readWrite();
@@ -112,16 +102,7 @@ public abstract class AbstractNeo4jGraphProvider extends AbstractGraphProvider {
                     createIndex(g, "CREATE INDEX ON :software(lang)");
                 }
                 g.tx().commit();
-            } else if (pick == 2) {
-                g.tx().readWrite();
-                if (random.nextBoolean())
-                    g.getBaseGraph().autoIndexProperties(true, "name");
-                if (random.nextBoolean())
-                    g.getBaseGraph().autoIndexProperties(true, "age");
-                if (random.nextBoolean())
-                    g.getBaseGraph().autoIndexProperties(true, "lang");
-                g.tx().commit();
-            }
+            } // else no indices
         } else if (graphData.equals(LoadGraphWith.GraphData.CLASSIC)) {
             if (pick == 1) {
                 g.tx().readWrite();
@@ -132,16 +113,7 @@ public abstract class AbstractNeo4jGraphProvider extends AbstractGraphProvider {
                 if (random.nextBoolean())
                     createIndex(g, "CREATE INDEX ON :vertex(lang)");
                 g.tx().commit();
-            } else if (pick == 2) {
-                g.tx().readWrite();
-                if (random.nextBoolean())
-                    g.getBaseGraph().autoIndexProperties(true, "name");
-                if (random.nextBoolean())
-                    g.getBaseGraph().autoIndexProperties(true, "age");
-                if (random.nextBoolean())
-                    g.getBaseGraph().autoIndexProperties(true, "lang");
-                g.tx().commit();
-            }
+            } // else no indices
         } else {
             // TODO: add CREW work here.
             // TODO: add meta_property indices when meta_property graph is provided

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/38a225ed/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
index 2971e19..8db88f9 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
@@ -146,34 +146,6 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
     }
 
     @Test
-    public void shouldReturnResultsUsingLegacyIndexOnVertex() {
-        graph.tx().readWrite();
-        this.getBaseGraph().autoIndexProperties(true, "name");
-        this.graph.tx().commit();
-
-        this.graph.addVertex(T.label, "Person", "name", "marko");
-        this.graph.addVertex(T.label, "Person", "name", "marko");
-        this.graph.tx().commit();
-        assertEquals(2, this.g.V().has("Person", "name", "marko").count().next(), 0);
-        assertEquals(2, this.g.V().has("name", "marko").count().next(), 0);
-    }
-
-    @Test
-    public void shouldUseLegacyIndexOnEdge() {
-        graph.tx().readWrite();
-        this.getBaseGraph().autoIndexProperties(true, "weight");
-        this.graph.tx().commit();
-
-        Vertex marko = this.graph.addVertex(T.label, "Person", "name", "marko");
-        Vertex john = this.graph.addVertex(T.label, "Person", "name", "john");
-        Vertex pete = this.graph.addVertex(T.label, "Person", "name", "pete");
-        marko.addEdge("friend", john, "weight", "a");
-        marko.addEdge("friend", pete, "weight", "a");
-        this.graph.tx().commit();
-        assertEquals(2, this.g.E().has("weight", "a").count().next(), 0);
-    }
-
-    @Test
     public void shouldEnforceUniqueConstraint() {
         this.graph.tx().readWrite();
         this.getBaseGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.name is unique", null);
@@ -336,24 +308,6 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
     }
 
     @Test
-    public void shouldDoLabelAndLegacyIndexSearch() {
-        graph.tx().readWrite();
-
-        this.getBaseGraph().execute("CREATE INDEX ON :Person(name)", null);
-        this.getBaseGraph().autoIndexProperties(true, "name");
-
-        this.graph.tx().commit();
-        this.graph.addVertex(T.label, "Person", "name", "marko");
-        this.graph.addVertex(T.label, "Person", "name", "john");
-        this.graph.addVertex(T.label, "Person", "name", "pete");
-        this.graph.tx().commit();
-        assertEquals(1, this.g.V().has(T.label, "Person").has("name", "marko").count().next(), 0);
-        assertEquals(3, this.g.V().has(T.label, "Person").count().next(), 0);
-        assertEquals(1, this.g.V().has("name", "john").count().next(), 0);
-
-    }
-
-    @Test
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
     public void shouldSupportVertexPropertyToVertexMappingOnIndexCalls() {
         graph.tx().readWrite();


[35/50] [abbrv] incubator-tinkerpop git commit: Used assumptions in supplied id feature tests TINKERPOP-695

Posted by dk...@apache.org.
Used assumptions in supplied id feature tests TINKERPOP-695

Assumptions allow the test to ignore rather than just pass which could be misleading in some sense.


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

Branch: refs/heads/preprocessor
Commit: c520013dea8900f65047d7ea7c3575625c3533a2
Parents: bfe1e98
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 08:25:46 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 08:25:46 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/FeatureSupportTest.java   | 205 +++++++++++--------
 1 file changed, 119 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c520013d/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
index 693d8f6..c2106cb 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
@@ -43,6 +43,7 @@ import static org.apache.tinkerpop.gremlin.structure.Graph.Features.VariableFeat
 import static org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.*;
+import static org.junit.Assume.assumeFalse;
 import static org.junit.Assume.assumeThat;
 
 /**
@@ -199,14 +200,15 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeString() throws Exception {
+            final String id = "this-is-a-valid-id";
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().vertex().willAllowId(id));
+
             try {
-                final String id = "this-is-a-valid-id";
                 graph.addVertex(T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().vertex().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
             } catch (Exception e) {
                 validateException(Vertex.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -216,27 +218,35 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
-        public void shouldSupportUserSuppliedIdsOfTypeNumeric() throws Exception {
+        public void shouldSupportUserSuppliedIdsOfTypeNumericInt() throws Exception {
+            final int id = 123456;
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().vertex().willAllowId(id));
+
             try {
-                final int id = 123456;
                 graph.addVertex(T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().vertex().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception e) {
                 validateException(Vertex.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
+        }
+
+        @Test
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
+        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
+        public void shouldSupportUserSuppliedIdsOfTypeNumericLong() throws Exception {
+            final long id = 123456l;
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().vertex().willAllowId(id));
 
             try {
-                final long id = 123456l;
                 graph.addVertex(T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().vertex().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception e) {
                 validateException(Vertex.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -247,14 +257,15 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeUuid() throws Exception {
+            final UUID id = UUID.randomUUID();
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().vertex().willAllowId(id));
+
             try {
-                final UUID id = UUID.randomUUID();
                 graph.addVertex(T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().vertex().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_UUID_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_UUID_IDS));
             } catch (Exception e) {
                 validateException(Vertex.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -441,15 +452,16 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeString() throws Exception {
+            final String id = "this-is-a-valid-id";
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().edge().willAllowId(id));
+
             try {
-                final String id = "this-is-a-valid-id";
                 final Vertex v = graph.addVertex();
                 v.addEdge("test", v, T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().edge().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -459,29 +471,37 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
-        public void shouldSupportUserSuppliedIdsOfTypeNumeric() throws Exception {
+        public void shouldSupportUserSuppliedIdsOfTypeNumericInt() throws Exception {
+            final int id = 123456;
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().edge().willAllowId(id));
+
             try {
-                final int id = 123456;
                 final Vertex v = graph.addVertex();
                 v.addEdge("test", v, T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().edge().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
+        }
+
+        @Test
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
+        @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
+        public void shouldSupportUserSuppliedIdsOfTypeNumericLong() throws Exception {
+            final long id = 123456l;
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().edge().willAllowId(id));
 
             try {
-                final long id = 123456l;
                 final Vertex v = graph.addVertex();
                 v.addEdge("test", v, T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().edge().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -492,15 +512,16 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeUuid() throws Exception {
+            final UUID id = UUID.randomUUID();
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().edge().willAllowId(id));
+
             try {
-                final UUID id = UUID.randomUUID();
                 final Vertex v = graph.addVertex();
                 v.addEdge("test", v, T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().edge().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_UUID_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_UUID_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -512,15 +533,16 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_ANY_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeAny() throws Exception {
+            final Date id = new Date();
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().edge().willAllowId(id));
+
             try {
-                final Date id = new Date();
                 final Vertex v = graph.addVertex();
                 v.addEdge("test", v, T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().edge().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -702,15 +724,16 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeString() throws Exception {
+            final String id = "this-is-a-valid-id";
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().vertex().properties().willAllowId(id));
+
             try {
-                final String id = "this-is-a-valid-id";
                 final Vertex v = graph.addVertex();
                 v.property(VertexProperty.Cardinality.single, "test", v, T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().vertex().properties().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
             }
@@ -720,29 +743,37 @@ public class FeatureSupportTest {
         @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
-        public void shouldSupportUserSuppliedIdsOfTypeNumeric() throws Exception {
+        public void shouldSupportUserSuppliedIdsOfTypeNumericInt() throws Exception {
+            final int id = 123456;
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().vertex().properties().willAllowId(id));
+
             try {
-                final int id = 123456;
                 final Vertex v = graph.addVertex();
                 v.property(VertexProperty.Cardinality.single, "test", v, T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().vertex().properties().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
             }
+        }
+
+        @Test
+        @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
+        @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
+        public void shouldSupportUserSuppliedIdsOfTypeNumericLong() throws Exception {
+            final long id = 123456l;
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().vertex().properties().willAllowId(id));
 
             try {
-                final long id = 123456l;
                 final Vertex v = graph.addVertex();
                 v.property(VertexProperty.Cardinality.single, "test", v, T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().vertex().properties().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
             }
@@ -753,15 +784,16 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeUuid() throws Exception {
+            final UUID id = UUID.randomUUID();
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().vertex().properties().willAllowId(id));
+
             try {
-                final UUID id = UUID.randomUUID();
                 final Vertex v = graph.addVertex();
                 v.property(VertexProperty.Cardinality.single, "test", v, T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().vertex().properties().willAllowId(id))
-                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_UUID_IDS));
+                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_UUID_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
             }
@@ -773,14 +805,15 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_ANY_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeAny() throws Exception {
+            final Date id = new Date();
+
+            // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+            // to throw the exception
+            assumeFalse(graph.features().vertex().properties().willAllowId(id));
+
             try {
-                final Date id = new Date();
                 final Vertex v = graph.addVertex();
                 v.property(VertexProperty.Cardinality.single, "test", v, T.id, id);
-
-                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
-                // to throw the exception
-                if (!graph.features().vertex().properties().willAllowId(id))
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);


[24/50] [abbrv] incubator-tinkerpop git commit: updated CHANGELOG with Neo4j note.

Posted by dk...@apache.org.
updated CHANGELOG with Neo4j note.


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

Branch: refs/heads/preprocessor
Commit: 00fc75d8bd7783ad1391c208f142d10f747ad595
Parents: d9e1932
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 14:24:46 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 14:24:46 2015 -0600

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


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/00fc75d8/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 09760b3..7cbe410 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@ image::http://www.tinkerpop.com/docs/current/images/gremlin-hindu.png[width=225]
 TinkerPop 3.0.0.GA (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Added back neo4j-gremlin as the licensing of the Neo4j API is now Apache2.
 * Added `willAllowId` method to features related to vertices, edges and vertex properties to test if an identifier can be use when `supportsUserSuppliedIds` is `true`.
 * Fixed a bug in `GraphTraversal.choose(predicate,trueTraversal,falseTraversal)`.
 * Removed `MapTraversal`, `MapTraverserTraversal`, `FilterTraversal`, and `FilterTraverserTraversal` as these are simply `__.map(function)` and `__.filter(predicate)`.


[05/50] [abbrv] incubator-tinkerpop git commit: Add the "external" dependencies to neo4j-gremlin pom.xml.

Posted by dk...@apache.org.
Add the "external" dependencies to neo4j-gremlin pom.xml.

This enables the neo4j plugin to gather the GPL'd dependencies without requiring them in the pom.xml.


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

Branch: refs/heads/preprocessor
Commit: efc143b38737a59cd01d29bd9879b13d3526b017
Parents: f535f1c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 10:51:58 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 10:51:58 2015 -0400

----------------------------------------------------------------------
 neo4j-gremlin/pom.xml                                | 15 ++++++++-------
 .../neo4j/groovy/plugin/Neo4jGremlinPlugin.java      |  5 +++++
 2 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/efc143b3/neo4j-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml
index 6551914..7a5a1f6 100644
--- a/neo4j-gremlin/pom.xml
+++ b/neo4j-gremlin/pom.xml
@@ -105,13 +105,14 @@ limitations under the License.
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jar-plugin</artifactId>
                 <version>2.6</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>test-jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
+                <configuration>
+                    <archive>
+                        <manifestEntries>
+                            <Gremlin-Plugin-Dependencies>org.neo4j:neo4j-tinkerpop-api-impl:0.1-2.2
+                            </Gremlin-Plugin-Dependencies>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
             </plugin>
         </plugins>
     </build>

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/efc143b3/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java
index b112e43..b76c5dd 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java
@@ -50,4 +50,9 @@ public final class Neo4jGremlinPlugin extends AbstractGremlinPlugin {
     public void afterPluginTo(final PluginAcceptor pluginAcceptor) throws IllegalEnvironmentException, PluginInitializationException {
 
     }
+
+    @Override
+    public boolean requireRestart() {
+        return true;
+    }
 }
\ No newline at end of file


[08/50] [abbrv] incubator-tinkerpop git commit: Neo4jTrait now exists -- NoMultiNoMetaNeo4jTrait and MultiMetaNeo4jTrait. Simpler code.

Posted by dk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
new file mode 100644
index 0000000..9133921
--- /dev/null
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
@@ -0,0 +1,261 @@
+/*
+ *
+ *  * 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.neo4j.structure.trait;
+
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jProperty;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
+import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedGraph;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.neo4j.tinkerpop.api.Neo4jDirection;
+import org.neo4j.tinkerpop.api.Neo4jGraphAPI;
+import org.neo4j.tinkerpop.api.Neo4jNode;
+import org.neo4j.tinkerpop.api.Neo4jRelationship;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Optional;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class MultiMetaNeo4jTrait implements Neo4jTrait {
+
+    public static final String VERTEX_PROPERTY_LABEL = "vertexProperty";
+    public static final String VERTEX_PROPERTY_PREFIX = Graph.Hidden.hide("");
+    public static final String VERTEX_PROPERTY_TOKEN = Graph.Hidden.hide("vertexProperty");
+
+    @Override
+    public Predicate<Neo4jNode> getNodePredicate() {
+        return node -> !node.hasLabel(VERTEX_PROPERTY_LABEL);
+    }
+
+    @Override
+    public Predicate<Neo4jRelationship> getRelationshipPredicate() {
+        return relationship -> !relationship.type().startsWith(VERTEX_PROPERTY_PREFIX);
+    }
+
+    @Override
+    public void removeVertex(final Neo4jVertex vertex) {
+        try {
+            final Neo4jNode node = vertex.getBaseVertex();
+            for (final Neo4jRelationship relationship : node.relationships(Neo4jDirection.BOTH)) {
+                final Neo4jNode otherNode = relationship.other(node);
+                if (otherNode.hasLabel(VERTEX_PROPERTY_LABEL)) {
+                    otherNode.relationships(null).forEach(Neo4jRelationship::delete);
+                    otherNode.delete(); // meta property node
+                } else
+                    relationship.delete();
+            }
+            node.delete();
+        } catch (final IllegalStateException ignored) {
+            // this one happens if the vertex is still chilling in the tx
+        } catch (final RuntimeException ex) {
+            if (!Neo4jHelper.isNotFound(ex)) throw ex;
+            // this one happens if the vertex is committed
+        }
+    }
+
+    @Override
+    public <V> VertexProperty<V> getVertexProperty(final Neo4jVertex vertex, final String key) {
+        final Neo4jNode node = vertex.getBaseVertex();
+        if (Neo4jHelper.keyExistsInNeo4j(node, key)) {
+            if (node.getProperty(key).equals(VERTEX_PROPERTY_TOKEN)) {
+                if (node.degree(Neo4jDirection.OUTGOING, VERTEX_PROPERTY_PREFIX.concat(key)) > 1)
+                    throw Vertex.Exceptions.multiplePropertiesExistForProvidedKey(key);
+                else {
+                    final Neo4jNode vertexPropertyNode = node.relationships(Neo4jDirection.OUTGOING, VERTEX_PROPERTY_PREFIX.concat(key)).iterator().next().end();
+                    return new Neo4jVertexProperty<>(vertex, (String) vertexPropertyNode.getProperty(T.key.getAccessor()), (V) vertexPropertyNode.getProperty(T.value.getAccessor()), vertexPropertyNode);
+                }
+            } else {
+                return new Neo4jVertexProperty<>(vertex, key, (V) node.getProperty(key));
+            }
+        } else
+            return VertexProperty.<V>empty();
+    }
+
+    @Override
+    public <V> Iterator<VertexProperty<V>> getVertexProperties(final Neo4jVertex vertex, final String... keys) {
+        return IteratorUtils.stream(vertex.getBaseVertex().getKeys())
+                .filter(key -> ElementHelper.keyExists(key, keys))
+                .flatMap(key -> {
+                    if (vertex.getBaseVertex().getProperty(key).equals(VERTEX_PROPERTY_TOKEN))
+                        return IteratorUtils.stream(vertex.getBaseVertex().relationships(Neo4jDirection.OUTGOING, (VERTEX_PROPERTY_PREFIX.concat(key))))
+                                .map(relationship -> {
+                                    final Neo4jNode vertexPropertyNode = relationship.end();
+                                    return (VertexProperty<V>) new Neo4jVertexProperty<>(vertex, (String) vertexPropertyNode.getProperty(T.key.getAccessor()), vertexPropertyNode.getProperty(T.value.getAccessor()), vertexPropertyNode);
+                                });
+                    else
+                        return Stream.of(new Neo4jVertexProperty<>(vertex, key, (V) vertex.getBaseVertex().getProperty(key)));
+                }).iterator();
+    }
+
+    @Override
+    public <V> VertexProperty<V> setVertexProperty(Neo4jVertex vertex, VertexProperty.Cardinality cardinality, String key, V value, Object... keyValues) {
+        try {
+            final Optional<VertexProperty<V>> optionalVertexProperty = ElementHelper.stageVertexProperty(vertex, cardinality, key, value, keyValues);
+            if (optionalVertexProperty.isPresent()) return optionalVertexProperty.get();
+            final Neo4jNode node = vertex.getBaseVertex();
+            final Neo4jGraphAPI graph = ((Neo4jGraph) vertex.graph()).getBaseGraph();
+            final String prefixedKey = VERTEX_PROPERTY_PREFIX.concat(key);
+            if (Neo4jHelper.keyExistsInNeo4j(node, key)) {
+                if (node.getProperty(key).equals(VERTEX_PROPERTY_TOKEN)) {
+                    final Neo4jNode vertexPropertyNode = graph.createNode(VERTEX_PROPERTY_LABEL, key);
+                    vertexPropertyNode.setProperty(T.key.getAccessor(), key);
+                    vertexPropertyNode.setProperty(T.value.getAccessor(), value);
+                    node.connectTo(vertexPropertyNode, prefixedKey);
+                    final Neo4jVertexProperty<V> property = new Neo4jVertexProperty<>(vertex, key, value, vertexPropertyNode);
+                    ElementHelper.attachProperties(property, keyValues); // TODO: make this inlined
+                    return property;
+                } else {
+                    Neo4jNode vertexPropertyNode = graph.createNode(VERTEX_PROPERTY_LABEL, key);
+                    vertexPropertyNode.setProperty(T.key.getAccessor(), key);
+                    vertexPropertyNode.setProperty(T.value.getAccessor(), node.removeProperty(key));
+                    node.connectTo(vertexPropertyNode, prefixedKey);
+                    node.setProperty(key, VERTEX_PROPERTY_TOKEN);
+                    vertexPropertyNode = graph.createNode(VERTEX_PROPERTY_LABEL, key);
+                    vertexPropertyNode.setProperty(T.key.getAccessor(), key);
+                    vertexPropertyNode.setProperty(T.value.getAccessor(), value);
+                    node.connectTo(vertexPropertyNode, prefixedKey);
+                    final Neo4jVertexProperty<V> property = new Neo4jVertexProperty<>(vertex, key, value, vertexPropertyNode);
+                    ElementHelper.attachProperties(property, keyValues); // TODO: make this inlined
+                    return property;
+                }
+            } else {
+                node.setProperty(key, value);
+                final Neo4jVertexProperty<V> property = new Neo4jVertexProperty<>(vertex, key, value);
+                ElementHelper.attachProperties(property, keyValues); // TODO: make this inlined
+                return property;
+            }
+        } catch (final IllegalArgumentException iae) {
+            throw Property.Exceptions.dataTypeOfPropertyValueNotSupported(value);
+        }
+    }
+
+    @Override
+    public VertexProperty.Cardinality getCardinality(final String key) {
+        return VertexProperty.Cardinality.list;
+    }
+
+    @Override
+    public boolean supportsMultiProperties() {
+        return true;
+    }
+
+    @Override
+    public boolean supportsMetaProperties() {
+        return true;
+    }
+
+    @Override
+    public void removeVertexProperty(final Neo4jVertexProperty vertexProperty) {
+        final Neo4jNode vertexPropertyNode = Neo4jHelper.getVertexPropertyNode(vertexProperty);
+        final Neo4jNode vertexNode = ((Neo4jVertex) vertexProperty.element()).getBaseVertex();
+        if (null != vertexPropertyNode) {
+            vertexPropertyNode.relationships(null).forEach(Neo4jRelationship::delete);
+            vertexPropertyNode.delete();
+            if (vertexNode.degree(Neo4jDirection.OUTGOING, VERTEX_PROPERTY_PREFIX.concat(vertexProperty.key())) == 0) {
+                if (vertexNode.hasProperty(vertexProperty.key()))
+                    vertexNode.removeProperty(vertexProperty.key());
+            }
+        } else {
+            if (vertexNode.degree(Neo4jDirection.OUTGOING, VERTEX_PROPERTY_PREFIX.concat(vertexProperty.key())) == 0) {
+                if (vertexNode.hasProperty(vertexProperty.key()))
+                    vertexNode.removeProperty(vertexProperty.key());
+            }
+        }
+    }
+
+    @Override
+    public <V> Property<V> setProperty(final Neo4jVertexProperty vertexProperty, final String key, final V value) {
+        final Neo4jNode vertexPropertyNode = Neo4jHelper.getVertexPropertyNode(vertexProperty);
+        if (null != vertexPropertyNode) {
+            vertexPropertyNode.setProperty(key, value);
+            return new Neo4jProperty<>(vertexProperty, key, value);
+        } else {
+            final Neo4jNode vertexNode = ((Neo4jVertex) vertexProperty.element()).getBaseVertex();
+            final Neo4jNode newVertexPropertyNode = ((WrappedGraph<Neo4jGraphAPI>) vertexProperty.element().graph()).getBaseGraph().createNode(VERTEX_PROPERTY_LABEL, vertexProperty.label());
+            newVertexPropertyNode.setProperty(T.key.getAccessor(), vertexProperty.key());
+            newVertexPropertyNode.setProperty(T.value.getAccessor(), vertexProperty.value());
+            newVertexPropertyNode.setProperty(key, value);
+            vertexNode.connectTo(newVertexPropertyNode, VERTEX_PROPERTY_PREFIX.concat(vertexProperty.key()));
+            vertexNode.setProperty(vertexProperty.key(), VERTEX_PROPERTY_TOKEN);
+            Neo4jHelper.setVertexPropertyNode(vertexProperty, newVertexPropertyNode);
+            return new Neo4jProperty<>(vertexProperty, key, value);
+        }
+    }
+
+    @Override
+    public <V> Property<V> getProperty(final Neo4jVertexProperty vertexProperty, final String key) {
+        //try {
+        final Neo4jNode vertexPropertyNode = Neo4jHelper.getVertexPropertyNode(vertexProperty);
+        if (null != vertexPropertyNode && vertexPropertyNode.hasProperty(key))
+            return new Neo4jProperty<>(vertexProperty, key, (V) vertexPropertyNode.getProperty(key));
+        else
+            return Property.empty();
+        /*} catch (IllegalStateException ex) {
+            throw Element.Exceptions.elementAlreadyRemoved(this.getClass(), this.id());
+        } catch (RuntimeException ex) {
+            if (Neo4jHelper.isNotFound(ex))
+                throw Element.Exceptions.elementAlreadyRemoved(this.getClass(), this.id());
+            throw ex;
+        }*/
+    }
+
+    @Override
+    public <V> Iterator<Property<V>> getProperties(Neo4jVertexProperty vertexProperty, String... keys) {
+        final Neo4jNode vertexPropertyNode = Neo4jHelper.getVertexPropertyNode(vertexProperty);
+        if (null == vertexPropertyNode)
+            return Collections.emptyIterator();
+        else
+            return IteratorUtils.map(IteratorUtils
+                            .filter(vertexPropertyNode.getKeys().iterator(), key -> !key.equals(T.key.getAccessor()) && !key.equals(T.value.getAccessor()) && ElementHelper.keyExists(key, keys)),
+                    key -> (Property<V>) new Neo4jProperty<>(vertexProperty, key, (V) vertexPropertyNode.getProperty(key)));
+    }
+
+    /*
+     @Override
+    public Set<String> keys() {
+        if (isNode()) {
+            this.vertex.graph().tx().readWrite();
+            final Set<String> keys = new HashSet<>();
+            for (final String key : this.node.getKeys()) {
+                if (!Graph.Hidden.isHidden(key))
+                    keys.add(key);
+            }
+            return keys;
+        } else {
+            return Collections.emptySet();
+        }
+    }
+     */
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/Neo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/Neo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/Neo4jTrait.java
new file mode 100644
index 0000000..9bb79ec
--- /dev/null
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/Neo4jTrait.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.neo4j.structure.trait;
+
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.neo4j.tinkerpop.api.Neo4jNode;
+import org.neo4j.tinkerpop.api.Neo4jRelationship;
+
+import java.util.Iterator;
+import java.util.function.Predicate;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public interface Neo4jTrait {
+
+    public Predicate<Neo4jNode> getNodePredicate();
+
+    public Predicate<Neo4jRelationship> getRelationshipPredicate();
+
+    public void removeVertex(final Neo4jVertex vertex);
+
+    public <V> VertexProperty<V> getVertexProperty(final Neo4jVertex vertex, final String key);
+
+    public <V> Iterator<VertexProperty<V>> getVertexProperties(final Neo4jVertex vertex, final String... keys);
+
+    public <V> VertexProperty<V> setVertexProperty(final Neo4jVertex vertex, final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues);
+
+    ////
+
+    public boolean supportsMultiProperties();
+
+    public boolean supportsMetaProperties();
+
+    public VertexProperty.Cardinality getCardinality(final String key);
+
+    public void removeVertexProperty(final Neo4jVertexProperty vertexProperty);
+
+    public <V> Property<V> setProperty(final Neo4jVertexProperty vertexProperty, final String key, final V value);
+
+    public <V> Property<V> getProperty(final Neo4jVertexProperty vertexProperty, final String key);
+
+    public <V> Iterator<Property<V>> getProperties(final Neo4jVertexProperty vertexProperty, final String... keys);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
new file mode 100644
index 0000000..c241328
--- /dev/null
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.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.neo4j.structure.trait;
+
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
+import org.neo4j.tinkerpop.api.Neo4jDirection;
+import org.neo4j.tinkerpop.api.Neo4jNode;
+import org.neo4j.tinkerpop.api.Neo4jRelationship;
+
+import java.util.Iterator;
+import java.util.function.Predicate;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class NoMultiNoMetaNeo4jTrait implements Neo4jTrait {
+
+    @Override
+    public Predicate<Neo4jNode> getNodePredicate() {
+        return node -> true;
+    }
+
+    @Override
+    public Predicate<Neo4jRelationship> getRelationshipPredicate() {
+        return relationship -> true;
+    }
+
+    @Override
+    public void removeVertex(final Neo4jVertex vertex) {
+        try {
+            final Neo4jNode node = vertex.getBaseVertex();
+            for (final Neo4jRelationship relationship : node.relationships(Neo4jDirection.BOTH)) {
+                relationship.delete();
+            }
+            node.delete();
+        } catch (final IllegalStateException ignored) {
+            // this one happens if the vertex is still chilling in the tx
+        } catch (final RuntimeException ex) {
+            if (!Neo4jHelper.isNotFound(ex)) throw ex;
+            // this one happens if the vertex is committed
+        }
+    }
+
+    @Override
+    public <V> VertexProperty<V> getVertexProperty(final Neo4jVertex vertex, final String key) {
+        if (Neo4jHelper.keyExistsInNeo4j(vertex.getBaseVertex(), key)) {
+            return new Neo4jVertexProperty<>(vertex, key, (V) vertex.getBaseVertex().getProperty(key));
+        } else
+            return VertexProperty.<V>empty();
+    }
+
+    @Override
+    public <V> Iterator<VertexProperty<V>> getVertexProperties(final Neo4jVertex vertex, final String... keys) {
+        return (Iterator) IteratorUtils.stream(vertex.getBaseVertex().getKeys())
+                .filter(key -> ElementHelper.keyExists(key, keys))
+                .map(key -> new Neo4jVertexProperty<>(vertex, key, (V) vertex.getBaseVertex().getProperty(key))).iterator();
+    }
+
+    @Override
+    public <V> VertexProperty<V> setVertexProperty(final Neo4jVertex vertex, final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
+        if (cardinality != VertexProperty.Cardinality.single)
+            throw VertexProperty.Exceptions.multiPropertiesNotSupported();
+        if (keyValues.length > 0)
+            throw VertexProperty.Exceptions.metaPropertiesNotSupported();
+        ElementHelper.validateProperty(key, value);
+        try {
+            vertex.getBaseVertex().setProperty(key, value);
+            return new Neo4jVertexProperty<>(vertex, key, value);
+        } catch (final IllegalArgumentException iae) {
+            throw Property.Exceptions.dataTypeOfPropertyValueNotSupported(value);
+        }
+    }
+
+    @Override
+    public VertexProperty.Cardinality getCardinality(final String key) {
+        return VertexProperty.Cardinality.single;
+    }
+
+    @Override
+    public boolean supportsMultiProperties() {
+        return false;
+    }
+
+    @Override
+    public boolean supportsMetaProperties() {
+        return false;
+    }
+
+    @Override
+    public void removeVertexProperty(final Neo4jVertexProperty vertexProperty) {
+        if (Neo4jHelper.keyExistsInNeo4j(((Neo4jVertex) vertexProperty.element()).getBaseVertex(), vertexProperty.key()))
+            ((Neo4jVertex) vertexProperty.element()).getBaseVertex().removeProperty(vertexProperty.key());
+    }
+
+    @Override
+    public <V> Property<V> setProperty(final Neo4jVertexProperty vertexProperty, final String key, final V value) {
+        throw VertexProperty.Exceptions.metaPropertiesNotSupported();
+    }
+
+    @Override
+    public <V> Property<V> getProperty(final Neo4jVertexProperty vertexProperty, final String key) {
+        throw VertexProperty.Exceptions.metaPropertiesNotSupported();
+    }
+
+    @Override
+    public <V> Iterator<Property<V>> getProperties(final Neo4jVertexProperty vertexProperty, final String... keys) {
+        throw VertexProperty.Exceptions.metaPropertiesNotSupported();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/FullNeo4jGraphProvider.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/FullNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/FullNeo4jGraphProvider.java
deleted file mode 100644
index cce782c..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/FullNeo4jGraphProvider.java
+++ /dev/null
@@ -1,45 +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.neo4j;
-
-import org.apache.tinkerpop.gremlin.LoadGraphWith;
-import org.apache.tinkerpop.gremlin.TestHelper;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class FullNeo4jGraphProvider extends AbstractNeo4jGraphProvider {
-    @Override
-    public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, final LoadGraphWith.GraphData graphData) {
-        return new HashMap<String, Object>() {{
-            put(Graph.GRAPH, Neo4jGraph.class.getName());
-            String directory = getWorkingDirectory() + File.separator + TestHelper.cleanPathSegment(graphName) + File.separator + cleanParameters(TestHelper.cleanPathSegment(testMethodName));
-            put(Neo4jGraph.CONFIG_DIRECTORY, directory);
-            put(Neo4jGraph.CONFIG_META_PROPERTIES, true);
-            put(Neo4jGraph.CONFIG_MULTI_PROPERTIES, true);
-            put(Neo4jGraph.CONFIG_CHECK_ELEMENTS_IN_TRANSACTION, true);
-        }};
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/MultiMetaNeo4jGraphProvider.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/MultiMetaNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/MultiMetaNeo4jGraphProvider.java
new file mode 100644
index 0000000..a81394f
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/MultiMetaNeo4jGraphProvider.java
@@ -0,0 +1,45 @@
+/*
+ * 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.neo4j;
+
+import org.apache.tinkerpop.gremlin.LoadGraphWith;
+import org.apache.tinkerpop.gremlin.TestHelper;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class MultiMetaNeo4jGraphProvider extends AbstractNeo4jGraphProvider {
+    @Override
+    public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, final LoadGraphWith.GraphData graphData) {
+        return new HashMap<String, Object>() {{
+            put(Graph.GRAPH, Neo4jGraph.class.getName());
+            String directory = getWorkingDirectory() + File.separator + TestHelper.cleanPathSegment(graphName) + File.separator + cleanParameters(TestHelper.cleanPathSegment(testMethodName));
+            put(Neo4jGraph.CONFIG_DIRECTORY, directory);
+            put(Neo4jGraph.CONFIG_META_PROPERTIES, true);
+            put(Neo4jGraph.CONFIG_MULTI_PROPERTIES, true);
+            put(Neo4jGraph.CONFIG_CHECK_ELEMENTS_IN_TRANSACTION, true);
+        }};
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NoMultiNoMetaNeo4jGraphProvider.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NoMultiNoMetaNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NoMultiNoMetaNeo4jGraphProvider.java
new file mode 100644
index 0000000..0e7c29f
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NoMultiNoMetaNeo4jGraphProvider.java
@@ -0,0 +1,48 @@
+/*
+ *
+ *  * 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.neo4j;
+
+import org.apache.tinkerpop.gremlin.LoadGraphWith;
+import org.apache.tinkerpop.gremlin.TestHelper;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class NoMultiNoMetaNeo4jGraphProvider extends AbstractNeo4jGraphProvider {
+    @Override
+    public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, final LoadGraphWith.GraphData graphData) {
+        return new HashMap<String, Object>() {{
+            put(Graph.GRAPH, Neo4jGraph.class.getName());
+            String directory = getWorkingDirectory() + File.separator + TestHelper.cleanPathSegment(graphName) + File.separator + cleanParameters(TestHelper.cleanPathSegment(testMethodName));
+            put(Neo4jGraph.CONFIG_DIRECTORY, directory);
+            put(Neo4jGraph.CONFIG_META_PROPERTIES, false);
+            put(Neo4jGraph.CONFIG_MULTI_PROPERTIES, false);
+            put(Neo4jGraph.CONFIG_CHECK_ELEMENTS_IN_TRANSACTION, true);
+        }};
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/SimpleNeo4jGraphProvider.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/SimpleNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/SimpleNeo4jGraphProvider.java
deleted file mode 100644
index 51f75a7..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/SimpleNeo4jGraphProvider.java
+++ /dev/null
@@ -1,48 +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.neo4j;
-
-import org.apache.tinkerpop.gremlin.LoadGraphWith;
-import org.apache.tinkerpop.gremlin.TestHelper;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class SimpleNeo4jGraphProvider extends AbstractNeo4jGraphProvider {
-    @Override
-    public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, final LoadGraphWith.GraphData graphData) {
-        return new HashMap<String, Object>() {{
-            put(Graph.GRAPH, Neo4jGraph.class.getName());
-            String directory = getWorkingDirectory() + File.separator + TestHelper.cleanPathSegment(graphName) + File.separator + cleanParameters(TestHelper.cleanPathSegment(testMethodName));
-            put(Neo4jGraph.CONFIG_DIRECTORY, directory);
-            put(Neo4jGraph.CONFIG_META_PROPERTIES, false);
-            put(Neo4jGraph.CONFIG_MULTI_PROPERTIES, false);
-            put(Neo4jGraph.CONFIG_CHECK_ELEMENTS_IN_TRANSACTION, true);
-        }};
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/FullNeo4jGraphProcessStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/FullNeo4jGraphProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/FullNeo4jGraphProcessStandardTest.java
deleted file mode 100644
index e9d4921..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/FullNeo4jGraphProcessStandardTest.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.neo4j.process;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.FullNeo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.neo4j.structure.full.FullNeo4jGraph;
-import org.apache.tinkerpop.gremlin.process.ProcessStandardSuite;
-import org.junit.runner.RunWith;
-
-
-/**
- * Executes the Standard Gremlin Structure Test Suite using Neo4j.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-@RunWith(ProcessStandardSuite.class)
-@GraphProviderClass(provider = FullNeo4jGraphProvider.class, graph = FullNeo4jGraph.class)
-public class FullNeo4jGraphProcessStandardTest {
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/MultiMetaNeo4jGraphProcessStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/MultiMetaNeo4jGraphProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/MultiMetaNeo4jGraphProcessStandardTest.java
new file mode 100644
index 0000000..62f7b83
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/MultiMetaNeo4jGraphProcessStandardTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.neo4j.process;
+
+import org.apache.tinkerpop.gremlin.GraphProviderClass;
+import org.apache.tinkerpop.gremlin.neo4j.MultiMetaNeo4jGraphProvider;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
+import org.apache.tinkerpop.gremlin.process.ProcessStandardSuite;
+import org.junit.runner.RunWith;
+
+
+/**
+ * Executes the Standard Gremlin Structure Test Suite using Neo4j.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+@RunWith(ProcessStandardSuite.class)
+@GraphProviderClass(provider = MultiMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class)
+public class MultiMetaNeo4jGraphProcessStandardTest {
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/NoMultiNoMetaNeo4jGraphProcessStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/NoMultiNoMetaNeo4jGraphProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/NoMultiNoMetaNeo4jGraphProcessStandardTest.java
new file mode 100644
index 0000000..e961ffe
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/NoMultiNoMetaNeo4jGraphProcessStandardTest.java
@@ -0,0 +1,36 @@
+/*
+ *
+ *  * 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.neo4j.process;
+
+import org.apache.tinkerpop.gremlin.GraphProviderClass;
+import org.apache.tinkerpop.gremlin.neo4j.NoMultiNoMetaNeo4jGraphProvider;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
+import org.apache.tinkerpop.gremlin.process.ProcessStandardSuite;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+@RunWith(ProcessStandardSuite.class)
+@GraphProviderClass(provider = NoMultiNoMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class)
+public class NoMultiNoMetaNeo4jGraphProcessStandardTest {
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/SimpleNeo4jGraphProcessStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/SimpleNeo4jGraphProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/SimpleNeo4jGraphProcessStandardTest.java
deleted file mode 100644
index 724a457..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/SimpleNeo4jGraphProcessStandardTest.java
+++ /dev/null
@@ -1,36 +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.neo4j.process;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.SimpleNeo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.neo4j.structure.simple.SimpleNeo4jGraph;
-import org.apache.tinkerpop.gremlin.process.ProcessStandardSuite;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(ProcessStandardSuite.class)
-@GraphProviderClass(provider = SimpleNeo4jGraphProvider.class, graph = SimpleNeo4jGraph.class)
-public class SimpleNeo4jGraphProcessStandardTest {
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/FullNeo4jGraphGroovyProcessStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/FullNeo4jGraphGroovyProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/FullNeo4jGraphGroovyProcessStandardTest.java
deleted file mode 100644
index df17960..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/FullNeo4jGraphGroovyProcessStandardTest.java
+++ /dev/null
@@ -1,33 +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.neo4j.process.groovy;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.FullNeo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.neo4j.structure.full.FullNeo4jGraph;
-import org.apache.tinkerpop.gremlin.process.GroovyProcessStandardSuite;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(GroovyProcessStandardSuite.class)
-@GraphProviderClass(provider = FullNeo4jGraphProvider.class, graph = FullNeo4jGraph.class)
-public class FullNeo4jGraphGroovyProcessStandardTest {
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/MultiMetaNeo4jGraphGroovyProcessStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/MultiMetaNeo4jGraphGroovyProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/MultiMetaNeo4jGraphGroovyProcessStandardTest.java
new file mode 100644
index 0000000..2e22e1c
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/MultiMetaNeo4jGraphGroovyProcessStandardTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.neo4j.process.groovy;
+
+import org.apache.tinkerpop.gremlin.GraphProviderClass;
+import org.apache.tinkerpop.gremlin.neo4j.MultiMetaNeo4jGraphProvider;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
+import org.apache.tinkerpop.gremlin.process.GroovyProcessStandardSuite;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+@RunWith(GroovyProcessStandardSuite.class)
+@GraphProviderClass(provider = MultiMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class)
+public class MultiMetaNeo4jGraphGroovyProcessStandardTest {
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNometaNeo4jGraphGroovyProcessStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNometaNeo4jGraphGroovyProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNometaNeo4jGraphGroovyProcessStandardTest.java
new file mode 100644
index 0000000..3bc5aa1
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNometaNeo4jGraphGroovyProcessStandardTest.java
@@ -0,0 +1,36 @@
+/*
+ *
+ *  * 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.neo4j.process.groovy;
+
+import org.apache.tinkerpop.gremlin.GraphProviderClass;
+import org.apache.tinkerpop.gremlin.neo4j.NoMultiNoMetaNeo4jGraphProvider;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
+import org.apache.tinkerpop.gremlin.process.GroovyProcessStandardSuite;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+@RunWith(GroovyProcessStandardSuite.class)
+@GraphProviderClass(provider = NoMultiNoMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class)
+public class NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest {
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/SimpleNeo4jGraphGroovyProcessStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/SimpleNeo4jGraphGroovyProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/SimpleNeo4jGraphGroovyProcessStandardTest.java
deleted file mode 100644
index 7e81bc8..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/SimpleNeo4jGraphGroovyProcessStandardTest.java
+++ /dev/null
@@ -1,36 +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.neo4j.process.groovy;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.SimpleNeo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.neo4j.structure.simple.SimpleNeo4jGraph;
-import org.apache.tinkerpop.gremlin.process.GroovyProcessStandardSuite;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(GroovyProcessStandardSuite.class)
-@GraphProviderClass(provider = SimpleNeo4jGraphProvider.class, graph = SimpleNeo4jGraph.class)
-public class SimpleNeo4jGraphGroovyProcessStandardTest {
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/FullNeo4jGraphNativeNeo4jTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/FullNeo4jGraphNativeNeo4jTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/FullNeo4jGraphNativeNeo4jTest.java
deleted file mode 100644
index d0c25a5..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/FullNeo4jGraphNativeNeo4jTest.java
+++ /dev/null
@@ -1,36 +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.neo4j.structure;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.FullNeo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.neo4j.NativeNeo4jSuite;
-import org.apache.tinkerpop.gremlin.neo4j.structure.full.FullNeo4jGraph;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(NativeNeo4jSuite.class)
-@GraphProviderClass(provider = FullNeo4jGraphProvider.class, graph = FullNeo4jGraph.class)
-public class FullNeo4jGraphNativeNeo4jTest {
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/FullNeo4jGraphStructureStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/FullNeo4jGraphStructureStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/FullNeo4jGraphStructureStandardTest.java
deleted file mode 100644
index 4bde085..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/FullNeo4jGraphStructureStandardTest.java
+++ /dev/null
@@ -1,36 +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.neo4j.structure;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.FullNeo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.neo4j.structure.full.FullNeo4jGraph;
-import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
-import org.junit.runner.RunWith;
-
-
-/**
- * Executes the Standard Gremlin Structure Test Suite using Neo4j.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-@RunWith(StructureStandardSuite.class)
-@GraphProviderClass(provider = FullNeo4jGraphProvider.class, graph = FullNeo4jGraph.class)
-public class FullNeo4jGraphStructureStandardTest {
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/MultiMetaNeo4jGraphNativeNeo4jTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/MultiMetaNeo4jGraphNativeNeo4jTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/MultiMetaNeo4jGraphNativeNeo4jTest.java
new file mode 100644
index 0000000..1015799
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/MultiMetaNeo4jGraphNativeNeo4jTest.java
@@ -0,0 +1,35 @@
+/*
+ *
+ *  * 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.neo4j.structure;
+
+import org.apache.tinkerpop.gremlin.GraphProviderClass;
+import org.apache.tinkerpop.gremlin.neo4j.MultiMetaNeo4jGraphProvider;
+import org.apache.tinkerpop.gremlin.neo4j.NativeNeo4jSuite;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+@RunWith(NativeNeo4jSuite.class)
+@GraphProviderClass(provider = MultiMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class)
+public class MultiMetaNeo4jGraphNativeNeo4jTest {
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/MultiMetaNeo4jGraphStructureStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/MultiMetaNeo4jGraphStructureStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/MultiMetaNeo4jGraphStructureStandardTest.java
new file mode 100644
index 0000000..0e56f28
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/MultiMetaNeo4jGraphStructureStandardTest.java
@@ -0,0 +1,35 @@
+/*
+ * 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.neo4j.structure;
+
+import org.apache.tinkerpop.gremlin.GraphProviderClass;
+import org.apache.tinkerpop.gremlin.neo4j.MultiMetaNeo4jGraphProvider;
+import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
+import org.junit.runner.RunWith;
+
+
+/**
+ * Executes the Standard Gremlin Structure Test Suite using Neo4j.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+@RunWith(StructureStandardSuite.class)
+@GraphProviderClass(provider = MultiMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class)
+public class MultiMetaNeo4jGraphStructureStandardTest {
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
index a761e66..4e79e14 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
@@ -25,7 +25,7 @@ import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.FeatureRequirement;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 import org.apache.tinkerpop.gremlin.neo4j.AbstractNeo4jGremlinTest;
-import org.apache.tinkerpop.gremlin.neo4j.structure.full.FullNeo4jVertexProperty;
+import org.apache.tinkerpop.gremlin.neo4j.structure.trait.MultiMetaNeo4jTrait;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
@@ -370,7 +370,7 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
             assertEquals(a.id(), g.V().has("person", "name", "okram").id().next());
             assertEquals(1, g.V().has("person", "name", "okram").count().next().intValue());
             assertEquals(34, ((Neo4jVertex) g.V().has("person", "name", "okram").next()).getBaseVertex().getProperty("age"));
-            assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_TOKEN, ((Neo4jVertex) g.V().has("person", "name", "okram").next()).getBaseVertex().getProperty("name"));
+            assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_TOKEN, ((Neo4jVertex) g.V().has("person", "name", "okram").next()).getBaseVertex().getProperty("name"));
             ///
             assertEquals(b.id(), g.V().has("person", "name", "stephen").id().next());
             assertEquals(1, g.V().has("person", "name", "stephen").count().next().intValue());
@@ -394,14 +394,14 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
             assertEquals(d.id(), g.V().has("person", "name", P.within("daniel", "kuppitz")).id().next());
             assertEquals(d.id(), g.V().has("person", "name", "kuppitz").id().next());
             assertEquals(d.id(), g.V().has("person", "name", "daniel").id().next());
-            assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_TOKEN, ((Neo4jVertex) g.V().has("person", "name", "kuppitz").next()).getBaseVertex().getProperty("name"));
+            assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_TOKEN, ((Neo4jVertex) g.V().has("person", "name", "kuppitz").next()).getBaseVertex().getProperty("name"));
         });
         d.property(VertexProperty.Cardinality.list, "name", "marko", "acl", "private");
         tryCommit(graph, graph -> {
             assertEquals(2, g.V().has("person", "name", "marko").count().next().intValue());
             assertEquals(1, g.V().has("person", "name", "marko").properties("name").has(T.value, "marko").has("acl", "private").count().next().intValue());
             g.V().has("person", "name", "marko").forEachRemaining(v -> {
-                assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_TOKEN, ((Neo4jVertex) v).getBaseVertex().getProperty("name"));
+                assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_TOKEN, ((Neo4jVertex) v).getBaseVertex().getProperty("name"));
             });
 
         });
@@ -497,7 +497,7 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
             assertEquals(2l, this.getGraph().execute("MATCH (a)-[r]->() WHERE id(a) = " + a.id() + " RETURN COUNT(r)", null).next().get("COUNT(r)"));
             final AtomicInteger counter = new AtomicInteger(0);
             a.getBaseVertex().relationships(Neo4jDirection.OUTGOING).forEach(relationship -> {
-                assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX.concat("name"), relationship.type());
+                assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX.concat("name"), relationship.type());
                 counter.incrementAndGet();
             });
             assertEquals(2, counter.getAndSet(0));
@@ -512,7 +512,7 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
                 assertTrue("marko".equals(node.getProperty(T.value.getAccessor())) || "okram".equals(node.getProperty(T.value.getAccessor())));
                 assertEquals(0, node.degree(Neo4jDirection.OUTGOING, null));
                 assertEquals(1, node.degree(Neo4jDirection.INCOMING, null));
-                assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX.concat("name"), node.relationships(Neo4jDirection.INCOMING).iterator().next().type());
+                assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX.concat("name"), node.relationships(Neo4jDirection.INCOMING).iterator().next().type());
                 counter.incrementAndGet();
             });
             assertEquals(2, counter.getAndSet(0));
@@ -566,7 +566,7 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
             assertEquals(1l, this.getGraph().execute("MATCH (a)-[r]->() WHERE id(a) = " + a.id() + " RETURN COUNT(r)", null).next().get("COUNT(r)"));
             final AtomicInteger counter = new AtomicInteger(0);
             a.getBaseVertex().relationships(Neo4jDirection.OUTGOING).forEach(relationship -> {
-                assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX.concat("name"), relationship.type());
+                assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX.concat("name"), relationship.type());
                 counter.incrementAndGet();
             });
             assertEquals(1, counter.getAndSet(0));
@@ -582,14 +582,14 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
                 assertEquals("private", node.getProperty("acl"));
                 assertEquals(0, node.degree(Neo4jDirection.OUTGOING, null));
                 assertEquals(1, node.degree(Neo4jDirection.INCOMING, null));
-                assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX.concat("name"), node.relationships(Neo4jDirection.INCOMING).iterator().next().type());
+                assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX.concat("name"), node.relationships(Neo4jDirection.INCOMING).iterator().next().type());
                 counter.incrementAndGet();
             });
             assertEquals(1, counter.getAndSet(0));
 
             assertEquals(1, IteratorUtils.count(a.getBaseVertex().getKeys()));
             assertTrue(a.getBaseVertex().hasProperty("name"));
-            assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_TOKEN, a.getBaseVertex().getProperty("name"));
+            assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_TOKEN, a.getBaseVertex().getProperty("name"));
             assertEquals(2, IteratorUtils.count(b.getBaseVertex().getKeys()));
             assertEquals("stephen", b.getBaseVertex().getProperty("name"));
             assertEquals("virginia", b.getBaseVertex().getProperty("location"));
@@ -611,7 +611,7 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
             assertEquals(1l, this.getGraph().execute("MATCH (a)-[r]->() WHERE id(a) = " + a.id() + " RETURN COUNT(r)", null).next().get("COUNT(r)"));
             final AtomicInteger counter = new AtomicInteger(0);
             a.getBaseVertex().relationships(Neo4jDirection.OUTGOING).forEach(relationship -> {
-                assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX.concat("name"), relationship.type());
+                assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX.concat("name"), relationship.type());
                 counter.incrementAndGet();
             });
             assertEquals(1, counter.getAndSet(0));
@@ -627,14 +627,14 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
                 assertEquals("private", node.getProperty("acl"));
                 assertEquals(0, node.degree(Neo4jDirection.OUTGOING, null));
                 assertEquals(1, node.degree(Neo4jDirection.INCOMING, null));
-                assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_PREFIX.concat("name"), node.relationships(Neo4jDirection.INCOMING).iterator().next().type());
+                assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX.concat("name"), node.relationships(Neo4jDirection.INCOMING).iterator().next().type());
                 counter.incrementAndGet();
             });
             assertEquals(1, counter.getAndSet(0));
 
             assertEquals(1, IteratorUtils.count(a.getBaseVertex().getKeys()));
             assertTrue(a.getBaseVertex().hasProperty("name"));
-            assertEquals(FullNeo4jVertexProperty.VERTEX_PROPERTY_TOKEN, a.getBaseVertex().getProperty("name"));
+            assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_TOKEN, a.getBaseVertex().getProperty("name"));
             assertEquals(2, IteratorUtils.count(b.getBaseVertex().getKeys()));
             assertEquals("stephen", b.getBaseVertex().getProperty("name"));
             assertEquals("virginia", b.getBaseVertex().getProperty("location"));

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NoMultiNoMetaNeo4jGraphNativeNeo4jTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NoMultiNoMetaNeo4jGraphNativeNeo4jTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NoMultiNoMetaNeo4jGraphNativeNeo4jTest.java
new file mode 100644
index 0000000..c83651d
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NoMultiNoMetaNeo4jGraphNativeNeo4jTest.java
@@ -0,0 +1,35 @@
+/*
+ *
+ *  * 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.neo4j.structure;
+
+import org.apache.tinkerpop.gremlin.GraphProviderClass;
+import org.apache.tinkerpop.gremlin.neo4j.NativeNeo4jSuite;
+import org.apache.tinkerpop.gremlin.neo4j.NoMultiNoMetaNeo4jGraphProvider;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+@RunWith(NativeNeo4jSuite.class)
+@GraphProviderClass(provider = NoMultiNoMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class)
+public class NoMultiNoMetaNeo4jGraphNativeNeo4jTest {
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NoMultiNoMetaNeo4jGraphStructureStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NoMultiNoMetaNeo4jGraphStructureStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NoMultiNoMetaNeo4jGraphStructureStandardTest.java
new file mode 100644
index 0000000..5de4583
--- /dev/null
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NoMultiNoMetaNeo4jGraphStructureStandardTest.java
@@ -0,0 +1,35 @@
+/*
+ *
+ *  * 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.neo4j.structure;
+
+import org.apache.tinkerpop.gremlin.GraphProviderClass;
+import org.apache.tinkerpop.gremlin.neo4j.NoMultiNoMetaNeo4jGraphProvider;
+import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+@RunWith(StructureStandardSuite.class)
+@GraphProviderClass(provider = NoMultiNoMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class)
+public class NoMultiNoMetaNeo4jGraphStructureStandardTest {
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/SimpleNeo4jGraphNativeNeo4jTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/SimpleNeo4jGraphNativeNeo4jTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/SimpleNeo4jGraphNativeNeo4jTest.java
deleted file mode 100644
index c0caa13..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/SimpleNeo4jGraphNativeNeo4jTest.java
+++ /dev/null
@@ -1,36 +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.neo4j.structure;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.NativeNeo4jSuite;
-import org.apache.tinkerpop.gremlin.neo4j.SimpleNeo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.neo4j.structure.simple.SimpleNeo4jGraph;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(NativeNeo4jSuite.class)
-@GraphProviderClass(provider = SimpleNeo4jGraphProvider.class, graph = SimpleNeo4jGraph.class)
-public class SimpleNeo4jGraphNativeNeo4jTest {
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b8876819/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/SimpleNeo4jGraphStructureStandardTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/SimpleNeo4jGraphStructureStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/SimpleNeo4jGraphStructureStandardTest.java
deleted file mode 100644
index aa43e06..0000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/SimpleNeo4jGraphStructureStandardTest.java
+++ /dev/null
@@ -1,36 +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.neo4j.structure;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.SimpleNeo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.neo4j.structure.simple.SimpleNeo4jGraph;
-import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(StructureStandardSuite.class)
-@GraphProviderClass(provider = SimpleNeo4jGraphProvider.class, graph = SimpleNeo4jGraph.class)
-public class SimpleNeo4jGraphStructureStandardTest {
-}


[34/50] [abbrv] incubator-tinkerpop git commit: Loosen feature tests around identifiers TINKERPOP3-695

Posted by dk...@apache.org.
Loosen feature tests around identifiers TINKERPOP3-695

Check willAllowId() before asserting failure on id support tests.  This allows these tests to pass if the graph doesn't internally support the id type, but does allow the id to be used (e.g. a graph toString's all incoming ids).


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

Branch: refs/heads/preprocessor
Commit: bfe1e983ffc7eb9487f7172ba8b2ea77ae86d477
Parents: 96bc1ad
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 08:00:44 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 08:00:44 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/FeatureSupportTest.java   | 133 +++++++++++++++----
 1 file changed, 104 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bfe1e983/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
index 40b6694..693d8f6 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
@@ -200,8 +200,13 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeString() throws Exception {
             try {
-                graph.addVertex(T.id, "this-is-a-valid-id");
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
+                final String id = "this-is-a-valid-id";
+                graph.addVertex(T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().vertex().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
             } catch (Exception e) {
                 validateException(Vertex.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -213,15 +218,25 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeNumeric() throws Exception {
             try {
-                graph.addVertex(T.id, 123456);
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                final int id = 123456;
+                graph.addVertex(T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().vertex().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception e) {
                 validateException(Vertex.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
 
             try {
-                graph.addVertex(T.id, 123456l);
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                final long id = 123456l;
+                graph.addVertex(T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().vertex().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception e) {
                 validateException(Vertex.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -233,8 +248,13 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeUuid() throws Exception {
             try {
-                graph.addVertex(T.id, UUID.randomUUID());
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_UUID_IDS));
+                final UUID id = UUID.randomUUID();
+                graph.addVertex(T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().vertex().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_UUID_IDS));
             } catch (Exception e) {
                 validateException(Vertex.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -246,8 +266,13 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_ANY_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeAny() throws Exception {
             try {
-                graph.addVertex(T.id, new Date());
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
+                final Date id = new Date();
+                graph.addVertex(T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().vertex().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
             } catch (Exception e) {
                 validateException(Vertex.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -417,9 +442,14 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeString() throws Exception {
             try {
+                final String id = "this-is-a-valid-id";
                 final Vertex v = graph.addVertex();
-                v.addEdge("test", v, T.id, "this-is-a-valid-id");
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
+                v.addEdge("test", v, T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().edge().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -431,17 +461,27 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeNumeric() throws Exception {
             try {
+                final int id = 123456;
                 final Vertex v = graph.addVertex();
-                v.addEdge("test", v, T.id, 123456);
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                v.addEdge("test", v, T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().edge().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
 
             try {
+                final long id = 123456l;
                 final Vertex v = graph.addVertex();
-                v.addEdge("test", v, T.id, 123456l);
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                v.addEdge("test", v, T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().edge().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -453,9 +493,14 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeUuid() throws Exception {
             try {
+                final UUID id = UUID.randomUUID();
                 final Vertex v = graph.addVertex();
-                v.addEdge("test", v, T.id, UUID.randomUUID());
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
+                v.addEdge("test", v, T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().edge().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_UUID_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -468,9 +513,14 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_ANY_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeAny() throws Exception {
             try {
+                final Date id = new Date();
                 final Vertex v = graph.addVertex();
-                v.addEdge("test", v, T.id, new Date());
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
+                v.addEdge("test", v, T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().edge().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, EdgeFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
             } catch (Exception e) {
                 validateException(Edge.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), e);
             }
@@ -653,9 +703,14 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_STRING_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeString() throws Exception {
             try {
+                final String id = "this-is-a-valid-id";
                 final Vertex v = graph.addVertex();
-                v.property(VertexProperty.Cardinality.single, "test", v, T.id, "this-is-a-valid-id");
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
+                v.property(VertexProperty.Cardinality.single, "test", v, T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().vertex().properties().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_STRING_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
             }
@@ -667,17 +722,27 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_NUMERIC_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeNumeric() throws Exception {
             try {
+                final int id = 123456;
                 final Vertex v = graph.addVertex();
-                v.property(VertexProperty.Cardinality.single, "test", v, T.id, 123456);
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                v.property(VertexProperty.Cardinality.single, "test", v, T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().vertex().properties().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
             }
 
             try {
+                final long id = 123456l;
                 final Vertex v = graph.addVertex();
-                v.property(VertexProperty.Cardinality.single, "test", v, T.id, 123456l);
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
+                v.property(VertexProperty.Cardinality.single, "test", v, T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().vertex().properties().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_NUMERIC_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
             }
@@ -689,9 +754,14 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_UUID_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeUuid() throws Exception {
             try {
+                final UUID id = UUID.randomUUID();
                 final Vertex v = graph.addVertex();
-                v.property(VertexProperty.Cardinality.single, "test", v, T.id, UUID.randomUUID());
-                fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
+                v.property(VertexProperty.Cardinality.single, "test", v, T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().vertex().properties().willAllowId(id))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_UUID_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);
             }
@@ -704,8 +774,13 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = VertexPropertyFeatures.class, feature = FEATURE_ANY_IDS, supported = false)
         public void shouldSupportUserSuppliedIdsOfTypeAny() throws Exception {
             try {
+                final Date id = new Date();
                 final Vertex v = graph.addVertex();
-                v.property(VertexProperty.Cardinality.single, "test", v, T.id, new Date());
+                v.property(VertexProperty.Cardinality.single, "test", v, T.id, id);
+
+                // a graph can "allow" an id without internally supporting it natively and therefore doesn't need
+                // to throw the exception
+                if (!graph.features().vertex().properties().willAllowId(id))
                 fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexPropertyFeatures.class.getSimpleName(), FEATURE_ANY_IDS));
             } catch (Exception ex) {
                 validateException(VertexProperty.Exceptions.userSuppliedIdsOfThisTypeNotSupported(), ex);


[43/50] [abbrv] incubator-tinkerpop git commit: Finalize a bunch of GraphML IO classes.

Posted by dk...@apache.org.
Finalize a bunch of GraphML IO classes.

Can't think of how/why someone would really extend these so better that they are final.


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

Branch: refs/heads/preprocessor
Commit: 1dd487c207e481165def46366d53443fd9b273c0
Parents: 27e5227
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 14:19:57 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 14:19:57 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/io/graphml/GraphMLIo.java     | 6 +++---
 .../tinkerpop/gremlin/structure/io/graphml/GraphMLMapper.java | 6 ++++--
 .../tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java | 2 +-
 .../tinkerpop/gremlin/structure/io/graphml/GraphMLTokens.java | 4 +++-
 .../tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java | 2 +-
 .../gremlin/structure/io/graphml/GraphMLWriterHelper.java     | 7 +++++--
 6 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1dd487c2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLIo.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLIo.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLIo.java
index e334b67..e8117e7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLIo.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLIo.java
@@ -36,10 +36,10 @@ import java.io.OutputStream;
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class GraphMLIo implements Io<GraphMLReader.Builder, GraphMLWriter.Builder, GraphMLMapper.Builder> {
+public final class GraphMLIo implements Io<GraphMLReader.Builder, GraphMLWriter.Builder, GraphMLMapper.Builder> {
     private final Graph graph;
 
-    public GraphMLIo(final Graph graph) {
+    private GraphMLIo(final Graph graph) {
         this.graph = graph;
     }
 
@@ -91,7 +91,7 @@ public class GraphMLIo implements Io<GraphMLReader.Builder, GraphMLWriter.Builde
         return new Builder();
     }
 
-    public static class Builder implements Io.Builder<GraphMLIo> {
+    public final static class Builder implements Io.Builder<GraphMLIo> {
 
         private Graph graph;
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1dd487c2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLMapper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLMapper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLMapper.java
index 6d37c2e..8dc7070 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLMapper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLMapper.java
@@ -28,7 +28,9 @@ import org.apache.tinkerpop.gremlin.structure.io.Mapper;
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class GraphMLMapper implements Mapper<Object> {
+public final class GraphMLMapper implements Mapper<Object> {
+    private GraphMLMapper() {}
+
     @Override
     public Object createMapper() {
         throw new UnsupportedOperationException("GraphML does not have an object mapper - it is a format for full Graph serialization");
@@ -38,7 +40,7 @@ public class GraphMLMapper implements Mapper<Object> {
         return new Builder();
     }
 
-    public static class Builder implements Mapper.Builder<Builder> {
+    public final static class Builder implements Mapper.Builder<Builder> {
         @Override
         public Builder addRegistry(final IoRegistry registry) {
             throw new UnsupportedOperationException("GraphML does not accept custom serializers - it is a format for full Graph serialization");

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1dd487c2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java
index ca6f76d..d2fdb39 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java
@@ -55,7 +55,7 @@ import java.util.stream.Stream;
  * @author Joshua Shinavier (http://fortytwo.net)
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class GraphMLReader implements GraphReader {
+public final class GraphMLReader implements GraphReader {
     private final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
 
     private final String edgeLabelKey;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1dd487c2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLTokens.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLTokens.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLTokens.java
index 8ab4297..921a10f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLTokens.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLTokens.java
@@ -24,7 +24,9 @@ package org.apache.tinkerpop.gremlin.structure.io.graphml;
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-class GraphMLTokens {
+final class GraphMLTokens {
+    private GraphMLTokens() {}
+
     public static final String XML_SCHEMA_NAMESPACE_TAG = "xsi";
     public static final String DEFAULT_GRAPHML_SCHEMA_LOCATION = "http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd";
     public static final String XML_SCHEMA_LOCATION_ATTRIBUTE = "schemaLocation";

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1dd487c2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java
index 5ff950b..e2a0952 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriter.java
@@ -56,7 +56,7 @@ import java.util.Optional;
  * @author Joshua Shinavier (http://fortytwo.net)
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
-public class GraphMLWriter implements GraphWriter {
+public final class GraphMLWriter implements GraphWriter {
     private final XMLOutputFactory inputFactory = XMLOutputFactory.newInstance();
     private boolean normalize = false;
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1dd487c2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriterHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriterHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriterHelper.java
index cedb302..60ece3d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriterHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLWriterHelper.java
@@ -24,9 +24,12 @@ import javax.xml.stream.XMLStreamWriter;
 import java.util.Stack;
 
 /**
- * A wrapper for the IndentingXMLStreamWriter class by Kohsuke Kawaguchi
+ * A wrapper for the different {@code XMLStreamWriter} implementations.
  */
-class GraphMLWriterHelper {
+final class GraphMLWriterHelper {
+
+    private GraphMLWriterHelper() {}
+
     /**
      * @author Tijs Rademakers
      */


[37/50] [abbrv] incubator-tinkerpop git commit: Closed graph in test.

Posted by dk...@apache.org.
Closed graph in test.

Not clearing the graph was causing problems for neo4j related tests around MultiMetaNeo4jGraphStructureStandardTest
shouldMaintainOriginalConfigurationObjectGivenToFactory


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

Branch: refs/heads/preprocessor
Commit: 15d8da0e76701c096f91ca06d04ce38ff77263ca
Parents: 8250a2f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 12:24:46 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 12:26:37 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/GraphConstructionTest.java       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/15d8da0e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphConstructionTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphConstructionTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphConstructionTest.java
index 16f893d..62dfa32 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphConstructionTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphConstructionTest.java
@@ -63,7 +63,7 @@ public class GraphConstructionTest extends AbstractGremlinTest {
      * A {@link Graph} should maintain the original {@code Configuration} object passed to it via {@link GraphFactory}.
      */
     @Test
-    public void shouldMaintainOriginalConfigurationObjectGivenToFactory() {
+    public void shouldMaintainOriginalConfigurationObjectGivenToFactory() throws Exception {
         final Configuration originalConfig = graphProvider.newGraphConfiguration("temp2", this.getClass(), name.getMethodName(), null);
         final Graph createdGraph = GraphFactory.open(originalConfig);
 
@@ -77,5 +77,7 @@ public class GraphConstructionTest extends AbstractGremlinTest {
         // need some keys in the originalConfig for this test to be meaningful
         assertTrue(keyCount.get() > 0);
         assertEquals(keyCount.get(), IteratorUtils.count(configInGraph.getKeys()));
+
+        graphProvider.clear(createdGraph, originalConfig);
     }
 }


[27/50] [abbrv] incubator-tinkerpop git commit: Config the crew to be defaulted to list cardinality.

Posted by dk...@apache.org.
Config the crew to be defaulted to list cardinality.


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

Branch: refs/heads/preprocessor
Commit: e4a4d52c93a1db79d0a0ce98a7ce3763b8fd10fc
Parents: 3e4d700
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 16:40:14 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 16:41:11 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e4a4d52c/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
index 04e03eb..459a207 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerFactory.java
@@ -87,7 +87,9 @@ public final class TinkerFactory {
     }
 
     public static TinkerGraph createTheCrew() {
-        final TinkerGraph g = TinkerGraph.open();
+        final Configuration conf = new BaseConfiguration();
+        conf.setProperty(TinkerGraph.CONFIG_DEFAULT_VERTEX_PROPERTY_CARDINALITY, VertexProperty.Cardinality.list.name());
+        final TinkerGraph g = TinkerGraph.open(conf);
         generateTheCrew(g);
         return g;
     }


[29/50] [abbrv] incubator-tinkerpop git commit: Neo4jGraph.cypher() provides the means by which indices are created. Updated docs. Fixed a bug in the IO docs around CoreIo.

Posted by dk...@apache.org.
Neo4jGraph.cypher() provides the means by which indices are created. Updated docs. Fixed a bug in the IO docs around CoreIo.


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

Branch: refs/heads/preprocessor
Commit: 14a86ee350c42f0b233ab55b34a09fe311f44c16
Parents: 38a225e
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 15:50:57 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 15:50:57 2015 -0600

----------------------------------------------------------------------
 docs/src/implementations.asciidoc               | 33 +++++-------
 docs/src/the-graph.asciidoc                     | 26 +++++-----
 .../gremlin/neo4j/structure/Neo4jGraph.java     |  4 --
 .../structure/NativeNeo4jStructureTest.java     | 54 ++++++++++----------
 4 files changed, 52 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/14a86ee3/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index d5f5632..3bad2a9 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -545,10 +545,12 @@ CAUTION: Unless under a commercial agreement with Neo Technology, Neo4j is licen
 [source,groovy]
 ----
 gremlin> :install org.apache.tinkerpop neo4j-gremlin x.y.z
-==>loaded: [org.apache.tinkerpop, neo4j-gremlin, x.y.z]
+==>Loaded: [org.apache.tinkerpop, neo4j-gremlin, x.y.z] - restart the console to use [tinkerpop.neo4j]
+gremlin> :q
+...
 gremlin> :plugin use tinkerpop.neo4j
 ==>tinkerpop.neo4j activated
-gremlin> g = Neo4jGraph.open('/tmp/neo4j')
+gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
 ==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
 ----
 
@@ -573,13 +575,8 @@ The Gremlin-Console session below demonstrates Neo4j indices. For more informati
 [source,groovy]
 gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
 ==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
-gremlin> graph.tx().open() // direct Neo4j access requires explicit transaction creation
-==>null
-gremlin> import org.neo4j.graphdb.*
-...
-gremlin> graph.getBaseGraph().schema().indexFor(DynamicLabel.label('person')).on('name').create()
-==>IndexDefinition[label:person, on:name]
-gremlin> graph.tx().commit()
+gremlin> graph.cypher("CREATE INDEX ON :person(name)")
+gremlin> graph.tx().commit() // schema mutations must happen in a different tx than graph mutations
 ==>null
 gremlin> graph.addVertex(label,'person','name','marko')
 ==>v[0]
@@ -595,15 +592,10 @@ Below demonstrates the runtime benefits of indices and demonstrates how if there
 [source,groovy]
 gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
 ==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
-gremlin> graph.tx().open()
-==>null
-gremlin> import org.neo4j.graphdb.*
-...
-gremlin> graph.getBaseGraph().schema().indexFor(DynamicLabel.label('artist')).on('name').create() <1>
-==>IndexDefinition[label:artist, on:name]
+gremlin> graph.cypher("CREATE INDEX ON :artist(name)") <1>
 gremlin> graph.tx().commit()
 ==>null
-gremlin> graph.io().readGraphML('data/grateful-dead.xml')
+gremlin> graph.io(graphml()).readGraph('data/grateful-dead.xml')
 ==>null
 gremlin> g = graph.traversal(standard())
 ==>graphtraversalsource[neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]], standard]
@@ -611,8 +603,7 @@ gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').next()}  <2>
 ==>0.0585639999999997
 gremlin> clock(1000){g.V().has('name','Garcia').next()} <3>
 ==>0.6039889999999992
-gremlin> g.getBaseGraph().schema().getIndexes(DynamicLabel.label('artist')).iterator().next().drop() <4>
-==>null
+gremlin> graph.cypher("DROP INDEX ON :artist(name)") <4>
 gremlin> g.tx().commit()
 ==>null
 gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').next()} <5>
@@ -620,10 +611,10 @@ gremlin> clock(1000){g.V().hasLabel('artist').has('name','Garcia').next()} <5>
 gremlin> clock(1000){g.V().has('name','Garcia').next()} <6>
 ==>0.6293959999999993
 
-<1> Create a schema index for all artist vertices on their name property.
+<1> Create an index for all artist vertices on their name property.
 <2> Find all artists whose name is Garcia which uses the pre-defined schema index.
 <3> Find all vertices whose name is Garcia which requires a linear scan of all the data in the graph.
-<4> Drop the created index schema.
+<4> Drop the created index.
 <5> Find all artists whose name is Garcia which does a linear scan of the artist vertex-label partition.
 <6> Find all vertices whose name is Garcia which requires a linear scan of all the data in the graph.
 
@@ -637,7 +628,7 @@ NeoTechnology are the creators of the graph pattern-match query language link:ht
 [source,groovy]
 gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
 ==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
-gremlin> graph.io().readGryo('data/tinkerpop-modern.kryo')
+gremlin> graph.io(gryo()).readGraph('data/tinkerpop-modern.kryo')
 ==>null
 gremlin> graph.cypher('MATCH (a {name:"marko"}) RETURN a')
 ==>[a:v[0]]

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/14a86ee3/docs/src/the-graph.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-graph.asciidoc b/docs/src/the-graph.asciidoc
index 8db78ed..1a761f4 100644
--- a/docs/src/the-graph.asciidoc
+++ b/docs/src/the-graph.asciidoc
@@ -276,9 +276,9 @@ The following code shows how to write a `Graph` instance to file called `tinkerp
 [source,java]
 ----
 final Graph graph = TinkerFactory.createModern();
-graph.io(CoreIo.graphml()).writeGraph("tinkerpop-modern.xml");
+graph.io(IoCore.graphml()).writeGraph("tinkerpop-modern.xml");
 final Graph newGraph = TinkerGraph.open();
-newGraph.io(CoreIo.graphml()).readGraph("tinkerpop-modern.xml");
+newGraph.io(IoCore.graphml()).readGraph("tinkerpop-modern.xml");
 ----
 
 If a custom configuration is required, then have the `Graph` generate a `GraphReader` or `GraphWriter` "builder" instance:
@@ -287,12 +287,12 @@ If a custom configuration is required, then have the `Graph` generate a `GraphRe
 ----
 final Graph graph = TinkerFactory.createModern();
 try (final OutputStream os = new FileOutputStream("tinkerpop-modern.xml")) {
-    graph.io(CoreIo.graphml()).writer().normalize(true).create().writeGraph(os, graph);
+    graph.io(IoCore.graphml()).writer().normalize(true).create().writeGraph(os, graph);
 }
 
 final Graph newGraph = TinkerGraph.open();
 try (final InputStream stream = new FileInputStream("tinkerpop-modern.xml")) {
-    newGraph.io(CoreIo.graphml()).reader().vertexIdKey("name").create().readGraph(stream, newGraph);
+    newGraph.io(IoCore.graphml()).reader().vertexIdKey("name").create().readGraph(stream, newGraph);
 }
 ----
 
@@ -310,10 +310,10 @@ GraphSON supports all of the `GraphReader` and `GraphWriter` interface methods a
 [source,java]
 ----
 final Graph graph = TinkerFactory.createModern();
-graph.io(CoreIo.graphson()).writeGraph("tinkerpop-modern.json");
+graph.io(IoCore.graphson()).writeGraph("tinkerpop-modern.json");
 
 final Graph newGraph = TinkerGraph.open();
-newGraph.io(CoreIo.graphson()).readGraph("tinkerpop-modern.json");
+newGraph.io(IoCore.graphson()).readGraph("tinkerpop-modern.json");
 ----
 
 If a custom configuration is required, then have the `Graph` generate a `GraphReader` or `GraphWriter` "builder" instance:
@@ -322,13 +322,13 @@ If a custom configuration is required, then have the `Graph` generate a `GraphRe
 ----
 final Graph graph = TinkerFactory.createModern();
 try (final OutputStream os = new FileOutputStream("tinkerpop-modern.json")) {
-    final GraphSONMapper mapper = graph.io(CoreIo.graphson()).mapper().normalize(true).create()
-    graph.io(CoreIo.graphson()).writer().mapper(mapper).create().writeGraph(os, graph)
+    final GraphSONMapper mapper = graph.io(IoCore.graphson()).mapper().normalize(true).create()
+    graph.io(IoCore.graphson()).writer().mapper(mapper).create().writeGraph(os, graph)
 }
 
 final Graph newGraph = TinkerGraph.open();
 try (final InputStream stream = new FileInputStream("tinkerpop-modern.json")) {
-    newGraph.io(CoreIo.graphson()).reader().vertexIdKey("name").create().readGraph(stream, newGraph);
+    newGraph.io(IoCore.graphson()).reader().vertexIdKey("name").create().readGraph(stream, newGraph);
 }
 ----
 
@@ -507,10 +507,10 @@ Kryo supports all of the `GraphReader` and `GraphWriter` interface methods and c
 [source,java]
 ----
 final Graph graph = TinkerFactory.createModern();
-graph.io(CoreIo.gryo()).writeGraph("tinkerpop-modern.kryo");
+graph.io(IoCore.gryo()).writeGraph("tinkerpop-modern.kryo");
 
 final Graph newGraph = TinkerGraph.open();
-newGraph.io(CoreIo.gryo()).readGraph("tinkerpop-modern.kryo")'
+newGraph.io(IoCore.gryo()).readGraph("tinkerpop-modern.kryo")'
 ----
 
 If a custom configuration is required, then have the `Graph` generate a `GraphReader` or `GraphWriter` "builder" instance:
@@ -519,12 +519,12 @@ If a custom configuration is required, then have the `Graph` generate a `GraphRe
 ----
 final Graph graph = TinkerFactory.createModern();
 try (final OutputStream os = new FileOutputStream("tinkerpop-modern.kryo")) {
-    graph.io(CoreIo.gryo()).writer().create().writeGraph(os, graph);
+    graph.io(IoCore.gryo()).writer().create().writeGraph(os, graph);
 }
 
 final Graph newGraph = TinkerGraph.open();
 try (final InputStream stream = new FileInputStream("tinkerpop-modern.kryo")) {
-    newGraph.io(CoreIo.gryo()).reader().vertexIdKey("name").create().readGraph(stream, newGraph);
+    newGraph.io(IoCore.gryo()).reader().vertexIdKey("name").create().readGraph(stream, newGraph);
 }
 ----
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/14a86ee3/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
index ae83677..31aa0c5 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
@@ -307,10 +307,6 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
         return traversal;
     }
 
-    public Iterator<Map<String, Object>> execute(String query, Map<String, Object> params) {
-        return new Neo4jCypherIterator(baseGraph.execute(query, params), this);
-    }
-
     class Neo4jTransaction extends AbstractTransaction {
 
         protected final ThreadLocal<Neo4jTx> threadLocalTx = ThreadLocal.withInitial(() -> null);

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/14a86ee3/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
index 8db88f9..dc29a91 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
@@ -159,8 +159,8 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
     @Test
     public void shouldEnforceMultipleUniqueConstraint() {
         this.graph.tx().readWrite();
-        this.getGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.name is unique", null);
-        this.getGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.surname is unique", null);
+        this.getBaseGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.name is unique", null);
+        this.getBaseGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.surname is unique", null);
         this.graph.tx().commit();
         this.graph.addVertex(T.label, "Person", "name", "marko");
         this.graph.addVertex(T.label, "Person", "surname", "aaaa");
@@ -189,8 +189,8 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
     @Test
     public void shouldDropMultipleUniqueConstraint() {
         this.graph.tx().readWrite();
-        this.getGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.name is unique", null);
-        this.getGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.surname is unique", null);
+        this.getBaseGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.name is unique", null);
+        this.getBaseGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.surname is unique", null);
         this.graph.tx().commit();
 
         this.graph.addVertex(T.label, "Person", "name", "marko");
@@ -213,8 +213,8 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
         this.graph.tx().commit();
 
         this.graph.tx().readWrite();
-        this.getGraph().execute("DROP CONSTRAINT ON (p:Person) assert p.name is unique", null);
-        this.getGraph().execute("DROP CONSTRAINT ON (p:Person) assert p.surname is unique", null);
+        this.getBaseGraph().execute("DROP CONSTRAINT ON (p:Person) assert p.name is unique", null);
+        this.getBaseGraph().execute("DROP CONSTRAINT ON (p:Person) assert p.surname is unique", null);
 
         this.graph.tx().commit();
         assertEquals(1, this.g.V().has(T.label, "Person").has("name", "marko").count().next(), 0);
@@ -229,7 +229,7 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
     @Test(expected = RuntimeException.class)
     public void shouldFailUniqueConstraint() {
         this.graph.tx().readWrite();
-        this.getGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.name is unique", null);
+        this.getBaseGraph().execute("CREATE CONSTRAINT ON (p:Person) assert p.name is unique", null);
         this.graph.tx().commit();
         this.graph.addVertex(T.label, "Person", "name", "marko");
         this.graph.tx().commit();
@@ -311,7 +311,7 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
     public void shouldSupportVertexPropertyToVertexMappingOnIndexCalls() {
         graph.tx().readWrite();
-        this.getGraph().execute("CREATE INDEX ON :person(name)", null);
+        this.getBaseGraph().execute("CREATE INDEX ON :person(name)", null);
 //            this.graph.getBaseGraph().execute("CREATE INDEX ON :name(" + T.value.getAccessor() + ")", null);
         this.graph.tx().commit();
 
@@ -366,9 +366,9 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
     public void shouldDoLabelsNamespaceBehavior() {
         graph.tx().readWrite();
 
-        this.getGraph().execute("CREATE INDEX ON :Person(name)", null);
-        this.getGraph().execute("CREATE INDEX ON :Product(name)", null);
-        this.getGraph().execute("CREATE INDEX ON :Corporate(name)", null);
+        this.getBaseGraph().execute("CREATE INDEX ON :Person(name)", null);
+        this.getBaseGraph().execute("CREATE INDEX ON :Product(name)", null);
+        this.getBaseGraph().execute("CREATE INDEX ON :Corporate(name)", null);
 
         this.graph.tx().commit();
         this.graph.addVertex(T.label, "Person", "name", "marko");
@@ -447,16 +447,16 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
             // assertEquals(1, b.properties("location").count().next().intValue());
             assertEquals(0, g.E().count().next().intValue());
 
-            assertEquals(4l, this.getGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
-            assertEquals(2l, this.getGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
-            assertEquals(2l, this.getGraph().execute("MATCH (a)-[r]->() WHERE id(a) = " + a.id() + " RETURN COUNT(r)", null).next().get("COUNT(r)"));
+            assertEquals(4l, this.getBaseGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
+            assertEquals(2l, this.getBaseGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
+            assertEquals(2l, this.getBaseGraph().execute("MATCH (a)-[r]->() WHERE id(a) = " + a.id() + " RETURN COUNT(r)", null).next().get("COUNT(r)"));
             final AtomicInteger counter = new AtomicInteger(0);
             a.getBaseVertex().relationships(Neo4jDirection.OUTGOING).forEach(relationship -> {
                 assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX.concat("name"), relationship.type());
                 counter.incrementAndGet();
             });
             assertEquals(2, counter.getAndSet(0));
-            this.getGraph().execute("MATCH (a)-[]->(m) WHERE id(a) = " + a.id() + " RETURN labels(m)", null).forEachRemaining(results -> {
+            this.getBaseGraph().execute("MATCH (a)-[]->(m) WHERE id(a) = " + a.id() + " RETURN labels(m)", null).forEachRemaining(results -> {
                 assertEquals(VertexProperty.DEFAULT_LABEL, ((List<String>) results.get("labels(m)")).get(0));
                 counter.incrementAndGet();
             });
@@ -484,8 +484,8 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
             //  assertEquals(1, b.properties("name").count().next().intValue());
             // assertEquals(1, b.properties("location").count().next().intValue());
             assertEquals(0, g.E().count().next().intValue());
-            assertEquals(2l, this.getGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
-            assertEquals(0l, this.getGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
+            assertEquals(2l, this.getBaseGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
+            assertEquals(0l, this.getBaseGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
 
             assertEquals(1, IteratorUtils.count(a.getBaseVertex().getKeys()));
             assertEquals("the marko", a.getBaseVertex().getProperty("name"));
@@ -500,8 +500,8 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
             //    assertEquals(0, a.properties().count().next().intValue());
             //   assertEquals(2, b.properties().count().next().intValue());
             assertEquals(0, g.E().count().next().intValue());
-            assertEquals(2l, this.getGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
-            assertEquals(0l, this.getGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
+            assertEquals(2l, this.getBaseGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
+            assertEquals(0l, this.getBaseGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
             assertEquals(0, IteratorUtils.count(a.getBaseVertex().getKeys()));
             assertEquals(2, IteratorUtils.count(b.getBaseVertex().getKeys()));
         });
@@ -515,16 +515,16 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
             // assertEquals(1, b.properties("location").count().next().intValue());
             assertEquals(0, g.E().count().next().intValue());
 
-            assertEquals(3l, this.getGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
-            assertEquals(1l, this.getGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
-            assertEquals(1l, this.getGraph().execute("MATCH (a)-[r]->() WHERE id(a) = " + a.id() + " RETURN COUNT(r)", null).next().get("COUNT(r)"));
+            assertEquals(3l, this.getBaseGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
+            assertEquals(1l, this.getBaseGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
+            assertEquals(1l, this.getBaseGraph().execute("MATCH (a)-[r]->() WHERE id(a) = " + a.id() + " RETURN COUNT(r)", null).next().get("COUNT(r)"));
             final AtomicInteger counter = new AtomicInteger(0);
             a.getBaseVertex().relationships(Neo4jDirection.OUTGOING).forEach(relationship -> {
                 assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX.concat("name"), relationship.type());
                 counter.incrementAndGet();
             });
             assertEquals(1, counter.getAndSet(0));
-            this.getGraph().execute("MATCH (a)-[]->(m) WHERE id(a) = " + a.id() + " RETURN labels(m)", null).forEachRemaining(results -> {
+            this.getBaseGraph().execute("MATCH (a)-[]->(m) WHERE id(a) = " + a.id() + " RETURN labels(m)", null).forEachRemaining(results -> {
                 assertEquals(VertexProperty.DEFAULT_LABEL, ((List<String>) results.get("labels(m)")).get(0));
                 counter.incrementAndGet();
             });
@@ -559,16 +559,16 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
              //assertEquals(1, b.properties("location").count().next().intValue());
              assertEquals(0, g.E().count().next().intValue());
 
-            assertEquals(3l, this.getGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
-            assertEquals(1l, this.getGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
-            assertEquals(1l, this.getGraph().execute("MATCH (a)-[r]->() WHERE id(a) = " + a.id() + " RETURN COUNT(r)", null).next().get("COUNT(r)"));
+            assertEquals(3l, this.getBaseGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
+            assertEquals(1l, this.getBaseGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
+            assertEquals(1l, this.getBaseGraph().execute("MATCH (a)-[r]->() WHERE id(a) = " + a.id() + " RETURN COUNT(r)", null).next().get("COUNT(r)"));
             final AtomicInteger counter = new AtomicInteger(0);
             a.getBaseVertex().relationships(Neo4jDirection.OUTGOING).forEach(relationship -> {
                 assertEquals(MultiMetaNeo4jTrait.VERTEX_PROPERTY_PREFIX.concat("name"), relationship.type());
                 counter.incrementAndGet();
             });
             assertEquals(1, counter.getAndSet(0));
-            this.getGraph().execute("MATCH (a)-[]->(m) WHERE id(a) = " + a.id() + " RETURN labels(m)", null).forEachRemaining(results -> {
+            this.getBaseGraph().execute("MATCH (a)-[]->(m) WHERE id(a) = " + a.id() + " RETURN labels(m)", null).forEachRemaining(results -> {
                 assertEquals(VertexProperty.DEFAULT_LABEL, ((List<String>) results.get("labels(m)")).get(0));
                 counter.incrementAndGet();
             });


[17/50] [abbrv] incubator-tinkerpop git commit: more tests, more fixes.... very clean.

Posted by dk...@apache.org.
more tests, more fixes.... very clean.


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

Branch: refs/heads/preprocessor
Commit: c19398c1d3f93e1ead67e19596c2b8875d228dda
Parents: 24c88a0
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 12:15:51 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 12:15:51 2015 -0600

----------------------------------------------------------------------
 .../gremlin/neo4j/structure/Neo4jEdge.java      |  8 ++++-
 .../gremlin/neo4j/structure/Neo4jElement.java   | 12 ++-----
 .../gremlin/neo4j/structure/Neo4jGraph.java     | 23 ++-----------
 .../gremlin/neo4j/structure/Neo4jHelper.java    |  8 ++---
 .../gremlin/neo4j/structure/Neo4jProperty.java  |  7 +++-
 .../gremlin/neo4j/structure/Neo4jVertex.java    |  3 ++
 .../neo4j/structure/Neo4jVertexProperty.java    |  8 ++++-
 .../structure/trait/MultiMetaNeo4jTrait.java    | 18 ++++++----
 .../trait/NoMultiNoMetaNeo4jTrait.java          | 14 ++++----
 .../neo4j/MultiMetaNeo4jGraphProvider.java      |  1 -
 .../neo4j/NoMultiNoMetaNeo4jGraphProvider.java  |  1 -
 .../structure/NativeNeo4jStructureTest.java     | 35 ++++++++++----------
 12 files changed, 65 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
index c2bbd6b..f0a5139 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.gremlin.structure.Property;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedEdge;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
@@ -96,6 +97,11 @@ public final class Neo4jEdge extends Neo4jElement implements Edge, WrappedEdge<N
 
     @Override
     public <V> Iterator<Property<V>> properties(final String... propertyKeys) {
-        return (Iterator) super.properties(propertyKeys);
+        this.graph.tx().readWrite();
+        Iterable<String> keys = this.baseElement.getKeys();
+        Iterator<String> filter = IteratorUtils.filter(keys.iterator(),
+                key -> ElementHelper.keyExists(key, propertyKeys));
+        return IteratorUtils.map(filter,
+                key -> new Neo4jProperty<>(this, key, (V) this.baseElement.getProperty(key)));
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
index 9e9bdb7..7dfc9a8 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
@@ -35,7 +35,7 @@ import java.util.Set;
 public abstract class Neo4jElement implements Element, WrappedElement<Neo4jEntity> {
     protected final Neo4jGraph graph;
     protected final Neo4jEntity baseElement;
-    protected boolean removed = false;
+    public boolean removed = false;
 
     public Neo4jElement(final Neo4jEntity baseElement, final Neo4jGraph graph) {
         this.baseElement = baseElement;
@@ -99,14 +99,6 @@ public abstract class Neo4jElement implements Element, WrappedElement<Neo4jEntit
         return this.baseElement;
     }
 
-    @Override
-    public <V> Iterator<? extends Property<V>> properties(final String... propertyKeys) {
-        this.graph.tx().readWrite();
-        Iterable<String> keys = this.baseElement.getKeys();
-        Iterator<String> filter = IteratorUtils.filter(keys.iterator(),
-                key -> ElementHelper.keyExists(key, propertyKeys));
-        return IteratorUtils.map(filter,
-                key -> new Neo4jProperty<>(this, key, (V) this.baseElement.getProperty(key)));
-    }
+
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
index 898286d..07aa0ef 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
@@ -76,19 +76,15 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
     public static final String CONFIG_CONF = "gremlin.neo4j.conf";
     public static final String CONFIG_META_PROPERTIES = "gremlin.neo4j.metaProperties";
     public static final String CONFIG_MULTI_PROPERTIES = "gremlin.neo4j.multiProperties";
-    public static final String CONFIG_CHECK_ELEMENTS_IN_TRANSACTION = "gremlin.neo4j.checkElementsInTransaction";
 
     private final Neo4jTransaction neo4jTransaction = new Neo4jTransaction();
     private Neo4jGraphVariables neo4jGraphVariables;
 
-    protected boolean checkElementsInTransaction = false;
-
     protected Neo4jTrait trait;
 
     private void initialize(final Neo4jGraphAPI baseGraph, final Configuration configuration) {
         this.configuration.copy(configuration);
         this.baseGraph = baseGraph;
-        this.checkElementsInTransaction = this.configuration.getBoolean(CONFIG_CHECK_ELEMENTS_IN_TRANSACTION, false);
         boolean supportsMetaProperties = this.configuration.getBoolean(CONFIG_META_PROPERTIES, false);
         boolean supportsMultiProperties = this.configuration.getBoolean(CONFIG_MULTI_PROPERTIES, false);
         if (supportsMultiProperties != supportsMetaProperties)
@@ -151,7 +147,7 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
         if (0 == vertexIds.length) {
             final Predicate<Neo4jNode> nodePredicate = this.trait.getNodePredicate();
             return IteratorUtils.stream(this.getBaseGraph().allNodes())
-                    .filter(node -> !this.checkElementsInTransaction || !Neo4jHelper.isDeleted(node))
+                    //.filter(node -> !Neo4jHelper.isDeleted(node))
                     .filter(nodePredicate)
                     .map(node -> (Vertex) new Neo4jVertex(node, this)).iterator();
         } else {
@@ -184,7 +180,7 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
         if (0 == edgeIds.length) {
             final Predicate<Neo4jRelationship> relationshipPredicate = this.trait.getRelationshipPredicate();
             return IteratorUtils.stream(this.getBaseGraph().allRelationships())
-                    .filter(relationship -> !this.checkElementsInTransaction || !Neo4jHelper.isDeleted(relationship))
+                    //.filter(relationship -> !Neo4jHelper.isDeleted(relationship))
                     .filter(relationshipPredicate)
                     .map(relationship -> (Edge) new Neo4jEdge(relationship, this)).iterator();
         } else {
@@ -269,21 +265,6 @@ public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> {
     }
 
     /**
-     * Neo4j's transactions are not consistent between the graph and the graph
-     * indices. Moreover, global graph operations are not consistent. For
-     * example, if a vertex is removed and then an index is queried in the same
-     * transaction, the removed vertex can be returned. This method allows the
-     * developer to turn on/off a Neo4jGraph 'hack' that ensures transactional
-     * consistency. The default behavior for Neo4jGraph is {@code true}.
-     *
-     * @param checkElementsInTransaction check whether an element is in the transaction between
-     *                                   returning it
-     */
-    public void checkElementsInTransaction(final boolean checkElementsInTransaction) {
-        this.checkElementsInTransaction = checkElementsInTransaction;
-    }
-
-    /**
      * Execute the Cypher query and get the result set as a {@link GraphTraversal}.
      *
      * @param query the Cypher query to execute

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
index d6679dd..524a089 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
@@ -50,20 +50,20 @@ public final class Neo4jHelper {
         }
     }
 
-    public static boolean isDeleted(final Neo4jRelationship relationship) {
+    /*public static boolean isDeleted(final Neo4jRelationship relationship) {
         try {
             relationship.type();
             return false;
         } catch (final IllegalStateException e) {
             return true;
         }
-    }
+    }*/
 
     public static boolean isNotFound(RuntimeException ex) {
         return ex.getClass().getSimpleName().equals("NotFoundException");
     }
 
-    public static boolean keyExistsInNeo4j(final Neo4jNode node, final String key) {
+    /*public static boolean keyExistsInNeo4j(final Neo4jNode node, final String key) {
         try {
             return node.hasProperty(key);
         } catch (IllegalStateException ex) {
@@ -75,7 +75,7 @@ public final class Neo4jHelper {
                 throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, node.getId());
             throw ex;
         }
-    }
+    }*/
 
     public static Neo4jNode getVertexPropertyNode(final Neo4jVertexProperty vertexProperty) {
         return vertexProperty.vertexPropertyNode;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java
index d283269..30aa0c1 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java
@@ -33,6 +33,7 @@ public final class Neo4jProperty<V> implements Property<V> {
     protected final String key;
     protected final Neo4jGraph graph;
     protected V value;
+    protected boolean removed = false;
 
     public Neo4jProperty(final Element element, final String key, final V value) {
         this.element = element;
@@ -50,8 +51,12 @@ public final class Neo4jProperty<V> implements Property<V> {
 
     @Override
     public void remove() {
+        if (this.removed) return;
+        this.removed = true;
         this.graph.tx().readWrite();
-        final Neo4jEntity entity = ((Neo4jElement) this.element).getBaseElement();
+        final Neo4jEntity entity = this.element instanceof Neo4jVertexProperty ?
+                ((Neo4jVertexProperty) this.element).vertexPropertyNode :
+                ((Neo4jElement) this.element).getBaseElement();
         if (entity.hasProperty(this.key)) {
             entity.removeProperty(this.key);
         }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java
index d7bdf4f..51fae20 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java
@@ -79,6 +79,9 @@ public final class Neo4jVertex extends Neo4jElement implements Vertex, WrappedVe
     @Override
     public <V> VertexProperty<V> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
         if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(Vertex.class, this.id());
+        ElementHelper.validateProperty(key, value);
+        if (ElementHelper.getIdValue(keyValues).isPresent())
+            throw Vertex.Exceptions.userSuppliedIdsNotSupported();
         this.graph.tx().readWrite();
         return this.graph.trait.setVertexProperty(this, cardinality, key, value, keyValues);
     }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
index 12e55e1..9c85dfc 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
@@ -28,7 +28,6 @@ import org.neo4j.tinkerpop.api.Neo4jNode;
 
 import java.util.Iterator;
 import java.util.NoSuchElementException;
-import java.util.Optional;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -39,6 +38,7 @@ public final class Neo4jVertexProperty<V> implements VertexProperty<V> {
     protected final String key;
     protected final V value;
     protected Neo4jNode vertexPropertyNode;
+    protected boolean removed = false;
 
 
     public Neo4jVertexProperty(final Neo4jVertex vertex, final String key, final V value) {
@@ -83,20 +83,26 @@ public final class Neo4jVertexProperty<V> implements VertexProperty<V> {
 
     @Override
     public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
+        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(VertexProperty.class, this.id());
         this.vertex.graph.tx().readWrite();
         return this.vertex.graph.trait.getProperties(this, propertyKeys);
     }
 
     @Override
     public <U> Property<U> property(final String key, final U value) {
+        if (this.removed) throw Element.Exceptions.elementAlreadyRemoved(VertexProperty.class, this.id());
         this.vertex.graph.tx().readWrite();
+        ElementHelper.validateProperty(key, value);
         return this.vertex.graph.trait.setProperty(this, key, value);
     }
 
     @Override
     public void remove() {
+        if (this.removed) return;
+        this.removed = true;
         this.vertex.graph.tx().readWrite();
         this.vertex.graph.trait.removeVertexProperty(this);
+        this.vertexPropertyNode= null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
index 6b4b2a3..fb2e8c2 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/MultiMetaNeo4jTrait.java
@@ -55,14 +55,17 @@ public class MultiMetaNeo4jTrait implements Neo4jTrait {
     public static final String VERTEX_PROPERTY_PREFIX = Graph.Hidden.hide("");
     public static final String VERTEX_PROPERTY_TOKEN = Graph.Hidden.hide("vertexProperty");
 
+    private static final Predicate<Neo4jNode> NODE_PREDICATE = node -> !node.hasLabel(VERTEX_PROPERTY_LABEL);
+    private static final Predicate<Neo4jRelationship> RELATIONSHIP_PREDICATE = relationship -> !relationship.type().startsWith(VERTEX_PROPERTY_PREFIX);
+
     @Override
     public Predicate<Neo4jNode> getNodePredicate() {
-        return node -> !node.hasLabel(VERTEX_PROPERTY_LABEL);
+        return NODE_PREDICATE;
     }
 
     @Override
     public Predicate<Neo4jRelationship> getRelationshipPredicate() {
-        return relationship -> !relationship.type().startsWith(VERTEX_PROPERTY_PREFIX);
+        return RELATIONSHIP_PREDICATE;
     }
 
     @Override
@@ -89,7 +92,7 @@ public class MultiMetaNeo4jTrait implements Neo4jTrait {
     @Override
     public <V> VertexProperty<V> getVertexProperty(final Neo4jVertex vertex, final String key) {
         final Neo4jNode node = vertex.getBaseVertex();
-        if (Neo4jHelper.keyExistsInNeo4j(node, key)) {
+        if (node.hasProperty(key)) {
             if (node.getProperty(key).equals(VERTEX_PROPERTY_TOKEN)) {
                 if (node.degree(Neo4jDirection.OUTGOING, VERTEX_PROPERTY_PREFIX.concat(key)) > 1)
                     throw Vertex.Exceptions.multiplePropertiesExistForProvidedKey(key);
@@ -106,6 +109,7 @@ public class MultiMetaNeo4jTrait implements Neo4jTrait {
 
     @Override
     public <V> Iterator<VertexProperty<V>> getVertexProperties(final Neo4jVertex vertex, final String... keys) {
+        if (Neo4jHelper.isDeleted(vertex.getBaseVertex())) return Collections.emptyIterator(); // TODO: WHY?
         return IteratorUtils.stream(vertex.getBaseVertex().getKeys())
                 .filter(key -> ElementHelper.keyExists(key, keys))
                 .flatMap(key -> {
@@ -128,7 +132,7 @@ public class MultiMetaNeo4jTrait implements Neo4jTrait {
             final Neo4jNode node = vertex.getBaseVertex();
             final Neo4jGraphAPI graph = ((Neo4jGraph) vertex.graph()).getBaseGraph();
             final String prefixedKey = VERTEX_PROPERTY_PREFIX.concat(key);
-            if (Neo4jHelper.keyExistsInNeo4j(node, key)) {
+            if (node.hasProperty(key)) {
                 if (node.getProperty(key).equals(VERTEX_PROPERTY_TOKEN)) {
                     final Neo4jNode vertexPropertyNode = graph.createNode(VERTEX_PROPERTY_LABEL, key);
                     vertexPropertyNode.setProperty(T.key.getAccessor(), key);
@@ -181,14 +185,14 @@ public class MultiMetaNeo4jTrait implements Neo4jTrait {
     public void removeVertexProperty(final Neo4jVertexProperty vertexProperty) {
         final Neo4jNode vertexPropertyNode = Neo4jHelper.getVertexPropertyNode(vertexProperty);
         final Neo4jNode vertexNode = ((Neo4jVertex) vertexProperty.element()).getBaseVertex();
-        if (null != vertexPropertyNode) {
-            vertexPropertyNode.relationships(null).forEach(Neo4jRelationship::delete);
-            vertexPropertyNode.delete();
+        if (null == vertexPropertyNode) {
             if (vertexNode.degree(Neo4jDirection.OUTGOING, VERTEX_PROPERTY_PREFIX.concat(vertexProperty.key())) == 0) {
                 if (vertexNode.hasProperty(vertexProperty.key()))
                     vertexNode.removeProperty(vertexProperty.key());
             }
         } else {
+            vertexPropertyNode.relationships(null).forEach(Neo4jRelationship::delete);
+            vertexPropertyNode.delete();
             if (vertexNode.degree(Neo4jDirection.OUTGOING, VERTEX_PROPERTY_PREFIX.concat(vertexProperty.key())) == 0) {
                 if (vertexNode.hasProperty(vertexProperty.key()))
                     vertexNode.removeProperty(vertexProperty.key());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
index c241328..25be842 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/trait/NoMultiNoMetaNeo4jTrait.java
@@ -40,14 +40,16 @@ import java.util.function.Predicate;
  */
 public class NoMultiNoMetaNeo4jTrait implements Neo4jTrait {
 
+    private final static Predicate TRUE_PREDICATE = x -> true;
+
     @Override
     public Predicate<Neo4jNode> getNodePredicate() {
-        return node -> true;
+        return TRUE_PREDICATE;
     }
 
     @Override
     public Predicate<Neo4jRelationship> getRelationshipPredicate() {
-        return relationship -> true;
+        return TRUE_PREDICATE;
     }
 
     @Override
@@ -68,10 +70,7 @@ public class NoMultiNoMetaNeo4jTrait implements Neo4jTrait {
 
     @Override
     public <V> VertexProperty<V> getVertexProperty(final Neo4jVertex vertex, final String key) {
-        if (Neo4jHelper.keyExistsInNeo4j(vertex.getBaseVertex(), key)) {
-            return new Neo4jVertexProperty<>(vertex, key, (V) vertex.getBaseVertex().getProperty(key));
-        } else
-            return VertexProperty.<V>empty();
+        return vertex.getBaseVertex().hasProperty(key) ? new Neo4jVertexProperty<>(vertex, key, (V) vertex.getBaseVertex().getProperty(key)) : VertexProperty.<V>empty();
     }
 
     @Override
@@ -87,7 +86,6 @@ public class NoMultiNoMetaNeo4jTrait implements Neo4jTrait {
             throw VertexProperty.Exceptions.multiPropertiesNotSupported();
         if (keyValues.length > 0)
             throw VertexProperty.Exceptions.metaPropertiesNotSupported();
-        ElementHelper.validateProperty(key, value);
         try {
             vertex.getBaseVertex().setProperty(key, value);
             return new Neo4jVertexProperty<>(vertex, key, value);
@@ -113,7 +111,7 @@ public class NoMultiNoMetaNeo4jTrait implements Neo4jTrait {
 
     @Override
     public void removeVertexProperty(final Neo4jVertexProperty vertexProperty) {
-        if (Neo4jHelper.keyExistsInNeo4j(((Neo4jVertex) vertexProperty.element()).getBaseVertex(), vertexProperty.key()))
+        if ((((Neo4jVertex) vertexProperty.element()).getBaseVertex().hasProperty(vertexProperty.key())))
             ((Neo4jVertex) vertexProperty.element()).getBaseVertex().removeProperty(vertexProperty.key());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/MultiMetaNeo4jGraphProvider.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/MultiMetaNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/MultiMetaNeo4jGraphProvider.java
index a81394f..672a779 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/MultiMetaNeo4jGraphProvider.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/MultiMetaNeo4jGraphProvider.java
@@ -39,7 +39,6 @@ public class MultiMetaNeo4jGraphProvider extends AbstractNeo4jGraphProvider {
             put(Neo4jGraph.CONFIG_DIRECTORY, directory);
             put(Neo4jGraph.CONFIG_META_PROPERTIES, true);
             put(Neo4jGraph.CONFIG_MULTI_PROPERTIES, true);
-            put(Neo4jGraph.CONFIG_CHECK_ELEMENTS_IN_TRANSACTION, true);
         }};
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NoMultiNoMetaNeo4jGraphProvider.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NoMultiNoMetaNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NoMultiNoMetaNeo4jGraphProvider.java
index 0e7c29f..3a1381b 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NoMultiNoMetaNeo4jGraphProvider.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NoMultiNoMetaNeo4jGraphProvider.java
@@ -42,7 +42,6 @@ public class NoMultiNoMetaNeo4jGraphProvider extends AbstractNeo4jGraphProvider
             put(Neo4jGraph.CONFIG_DIRECTORY, directory);
             put(Neo4jGraph.CONFIG_META_PROPERTIES, false);
             put(Neo4jGraph.CONFIG_MULTI_PROPERTIES, false);
-            put(Neo4jGraph.CONFIG_CHECK_ELEMENTS_IN_TRANSACTION, true);
         }};
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c19398c1/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
index 4e79e14..2971e19 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureTest.java
@@ -23,6 +23,7 @@ package org.apache.tinkerpop.gremlin.neo4j.structure;
 
 import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.FeatureRequirement;
+import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 import org.apache.tinkerpop.gremlin.neo4j.AbstractNeo4jGremlinTest;
 import org.apache.tinkerpop.gremlin.neo4j.structure.trait.MultiMetaNeo4jTrait;
@@ -490,7 +491,7 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
             // assertEquals(2, a.properties("name").count().next().intValue());
             // assertEquals(1, b.properties("name").count().next().intValue());
             // assertEquals(1, b.properties("location").count().next().intValue());
-            // assertEquals(0, g.E().count().next().intValue());
+            assertEquals(0, g.E().count().next().intValue());
 
             assertEquals(4l, this.getGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
             assertEquals(2l, this.getGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
@@ -523,13 +524,12 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
         });
 
         a.property("name", "the marko");
-        tryCommit(graph, g -> {
-            assertEquals(2, g.traversal().V().count().next().intValue());
+        tryCommit(graph, graph -> {
+            assertEquals(2, g.V().count().next().intValue());
             //assertEquals(1, a.prope rties().count().next().intValue());
             //  assertEquals(1, b.properties("name").count().next().intValue());
             // assertEquals(1, b.properties("location").count().next().intValue());
-            //  assertEquals(0, g.E().count().next().intValue());
-
+            assertEquals(0, g.E().count().next().intValue());
             assertEquals(2l, this.getGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
             assertEquals(0l, this.getGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
 
@@ -541,11 +541,11 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
         });
 
         a.property("name").remove();
-        tryCommit(graph, g -> {
-            assertEquals(2, g.traversal().V().count().next().intValue());
+        tryCommit(graph, graph -> {
+            assertEquals(2, g.V().count().next().intValue());
             //    assertEquals(0, a.properties().count().next().intValue());
             //   assertEquals(2, b.properties().count().next().intValue());
-            //     assertEquals(0, g.E().count().next().intValue());
+            assertEquals(0, g.E().count().next().intValue());
             assertEquals(2l, this.getGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
             assertEquals(0l, this.getGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
             assertEquals(0, IteratorUtils.count(a.getBaseVertex().getKeys()));
@@ -554,12 +554,12 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
 
         graph.tx().commit();
         a.property("name", "the marko", "acl", "private");
-        tryCommit(graph, g -> {
-            assertEquals(2, g.traversal().V().count().next().intValue());
+        tryCommit(graph, graph -> {
+            assertEquals(2, g.V().count().next().intValue());
             // assertEquals(1, a.properties("name").count().next().intValue());
             // assertEquals(1, b.properties("name").count().next().intValue());
             // assertEquals(1, b.properties("location").count().next().intValue());
-            //  assertEquals(0, g.E().count().next().intValue());
+            assertEquals(0, g.E().count().next().intValue());
 
             assertEquals(3l, this.getGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
             assertEquals(1l, this.getGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));
@@ -597,14 +597,13 @@ public class NativeNeo4jStructureTest extends AbstractNeo4jGremlinTest {
 
         a.property(VertexProperty.Cardinality.list, "name", "marko", "acl", "private");
         a.property(VertexProperty.Cardinality.list, "name", "okram", "acl", "public");
-        graph.tx().commit();  // TODO tx.commit() THIS IS REQUIRED: ?! Why does Neo4j not delete vertices correctly?
         a.property(VertexProperty.Cardinality.single, "name", "the marko", "acl", "private");
-        tryCommit(graph, g -> {
-            assertEquals(2, g.traversal().V().count().next().intValue());
-            // assertEquals(1, a.properties("name").count().next().intValue());
-            // assertEquals(1, b.properties("name").count().next().intValue());
-            // assertEquals(1, b.properties("location").count().next().intValue());
-            // assertEquals(0, g.E().count().next().intValue());
+        tryCommit(graph, graph -> {
+            assertEquals(2, g.V().count().next().intValue());
+             //assertEquals(1, a.properties("name").count().next().intValue());
+             //assertEquals(1, b.properties("name").count().next().intValue());
+             //assertEquals(1, b.properties("location").count().next().intValue());
+             assertEquals(0, g.E().count().next().intValue());
 
             assertEquals(3l, this.getGraph().execute("MATCH n RETURN COUNT(n)", null).next().get("COUNT(n)"));
             assertEquals(1l, this.getGraph().execute("MATCH (n)-[r]->(m) RETURN COUNT(r)", null).next().get("COUNT(r)"));


[42/50] [abbrv] incubator-tinkerpop git commit: Add test class for GraphMigrator.

Posted by dk...@apache.org.
Add test class for GraphMigrator.


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

Branch: refs/heads/preprocessor
Commit: 27e522779741b19c2c5967dac9f25d48b79c8cb5
Parents: d096ac2
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jun 1 13:59:23 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jun 1 13:59:23 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/io/GraphMigrator.java     |  3 ++
 .../gremlin/structure/io/GraphMigratorTest.java | 32 ++++++++++++++++++++
 2 files changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/27e52277/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/GraphMigrator.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/GraphMigrator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/GraphMigrator.java
index 641df3b..b2549e6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/GraphMigrator.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/GraphMigrator.java
@@ -36,6 +36,9 @@ import static org.apache.tinkerpop.gremlin.structure.io.IoCore.gryo;
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class GraphMigrator {
+
+    private GraphMigrator() {}
+
     /**
      * Use Gryo to pipe the data from one graph to another graph.  Uses readers and writers generated from each
      * {@link Graph} via the {@link Graph#io(Io.Builder)} method.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/27e52277/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/GraphMigratorTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/GraphMigratorTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/GraphMigratorTest.java
new file mode 100644
index 0000000..0b4a912
--- /dev/null
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/GraphMigratorTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.structure.io;
+
+import org.apache.tinkerpop.gremlin.TestHelper;
+import org.junit.Test;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class GraphMigratorTest {
+    @Test
+    public void shouldBeUtilityClass() throws Exception {
+        TestHelper.assertIsUtilityClass(GraphMigrator.class);
+    }
+}


[26/50] [abbrv] incubator-tinkerpop git commit: Update docs with respect to default cardinality config in TinkerGraph

Posted by dk...@apache.org.
Update docs with respect to default cardinality config in TinkerGraph


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

Branch: refs/heads/preprocessor
Commit: 3e4d70031cb2980073b71640d600fc6c9676b2f4
Parents: ff6067d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 29 16:39:36 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 29 16:41:11 2015 -0400

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 17 +++++++++++++++++
 docs/src/the-graph.asciidoc       |  4 ++--
 2 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3e4d7003/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index c4a087a..061f06a 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -504,10 +504,27 @@ TinkerGraph has several settings that can be provided on creation via `Configura
 |gremlin.tinkergraph.vertexIdManager |The `IdManager` implementation to use for vertices.
 |gremlin.tinkergraph.edgeIdManager |The `IdManager` implementation to use for edges.
 |gremlin.tinkergraph.vertexPropertyIdManager |The `IdManager` implementation to use for vertex properties.
+|gremlin.tinkergraph.defaultVertexPropertyCardinality |The default `VertexProperty.Cardinality` to use when `Vertex.property(k,v)` is called.
 |=========================================================
 
 The `IdManager` settings above refer to how TinkerGraph will control identifiers for vertices, edges and vertex properties.  There are several options for each of these settings: `ANY`, `LONG`, `INTEGER`, `UUID`, or the fully qualified class name of an `IdManager` implementation on the classpath.  When not specified, the default values for all settings is `ANY`, meaning that the graph will work with any object on the JVM as the identifier and will generate new identifiers from `Long` when the identifier is not user supplied.  TinkerGraph will also expect the user to understand the types used for identifiers when querying, meaning that `g.V(1)` and `g.V(1L)` could return two different vertices.  `LONG`, `INTEGER` and `UUID` settings will try to coerce identifier values to the expected type as well as generate new identifiers with that specified type.
 
+It is important to consider the data being imported to TinkerGraph with respect to `defaultVertexPropertyCardinality` setting.  For example, if a `.gryo` file is known to contain multi-property data, be sure to set the default cardinality to `list` or else the data will import as `single`.  Consider the following:
+
+[gremlin-groovy]
+----
+graph = TinkerGraph.open()
+graph.io(gryo()).readGraph("data/tinkerpop-crew.kryo")
+g = graph.traversal()
+g.V().properties()
+conf = new BaseConfiguration()
+conf.setProperty("gremlin.tinkergraph.defaultVertexPropertyCardinality","list")
+graph = TinkerGraph.open(conf)
+graph.io(gryo()).readGraph("data/tinkerpop-crew.kryo")
+g = graph.traversal()
+g.V().properties()
+----
+
 [[neo4j-gremlin]]
 Neo4j-Gremlin
 -------------

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3e4d7003/docs/src/the-graph.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/the-graph.asciidoc b/docs/src/the-graph.asciidoc
index aeefbea..8db78ed 100644
--- a/docs/src/the-graph.asciidoc
+++ b/docs/src/the-graph.asciidoc
@@ -116,7 +116,7 @@ g.V(v).values('name') <7>
 If the concept of vertex properties is difficult to grasp, then it may be best to think of vertex properties in terms of "literal vertices." A vertex can have an edge to a "literal vertex" that has a single value key/value -- e.g. "value=okram." The edge that points to that literal vertex has an edge-label of "name." The properties on the edge represent the literal vertex's properties. The "literal vertex" can not have any other edges to it (only one from the associated vertex).
 
 [[the-crew-toy-graph]]
-TIP: A toy graph demonstrating all of the new TinkerPop3 graph structure features is available at `TinkerFactory.createTheCrew()` and `data/tinkerpop-crew*`. This graph demonstrates multi-properties, meta-properties, and graph variables.
+TIP: A toy graph demonstrating all of the new TinkerPop3 graph structure features is available at `TinkerFactory.createTheCrew()` and `data/tinkerpop-crew*`. This graph demonstrates multi-properties and meta-properties.
 
 .TinkerPop Crew
 image::the-crew-graph.png[width=685]
@@ -133,7 +133,7 @@ g.V().has('name','gremlin').inE('uses').
       select().by('skill').by('name') // rank the users of gremlin by their skill level
 ----
 
-IMPORTANT: The default behavior for `Vertex.property(key,value)` is `Cardinality.single`.
+IMPORTANT: The default behavior for `Vertex.property(key,value)` is dependent on the graph implementation.  Please refer to the documentation of the graph to determine this method's behavior.
 
 Graph Variables
 ---------------


[30/50] [abbrv] incubator-tinkerpop git commit: use graph.cypher() to create indices.

Posted by dk...@apache.org.
use graph.cypher() to create indices.


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

Branch: refs/heads/preprocessor
Commit: 486bc3b01fa76ae7a85e95478f15b628ab1fff90
Parents: 14a86ee
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri May 29 16:11:38 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri May 29 16:11:38 2015 -0600

----------------------------------------------------------------------
 .../neo4j/AbstractNeo4jGraphProvider.java       | 55 +++++++++-----------
 1 file changed, 26 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/486bc3b0/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
index c243957..41b6d0f 100644
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
+++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.neo4j;
 
+import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.AbstractGraphProvider;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jEdge;
@@ -28,10 +29,11 @@ import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jProperty;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
 import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
 import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.commons.configuration.Configuration;
 
 import java.io.File;
-import java.util.*;
+import java.util.HashSet;
+import java.util.Random;
+import java.util.Set;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
@@ -73,46 +75,46 @@ public abstract class AbstractNeo4jGraphProvider extends AbstractGraphProvider {
         super.loadGraphData(graph, loadGraphWith, testClass, testName);
     }
 
-    private void createIndices(final Neo4jGraph g, final LoadGraphWith.GraphData graphData) {
+    private void createIndices(final Neo4jGraph graph, final LoadGraphWith.GraphData graphData) {
         final Random random = new Random();
-        final int pick = random.nextInt(2);
+        final boolean pick = random.nextBoolean();
         if (graphData.equals(LoadGraphWith.GraphData.GRATEFUL)) {
-            if (pick == 1) {
-                g.tx().readWrite();
+            if (pick) {
+                graph.tx().readWrite();
                 if (random.nextBoolean())
-                    createIndex(g, "CREATE INDEX ON :artist(name)");
+                    graph.cypher("CREATE INDEX ON :artist(name)").iterate();
                 if (random.nextBoolean())
-                    createIndex(g, "CREATE INDEX ON :song(name)");
+                    graph.cypher("CREATE INDEX ON :song(name)").iterate();
                 if (random.nextBoolean())
-                    createIndex(g, "CREATE INDEX ON :song(songType)");
+                    graph.cypher("CREATE INDEX ON :song(songType)").iterate();
                 if (random.nextBoolean())
-                    createIndex(g, "CREATE INDEX ON :song(performances)");
-                g.tx().commit();
+                    graph.cypher("CREATE INDEX ON :song(performances)").iterate();
+                graph.tx().commit();
             } // else no indices
         } else if (graphData.equals(LoadGraphWith.GraphData.MODERN)) {
-            if (pick == 1) {
-                g.tx().readWrite();
+            if (pick) {
+                graph.tx().readWrite();
                 if (random.nextBoolean())
-                    createIndex(g, "CREATE INDEX ON :person(name)");
+                    graph.cypher("CREATE INDEX ON :person(name)").iterate();
                 if (random.nextBoolean())
-                    createIndex(g, "CREATE INDEX ON :person(age)");
+                    graph.cypher("CREATE INDEX ON :person(age)").iterate();
                 if (random.nextBoolean())
-                    createIndex(g, "CREATE INDEX ON :software(name)");
+                    graph.cypher("CREATE INDEX ON :software(name)").iterate();
                 if (random.nextBoolean()) {
-                    createIndex(g, "CREATE INDEX ON :software(lang)");
+                    graph.cypher("CREATE INDEX ON :software(lang)").iterate();
                 }
-                g.tx().commit();
+                graph.tx().commit();
             } // else no indices
         } else if (graphData.equals(LoadGraphWith.GraphData.CLASSIC)) {
-            if (pick == 1) {
-                g.tx().readWrite();
+            if (pick) {
+                graph.tx().readWrite();
                 if (random.nextBoolean())
-                    createIndex(g, "CREATE INDEX ON :vertex(name)");
+                    graph.cypher("CREATE INDEX ON :vertex(name)").iterate();
                 if (random.nextBoolean())
-                    createIndex(g, "CREATE INDEX ON :vertex(age)");
+                    graph.cypher("CREATE INDEX ON :vertex(age)").iterate();
                 if (random.nextBoolean())
-                    createIndex(g, "CREATE INDEX ON :vertex(lang)");
-                g.tx().commit();
+                    graph.cypher("CREATE INDEX ON :vertex(lang)").iterate();
+                graph.tx().commit();
             } // else no indices
         } else {
             // TODO: add CREW work here.
@@ -121,11 +123,6 @@ public abstract class AbstractNeo4jGraphProvider extends AbstractGraphProvider {
         }
     }
 
-    private void createIndex(Neo4jGraph g, String indexQuery) {
-        Iterator<Map<String, Object>> it = g.getBaseGraph().execute(indexQuery, null);
-        while (it.hasNext()) it.next();
-    }
-
     @Override
     public Set<Class> getImplementations() {
         return IMPLEMENTATIONS;