You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2026/03/26 23:29:28 UTC
(tinkerpop) branch neo4j-remove updated (153fc28b37 -> 6cbced322b)
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a change to branch neo4j-remove
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
discard 153fc28b37 Remove neo4j-gremlin module deprecated in 3.7.0
add 06e03bae51 Add GremlinLang number type suffixes and fix Long deserialization in JS GLV (#3340)
add da1619db75 Update order of operation for request interceptor and serialization in gremlin-go (#3358)
add 6861dfa17c CTR updated reference and upgrade docs for go and .net GLVs
new 6cbced322b Remove neo4j-gremlin module deprecated in 3.7.0
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (153fc28b37)
\
N -- N -- N refs/heads/neo4j-remove (6cbced322b)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CHANGELOG.asciidoc | 5 +-
docs/src/reference/gremlin-variants.asciidoc | 319 +++++++--------
docs/src/upgrade/release-4.x.x.asciidoc | 99 +++++
gremlin-go/driver/auth.go | 25 +-
gremlin-go/driver/auth_test.go | 26 +-
gremlin-go/driver/connection.go | 178 ++++----
gremlin-go/driver/connection_test.go | 188 ++++++++-
gremlin-go/driver/interceptor.go | 113 ++++++
gremlin-go/driver/interceptor_test.go | 450 +++++++++++++++++++++
gremlin-go/driver/request.go | 16 +-
gremlin-go/driver/request_test.go | 14 +-
gremlin-go/driver/serializer.go | 6 +-
gremlin-go/driver/serializer_test.go | 10 +-
.../gremlin-javascript/lib/process/gremlin-lang.ts | 15 +-
.../io/binary/internals/LongSerializer.js | 6 +-
.../internals/NumberSerializationStrategy.js | 5 +-
.../test/unit/graphbinary/model-test.js | 6 +-
.../test/unit/graphbinary/model.js | 6 +-
.../test/unit/gremlin-lang-test.js | 36 +-
19 files changed, 1215 insertions(+), 308 deletions(-)
create mode 100644 gremlin-go/driver/interceptor.go
create mode 100644 gremlin-go/driver/interceptor_test.go
(tinkerpop) 01/01: Remove neo4j-gremlin module deprecated in 3.7.0
Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch neo4j-remove
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 6cbced322ba5e62ee43029016197605924c68741
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Thu Mar 26 17:31:54 2026 -0400
Remove neo4j-gremlin module deprecated in 3.7.0
The module was deprecated in TinkerPop 3.7 following community discussion
(https://lists.apache.org/thread/9nlws82q1ydghbjgswb4oj2d4cnp5v5m). Neo4j 3.4
reached EOL in March 2020. This commit removes the module and all references
throughout the codebase: build system, CI, server config, Docker scripts,
documentation, and CHANGELOG. (tinkerpop-0p8)
---
.github/workflows/build-test.yml | 20 +-
CHANGELOG.asciidoc | 1 +
docker/build.sh | 5 +-
docker/scripts/build.sh | 8 +-
docs/site/home/providers.html | 12 -
.../dev/developer/development-environment.asciidoc | 8 +-
docs/src/dev/developer/for-committers.asciidoc | 2 +-
docs/src/reference/gremlin-applications.asciidoc | 24 +-
docs/src/reference/implementations-neo4j.asciidoc | 395 ---------------
docs/src/reference/index.asciidoc | 1 -
docs/src/reference/the-traversal.asciidoc | 26 +-
.../tutorials/the-gremlin-console/index.asciidoc | 1 -
docs/static/images/neo4j-ha.png | Bin 108249 -> 0 bytes
gremlin-console/src/main/bin/gremlin.sh | 2 +-
gremlin-server/conf/gremlin-server-neo4j.yaml | 62 ---
gremlin-server/conf/neo4j-empty.properties | 46 --
.../src/test/scripts/neo4j-empty.properties | 33 --
gremlin-tools/gremlin-coverage/pom.xml | 5 -
neo4j-gremlin/pom.xml | 258 ----------
.../gremlin/neo4j/process/traversal/LabelP.java | 62 ---
.../traversal/step/sideEffect/CypherStartStep.java | 46 --
.../traversal/step/sideEffect/Neo4jGraphStep.java | 163 -------
.../optimization/Neo4jGraphStepStrategy.java | 73 ---
.../neo4j/process/util/Neo4jCypherIterator.java | 66 ---
.../gremlin/neo4j/structure/Neo4jEdge.java | 134 ------
.../gremlin/neo4j/structure/Neo4jElement.java | 83 ----
.../gremlin/neo4j/structure/Neo4jGraph.java | 529 ---------------------
.../neo4j/structure/Neo4jGraphVariables.java | 178 -------
.../gremlin/neo4j/structure/Neo4jHelper.java | 68 ---
.../gremlin/neo4j/structure/Neo4jProperty.java | 96 ----
.../gremlin/neo4j/structure/Neo4jVertex.java | 219 ---------
.../neo4j/structure/Neo4jVertexProperty.java | 139 ------
...g.apache.tinkerpop.gremlin.jsr223.GremlinPlugin | 1 -
.../gremlin/neo4j/AbstractNeo4jGraphProvider.java | 166 -------
.../gremlin/neo4j/AbstractNeo4jGremlinTest.java | 47 --
.../tinkerpop/gremlin/neo4j/NativeNeo4jSuite.java | 49 --
.../gremlin/neo4j/Neo4jGraphFeatureTest.java | 199 --------
.../gremlin/neo4j/Neo4jGraphNativeNeo4jTest.java | 31 --
.../gremlin/neo4j/Neo4jGraphProvider.java | 42 --
.../neo4j/process/NativeNeo4jCypherCheck.java | 226 ---------
.../process/Neo4jGraphProcessStandardTest.java | 33 --
.../optimization/Neo4jGraphStepStrategyTest.java | 139 ------
.../neo4j/structure/NativeNeo4jIndexCheck.java | 275 -----------
.../neo4j/structure/NativeNeo4jStructureCheck.java | 242 ----------
.../structure/Neo4jGraphStructureStandardTest.java | 32 --
.../src/test/resources/cucumber.properties | 1 -
.../src/test/resources/logback-silent.xml | 28 --
neo4j-gremlin/src/test/resources/logback-test.xml | 28 --
pom.xml | 1 -
49 files changed, 34 insertions(+), 4271 deletions(-)
diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index b6e879dbc5..c82b8ad9d7 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -5,7 +5,7 @@ env:
# take care when modifying this list because GLVs use shell commands to remove themselves from this list and
# modifications could break patterns of replacement they are searching for.
EXCLUDE_MODULES: '-:gremlin-dotnet-source,-:gremlin-dotnet-tests,-:gremlin-go,-:gremlin-js,-:gremlin-javascript,-:gremlint,-:gremlin-mcp,-:gremlin-python'
- EXCLUDE_FOR_GLV: '-:gremlin-annotations,-:gremlin-console,-:hadoop-gremlin,-:neo4j-gremlin,-:spark-gremlin,-:sparql-gremlin'
+ EXCLUDE_FOR_GLV: '-:gremlin-annotations,-:gremlin-console,-:hadoop-gremlin,-:spark-gremlin,-:sparql-gremlin'
jobs:
smoke:
name: smoke
@@ -67,7 +67,7 @@ jobs:
- name: Build with Maven
run: |
mvn clean install -pl $EXCLUDE_MODULES -q -DskipTests -Dci
- mvn verify -pl :gremlin-server -DskipTests -DskipIntegrationTests=false -DincludeNeo4j
+ mvn verify -pl :gremlin-server -DskipTests -DskipIntegrationTests=false
cache-gremlin-server-docker-image:
name: cache gremlin-server docker image
timeout-minutes: 10
@@ -329,22 +329,6 @@ jobs:
EXCLUDE="${EXCLUDE_MODULES/-:gremlin-dotnet-source,-:gremlin-dotnet-tests,},$EXCLUDE_FOR_GLV"
mvn clean install -pl $EXCLUDE -q -DskipTests -Dci
mvn verify -pl :gremlin-dotnet,:gremlin-dotnet-tests -P gremlin-dotnet
- neo4j-gremlin:
- name: neo4j-gremlin
- timeout-minutes: 20
- needs: smoke
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v6
- - name: Set up JDK11
- uses: actions/setup-java@v5
- with:
- java-version: '11'
- distribution: 'temurin'
- - name: Build with Maven
- run: |
- mvn clean install -pl $EXCLUDE_MODULES -q -DskipTests -Dci
- mvn verify -pl :neo4j-gremlin -DincludeNeo4j
go:
name: go
timeout-minutes: 20
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 99ab01d415..9fa4ce6d70 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
=== TinkerPop 4.0.0 (NOT OFFICIALLY RELEASED YET)
* Improved number type handling in `gremlin-javascript`: smart GremlinLang type suffixes, `bigint` as BigInteger, and Long deserialization now returns `bigint` for values beyond safe integer range.
+* Removed `neo4j-gremlin` module which was deprecated in 3.7.0.
* Added grammar-based `Translator` for `gremlin-javascript` supporting translation to JavaScript, Python, Go, .NET, Java, Groovy, canonical, and anonymized output.
* Added `translate_gremlin_query` tool to `gremlin-mcp` that translates Gremlin queries to a target language variant, with optional LLM-assisted normalization via MCP sampling for non-canonical input.
* Modified `gremlin-mcp` to support offline mode where utility tools (translate, format) remain available without a configured `GREMLIN_MCP_ENDPOINT`.
diff --git a/docker/build.sh b/docker/build.sh
index 9167fffc24..68f5344240 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -40,12 +40,11 @@ function usage {
"\nBuild the current local TinkerPop project in a Docker container." \
"\nBy default all modules are run. If you prefer to run a specific module then please" \
"\nenter it as an option. Selecting specific modules changes the build to include only" \
- "\nthose selected modules as well as gremlin-server, gremlin-test and neo4j-gremlin (and" \
+ "\nthose selected modules as well as gremlin-server and gremlin-test (and" \
"\ntheir dependencies)." \
"\n\nOptions are:\n" \
"\n\t-t, --tests run standard test suite" \
"\n\t-i, --integration-tests run integration tests" \
- "\n\t-n, --neo4j include Neo4j" \
"\n\t-go, --golang change to minimal build and add gremlin-go to build" \
"\n\t-py, --python change to minimal build and add gremlin-python to build" \
"\n\t-dn, --dotnet change to minimal build and add gremlin-dotnet to build" \
@@ -69,7 +68,6 @@ while [ ! -z "$1" ]; do
case "$1" in
-t | --tests ) ARGS="${ARGS} -t"; RUN_TESTS=true; shift ;;
-i | --integration-tests ) ARGS="${ARGS} -i"; RUN_INTEGRATION_TESTS=true; shift ;;
- -n | --neo4j ) ARGS="${ARGS} -n"; shift ;;
-go | --golang ) ARGS="${ARGS} -go"; INCLUDE_GO=true; shift ;;
-py | --python ) ARGS="${ARGS} -py"; INCLUDE_PYTHON=true; shift ;;
-dn | --dotnet ) ARGS="${ARGS} -dn"; INCLUDE_DOTNET=true; shift ;;
@@ -123,7 +121,6 @@ docker run -p 80:80 ${TINKERPOP_DOCKER_OPTS} ${REMOVE_CONTAINER} \
--mount type=bind,src=$(pwd)/gremlin-server/,dst=/usr/src/tinkerpop/gremlin-server/ \
--mount type=bind,src=$(pwd)/gremlin-test/,dst=/usr/src/tinkerpop/gremlin-test/ \
--mount type=bind,src=$(pwd)/gremlin-console/,dst=/usr/src/tinkerpop/gremlin-console/ \
- --mount type=bind,src=$(pwd)/neo4j-gremlin/,dst=/usr/src/tinkerpop/neo4j-gremlin/ \
tinkerpop:${BUILD_TAG}
check_status
diff --git a/docker/scripts/build.sh b/docker/scripts/build.sh
index 0de202ba6c..8831a3de3c 100755
--- a/docker/scripts/build.sh
+++ b/docker/scripts/build.sh
@@ -20,7 +20,6 @@
RUN_TESTS=
RUN_INTEGRATION_TESTS=
-INCLUDE_NEO4J=
BUILD_JAVA_DOCS=
BUILD_USER_DOCS=
INCLUDE_GO=
@@ -33,7 +32,6 @@ while [ ! -z "$1" ]; do
case "$1" in
-t | --tests ) RUN_TESTS=true; shift ;;
-i | --integration-tests ) RUN_INTEGRATION_TESTS=true; shift ;;
- -n | --neo4j ) INCLUDE_NEO4J=true; shift ;;
-j | --java-docs ) BUILD_JAVA_DOCS=true; shift ;;
-d | --docs ) BUILD_USER_DOCS=true; shift ;;
-go | --golang ) INCLUDE_GO=true; shift ;;
@@ -49,14 +47,13 @@ TINKERPOP_BUILD_OPTIONS="-DskipImageBuild -P -glv-js,-glv-go,-glv-python"
[ -z "${RUN_TESTS}" ] && TINKERPOP_BUILD_OPTIONS="${TINKERPOP_BUILD_OPTIONS} -DskipTests"
[ -z "${RUN_INTEGRATION_TESTS}" ] || TINKERPOP_BUILD_OPTIONS="${TINKERPOP_BUILD_OPTIONS} -DskipIntegrationTests=false"
-[ -z "${INCLUDE_NEO4J}" ] || TINKERPOP_BUILD_OPTIONS="${TINKERPOP_BUILD_OPTIONS} -DincludeNeo4j"
[ -z "${BUILD_JAVA_DOCS}" ] && TINKERPOP_BUILD_OPTIONS="${TINKERPOP_BUILD_OPTIONS} -Dmaven.javadoc.skip=true"
# If any of these GLVs are selected then create a minimal build to reduce build/test times
# as the user is likely not interested in the other modules.
if [[ -n ${INCLUDE_GO} || -n ${INCLUDE_PYTHON} || -n ${INCLUDE_DOTNET} || -n ${INCLUDE_JAVASCRIPT} || -n ${INCLUDE_CONSOLE} ]]; then
- # gremlin-server, gremlin-test and neo4j-gremlin are minimal dependencies needed to start a server for GLV testing.
- TINKERPOP_BUILD_OPTIONS="${TINKERPOP_BUILD_OPTIONS} -am -pl gremlin-server,gremlin-test,neo4j-gremlin"
+ # gremlin-server and gremlin-test are minimal dependencies needed to start a server for GLV testing.
+ TINKERPOP_BUILD_OPTIONS="${TINKERPOP_BUILD_OPTIONS} -am -pl gremlin-server,gremlin-test"
[ -n "${INCLUDE_GO}" ] && TINKERPOP_BUILD_OPTIONS="${TINKERPOP_BUILD_OPTIONS},gremlin-go"
[ -n "${INCLUDE_PYTHON}" ] && TINKERPOP_BUILD_OPTIONS="${TINKERPOP_BUILD_OPTIONS},gremlin-python"
@@ -118,7 +115,6 @@ if [ ! -z "${BUILD_USER_DOCS}" ]; then
# build docs
mkdir -p ~/.groovy
cp docker/resources/groovy/grapeConfig.xml ~/.groovy/
- rm -rf /tmp/neo4j
grep -l 'http://tinkerpop.apache.org/docs/x.y.z' $(find docs/src -name "*.asciidoc" | grep -v '^.docs/src/upgrade/') | xargs sed -i 's@http://tinkerpop.apache.org/docs/x.y.z@/docs/x.y.z@g'
bin/process-docs.sh || exit 1
diff --git a/docs/site/home/providers.html b/docs/site/home/providers.html
index 9f12c459b2..c868b6b343 100644
--- a/docs/site/home/providers.html
+++ b/docs/site/home/providers.html
@@ -575,18 +575,6 @@ under the License.
</div>
</div>
- <div class="col-md-6 col-lg-4">
- <div class="uc-box">
- <div class="d-flex align-items-start">
- <img src="img/providers/16.png " class="img-fluid mb-3" alt="img">
- <div class="text-start ms-3">
- <a class="ft-18 bold text-blue" href="https://tinkerpop.apache.org/docs/current/reference/#neo4j-gremlin">Neo4j</a>
- <p class="mb-0 mt-2">OLTP graph database (embedded and high availability).</p>
- </div>
- </div>
- </div>
- </div>
-
<div class="col-md-6 col-lg-4">
<div class="uc-box">
<div class="d-flex align-items-start">
diff --git a/docs/src/dev/developer/development-environment.asciidoc b/docs/src/dev/developer/development-environment.asciidoc
index 9b5dd3d117..ff38b346b6 100644
--- a/docs/src/dev/developer/development-environment.asciidoc
+++ b/docs/src/dev/developer/development-environment.asciidoc
@@ -507,7 +507,6 @@ 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 toy graph 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`)
* Start Gremlin Server with Docker using the standard test configuration: `docker/gremlin-server.sh`
@@ -525,8 +524,6 @@ mvn -Dmaven.javadoc.skip=true --projects tinkergraph-gremlin test
* Check the effective `pom.xml`: `mvn -pl gremlin-python -Pglv-python help:effective-pom -Doutput=withProfilePom.xml`
* Deploy JavaDocs/AsciiDocs: `bin/publish-docs.sh svn-username`
* Integration Tests: `mvn verify -DskipIntegrationTests=false`
-** Execute with the `-DincludeNeo4j` option to include neo4j-gremlin tests. Transactional tests on Gremlin Server,
-Gremlin Driver, and GLVs will run automatically with integration tests against the `TinkerTransactionGraph`.
** Execute with the `-DuseEpoll` option to try to use Netty native transport (works on Linux, but will fallback to Java NIO on other OS).
* Benchmarks: `mvn verify -DskipBenchmarks=false`
** Reports are generated to the console and to `gremlin-tools/gremlin-benchmark/target/reports/benchmark`.
@@ -584,7 +581,7 @@ By default, this script will run every module in the project. However, if you ar
small set of the modules (e.g. the GLVs) then you can use the script options to reduce the modules included by
specifically selecting which modules you want. This behavior is currently supported for the non-Java GLVs and
gremlin-console. This option will include only the selected modules as well as gremlin-server, gremlin-test,
-neo4j-gremlin and all their dependencies. This is the minimum set of modules required to build and test the GLVs.
+and all their dependencies. This is the minimum set of modules required to build and test the GLVs.
[source,bash]
.Build and test gremlin-python and gremlin-go with minimal Gremlin Server dependencies
@@ -747,9 +744,6 @@ that the `jsr223` classes `__`, ``CredentialTraversal`, `CredentialTraversalSour
cannot be found. Those classes are generated by annotations. To fix these errors, make sure mark the
directory `gremlin-groovy/target/generated-sources/annotations` as "Generated Sources Root".
-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.
-
=== Debugging
It is generally assumed that JVM-based debugging of TinkerPop code in Intellij is a relatively straightforward task
diff --git a/docs/src/dev/developer/for-committers.asciidoc b/docs/src/dev/developer/for-committers.asciidoc
index d6aada0091..7101836c90 100644
--- a/docs/src/dev/developer/for-committers.asciidoc
+++ b/docs/src/dev/developer/for-committers.asciidoc
@@ -279,7 +279,7 @@ can cause problems for some graph providers.
* Tests that are designed to use a `GraphProvider` implementation in conjunction with `AbstractGremlinTest` _and_ are
in the `/test` directory should not be named with `Test` as the suffix, as this will cause them to execute in some
environments without a `GraphProvider` being initialized by a suite. These types of tests should be suffixed with
-`Check` instead. Please see link:https://github.com/apache/tinkerpop/blob/e32a4187e4f25e290aabe14007f9087c48a06521/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureCheck.java[NativeNeo4jStructureCheck]
+`Check` instead. Please see link:https://github.com/apache/tinkerpop/blob/master/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/structure/io/SparkIoRegistryCheck.java[SparkIoRegistryCheck]
for an example.
[[gremlin-language-test-cases]]
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 00527c8ac2..ace1db5ae3 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -231,21 +231,21 @@ gremlin> :plugin list <1>
==>tinkerpop.tinkergraph[active]
gremlin> :plugin use tinkerpop.sugar <2>
==>tinkerpop.sugar activated
-gremlin> :install org.apache.tinkerpop neo4j-gremlin x.y.z <3>
-==>loaded: [org.apache.tinkerpop, neo4j-gremlin, x.y.z]
+gremlin> :install org.apache.tinkerpop hadoop-gremlin x.y.z <3>
+==>loaded: [org.apache.tinkerpop, hadoop-gremlin, x.y.z]
gremlin> :plugin list <4>
==>tinkerpop.server[active]
==>tinkerpop.utilities[active]
-==>tinkerpop.sugar
+==>tinkerpop.sugar[active]
==>tinkerpop.tinkergraph[active]
-==>tinkerpop.neo4j
-gremlin> :plugin use tinkerpop.neo4j <5>
-==>tinkerpop.neo4j activated
+==>tinkerpop.hadoop
+gremlin> :plugin use tinkerpop.hadoop <5>
+==>tinkerpop.hadoop activated
gremlin> :plugin list <6>
==>tinkerpop.server[active]
==>tinkerpop.sugar[active]
==>tinkerpop.utilities[active]
-==>tinkerpop.neo4j[active]
+==>tinkerpop.hadoop[active]
==>tinkerpop.tinkergraph[active]
----
@@ -254,9 +254,9 @@ the Console classpath. Plugins need to be "active" for their features to be ava
<2> To make a plugin "active" execute the `:plugin use` command and specify the name of the plugin to enable.
<3> Sometimes there are external dependencies that would be useful within the Console. To bring those in, execute
`:install` and specify the Maven coordinates for the dependency.
-<4> Note that there is a "tinkerpop.neo4j" plugin available, but it is not yet "active".
-<5> Again, to use the "tinkerpop.neo4j" plugin, it must be made "active" with `:plugin use`.
-<6> Now when the plugin list is displayed, the "tinkerpop.neo4j" plugin is displayed as "active".
+<4> Note that there is a "tinkerpop.hadoop" plugin available, but it is not yet "active".
+<5> Again, to use the "tinkerpop.hadoop" plugin, it must be made "active" with `:plugin use`.
+<6> Now when the plugin list is displayed, the "tinkerpop.hadoop" plugin is displayed as "active".
WARNING: Plugins must be compatible with the version of the Gremlin Console (or Gremlin Server) being used. Attempts
to use incompatible versions cannot be guaranteed to work. Moreover, be prepared for dependency conflicts in
@@ -741,11 +741,11 @@ string argument with by setting the `language` key.
The `gremlin-server.sh` file serves multiple purposes. It can be used to "install" dependencies to the Gremlin
Server path. For example, to be able to configure and use other `Graph` implementations, the dependencies must be
made available to Gremlin Server. To do this, use the `install` switch and supply the Maven coordinates for the
-dependency to "install". For example, to use Neo4j in Gremlin Server:
+dependency to "install". For example, to use Hadoop in Gremlin Server:
[source,text]
----
-bin/gremlin-server.sh install org.apache.tinkerpop neo4j-gremlin x.y.z
+bin/gremlin-server.sh install org.apache.tinkerpop hadoop-gremlin x.y.z
----
This command will "grab" the appropriate dependencies and copy them to the `ext` directory of Gremlin Server, which
diff --git a/docs/src/reference/implementations-neo4j.asciidoc b/docs/src/reference/implementations-neo4j.asciidoc
deleted file mode 100644
index 633503a8d8..0000000000
--- a/docs/src/reference/implementations-neo4j.asciidoc
+++ /dev/null
@@ -1,395 +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.
-////
-[[neo4j-gremlin]]
-== Neo4j-Gremlin (Deprecated)
-
-WARNING: Deprecated: Neo4j-Gremlin is not compatible with versions of Neo4j beyond 3.4 (Reached End of Life March 31, 2020).
-For this reason, use of Neo4j-Gremlin is not recommended for production environments. Neo4j-Gremlin is expected to
-remain compatible with upcoming releases of TinkerPop, however long term support is not guaranteed. Neo4j-Gremlin may
-be dropped from future versions of TinkerPop if compatibility cannot reasonably be maintained. Alternative TinkerPop
-enabled graph providers can be found on the link:https://tinkerpop.apache.org/providers.html[TinkerPop site].
-
-WARNING: Neo4j-Gremlin can work with JDK17, but requires the use of the `--add-opens` flag to be provided to the JVM
-as follows: `--add-opens=java.base/sun.nio.ch=ALL-UNNAMED`.
-
-[source,xml]
-----
-<dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>neo4j-gremlin</artifactId>
- <version>x.y.z</version>
-</dependency>
-<!-- neo4j-tinkerpop-api-impl is NOT Apache 2 licensed - more information below -->
-<!-- supports Neo4j 3.4.11 -->
-<dependency>
- <groupId>org.neo4j</groupId>
- <artifactId>neo4j-tinkerpop-api-impl</artifactId>
- <version>0.9-3.4.0</version>
-</dependency>
-----
-
-link:http://neo4j.com[Neo4j, Inc.] are the developers of the OLTP-based link:http://neo4j.com[Neo4j graph database].
-
-WARNING: Unless under a commercial agreement with Neo4j, Inc., Neo4j is licensed
-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 its implementation). Note that neither the
-<<gremlin-console,Gremlin Console>> nor <<gremlin-server,Gremlin Server>> distribute with the Neo4j implementation
-binaries. To access the binaries, use the `:install` command to download binaries from
-link:http://search.maven.org/[Maven Central Repository].
-
-IMPORTANT: When connecting to existing Neo4j databases, ensure that this database is compatible with the version of
-Neo4j that TinkerPop currently supports in the `neo4j-tinkerpop-api-impl`.
-
-TIP: For configuring Grape, the dependency resolver of Groovy, please refer to the <<gremlin-applications,Gremlin Applications>> section.
-
-[source,groovy]
-----
-gremlin> :install 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> graph = Neo4jGraph.open('/tmp/neo4j')
-==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
-----
-
-TIP: To host Neo4j in <<gremlin-server,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 install org.apache.tinkerpop neo4j-gremlin x.y.z`. Once installed, the Gremlin Server
-configuration file must be edited to include the `Neo4jGremlinPlugin` as shown in `conf/gremlin-server-neo4j.yaml`.
-
-=== Indices
-
-Neo4j 2.x indices leverage vertex labels to partition the index space. TinkerPop 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: `Neo4jGraphStep` will attempt to discern which indices to use when executing a traversal of the form `g.V().has()`.
-
-The Gremlin-Console session below demonstrates Neo4j indices. For more information, please refer to the Neo4j documentation:
-
-* Manipulating indices with link:http://neo4j.com/docs/developer-manual/current/#query-schema-index[Cypher].
-* Manipulating indices with the Neo4j link:http://neo4j.com/docs/stable/tutorials-java-embedded-new-index.html[Java API].
-
-[source,groovy]
-----
-gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
-==>neo4jgraph[community single [/tmp/neo4j]]
-gremlin> g = traversal().withEmbedded(graph)
-==>graphtraversalsource[neo4jgraph[community single [/tmp/neo4j]], standard]
-gremlin> graph.cypher("CREATE INDEX ON :person(name)")
-gremlin> graph.tx().commit() //// (1)
-==>null
-gremlin> g.addV('person').property('name','marko')
-==>v[0]
-gremlin> g.addV('dog').property('name','puppy')
-==>v[1]
-gremlin> g.V().hasLabel('person').has('name','marko').values('name')
-==>marko
-gremlin> graph.close()
-==>null
-----
-
-<1> Schema mutations must happen in a different transaction 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]
-----
-gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
-==>neo4jgraph[community single [/tmp/neo4j]]
-gremlin> g = traversal().withEmbedded(graph)
-==>graphtraversalsource[neo4jgraph[community single [/tmp/neo4j]], standard]
-gremlin> g.io('data/grateful-dead.xml').read().iterate()
-gremlin> g.tx().commit()
-==>null
-gremlin> clock(1000) {g.V().hasLabel('artist').has('name','Garcia').iterate()} //// (1)
-==>0.35031228
-gremlin> graph.cypher("CREATE INDEX ON :artist(name)") //// (2)
-gremlin> g.tx().commit()
-==>null
-gremlin> Thread.sleep(5000) //// (3)
-==>null
-gremlin> clock(1000) {g.V().hasLabel('artist').has('name','Garcia').iterate()} //// (4)
-==>0.061846079
-gremlin> clock(1000) {g.V().has('name','Garcia').iterate()} //// (5)
-==>0.6680353569999999
-gremlin> graph.cypher("DROP INDEX ON :artist(name)") //// (6)
-gremlin> g.tx().commit()
-==>null
-gremlin> graph.close()
-==>null
-----
-
-<1> Find all artists whose name is Garcia which does a linear scan of the artist vertex-label partition.
-<2> Create an index for all artist vertices on their name property.
-<3> Neo4j indices are eventually consistent so this stalls to give the index time to populate itself.
-<4> Find all artists whose name is Garcia which uses the pre-defined schema index.
-<5> Find all vertices whose name is Garcia which requires a linear scan of all the data in the graph.
-<6> Drop the created index.
-
-=== Cypher
-
-image::gremlin-loves-cypher.png[width=400]
-
-NeoTechnology are the creators of the graph pattern-match query language link:https://neo4j.com/developer/cypher-query-language/[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[community single [/tmp/neo4j]]
-gremlin> g = traversal().withEmbedded(graph)
-==>graphtraversalsource[neo4jgraph[community single [/tmp/neo4j]], standard]
-gremlin> g.io('data/tinkerpop-modern.kryo').read().iterate()
-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')
-==>josh
-==>vadas
-gremlin> graph.close()
-==>null
-----
-
-Thus, like <<match-step,`match()`>>-step in Gremlin, it is possible to do a declarative pattern match and then move
-back into imperative Gremlin.
-
-TIP: 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
-
-TinkerPop 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/developer-manual/current/#graphdb-neo4j-labels[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(String label) // add a label to the vertex
-public void removeLabel(String label) // remove a label from the vertex
-
-An example use case is presented below.
-
-[source,groovy]
-----
-gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
-==>neo4jgraph[community single [/tmp/neo4j]]
-gremlin> g = traversal().withEmbedded(graph)
-==>graphtraversalsource[neo4jgraph[community single [/tmp/neo4j]], standard]
-gremlin> vertex = (Neo4jVertex) g.addV('human::animal').next() //// (1)
-==>v[0]
-gremlin> vertex.label() //// (2)
-==>animal::human
-gremlin> vertex.labels() //// (3)
-==>animal
-==>human
-gremlin> vertex.addLabel('organism') //// (4)
-==>null
-gremlin> vertex.label()
-==>animal::human::organism
-gremlin> vertex.removeLabel('human') //// (5)
-==>null
-gremlin> vertex.labels()
-==>animal
-==>organism
-gremlin> vertex.addLabel('organism') //// (6)
-==>null
-gremlin> vertex.labels()
-==>animal
-==>organism
-gremlin> vertex.removeLabel('human') //// (7)
-==>null
-gremlin> vertex.label()
-==>animal::organism
-gremlin> g.V().has(label,'organism') //// (8)
-gremlin> g.V().has(label,of('organism')) //// (9)
-==>v[0]
-gremlin> g.V().has(label,of('organism')).has(label,of('animal'))
-==>v[0]
-gremlin> g.V().has(label,of('organism').and(of('animal')))
-==>v[0]
-gremlin> graph.close()
-==>null
-----
-
-<1> Typecasting to a `Neo4jVertex` is only required in Java.
-<2> The standard `Vertex.label()` method returns all the labels in alphabetical order concatenated using `::`.
-<3> `Neo4jVertex.labels()` method returns the individual labels as a set.
-<4> `Neo4jVertex.addLabel()` method adds a single label.
-<5> `Neo4jVertex.removeLabel()` method removes a single label.
-<6> Labels are unique and thus duplicate labels don't exist.
-<7> If a label that does not exist is removed, nothing happens.
-<8> `P.eq()` does a full string match and should only be used if multi-labels are not leveraged.
-<9> `LabelP.of()` is specific to `Neo4jGraph` and used for multi-label matching.
-
-IMPORTANT: `LabelP.of()` is only required if multi-labels are leveraged. `LabelP.of()` is used when
-filtering/looking-up vertices by their label(s) as the standard `P.eq()` does a direct match on the `::`-representation
-of `vertex.label()`
-
-=== Configuration
-
-The previous examples showed how to create a `Neo4jGraph` with the default configuration, but Neo4j has many other
-options to initialize it that are native to Neo4j. In order to expose those, `Neo4jGraph` has an `open(Configuration)`
-method which takes a standard Apache Configuration object. The same can be said of the standard method for creating
-`Graph` instances with `GraphFactory`. Each configuration key that Neo4j has must simply be prefixed with
-`gremlin.neo4j.conf.` and the suffix configuration key will be passed through to Neo4j.
-
-NOTE: Gremlin Server uses `GraphFactory` to instantiate the `Graph` instances it manages, so the example below is also
-relevant for that purpose as well.
-
-For example, a standard configuration file called `neo4j.properties` that sets the Neo4j
-`dbms.index_sampling.background_enabled` setting might look like:
-
-[source,properties]
-----
-gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
-gremlin.neo4j.directory=/tmp/neo4j
-gremlin.neo4j.conf.dbms.index_sampling.background_enabled=true
-----
-
-which can then be used as follows:
-
-[source,text]
-----
-gremlin> graph = GraphFactory.open('neo4j.properties')
-==>neo4jgraph[community single [/tmp/neo4j]]
-gremlin> g = traversal().with(graph)
-==>graphtraversalsource[neo4jgraph[community single [/tmp/neo4j]], standard]
-----
-
-Having this ability to set standard Neo4j configurations makes it possible to better control the initialization of
-Neo4j itself and provides the ability to enable certain features that would not otherwise be accessible.
-
-=== Bolt Configuration
-
-While `Neo4jGraph` enables Gremlin based queries, users may find it helpful to also be able to connect to that graph
-with native Neo4j drivers and other tools from that space. It is possible to enable the
-link:https://boltprotocol.org/[Bolt Protocol] as a way to do this:
-
-[source,properties]
-----
-gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
-gremlin.neo4j.directory=/tmp/neo4j
-gremlin.neo4j.conf.dbms.connector.0.type=BOLT
-gremlin.neo4j.conf.dbms.connector.0.enabled=true
-gremlin.neo4j.conf.dbms.connector.0.address=localhost:7687
-----
-
-This configuration is especially relevant to Gremlin Server where one might want to connect to the same graph instance
-with both Gremlin and Cypher.
-
-[source,text]
-----
-gremlin> :install org.neo4j.driver neo4j-java-driver 1.7.2
-==>Loaded: [org.neo4j.driver, neo4j-java-driver, 1.7.2]
-... // restart Gremlin Console
-gremlin> import org.neo4j.driver.v1.*
-==>org.apache.tinkerpop.gremlin.structure.*, org.apache.tinkerpop.gremlin.structure.util.*, ... org.neo4j.driver.v1.*
-gremlin> driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic("neo4j", "neo4j"))
-Oct 28, 2019 3:28:20 PM org.neo4j.driver.internal.logging.JULogger info
-INFO: Direct driver instance 1385140107 created for server address localhost:7687
-==>org.neo4j.driver.internal.InternalDriver@528f8f8b
-gremlin> session = driver.session()
-==>org.neo4j.driver.internal.NetworkSession@f3fcd59
-gremlin> session.run( "CREATE (a:person {name: {name}, age: {age}})",
-......1> Values.parameters("name", "stephen", "age", 29))
-gremlin> :remote connect tinkerpop.server conf/remote.yaml
-==>Configured localhost/127.0.0.1:8182
-gremlin> :remote console
-==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
-gremlin> g.V().elementMap()
-==>{id=0, label=person, name=stephen, age=29}
-----
-
-=== High Availability Configuration
-
-image:neo4j-ha.png[width=400,float=right] TinkerPop supports running Neo4j with its fault tolerant master-slave
-replication configuration, referred to as its
-link:http://neo4j.com/docs/operations-manual/current/#_neo4j_cluster_install[High Availability (HA) cluster]. From the
-TinkerPop perspective, configuring for HA is not that different than configuring for embedded mode as shown above. The
-main difference is the usage of HA configuration options that enable the cluster. Once connected to a cluster, usage
-from the TinkerPop perspective is largely the same.
-
-In configuring for HA the most important thing to realize is that all Neo4j HA settings are simply passed through the
-TinkerPop configuration settings given to the `GraphFactory.open()` or `Neo4j.open()` methods. For example, to
-provide the all-important `ha.server_id` configuration option through TinkerPop, simply prefix that key with the
-TinkerPop Neo4j key of `gremlin.neo4j.conf`.
-
-The following properties demonstrates one of the three configuration files required to setup a simple three node HA
-cluster on the same machine instance:
-
-[source,properties]
-----
-gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
-gremlin.neo4j.directory=/tmp/neo4j.server1
-gremlin.neo4j.conf.ha.server_id=1
-gremlin.neo4j.conf.ha.initial_hosts=localhost:5001\,localhost:5002\,localhost:5003
-gremlin.neo4j.conf.ha.host.coordination=localhost:5001
-gremlin.neo4j.conf.ha.host.data=localhost:6001
-----
-
-Assuming the intent is to configure this cluster completely within TinkerPop (perhaps within three separate Gremlin
-Server instances), the other two configuration files will be quite similar. The second will be:
-
-[source,properties]
-----
-gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
-gremlin.neo4j.directory=/tmp/neo4j.server2
-gremlin.neo4j.conf.ha.server_id=2
-gremlin.neo4j.conf.ha.initial_hosts=localhost:5001\,localhost:5002\,localhost:5003
-gremlin.neo4j.conf.ha.host.coordination=localhost:5002
-gremlin.neo4j.conf.ha.host.data=localhost:6002
-----
-
-and the third will be:
-
-[source,properties]
-----
-gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
-gremlin.neo4j.directory=/tmp/neo4j.server3
-gremlin.neo4j.conf.ha.server_id=3
-gremlin.neo4j.conf.ha.initial_hosts=localhost:5001\,localhost:5002\,localhost:5003
-gremlin.neo4j.conf.ha.host.coordination=localhost:5003
-gremlin.neo4j.conf.ha.host.data=localhost:6003
-----
-
-IMPORTANT: The backslashes in the values provided to `gremlin.neo4j.conf.ha.initial_hosts` prevent that configuration
-setting as being interpreted as a `List`.
-
-Create three separate Gremlin Server configuration files and point each at one of these Neo4j files. Since these Gremlin
-Server instances will be running on the same machine, ensure that each Gremlin Server instance has a unique `port`
-setting in that Gremlin Server configuration file. Start each Gremlin Server instance to bring the HA cluster online.
-
-NOTE: `Neo4jGraph` instances will block until all nodes join the cluster.
-
-Neither Gremlin Server nor Neo4j will share transactions across the cluster. Be sure to either use Gremlin Server
-managed transactions or, if using a session without that option, ensure that all requests are being routed to the
-same server.
-
-This example discussed use of Gremlin Server to demonstrate the HA configuration, but it is also easy to setup with
-three Gremlin Console instances. Simply start three Gremlin Console instances and use `GraphFactory` to read those
-configuration files to form the cluster. Furthermore, keep in mind that it is possible to have a Gremlin Console join
-a cluster handled by two Gremlin Servers or Neo4j Enterprise. The only limits as to how the configuration can be
-utilized are prescribed by Neo4j itself. Please refer to their
-link:http://neo4j.com/docs/operations-manual/current/#ha-setup-tutorial[documentation] for more information on how
-this feature works.
diff --git a/docs/src/reference/index.asciidoc b/docs/src/reference/index.asciidoc
index 98f50906a9..80f1112d2a 100644
--- a/docs/src/reference/index.asciidoc
+++ b/docs/src/reference/index.asciidoc
@@ -41,7 +41,6 @@ include::gremlin-variants.asciidoc[]
include::implementations-intro.asciidoc[]
include::implementations-tinkergraph.asciidoc[]
-include::implementations-neo4j.asciidoc[]
// the hadoop section is split into parts because of serialization issues that are encountered when trying
// to generate graph/spark without restarting the console and currently the only way to force a restart of the
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 2c665a96fe..71ae0c15db 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -211,8 +211,8 @@ IMPORTANT: As transactions are `ThreadLocal` in nature, so are the transaction c
`onClose`.
Once there is an understanding for how transactions are configured, most of the rest of the `Transaction` interface
-is self-explanatory. Note that <<neo4j-gremlin,Neo4j-Gremlin>> is used for the examples to follow as TinkerGraph does
-not support transactions.
+is self-explanatory. Note that `TinkerTransactionGraph` is used for the examples to follow as standard `TinkerGraph`
+does not support transactions.
IMPORTANT: The following example is meant to demonstrate specific use of `ThreadLocal` transactions and is at odds
with the more generalized transaction convention that is recommended for both embedded and remote contexts. Please be
@@ -221,39 +221,39 @@ using this method.
[source,groovy]
----
-gremlin> graph = Neo4jGraph.open('/tmp/neo4j')
-==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
+gremlin> graph = TinkerTransactionGraph.open()
+==>tinkertransactiongraph[vertices:0 edges:0]
gremlin> g = traversal().with(graph)
-==>graphtraversalsource[neo4jgraph[community single [/tmp/neo4j]], standard]
+==>graphtraversalsource[tinkertransactiongraph[vertices:0 edges:0], standard]
gremlin> graph.features()
==>FEATURES
> GraphFeatures
>-- Transactions: true <1>
>-- Computer: false
->-- Persistence: true
+>-- Persistence: false
...
gremlin> g.tx().onReadWrite(Transaction.READ_WRITE_BEHAVIOR.AUTO) <2>
-==>org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph$Neo4jTransaction@1c067c0d
-gremlin> g.addV("person").("name","stephen") <3>
+==>org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerTransactionGraph$TinkerTransaction@1c067c0d
+gremlin> g.addV("person").property("name","stephen") <3>
==>v[0]
gremlin> g.tx().commit() <4>
==>null
gremlin> g.tx().onReadWrite(Transaction.READ_WRITE_BEHAVIOR.MANUAL) <5>
-==>org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph$Neo4jTransaction@1c067c0d
+==>org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerTransactionGraph$TinkerTransaction@1c067c0d
gremlin> g.tx().isOpen()
==>false
-gremlin> g.addV("person").("name","marko") <6>
+gremlin> g.addV("person").property("name","marko") <6>
Open a transaction before attempting to read/write the transaction
gremlin> g.tx().open() <7>
==>null
-gremlin> g.addV("person").("name","marko") <8>
+gremlin> g.addV("person").property("name","marko") <8>
==>v[1]
gremlin> g.tx().commit()
==>null
----
<1> Check `features` to ensure that the graph supports transactions.
-<2> By default, `Neo4jGraph` is configured with "automatic" transactions, so it is set here for demonstration purposes only.
+<2> By default, `TinkerTransactionGraph` is configured with "automatic" transactions, so it is set here for demonstration purposes only.
<3> When the vertex is added, the transaction is automatically started. From this point, more mutations can be staged
or other read operations executed in the context of that open transaction.
<4> Calling `commit` finalizes the transaction.
@@ -2417,7 +2417,7 @@ serialization package for the JVM. Gremlin-Kryo is a binary `Graph` serializatio
languages. It is designed to be space efficient, non-lossy and is promoted as the standard format to use when working
with graph data inside of the TinkerPop stack. A list of common use cases is presented below:
-* Migration from one Gremlin Structure implementation to another (e.g. `TinkerGraph` to `Neo4jGraph`)
+* Migration from one Gremlin Structure implementation to another (e.g. `TinkerGraph` to `JanusGraph`)
* Serialization of individual graph elements to be sent over the network to another JVM.
* Backups of in-memory graphs or subgraphs.
diff --git a/docs/src/tutorials/the-gremlin-console/index.asciidoc b/docs/src/tutorials/the-gremlin-console/index.asciidoc
index bf1bb88db1..195ba630ad 100644
--- a/docs/src/tutorials/the-gremlin-console/index.asciidoc
+++ b/docs/src/tutorials/the-gremlin-console/index.asciidoc
@@ -561,7 +561,6 @@ other libraries into the console with the `:install` command. With `:install`, y
coordinates (i.e. group, artifact, and version) of a library to have it automatically downloaded from a Maven
repository and placed into the console classpath. If you have read through the reference documentation, you would find
a number of examples of `:install` usage to bring in unbundled TinkerPop libraries, like
-link:https://tinkerpop.apache.org/docs/x.y.z/reference/#neo4j-gremlin[neo4j-gremlin] or
link:https://tinkerpop.apache.org/docs/x.y.z/reference/#hadoop-gremlin[hadoop-gremlin].
IMPORTANT: Before you use the `:install` command, please be sure to read the reference documentation on
diff --git a/docs/static/images/neo4j-ha.png b/docs/static/images/neo4j-ha.png
deleted file mode 100644
index b21393c6d1..0000000000
Binary files a/docs/static/images/neo4j-ha.png and /dev/null differ
diff --git a/gremlin-console/src/main/bin/gremlin.sh b/gremlin-console/src/main/bin/gremlin.sh
index b4c50f829a..2cd33cbc04 100755
--- a/gremlin-console/src/main/bin/gremlin.sh
+++ b/gremlin-console/src/main/bin/gremlin.sh
@@ -108,7 +108,7 @@ if [ -n "$SCRIPT_DEBUG" ]; then
set -x
fi
-# Try to detect JDK version and add specific flag for JDK 17 to allow use of neo4j-gremlin
+# Detect JDK version and add specific flags for JDK 17
JAVA_VERSION=$($JAVA -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ "$JAVA_VERSION" == 17* ]]; then
JVM_OPTS+=( "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED" )
diff --git a/gremlin-server/conf/gremlin-server-neo4j.yaml b/gremlin-server/conf/gremlin-server-neo4j.yaml
deleted file mode 100644
index e11500a6b8..0000000000
--- a/gremlin-server/conf/gremlin-server-neo4j.yaml
+++ /dev/null
@@ -1,62 +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.
-
-# Note that TinkerPop does not include Neo4j dependencies in its
-# distributions. This file cannot be used as a configuration file to
-# Gremlin Server unless Neo4j dependencies are installed on the
-# Gremlin Server path with:
-#
-# bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin x.y.z
-#
-# Note that unless under a commercial agreement with Neo4j, Inc.,
-# Neo4j is licensed AGPL.
-
-host: localhost
-port: 8182
-evaluationTimeout: 30000
-channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
-graphs: {
- graph: conf/neo4j-empty.properties}
-scriptEngines: {
- gremlin-lang: {},
- gremlin-groovy: {
- plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
- org.apache.tinkerpop.gremlin.neo4j.jsr223.Neo4jGremlinPlugin: {},
- org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
- org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}}
-serializers:
- - { className: org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV3, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3] }} # application/json
- - { className: org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1 } # application/vnd.graphbinary-v1.0
- - { className: org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1, config: { serializeResultToString: true }} # application/vnd.graphbinary-v1.0-stringd
-metrics: {
- consoleReporter: {enabled: true, interval: 180000},
- csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
- jmxReporter: {enabled: true},
- slf4jReporter: {enabled: true, interval: 180000}}
-strictTransactionManagement: false
-idleConnectionTimeout: 0
-keepAliveInterval: 0
-maxInitialLineLength: 4096
-maxHeaderSize: 8192
-maxChunkSize: 8192
-maxRequestContentLength: 10485760
-maxAccumulationBufferComponents: 1024
-resultIterationBatchSize: 64
-writeBufferLowWaterMark: 32768
-writeBufferHighWaterMark: 65536
-ssl: {
- enabled: false}
diff --git a/gremlin-server/conf/neo4j-empty.properties b/gremlin-server/conf/neo4j-empty.properties
deleted file mode 100644
index 53dfe271e9..0000000000
--- a/gremlin-server/conf/neo4j-empty.properties
+++ /dev/null
@@ -1,46 +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.
-
-# This is a sample configuration file for Neo4j. Note that
-# TinkerPop does not include Neo4j dependencies in its
-# distributions. To use this file, please ensure that Neo4j
-# dependencies are installed into Gremlin Server's path
-# with:
-#
-# gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin 3.y.z
-#
-# Note that unless under a commercial agreement with Neo4j, Inc.,
-# Neo4j is licensed AGPL.
-
-
-gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
-gremlin.neo4j.directory=/tmp/neo4j
-gremlin.neo4j.conf.dbms.auto_index.nodes.enabled=true
-#gremlin.neo4j.conf.dbms.auto_index.nodes.keys=
-gremlin.neo4j.conf.dbms.auto_index.relationships.enabled=true
-#gremlin.neo4j.conf.dbms.auto_index.relationships.keys=
-
-# these memory settings are likely unsuitable for production cases
-gremlin.neo4j.conf.dbms.memory.heap.initial_size=500m
-gremlin.neo4j.conf.dbms.memory.heap.max_size=500m
-gremlin.neo4j.conf.dbms.memory.pagecache.size=1m
-gremlin.neo4j.conf.dbms.tx_state.memory_allocation=ON_HEAP
-
-# uncomment the following to enable Bolt on the specified port
-# gremlin.neo4j.conf.dbms.connector.0.type=BOLT
-# gremlin.neo4j.conf.dbms.connector.0.enabled=true
-# gremlin.neo4j.conf.dbms.connector.0.address=localhost:7687
diff --git a/gremlin-server/src/test/scripts/neo4j-empty.properties b/gremlin-server/src/test/scripts/neo4j-empty.properties
deleted file mode 100644
index 6c4c93b9f8..0000000000
--- a/gremlin-server/src/test/scripts/neo4j-empty.properties
+++ /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.
-
-# This is a sample configuration file for Neo4j. Note that
-# TinkerPop does not include Neo4j dependencies in its
-# distributions. To use this file, please ensure that Neo4j
-# dependencies are installed into Gremlin Server's path
-# with:
-#
-# gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin 3.y.z
-#
-# Note that unless under a commercial agreement with Neo4j, Inc.,
-# Neo4j is licensed AGPL.
-
-
-gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
-gremlin.neo4j.directory=/tmp/neo4j
-gremlin.neo4j.conf.node_auto_indexing=true
-gremlin.neo4j.conf.relationship_auto_indexing=true
\ No newline at end of file
diff --git a/gremlin-tools/gremlin-coverage/pom.xml b/gremlin-tools/gremlin-coverage/pom.xml
index f69756f876..ef6b9ac682 100644
--- a/gremlin-tools/gremlin-coverage/pom.xml
+++ b/gremlin-tools/gremlin-coverage/pom.xml
@@ -66,11 +66,6 @@ limitations under the License.
<artifactId>gremlin-test</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>neo4j-gremlin</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml
deleted file mode 100644
index 1d682c8b61..0000000000
--- a/neo4j-gremlin/pom.xml
+++ /dev/null
@@ -1,258 +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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>tinkerpop</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>neo4j-gremlin</artifactId>
- <name>Apache TinkerPop :: Neo4j Gremlin</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>gremlin-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.neo4j</groupId>
- <artifactId>neo4j-tinkerpop-api</artifactId>
- <version>0.1.1</version>
- </dependency>
- <!-- TESTING -->
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>gremlin-test</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <!-- conflict from kirby -->
- <exclusions>
- <exclusion>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tinkerpop</groupId>
- <artifactId>tinkergraph-gremlin</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- <version>4.2.3</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <directory>${basedir}/target</directory>
- <finalName>${project.artifactId}-${project.version}</finalName>
- <resources>
- <resource>
- <directory>${basedir}/src/main/resources
- </directory>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>${basedir}/src/test/resources
- </directory>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.gmavenplus</groupId>
- <artifactId>gmavenplus-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestEntries>
- <Gremlin-Plugin-Dependencies>org.neo4j:neo4j-tinkerpop-api-impl:0.9-3.4.0
- </Gremlin-Plugin-Dependencies>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <!--
- Use this profile if you want the Neo4j test suite to run. The project should compile/install
- Neo4j without this profile. Note that if you "deploy" with this profile, neo4j-gremlin artifacts
- will be skipped.
- -->
- <id>include-neo4j</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- <property>
- <name>includeNeo4j</name>
- </property>
- </activation>
- <dependencies>
- <!-- TESTING -->
- <!-- *** WARNING *** -->
- <dependency>
- <groupId>org.neo4j</groupId>
- <artifactId>neo4j-tinkerpop-api-impl</artifactId>
- <version>0.9-3.4.0</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.neo4j</groupId>
- <artifactId>neo4j-kernel</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-text</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.github.ben-manes.caffeine</groupId>
- <artifactId>caffeine</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-reflect</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-nop</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>io.dropwizard.metrics</groupId>
- <artifactId>metrics-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-text</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- <version>2.11.8</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-reflect</artifactId>
- <version>2.11.8</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.github.ben-manes.caffeine</groupId>
- <artifactId>caffeine</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
- <version>5.5.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.dropwizard.metrics</groupId>
- <artifactId>metrics-core</artifactId>
- <version>4.2.19</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.neo4j</groupId>
- <artifactId>neo4j-kernel</artifactId>
- <version>3.4.11</version>
- <scope>test</scope>
- </dependency>
- <!-- *** WARNING *** -->
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>false</skipTests>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <configuration>
- <skipTests>false</skipTests>
- <reuseForks>false</reuseForks>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/LabelP.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/LabelP.java
deleted file mode 100644
index dd70515add..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/LabelP.java
+++ /dev/null
@@ -1,62 +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.traversal;
-
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
-import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate;
-
-import java.io.Serializable;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public final class LabelP extends P<String> {
-
- private LabelP(final String label) {
- super(LabelBiPredicate.instance(), label);
- }
-
- public static P<String> of(final String label) {
- return new LabelP(label);
- }
-
- /**
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
- @Deprecated
- public static final class LabelBiPredicate implements PBiPredicate<String, String>, Serializable {
- private static final LabelBiPredicate INSTANCE = new LabelBiPredicate();
-
- private LabelBiPredicate() {
- }
-
- @Override
- public boolean test(final String labels, final String checkLabel) {
- return labels.equals(checkLabel) || labels.contains(Neo4jVertex.LABEL_DELIMINATOR + checkLabel) || labels.contains(checkLabel + Neo4jVertex.LABEL_DELIMINATOR);
- }
-
- public static LabelBiPredicate instance() {
- return INSTANCE;
- }
- }
-
-}
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/CypherStartStep.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/CypherStartStep.java
deleted file mode 100644
index fa8d7d9951..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/CypherStartStep.java
+++ /dev/null
@@ -1,46 +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.traversal.step.sideEffect;
-
-import org.apache.tinkerpop.gremlin.neo4j.process.util.Neo4jCypherIterator;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StartStep;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-
-import java.util.Map;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public final class CypherStartStep extends StartStep<Map<String, Object>> {
-
- private final String query;
-
- public CypherStartStep(final Traversal.Admin traversal, final String query, final Neo4jCypherIterator<?> cypherIterator) {
- super(traversal, cypherIterator);
- this.query = query;
- }
-
- @Override
- public String toString() {
- return StringFactory.stepString(this, this.query);
- }
-}
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
deleted file mode 100644
index 04a30bb8ff..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
+++ /dev/null
@@ -1,163 +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.traversal.step.sideEffect;
-
-import org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP;
-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.P;
-import org.apache.tinkerpop.gremlin.process.traversal.Text;
-import org.apache.tinkerpop.gremlin.process.traversal.step.HasContainerHolder;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
-import org.apache.tinkerpop.gremlin.process.traversal.util.AndP;
-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;
-import org.neo4j.tinkerpop.api.Neo4jGraphAPI;
-import org.neo4j.tinkerpop.api.Neo4jNode;
-import org.neo4j.tinkerpop.api.Neo4jStringSearchMode;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Optional;
-import java.util.function.BiPredicate;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @author Pieter Martin
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public final class Neo4jGraphStep<S, E extends Element> extends GraphStep<S, E> implements HasContainerHolder<S, E> {
-
- private final List<HasContainer> hasContainers = new ArrayList<>();
-
- public Neo4jGraphStep(final GraphStep<S, E> originalGraphStep) {
- super(originalGraphStep.getTraversal(), originalGraphStep.getReturnClass(), originalGraphStep.isStartStep(), originalGraphStep.getIds());
- originalGraphStep.getLabels().forEach(this::addLabel);
- this.setIteratorSupplier(() -> (Iterator<E>) (Vertex.class.isAssignableFrom(this.returnClass) ? this.vertices() : this.edges()));
- }
-
- private Iterator<? extends Edge> edges() {
- if (null == this.ids)
- return Collections.emptyIterator();
- return IteratorUtils.filter(this.getTraversal().getGraph().get().edges(this.ids), edge -> HasContainer.testAll(edge, this.hasContainers));
- }
-
- private Iterator<? extends Vertex> vertices() {
- if (null == this.ids)
- return Collections.emptyIterator();
- final Neo4jGraph graph = (Neo4jGraph) this.getTraversal().getGraph().get();
-
- // 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
- Optional<String> label = hasContainers.stream()
- .filter(hasContainer -> hasContainer.getKey() != null && hasContainer.getKey().equals(T.label.getAccessor()))
- .filter(hasContainer -> Compare.eq == hasContainer.getBiPredicate())
- .filter(hasContainer -> hasContainer.getValue() != null)
- .map(hasContainer -> (String) hasContainer.getValue())
- .findAny();
- if (!label.isPresent())
- label = hasContainers.stream()
- .filter(hasContainer -> hasContainer.getKey() != null && hasContainer.getKey().equals(T.label.getAccessor()))
- .filter(hasContainer -> hasContainer.getPredicate() instanceof LabelP)
- .filter(hasContainer -> hasContainer.getValue() != null)
- .map(hasContainer -> (String) hasContainer.getValue())
- .findAny();
-
- if (label.isPresent()) {
- // find a vertex by label and key/value
- final String labelValue = label.get();
- final Neo4jGraphAPI baseGraph = graph.getBaseGraph();
- for (final HasContainer hasContainer : hasContainers) {
- final String key = hasContainer.getKey();
- final Object value = hasContainer.getValue();
- if (key != null && !key.equals(T.label.getAccessor()) && baseGraph.hasSchemaIndex(labelValue, key)) {
- final BiPredicate<?, ?> predicate = hasContainer.getBiPredicate();
- Iterable<Neo4jNode> nodes = null;
- if (Compare.eq == predicate) {
- nodes = baseGraph.findNodes(labelValue, key, value);
- } else if (Text.containing == predicate) {
- nodes = baseGraph.findNodes(labelValue, key, value.toString(), Neo4jStringSearchMode.CONTAINS);
- } else if (Text.startingWith == predicate) {
- nodes = baseGraph.findNodes(labelValue, key, value.toString(), Neo4jStringSearchMode.PREFIX);
- } else if (Text.endingWith == predicate) {
- nodes = baseGraph.findNodes(labelValue, key, value.toString(), Neo4jStringSearchMode.SUFFIX);
- }
- if (nodes != null) {
- return IteratorUtils.stream(nodes)
- .map(node -> (Vertex) new Neo4jVertex(node, graph))
- .filter(vertex -> HasContainer.testAll(vertex, hasContainers)).iterator();
- }
- }
- }
-
- // find a vertex by label
- return IteratorUtils.stream(graph.getBaseGraph().findNodes(label.get()))
- .map(node -> (Vertex) new Neo4jVertex(node, graph))
- .filter(vertex -> HasContainer.testAll(vertex, hasContainers)).iterator();
- } else {
- // linear scan
- return IteratorUtils.filter(graph.vertices(), vertex -> HasContainer.testAll(vertex, hasContainers));
- }
- }
-
- @Override
- public String toString() {
- if (this.hasContainers.isEmpty())
- return super.toString();
- else
- return 0 == this.ids.length ?
- StringFactory.stepString(this, this.returnClass.getSimpleName().toLowerCase(), this.hasContainers) :
- StringFactory.stepString(this, this.returnClass.getSimpleName().toLowerCase(), Arrays.toString(this.ids), this.hasContainers);
- }
-
- @Override
- public List<HasContainer> getHasContainers() {
- return Collections.unmodifiableList(this.hasContainers);
- }
-
- @Override
- public void addHasContainer(final HasContainer hasContainer) {
- if (hasContainer.getPredicate() instanceof AndP) {
- for (final P<?> predicate : ((AndP<?>) hasContainer.getPredicate()).getPredicates()) {
- this.addHasContainer(new HasContainer(hasContainer.getKey(), predicate));
- }
- } else
- this.hasContainers.add(hasContainer);
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() ^ this.hasContainers.hashCode();
- }
-}
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategy.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategy.java
deleted file mode 100644
index dba91597b3..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategy.java
+++ /dev/null
@@ -1,73 +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.traversal.strategy.optimization;
-
-import org.apache.tinkerpop.gremlin.neo4j.process.traversal.step.sideEffect.Neo4jGraphStep;
-import org.apache.tinkerpop.gremlin.process.traversal.Step;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.step.HasContainerHolder;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
-
-import java.util.List;
-
-/**
- * @author Pieter Martin
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public final class Neo4jGraphStepStrategy extends AbstractTraversalStrategy<TraversalStrategy.ProviderOptimizationStrategy> implements TraversalStrategy.ProviderOptimizationStrategy {
-
- private static final Neo4jGraphStepStrategy INSTANCE = new Neo4jGraphStepStrategy();
-
- private Neo4jGraphStepStrategy() {
- }
-
- @Override
- public void apply(final Traversal.Admin<?, ?> traversal) {
- for (final GraphStep originalGraphStep : TraversalHelper.getStepsOfClass(GraphStep.class, traversal)) {
- final Neo4jGraphStep<?, ?> neo4jGraphStep = new Neo4jGraphStep<>(originalGraphStep);
- TraversalHelper.replaceStep(originalGraphStep, neo4jGraphStep, traversal);
- Step<?, ?> currentStep = neo4jGraphStep.getNextStep();
- while (currentStep instanceof HasStep || currentStep instanceof NoOpBarrierStep) {
- if (currentStep instanceof HasStep) {
- List<HasContainer> hasContainers = ((HasStep) currentStep).getHasContainers();
- for (final HasContainer hasContainer : hasContainers) {
- if (!GraphStep.processHasContainerIds(neo4jGraphStep, hasContainer))
- neo4jGraphStep.addHasContainer(hasContainer);
- }
- TraversalHelper.copyLabels(currentStep, currentStep.getPreviousStep(), false);
- traversal.removeStep(currentStep);
- }
- currentStep = currentStep.getNextStep();
- }
- }
- }
-
- public static Neo4jGraphStepStrategy instance() {
- return INSTANCE;
- }
-
-}
\ No newline at end of file
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
deleted file mode 100644
index f511619f01..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/util/Neo4jCypherIterator.java
+++ /dev/null
@@ -1,66 +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.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;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public final class Neo4jCypherIterator<T> implements Iterator<Map<String, T>> {
-
- private final Iterator<Map<String, T>> iterator;
- private final Neo4jGraph graph;
-
- public Neo4jCypherIterator(final Iterator<Map<String, T>> iterator, final Neo4jGraph graph) {
- this.iterator = iterator;
- this.graph = graph;
- }
-
- @Override
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- @Override
- public Map<String, T> next() {
- return this.iterator.next().entrySet().stream().collect(Collectors.toMap(
- Map.Entry::getKey,
- entry -> {
- final T val = entry.getValue();
- if (Neo4jNode.class.isAssignableFrom(val.getClass())) {
- return (T) new Neo4jVertex((Neo4jNode) val, this.graph);
- } else if (Neo4jRelationship.class.isAssignableFrom(val.getClass())) {
- return (T) new Neo4jEdge((Neo4jRelationship) val, this.graph);
- } else {
- return val;
- }
- }));
- }
-}
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
deleted file mode 100644
index c30250cb44..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jEdge.java
+++ /dev/null
@@ -1,134 +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.structure.Direction;
-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;
-import org.neo4j.tinkerpop.api.Neo4jRelationship;
-
-import java.util.Iterator;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public final class Neo4jEdge extends Neo4jElement implements Edge, WrappedEdge<Neo4jRelationship> {
-
- public Neo4jEdge(final Neo4jRelationship relationship, final Neo4jGraph graph) {
- super(relationship, graph);
- }
-
- @Override
- public Vertex outVertex() {
- return new Neo4jVertex(this.getBaseEdge().start(), this.graph);
- }
-
- @Override
- public Vertex inVertex() {
- return new Neo4jVertex(this.getBaseEdge().end(), this.graph);
- }
-
- @Override
- public Iterator<Vertex> vertices(final Direction direction) {
- this.graph.tx().readWrite();
- switch (direction) {
- case OUT:
- return IteratorUtils.of(new Neo4jVertex(this.getBaseEdge().start(), this.graph));
- case IN:
- return IteratorUtils.of(new Neo4jVertex(this.getBaseEdge().end(), this.graph));
- default:
- return IteratorUtils.of(new Neo4jVertex(this.getBaseEdge().start(), this.graph), new Neo4jVertex(this.getBaseEdge().end(), this.graph));
- }
- }
-
- @Override
- public void remove() {
- this.graph.tx().readWrite();
- try {
- this.baseElement.delete();
- } catch (IllegalStateException ignored) {
- // NotFoundException happens if the edge is committed
- // IllegalStateException happens if the edge is still chilling in the tx
- } catch (RuntimeException e) {
- if (!Neo4jHelper.isNotFound(e)) throw e;
- // NotFoundException happens if the edge is committed
- // IllegalStateException happens if the edge is still chilling in the tx
- }
- }
-
- public String toString() {
- return StringFactory.edgeString(this);
- }
-
- @Override
- public String label() {
- this.graph.tx().readWrite();
- return this.getBaseEdge().type();
- }
-
- @Override
- public Neo4jRelationship getBaseEdge() {
- return (Neo4jRelationship) this.baseElement;
- }
-
- @Override
- public <V> Iterator<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)));
- }
-
- @Override
- public <V> Property<V> property(final String key) {
- this.graph.tx().readWrite();
- if (this.baseElement.hasProperty(key))
- return new Neo4jProperty<>(this, key, (V) this.baseElement.getProperty(key));
- else
- return Property.empty();
- }
-
- @Override
- public <V> Property<V> property(final String key, final V value) {
- ElementHelper.validateProperty(key, value);
-
- if (null == value) {
- properties(key).forEachRemaining(Property::remove);
- return Property.empty();
- }
-
- 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, e);
- }
- }
-}
\ No newline at end of file
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
deleted file mode 100644
index b74ca861d0..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jElement.java
+++ /dev/null
@@ -1,83 +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.structure.Element;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
-import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedElement;
-import org.neo4j.tinkerpop.api.Neo4jEntity;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public abstract class Neo4jElement implements Element, WrappedElement<Neo4jEntity> {
- protected final Neo4jGraph graph;
- protected final Neo4jEntity baseElement;
-
- public Neo4jElement(final Neo4jEntity baseElement, final Neo4jGraph graph) {
- this.baseElement = baseElement;
- this.graph = graph;
- }
-
- @Override
- public Graph graph() {
- return this.graph;
- }
-
- @Override
- public Object id() {
- this.graph.tx().readWrite();
- return this.baseElement.getId();
- }
-
- @Override
- public Set<String> keys() {
- this.graph.tx().readWrite();
- final Set<String> keys = new HashSet<>();
- for (final String key : this.baseElement.getKeys()) {
- if (!Graph.Hidden.isHidden(key))
- keys.add(key);
- }
- return Collections.unmodifiableSet(keys);
- }
-
- @Override
- public boolean equals(final Object object) {
- return ElementHelper.areEqual(this, object);
- }
-
- @Override
- public int hashCode() {
- return ElementHelper.hashCode(this);
- }
-
- @Override
- public Neo4jEntity getBaseElement() {
- return this.baseElement;
- }
-
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 4560b2bfcb..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
+++ /dev/null
@@ -1,529 +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.commons.configuration2.BaseConfiguration;
-import org.apache.commons.configuration2.Configuration;
-import org.apache.commons.configuration2.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.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;
-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.AbstractThreadLocalTransaction;
-import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.structure.util.TransactionException;
-import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedGraph;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.neo4j.tinkerpop.api.Neo4jFactory;
-import org.neo4j.tinkerpop.api.Neo4jGraphAPI;
-import org.neo4j.tinkerpop.api.Neo4jTx;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.stream.Stream;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @author Pieter Martin
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Graph.OptIn(Graph.OptIn.SUITE_STRUCTURE_STANDARD)
-@Graph.OptIn(Graph.OptIn.SUITE_STRUCTURE_INTEGRATE)
-@Graph.OptIn(Graph.OptIn.SUITE_PROCESS_EMBEDDED_STANDARD)
-@Graph.OptIn("org.apache.tinkerpop.gremlin.neo4j.NativeNeo4jSuite")
-@Graph.OptOut(
- test = "org.apache.tinkerpop.gremlin.structure.TransactionMultiThreadedTest",
- method = "*",
- reason = "Some scenarios are supported by Neo4jGraph")
-@Deprecated
-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;
- protected BaseConfiguration configuration = new BaseConfiguration();
-
- public static final String CONFIG_DIRECTORY = "gremlin.neo4j.directory";
- public static final String CONFIG_CONF = "gremlin.neo4j.conf";
-
- private final Neo4jTransaction neo4jTransaction = new Neo4jTransaction();
- private Neo4jGraphVariables neo4jGraphVariables;
-
- private void initialize(final Neo4jGraphAPI baseGraph, final Configuration configuration) {
- this.configuration.copy(configuration);
- this.baseGraph = baseGraph;
- this.neo4jGraphVariables = new Neo4jGraphVariables(this);
- }
-
- protected Neo4jGraph(final Neo4jGraphAPI baseGraph, final Configuration configuration) {
- this.initialize(baseGraph, configuration);
- }
-
- protected Neo4jGraph(final Configuration configuration) {
- this.configuration.copy(configuration);
- final String directory = this.configuration.getString(CONFIG_DIRECTORY);
- final Map neo4jSpecificConfig = ConfigurationConverter.getMap(this.configuration.subset(CONFIG_CONF));
- this.baseGraph = Neo4jFactory.Builder.open(directory, neo4jSpecificConfig);
- this.initialize(this.baseGraph, configuration);
- }
-
- /**
- * Open a new {@link Neo4jGraph} instance.
- *
- * @param configuration the configuration for the instance
- * @return a newly opened {@link Graph}
- */
- public static Neo4jGraph open(final Configuration configuration) {
- 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));
- return new Neo4jGraph(configuration);
- }
-
- /**
- * Construct a Neo4jGraph instance by specifying the directory to create the database in..
- */
- public static Neo4jGraph open(final String directory) {
- final Configuration config = new BaseConfiguration();
- config.setProperty(CONFIG_DIRECTORY, directory);
- 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);
- if (ElementHelper.getIdValue(keyValues).isPresent())
- throw Vertex.Exceptions.userSuppliedIdsNotSupported();
- this.tx().readWrite();
- 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;
- }
-
- @Override
- public Iterator<Vertex> vertices(final Object... vertexIds) {
- this.tx().readWrite();
- if (0 == vertexIds.length) {
- return IteratorUtils.stream(this.getBaseGraph().allNodes())
- .map(node -> (Vertex) new Neo4jVertex(node, this)).iterator();
- } else {
- return Stream.of(vertexIds)
- .map(id -> {
- if (id instanceof Number)
- return ((Number) id).longValue();
- else if (id instanceof String)
- return Long.valueOf(id.toString());
- else if (id instanceof Vertex && ((Vertex) id).id() instanceof Number)
- return ((Number) ((Vertex) id).id()).longValue();
- else if (null == id)
- return null;
- else
- throw new IllegalArgumentException("Unknown vertex id type: " + id);
- })
- .flatMap(id -> {
- // can't have a null id so just filter
- if (null == id) return Stream.empty();
- try {
- return Stream.of(this.baseGraph.getNodeById(id));
- } catch (final RuntimeException e) {
- if (Neo4jHelper.isNotFound(e)) return Stream.empty();
- throw e;
- }
- })
- .map(node -> (Vertex) new Neo4jVertex(node, this)).iterator();
- }
- }
-
- @Override
- public Iterator<Edge> edges(final Object... edgeIds) {
- this.tx().readWrite();
- if (0 == edgeIds.length) {
- return IteratorUtils.stream(this.getBaseGraph().allRelationships())
- .map(relationship -> (Edge) new Neo4jEdge(relationship, this)).iterator();
- } else {
- return Stream.of(edgeIds)
- .map(id -> {
- if (id instanceof Number)
- return ((Number) id).longValue();
- else if (id instanceof String)
- return Long.valueOf(id.toString());
- else if (id instanceof Edge && ((Edge) id).id() instanceof Number)
- return ((Number) ((Edge) id).id()).longValue();
- else if (null == id)
- return null;
- else
- throw new IllegalArgumentException("Unknown edge id type: " + id);
- })
- .flatMap(id -> {
- // can't have a null id so just filter
- if (null == id) return Stream.empty();
- try {
- return Stream.of(this.baseGraph.getRelationshipById(id));
- } catch (final RuntimeException e) {
- if (Neo4jHelper.isNotFound(e)) return Stream.empty();
- throw e;
- }
- })
- .map(relationship -> (Edge) new Neo4jEdge(relationship, this)).iterator();
- }
- }
-
- @Override
- public <C extends GraphComputer> C compute(final Class<C> graphComputerClass) {
- throw Graph.Exceptions.graphComputerNotSupported();
- }
-
- @Override
- public GraphComputer compute() {
- throw Graph.Exceptions.graphComputerNotSupported();
- }
-
- @Override
- public Transaction tx() {
- return this.neo4jTransaction;
- }
-
- @Override
- public Variables variables() {
- return this.neo4jGraphVariables;
- }
-
- @Override
- public Configuration configuration() {
- return this.configuration;
- }
-
- /**
- * This implementation of {@code close} will also close the current transaction on the thread, but it
- * is up to the caller to deal with dangling transactions in other threads prior to calling this method.
- */
- @Override
- public void close() throws Exception {
- this.tx().close();
- if (this.baseGraph != null) this.baseGraph.shutdown();
- }
-
- public String toString() {
- return StringFactory.graphString(this, baseGraph.toString());
- }
-
- @Override
- public Features features() {
- return features;
- }
-
- @Override
- public Neo4jGraphAPI getBaseGraph() {
- return this.baseGraph;
- }
-
- /**
- * Execute the Cypher query and get the result set as a {@link GraphTraversal}.
- *
- * @param query the Cypher query to execute
- * @return a fluent Gremlin traversal
- */
- public <S, E> GraphTraversal<S, E> cypher(final String query) {
- return cypher(query, Collections.emptyMap());
- }
-
- /**
- * Execute the Cypher query with provided parameters and get the result set as a {@link GraphTraversal}.
- *
- * @param query the Cypher query to execute
- * @param parameters the parameters of the Cypher query
- * @return a fluent Gremlin traversal
- */
- public <S, E> GraphTraversal<S, E> cypher(final String query, final Map<String, Object> parameters) {
- this.tx().readWrite();
- final GraphTraversal.Admin<S, E> traversal = new DefaultGraphTraversal<>(this);
- traversal.addStep(new CypherStartStep(traversal, query, new Neo4jCypherIterator<>((Iterator) this.baseGraph.execute(query, parameters), this)));
- return traversal;
- }
-
- class Neo4jTransaction extends AbstractThreadLocalTransaction {
-
- protected final ThreadLocal<Neo4jTx> threadLocalTx = ThreadLocal.withInitial(() -> null);
-
- public Neo4jTransaction() {
- super(Neo4jGraph.this);
- }
-
- @Override
- public void doOpen() {
- threadLocalTx.set(getBaseGraph().tx());
- }
-
- @Override
- public void doCommit() throws TransactionException {
- try (Neo4jTx tx = threadLocalTx.get()) {
- tx.success();
- } catch (Exception ex) {
- throw new TransactionException(ex);
- } finally {
- threadLocalTx.remove();
- }
- }
-
- @Override
- public void doRollback() throws TransactionException {
- try (Neo4jTx tx = threadLocalTx.get()) {
- tx.failure();
- } catch (Exception e) {
- throw new TransactionException(e);
- } finally {
- threadLocalTx.remove();
- }
- }
-
- @Override
- public boolean isOpen() {
- return (threadLocalTx.get() != null);
- }
- }
-
- public class Neo4jGraphFeatures implements Features {
- protected GraphFeatures graphFeatures = new Neo4jGraphGraphFeatures();
- protected VertexFeatures vertexFeatures = new Neo4jVertexFeatures();
- protected EdgeFeatures edgeFeatures = new Neo4jEdgeFeatures();
-
- @Override
- public GraphFeatures graph() {
- return graphFeatures;
- }
-
- @Override
- public VertexFeatures vertex() {
- return vertexFeatures;
- }
-
- @Override
- public EdgeFeatures edge() {
- return edgeFeatures;
- }
-
- @Override
- public String toString() {
- return StringFactory.featureString(this);
- }
-
- public class Neo4jGraphGraphFeatures implements GraphFeatures {
-
- private VariableFeatures variableFeatures = new Neo4jGraphVariables.Neo4jVariableFeatures();
-
- Neo4jGraphGraphFeatures() {
- }
-
- @Override
- public boolean supportsConcurrentAccess() {
- return false;
- }
-
- @Override
- public boolean supportsComputer() {
- return false;
- }
-
- @Override
- public VariableFeatures variables() {
- return variableFeatures;
- }
-
- @Override
- public boolean supportsThreadedTransactions() {
- return false;
- }
- }
-
- public class Neo4jVertexFeatures extends Neo4jElementFeatures implements VertexFeatures {
-
- private final VertexPropertyFeatures vertexPropertyFeatures = new Neo4jVertexPropertyFeatures();
-
- protected Neo4jVertexFeatures() {
- }
-
- @Override
- public VertexPropertyFeatures properties() {
- return vertexPropertyFeatures;
- }
-
- @Override
- public boolean supportsMetaProperties() {
- return false;
- }
-
- @Override
- public boolean supportsMultiProperties() {
- return false;
- }
-
- @Override
- public boolean supportsUserSuppliedIds() {
- return false;
- }
-
- @Override
- public VertexProperty.Cardinality getCardinality(final String key) {
- return VertexProperty.Cardinality.single;
- }
- }
-
- public class Neo4jEdgeFeatures extends Neo4jElementFeatures implements EdgeFeatures {
-
- private final EdgePropertyFeatures edgePropertyFeatures = new Neo4jEdgePropertyFeatures();
-
- Neo4jEdgeFeatures() {
- }
-
- @Override
- public EdgePropertyFeatures properties() {
- return edgePropertyFeatures;
- }
- }
-
- public class Neo4jElementFeatures implements ElementFeatures {
-
- Neo4jElementFeatures() {
- }
-
- @Override
- public boolean supportsNullPropertyValues() {
- return false;
- }
-
- @Override
- public boolean supportsUserSuppliedIds() {
- return false;
- }
-
- @Override
- public boolean supportsStringIds() {
- return false;
- }
-
- @Override
- public boolean supportsUuidIds() {
- return false;
- }
-
- @Override
- public boolean supportsAnyIds() {
- return false;
- }
-
- @Override
- public boolean supportsCustomIds() {
- return false;
- }
- }
-
- public class Neo4jVertexPropertyFeatures implements VertexPropertyFeatures {
-
- Neo4jVertexPropertyFeatures() {
- }
-
- @Override
- public boolean supportsNullPropertyValues() {
- return false;
- }
-
- @Override
- public boolean supportsMapValues() {
- return false;
- }
-
- @Override
- public boolean supportsMixedListValues() {
- return false;
- }
-
- @Override
- public boolean supportsSerializableValues() {
- return false;
- }
-
- @Override
- public boolean supportsUniformListValues() {
- return false;
- }
-
- @Override
- public boolean supportsUserSuppliedIds() {
- return false;
- }
-
- @Override
- public boolean supportsAnyIds() {
- return false;
- }
- }
-
- public class Neo4jEdgePropertyFeatures implements EdgePropertyFeatures {
-
- Neo4jEdgePropertyFeatures() {
- }
-
- @Override
- public boolean supportsMapValues() {
- return false;
- }
-
- @Override
- public boolean supportsMixedListValues() {
- return false;
- }
-
- @Override
- public boolean supportsSerializableValues() {
- return false;
- }
-
- @Override
- public boolean supportsUniformListValues() {
- return false;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraphVariables.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraphVariables.java
deleted file mode 100644
index 0fc0a131dd..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraphVariables.java
+++ /dev/null
@@ -1,178 +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.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.util.GraphVariableHelper;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.neo4j.tinkerpop.api.Neo4jGraphAPI;
-
-import java.util.HashSet;
-import java.util.Optional;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public final class Neo4jGraphVariables implements Graph.Variables {
-
- private final Neo4jGraph graph;
- private final Neo4jGraphAPI baseGraph;
-
- protected Neo4jGraphVariables(final Neo4jGraph graph) {
- this.graph = graph;
- baseGraph = graph.getBaseGraph();
- }
-
- @Override
- public Set<String> keys() {
- this.graph.tx().readWrite();
- final Set<String> keys = new HashSet<>();
- for (final String key : this.baseGraph.getKeys()) {
- if (!Graph.Hidden.isHidden(key))
- keys.add(key);
- }
- return keys;
- }
-
- @Override
- public <R> Optional<R> get(final String key) {
- this.graph.tx().readWrite();
- return this.baseGraph.hasProperty(key) ?
- Optional.of((R) this.baseGraph.getProperty(key)) :
- Optional.<R>empty();
- }
-
- @Override
- public void set(final String key, final Object value) {
- GraphVariableHelper.validateVariable(key, value);
- this.graph.tx().readWrite();
- try {
- this.baseGraph.setProperty(key, value);
- } catch (final IllegalArgumentException e) {
- throw Graph.Variables.Exceptions.dataTypeOfVariableValueNotSupported(value, e);
- }
- }
-
- @Override
- public void remove(final String key) {
- this.graph.tx().readWrite();
- if (this.baseGraph.hasProperty(key))
- this.baseGraph.removeProperty(key);
- }
-
- @Override
- public String toString() {
- return StringFactory.graphVariablesString(this);
- }
-
- public static class Neo4jVariableFeatures implements Graph.Features.VariableFeatures {
- @Override
- public boolean supportsBooleanValues() {
- return true;
- }
-
- @Override
- public boolean supportsDoubleValues() {
- return true;
- }
-
- @Override
- public boolean supportsFloatValues() {
- return true;
- }
-
- @Override
- public boolean supportsIntegerValues() {
- return true;
- }
-
- @Override
- public boolean supportsLongValues() {
- return true;
- }
-
- @Override
- public boolean supportsMapValues() {
- return false;
- }
-
- @Override
- public boolean supportsMixedListValues() {
- return false;
- }
-
- @Override
- public boolean supportsByteValues() {
- return false;
- }
-
- @Override
- public boolean supportsBooleanArrayValues() {
- return true;
- }
-
- @Override
- public boolean supportsByteArrayValues() {
- return false;
- }
-
- @Override
- public boolean supportsDoubleArrayValues() {
- return true;
- }
-
- @Override
- public boolean supportsFloatArrayValues() {
- return true;
- }
-
- @Override
- public boolean supportsIntegerArrayValues() {
- return true;
- }
-
- @Override
- public boolean supportsLongArrayValues() {
- return true;
- }
-
- @Override
- public boolean supportsStringArrayValues() {
- return true;
- }
-
- @Override
- public boolean supportsSerializableValues() {
- return false;
- }
-
- @Override
- public boolean supportsStringValues() {
- return true;
- }
-
- @Override
- public boolean supportsUniformListValues() {
- return false;
- }
- }
-}
\ No newline at end of file
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
deleted file mode 100644
index a12ed687e3..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jHelper.java
+++ /dev/null
@@ -1,68 +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.structure.Direction;
-import org.neo4j.tinkerpop.api.Neo4jNode;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public final class Neo4jHelper {
-
- private static final String NOT_FOUND_EXCEPTION = "NotFoundException";
-
- private Neo4jHelper() {
- }
-
- public static org.neo4j.tinkerpop.api.Neo4jDirection mapDirection(final Direction direction) {
- if (direction.equals(Direction.OUT))
- return org.neo4j.tinkerpop.api.Neo4jDirection.OUTGOING;
- else if (direction.equals(Direction.IN))
- return org.neo4j.tinkerpop.api.Neo4jDirection.INCOMING;
- else
- return org.neo4j.tinkerpop.api.Neo4jDirection.BOTH;
- }
-
- public static boolean isDeleted(final Neo4jNode node) {
- try {
- node.getKeys();
- return false;
- } catch (final RuntimeException e) {
- if (isNotFound(e))
- return true;
- else
- throw e;
- }
- }
-
- public static boolean isNotFound(final RuntimeException ex) {
- return ex.getClass().getSimpleName().equals(NOT_FOUND_EXCEPTION);
- }
-
- 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
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
deleted file mode 100644
index 9b23d3c3a9..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jProperty.java
+++ /dev/null
@@ -1,96 +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.structure.Element;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.neo4j.tinkerpop.api.Neo4jEntity;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public final class Neo4jProperty<V> implements Property<V> {
-
- protected final Element element;
- 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;
- this.key = key;
- this.value = value;
- this.graph = element instanceof Neo4jVertexProperty ?
- ((Neo4jVertex) (((Neo4jVertexProperty) element).element())).graph :
- ((Neo4jElement) element).graph;
- }
-
- @Override
- public Element element() {
- return this.element;
- }
-
- @Override
- public void remove() {
- if (this.removed) return;
- this.removed = true;
- this.graph.tx().readWrite();
- final Neo4jEntity entity = this.element instanceof Neo4jVertexProperty ?
- ((Neo4jVertexProperty) this.element).vertexPropertyNode :
- ((Neo4jElement) this.element).getBaseElement();
- if (entity.hasProperty(this.key)) {
- entity.removeProperty(this.key);
- }
- }
-
- @Override
- public String key() {
- return this.key;
- }
-
- @Override
- public V value() {
- return this.value;
- }
-
- @Override
- public boolean isPresent() {
- return null != this.value;
- }
-
- @Override
- public String toString() {
- return StringFactory.propertyString(this);
- }
-
- @Override
- public boolean equals(final Object object) {
- return ElementHelper.areEqual(this, object);
- }
-
- @Override
- public int hashCode() {
- return ElementHelper.hashCode(this);
- }
-}
\ No newline at end of file
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
deleted file mode 100644
index 3afc3e145b..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertex.java
+++ /dev/null
@@ -1,219 +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.structure.Direction;
-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.util.ElementHelper;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedVertex;
-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.Collections;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.TreeSet;
-
-import static org.apache.tinkerpop.gremlin.structure.Direction.BOTH;
-import static org.apache.tinkerpop.gremlin.structure.Direction.IN;
-import static org.apache.tinkerpop.gremlin.structure.Direction.OUT;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-public final class Neo4jVertex extends Neo4jElement implements Vertex, WrappedVertex<Neo4jNode> {
-
- public static final String LABEL_DELIMINATOR = "::";
-
- public Neo4jVertex(final Neo4jNode node, final Neo4jGraph graph) {
- super(node, graph);
- }
-
- @Override
- public Edge addEdge(final String label, final Vertex inVertex, final Object... keyValues) {
- if (null == inVertex) throw Graph.Exceptions.argumentCanNotBeNull("inVertex");
- ElementHelper.validateLabel(label);
- ElementHelper.legalPropertyKeyValueArray(keyValues);
- if (ElementHelper.getIdValue(keyValues).isPresent())
- throw Edge.Exceptions.userSuppliedIdsNotSupported();
-
- this.graph.tx().readWrite();
- final Neo4jNode node = (Neo4jNode) this.baseElement;
- final Neo4jEdge edge = new Neo4jEdge(node.connectTo(((Neo4jVertex) inVertex).getBaseVertex(), label), this.graph);
- ElementHelper.attachProperties(edge, keyValues);
- return edge;
- }
-
- @Override
- public <V> VertexProperty<V> property(final String key, final V value) {
- return this.property(VertexProperty.Cardinality.single, key, value);
- }
-
- @Override
- public void remove() {
- this.graph.tx().readWrite();
- try {
- final Neo4jNode node = (Neo4jNode) baseElement;
- 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> property(final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
- ElementHelper.validateProperty(key, value);
- if (ElementHelper.getIdValue(keyValues).isPresent())
- throw Vertex.Exceptions.userSuppliedIdsNotSupported();
- this.graph.tx().readWrite();
-
- if (cardinality != VertexProperty.Cardinality.single)
- throw VertexProperty.Exceptions.multiPropertiesNotSupported();
-
- if (null == value) {
- properties(key).forEachRemaining(VertexProperty::remove);
- return VertexProperty.empty();
- }
-
- if (keyValues.length > 0)
- throw VertexProperty.Exceptions.metaPropertiesNotSupported();
- try {
- this.baseElement.setProperty(key, value);
- return new Neo4jVertexProperty<>(this, key, value);
- } catch (final IllegalArgumentException iae) {
- throw Property.Exceptions.dataTypeOfPropertyValueNotSupported(value, iae);
- }
- }
-
- @Override
- public <V> VertexProperty<V> property(final String key) {
- this.graph.tx().readWrite();
- return baseElement.hasProperty(key) ? new Neo4jVertexProperty<>(this, key, (V) baseElement.getProperty(key)) : VertexProperty.<V>empty();
- }
-
- @Override
- public <V> Iterator<VertexProperty<V>> properties(final String... propertyKeys) {
- this.graph.tx().readWrite();
- return (Iterator) IteratorUtils.stream(this.baseElement.getKeys())
- .filter(key -> ElementHelper.keyExists(key, propertyKeys))
- .map(key -> new Neo4jVertexProperty<>(this, key, (V) this.baseElement.getProperty(key))).iterator();
- }
-
- @Override
- public Neo4jNode getBaseVertex() {
- return (Neo4jNode) this.baseElement;
- }
-
- @Override
- public String label() {
- this.graph.tx().readWrite();
- return String.join(LABEL_DELIMINATOR, this.labels());
- }
-
- @Override
- public Iterator<Vertex> vertices(final Direction direction, final String... edgeLabels) {
- this.graph.tx().readWrite();
- return new Iterator<Vertex>() {
- final Iterator<Neo4jRelationship> relationshipIterator = 0 == edgeLabels.length ?
- BOTH == direction ?
- IteratorUtils.concat(getBaseVertex().relationships(Neo4jHelper.mapDirection(OUT)).iterator(),
- getBaseVertex().relationships(Neo4jHelper.mapDirection(IN)).iterator()) :
- getBaseVertex().relationships(Neo4jHelper.mapDirection(direction)).iterator() :
- BOTH == direction ?
- IteratorUtils.concat(getBaseVertex().relationships(Neo4jHelper.mapDirection(OUT), (edgeLabels)).iterator(),
- getBaseVertex().relationships(Neo4jHelper.mapDirection(IN), (edgeLabels)).iterator()) :
- getBaseVertex().relationships(Neo4jHelper.mapDirection(direction), (edgeLabels)).iterator();
-
- @Override
- public boolean hasNext() {
- return this.relationshipIterator.hasNext();
- }
-
- @Override
- public Neo4jVertex next() {
- return new Neo4jVertex(this.relationshipIterator.next().other(getBaseVertex()), graph);
- }
- };
- }
-
- @Override
- public Iterator<Edge> edges(final Direction direction, final String... edgeLabels) {
- this.graph.tx().readWrite();
- return new Iterator<Edge>() {
- final Iterator<Neo4jRelationship> relationshipIterator = 0 == edgeLabels.length ?
- BOTH == direction ?
- IteratorUtils.concat(getBaseVertex().relationships(Neo4jHelper.mapDirection(OUT)).iterator(),
- getBaseVertex().relationships(Neo4jHelper.mapDirection(IN)).iterator()) :
- getBaseVertex().relationships(Neo4jHelper.mapDirection(direction)).iterator() :
- BOTH == direction ?
- IteratorUtils.concat(getBaseVertex().relationships(Neo4jHelper.mapDirection(OUT), (edgeLabels)).iterator(),
- getBaseVertex().relationships(Neo4jHelper.mapDirection(IN), (edgeLabels)).iterator()) :
- getBaseVertex().relationships(Neo4jHelper.mapDirection(direction), (edgeLabels)).iterator();
-
- @Override
- public boolean hasNext() {
- return this.relationshipIterator.hasNext();
- }
-
- @Override
- public Neo4jEdge next() {
- return new Neo4jEdge(this.relationshipIterator.next(), graph);
- }
- };
- }
-
- /////////////// Neo4jVertex Specific Methods for Multi-Label Support ///////////////
- public Set<String> labels() {
- this.graph.tx().readWrite();
- final Set<String> labels = new TreeSet<>(this.getBaseVertex().labels());
- return Collections.unmodifiableSet(labels);
- }
-
- public void addLabel(final String label) {
- this.graph.tx().readWrite();
- this.getBaseVertex().addLabel(label);
- }
-
- public void removeLabel(final String label) {
- this.graph.tx().readWrite();
- this.getBaseVertex().removeLabel(label);
- }
- //////////////////////////////////////////////////////////////////////////////////////
-
- @Override
- public String toString() {
- return StringFactory.vertexString(this);
- }
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 3dab4a6f70..0000000000
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jVertexProperty.java
+++ /dev/null
@@ -1,139 +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.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.structure.util.StringFactory;
-import org.neo4j.tinkerpop.api.Neo4jNode;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated See: https://tinkerpop.apache.org/docs/3.5.7/reference/#neo4j-gremlin
- */
-@Deprecated
-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;
- }
-
- public Neo4jVertexProperty(final Neo4jVertex vertex, final Neo4jNode vertexPropertyNode) {
- this.vertex = vertex;
- this.key = (String) vertexPropertyNode.getProperty(T.key.getAccessor());
- this.value = (V) vertexPropertyNode.getProperty(T.value.getAccessor());
- this.vertexPropertyNode = vertexPropertyNode;
- }
-
- @Override
- public Vertex element() {
- return this.vertex;
- }
-
- @Override
- public Object id() {
- // TODO: Neo4j needs a better ID system for VertexProperties
- return (long) (this.key.hashCode() + this.value.hashCode() + this.vertex.id().hashCode());
- }
-
- @Override
- public String key() {
- return this.key;
- }
-
- @Override
- public V value() throws NoSuchElementException {
- return this.value;
- }
-
- @Override
- public boolean isPresent() {
- return null != this.value;
- }
-
- @Override
- public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
- return Collections.emptyIterator();
- }
-
- @Override
- public <U> Property<U> property(final String key, final U value) {
- throw VertexProperty.Exceptions.metaPropertiesNotSupported();
- }
-
- @Override
- public void remove() {
- this.vertex.graph.tx().readWrite();
- final Neo4jNode node = ((Neo4jVertex) element()).getBaseVertex();
- if (node.hasProperty(key)) node.removeProperty(key);
- this.vertexPropertyNode= null;
- }
-
- @Override
- public Set<String> keys() {
- if(null == this.vertexPropertyNode) return Collections.emptySet();
- final Set<String> keys = new HashSet<>();
- for (final String key : this.vertexPropertyNode.getKeys()) {
- if (!Graph.Hidden.isHidden(key) && !key.equals(this.key))
- keys.add(key);
- }
- return Collections.unmodifiableSet(keys);
- }
-
- @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
diff --git a/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin b/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
deleted file mode 100644
index cb86e57553..0000000000
--- a/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.tinkerpop.gremlin.neo4j.jsr223.Neo4jGremlinPlugin
\ No newline at end of file
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
deleted file mode 100644
index 31a6b6ef38..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGraphProvider.java
+++ /dev/null
@@ -1,166 +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.commons.configuration2.Configuration;
-import org.apache.tinkerpop.gremlin.AbstractGraphProvider;
-import org.apache.tinkerpop.gremlin.LoadGraphWith;
-import org.apache.tinkerpop.gremlin.TestHelper;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jEdge;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jElement;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraphVariables;
-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 java.io.File;
-import java.util.HashSet;
-import java.util.Optional;
-import java.util.Random;
-import java.util.Set;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public abstract class AbstractNeo4jGraphProvider extends AbstractGraphProvider {
- private static final Set<Class> IMPLEMENTATIONS = new HashSet<Class>() {{
- add(Neo4jEdge.class);
- add(Neo4jElement.class);
- add(Neo4jGraph.class);
- add(Neo4jGraphVariables.class);
- add(Neo4jProperty.class);
- add(Neo4jVertex.class);
- add(Neo4jVertexProperty.class);
- }};
-
- protected Graph.Features features = null;
-
- @Override
- public Graph openTestGraph(final Configuration config) {
- final Graph graph = super.openTestGraph(config);
-
- // we can just use the initial set of features taken from the first graph generated from the provider because
- // neo4j feature won't ever change. don't think there is any danger of keeping this instance about even if
- // the original graph instance goes out of scope.
- if (null == features) {
- this.features = graph.features();
- }
- return graph;
- }
-
- @Override
- public Optional<Graph.Features> getStaticFeatures() {
- return Optional.ofNullable(features);
- }
-
- @Override
- public void clear(final Graph graph, final Configuration configuration) throws Exception {
- if (null != graph) {
- if (graph.tx().isOpen()) graph.tx().rollback();
- graph.close();
- }
-
- if (null != configuration && configuration.containsKey(Neo4jGraph.CONFIG_DIRECTORY)) {
- // this is a non-in-sideEffects configuration so blow away the directory
- final File graphDirectory = new File(configuration.getString(Neo4jGraph.CONFIG_DIRECTORY));
- deleteDirectory(graphDirectory);
- }
- }
-
- @Override
- public void loadGraphData(final Graph graph, final LoadGraphWith loadGraphWith, final Class testClass, final String testName) {
- if (loadGraphWith != null) this.createIndices((Neo4jGraph) graph, loadGraphWith.value());
- 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();
- }
- }
-
- private void createIndices(final Neo4jGraph graph, final LoadGraphWith.GraphData graphData) {
- final Random random = TestHelper.RANDOM;
- final boolean pick = random.nextBoolean();
- if (graphData.equals(LoadGraphWith.GraphData.GRATEFUL)) {
- if (pick) {
- graph.tx().readWrite();
- if (random.nextBoolean())
- graph.cypher("CREATE INDEX ON :artist(name)").iterate();
- if (random.nextBoolean())
- graph.cypher("CREATE INDEX ON :song(name)").iterate();
- if (random.nextBoolean())
- graph.cypher("CREATE INDEX ON :song(songType)").iterate();
- if (random.nextBoolean())
- graph.cypher("CREATE INDEX ON :song(performances)").iterate();
- graph.tx().commit();
- } // else no indices
- } else if (graphData.equals(LoadGraphWith.GraphData.MODERN)) {
- if (pick) {
- graph.tx().readWrite();
- if (random.nextBoolean())
- graph.cypher("CREATE INDEX ON :person(name)").iterate();
- if (random.nextBoolean())
- graph.cypher("CREATE INDEX ON :person(age)").iterate();
- if (random.nextBoolean())
- graph.cypher("CREATE INDEX ON :software(name)").iterate();
- if (random.nextBoolean()) {
- graph.cypher("CREATE INDEX ON :software(lang)").iterate();
- }
- graph.tx().commit();
- } // else no indices
- } else if (graphData.equals(LoadGraphWith.GraphData.CLASSIC)) {
- if (pick) {
- graph.tx().readWrite();
- if (random.nextBoolean())
- graph.cypher("CREATE INDEX ON :vertex(name)").iterate();
- if (random.nextBoolean())
- graph.cypher("CREATE INDEX ON :vertex(age)").iterate();
- if (random.nextBoolean())
- graph.cypher("CREATE INDEX ON :vertex(lang)").iterate();
- graph.tx().commit();
- } // else no indices
- }
- }
-
- @Override
- public Set<Class> getImplementations() {
- return IMPLEMENTATIONS;
- }
-}
\ No newline at end of file
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGremlinTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGremlinTest.java
deleted file mode 100644
index dca9e8de79..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/AbstractNeo4jGremlinTest.java
+++ /dev/null
@@ -1,47 +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.AbstractGremlinTest;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.neo4j.tinkerpop.api.Neo4jGraphAPI;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class AbstractNeo4jGremlinTest extends AbstractGremlinTest {
-
- protected Neo4jGraph getGraph() {
- return (Neo4jGraph) this.graph;
- }
-
- protected Neo4jGraphAPI getBaseGraph() {
- return ((Neo4jGraph) this.graph).getBaseGraph();
- }
-
- protected void validateCounts(int gV, int gE, int gN, int gR) {
- assertEquals(gV, IteratorUtils.count(graph.vertices()));
- assertEquals(gE, IteratorUtils.count(graph.edges()));
- assertEquals(gN, IteratorUtils.count(this.getBaseGraph().allNodes()));
- assertEquals(gR, IteratorUtils.count(this.getBaseGraph().allRelationships()));
- }
-}
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
deleted file mode 100644
index ec8948b6f9..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/NativeNeo4jSuite.java
+++ /dev/null
@@ -1,49 +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.AbstractGremlinSuite;
-import org.apache.tinkerpop.gremlin.neo4j.process.NativeNeo4jCypherCheck;
-import org.apache.tinkerpop.gremlin.neo4j.structure.NativeNeo4jIndexCheck;
-import org.apache.tinkerpop.gremlin.neo4j.structure.NativeNeo4jStructureCheck;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.RunnerBuilder;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class NativeNeo4jSuite extends AbstractGremlinSuite {
-
- public NativeNeo4jSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
- super(klass, builder,
- new Class<?>[]{
- NativeNeo4jStructureCheck.class,
- NativeNeo4jIndexCheck.class,
- NativeNeo4jCypherCheck.class,
- }, new Class<?>[]{
- NativeNeo4jStructureCheck.class,
- NativeNeo4jIndexCheck.class,
- NativeNeo4jCypherCheck.class
- },
- false,
- TraversalEngine.Type.STANDARD);
- }
-
-}
\ No newline at end of file
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/Neo4jGraphFeatureTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/Neo4jGraphFeatureTest.java
deleted file mode 100644
index adb70cc0a8..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/Neo4jGraphFeatureTest.java
+++ /dev/null
@@ -1,199 +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 com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Stage;
-import io.cucumber.guice.CucumberModules;
-import io.cucumber.guice.GuiceFactory;
-import io.cucumber.guice.InjectorSource;
-import io.cucumber.java.Scenario;
-import io.cucumber.junit.Cucumber;
-import io.cucumber.junit.CucumberOptions;
-import org.apache.commons.configuration2.MapConfiguration;
-import org.apache.commons.lang3.RandomStringUtils;
-import org.apache.tinkerpop.gremlin.LoadGraphWith;
-import org.apache.tinkerpop.gremlin.TestHelper;
-import org.apache.tinkerpop.gremlin.features.World;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoResourceAccess;
-import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData;
-
-@RunWith(Cucumber.class)
-@CucumberOptions(
- tags = "not @MultiProperties and not @MetaProperties and not @GraphComputerOnly and not @StepHasId and " +
- "not @DataDateTime and not @DataList and not @DataMap and not @DataSet and not @DataUUID and " +
- "not @AllowNullPropertyValues and not @UserSuppliedVertexPropertyIds and not @UserSuppliedEdgeIds and " +
- "not @UserSuppliedVertexIds and not @TinkerServiceRegistry and not @InsertionOrderingRequired and not @StepHasId", //TODO:: can we include hasId?
- glue = { "org.apache.tinkerpop.gremlin.features" },
- objectFactory = GuiceFactory.class,
- features = { "classpath:/org/apache/tinkerpop/gremlin/test/features" },
- plugin = {"progress", "junit:target/cucumber.xml"})
-public class Neo4jGraphFeatureTest {
- private static final Logger logger = LoggerFactory.getLogger(Neo4jGraphFeatureTest.class);
-
- public static final class ServiceModule extends AbstractModule {
- @Override
- protected void configure() {
- bind(World.class).to(Neo4jGraphWorld.class);
- }
- }
-
- public static class Neo4jGraphWorld implements World {
-
- private static final Neo4jGraph modern = Neo4jGraph.open(new MapConfiguration(getBaseConfiguration(GraphData.MODERN)));
- private static final Neo4jGraph classic = Neo4jGraph.open(new MapConfiguration(getBaseConfiguration(GraphData.CLASSIC)));
- private static final Neo4jGraph sink = Neo4jGraph.open(new MapConfiguration(getBaseConfiguration(GraphData.SINK)));
- private static final Neo4jGraph grateful = Neo4jGraph.open(new MapConfiguration(getBaseConfiguration(GraphData.GRATEFUL)));
- private static final Neo4jGraph empty = Neo4jGraph.open(new MapConfiguration(getBaseConfiguration(null)));
-
- static {
- createIndices();
- readIntoGraph(modern, GraphData.MODERN);
- readIntoGraph(classic, GraphData.CLASSIC);
- readIntoGraph(sink, GraphData.SINK);
- readIntoGraph(grateful, GraphData.GRATEFUL);
- }
-
- @Override
- public GraphTraversalSource getGraphTraversalSource(final GraphData graphData) {
- if (null == graphData)
- return empty.traversal();
- else if (graphData == GraphData.CLASSIC)
- return classic.traversal();
- else if (graphData == GraphData.CREW)
- throw new UnsupportedOperationException("The Crew dataset is not supported by Neo4j because it doesn't support mult/meta-properties");
- else if (graphData == GraphData.MODERN)
- return modern.traversal();
- else if (graphData == GraphData.SINK)
- return sink.traversal();
- else if (graphData == GraphData.GRATEFUL)
- return grateful.traversal();
- else
- throw new UnsupportedOperationException("GraphData not supported: " + graphData.name());
- }
-
- @Override
- public void beforeEachScenario(final Scenario scenario) {
- cleanEmpty();
- }
-
- @Override
- public String changePathToDataFile(final String pathToFileFromGremlin) {
- return ".." + File.separator + pathToFileFromGremlin;
- }
-
- private static void createIndices() {
- grateful.tx().readWrite();
- grateful.cypher("CREATE INDEX ON :artist(name)").iterate();
- grateful.cypher("CREATE INDEX ON :song(name)").iterate();
- grateful.cypher("CREATE INDEX ON :song(songType)").iterate();
- grateful.cypher("CREATE INDEX ON :song(performances)").iterate();
- grateful.tx().commit();
-
- modern.tx().readWrite();
- modern.cypher("CREATE INDEX ON :person(name)").iterate();
- modern.cypher("CREATE INDEX ON :person(age)").iterate();
- modern.cypher("CREATE INDEX ON :software(name)").iterate();
- modern.cypher("CREATE INDEX ON :software(lang)").iterate();
- modern.tx().commit();
-
- classic.tx().readWrite();
- classic.cypher("CREATE INDEX ON :vertex(name)").iterate();
- classic.cypher("CREATE INDEX ON :vertex(age)").iterate();
- classic.cypher("CREATE INDEX ON :vertex(lang)").iterate();
- classic.tx().commit();
- }
-
- private void cleanEmpty() {
- final GraphTraversalSource g = empty.traversal();
- g.V().drop().iterate();
- }
-
- private static void readIntoGraph(final Graph graph, final GraphData graphData) {
- try {
- final String dataFile = TestHelper.generateTempFileFromResource(graph.getClass(),
- GryoResourceAccess.class, graphData.location().substring(graphData.location().lastIndexOf(File.separator) + 1), "", false).getAbsolutePath();
- graph.traversal().io(dataFile).read().iterate();
- } catch (IOException ioe) {
- throw new IllegalStateException(ioe);
- }
- }
-
- private static String getWorkingDirectory() {
- return TestHelper.makeTestDataDirectory(Neo4jGraphFeatureTest.class, "graph-provider-data");
- }
-
- private static String makeTestDirectory(final String graphName) {
- return getWorkingDirectory() + File.separator
- + RandomStringUtils.randomAlphabetic(10) + File.separator
- + TestHelper.cleanPathSegment(graphName);
- }
-
- private static Map<String, Object> getBaseConfiguration(final LoadGraphWith.GraphData graphData) {
- final String directory = makeTestDirectory(graphData == null ? "default" : graphData.name().toLowerCase());
-
- final File f = new File(directory);
- if (f.exists()) deleteDirectory(f);
- f.mkdirs();
-
- return new HashMap<String, Object>() {{
- put(Graph.GRAPH, Neo4jGraph.class.getName());
- put(Neo4jGraph.CONFIG_DIRECTORY, directory);
- put(Neo4jGraph.CONFIG_CONF + ".dbms.memory.pagecache.size", "1m");
- }};
- }
-
- static void deleteDirectory(final File directory) {
- if (directory.exists()) {
- for (File file : directory.listFiles()) {
- if (file.isDirectory()) {
- deleteDirectory(file);
- } else {
- file.delete();
- }
- }
- directory.delete();
- }
-
- if (directory.exists()) logger.error("unable to delete directory " + directory.getAbsolutePath());
- }
- }
-
- public static final class WorldInjectorSource implements InjectorSource {
- @Override
- public Injector getInjector() {
- return Guice.createInjector(Stage.PRODUCTION, CucumberModules.createScenarioModule(), new ServiceModule());
- }
- }
-
-}
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/Neo4jGraphNativeNeo4jTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/Neo4jGraphNativeNeo4jTest.java
deleted file mode 100644
index a544f802d4..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/Neo4jGraphNativeNeo4jTest.java
+++ /dev/null
@@ -1,31 +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.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(NativeNeo4jSuite.class)
-@GraphProviderClass(provider = Neo4jGraphProvider.class, graph = Neo4jGraph.class)
-public class Neo4jGraphNativeNeo4jTest {
-}
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/Neo4jGraphProvider.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/Neo4jGraphProvider.java
deleted file mode 100644
index 07bda97e5c..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/Neo4jGraphProvider.java
+++ /dev/null
@@ -1,42 +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.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class Neo4jGraphProvider extends AbstractNeo4jGraphProvider {
- @Override
- public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, final LoadGraphWith.GraphData graphData) {
- final String directory = makeTestDirectory(graphName, test, testMethodName);
-
- return new HashMap<String, Object>() {{
- put(Graph.GRAPH, Neo4jGraph.class.getName());
- put(Neo4jGraph.CONFIG_DIRECTORY, directory);
- put(Neo4jGraph.CONFIG_CONF + ".dbms.memory.pagecache.size", "1m");
- }};
- }
-}
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/NativeNeo4jCypherCheck.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/NativeNeo4jCypherCheck.java
deleted file mode 100644
index 471c2fea25..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/NativeNeo4jCypherCheck.java
+++ /dev/null
@@ -1,226 +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.LoadGraphWith;
-import org.apache.tinkerpop.gremlin.neo4j.AbstractNeo4jGremlinTest;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-import org.apache.tinkerpop.gremlin.structure.T;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.util.TimeUtil;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Supplier;
-
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.as;
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.where;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class NativeNeo4jCypherCheck extends AbstractNeo4jGremlinTest {
- private static final Logger logger = LoggerFactory.getLogger(NativeNeo4jCypherCheck.class);
-
- @Test
- @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
- public void shouldExecuteCypher() throws Exception {
- this.graph.addVertex("name", "marko");
- this.graph.tx().commit();
- final Iterator<Map<String, Object>> result = this.getGraph().cypher("MATCH (a {name:\"marko\"}) RETURN a", Collections.emptyMap());
- assertNotNull(result);
- assertTrue(result.hasNext());
- }
-
- @Test
- @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
- public void shouldExecuteCypherWithArgs() throws Exception {
- this.graph.addVertex("name", "marko");
- this.graph.tx().commit();
- final Map<String, Object> bindings = new HashMap<>();
- bindings.put("n", "marko");
- final Iterator<Map<String, Object>> result = this.getGraph().cypher("MATCH (a {name:{n}}) RETURN a", bindings);
- assertNotNull(result);
- assertTrue(result.hasNext());
- }
-
- @Test
- @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
- public void shouldExecuteCypherWithArgsUsingVertexIdList() throws Exception {
- final Vertex v = this.graph.addVertex("name", "marko");
- final List<Object> idList = Arrays.asList(v.id());
- this.graph.tx().commit();
-
- final Map<String, Object> bindings = new HashMap<>();
- bindings.put("ids", idList);
- final Iterator<String> result = this.getGraph().cypher("START n=node({ids}) RETURN n", bindings).select("n").values("name");
- assertNotNull(result);
- assertTrue(result.hasNext());
- assertEquals("marko", result.next());
- }
-
- @Test
- @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
- public void shouldExecuteCypherAndBackToGremlin() throws Exception {
- this.graph.addVertex("name", "marko", "age", 29, "color", "red");
- this.graph.addVertex("name", "marko", "age", 30, "color", "yellow");
-
- this.graph.tx().commit();
- final Traversal result = this.getGraph().cypher("MATCH (a {name:\"marko\"}) RETURN a").select("a").has("age", 29).values("color");
- assertNotNull(result);
- assertTrue(result.hasNext());
- assertEquals("red", result.next().toString());
- }
-
- @Test
- @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
- public void shouldExecuteMultiIdWhereCypher() throws Exception {
- this.graph.addVertex("name", "marko", "age", 29, "color", "red");
- this.graph.addVertex("name", "marko", "age", 30, "color", "yellow");
- this.graph.addVertex("name", "marko", "age", 30, "color", "orange");
- this.graph.tx().commit();
-
- final List<Object> result = this.getGraph().cypher("MATCH (n) WHERE id(n) IN [1,2] RETURN n").select("n").id().toList();
- assertNotNull(result);
- assertEquals(2, result.size());
- assertTrue(result.contains(1l));
- assertTrue(result.contains(2l));
- }
-
- @Test
- @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
- public void shouldExecuteMultiIdWhereWithParamCypher() throws Exception {
- final Vertex v1 = this.graph.addVertex("name", "marko", "age", 29, "color", "red");
- final Vertex v2 = this.graph.addVertex("name", "marko", "age", 30, "color", "yellow");
- this.graph.addVertex("name", "marko", "age", 30, "color", "orange");
- this.graph.tx().commit();
-
- final List<Object> ids = Arrays.asList(v1.id(), v2.id());
- final Map<String, Object> m = new HashMap<>();
- m.put("ids", ids);
- final List<Object> result = this.getGraph().cypher("MATCH (n) WHERE id(n) IN {ids} RETURN n", m).select("n").id().toList();
- assertNotNull(result);
- assertEquals(2, result.size());
- assertTrue(result.contains(v1.id()));
- assertTrue(result.contains(v2.id()));
- }
-
- @Test
- @Ignore
- @LoadGraphWith(LoadGraphWith.GraphData.GRATEFUL)
- public void benchmarkCypherAndMatch() throws Exception {
- final Neo4jGraph n = (Neo4jGraph) graph;
- final List<Supplier<GraphTraversal<?, ?>>> traversals = Arrays.asList(
- () -> g.V().match(
- as("a").in("sungBy").as("b"),
- as("a").in("writtenBy").as("b")).select("a", "b").by("name"),
- () -> n.cypher("MATCH (a)<-[:sungBy]-(b), (a)<-[:writtenBy]-(b) RETURN a.name, b.name"),
- ///
- () -> g.V().match(
- as("a").out("followedBy").as("b"),
- as("b").out("followedBy").as("a")).select("a", "b").by("name"),
- () -> n.cypher("MATCH (a)-[:followedBy]->(b), (b)-[:followedBy]->(a) RETURN a.name, b.name"),
- ///
- () -> g.V().match(
- as("a").out("followedBy").count().is(P.gt(10)).as("b"),
- as("a").in("followedBy").count().is(P.gt(10)).as("b")).
- select("a").by("name"),
- () -> n.cypher("MATCH (a)-[:followedBy]->(b) WITH a, COUNT(b) AS bc WHERE bc > 10 MATCH (a)<-[:followedBy]-(c) WITH a, bc, COUNT(c) AS cc WHERE bc = cc RETURN a.name"),
- ///
- () -> g.V().match(
- as("a").in("sungBy").count().as("b"),
- as("a").in("sungBy").as("c"),
- as("c").out("followedBy").as("d"),
- as("d").out("sungBy").as("e"),
- as("e").in("sungBy").count().as("b"),
- where("a", P.neq("e"))).select("a", "e").by("name"),
- () -> n.cypher("MATCH (a)<-[:sungBy]-()-[:followedBy]->()-[:sungBy]->(e) WHERE a <> e WITH a, e MATCH (a)<-[:sungBy]-(b) WITH a, e, COUNT(DISTINCT b) as bc MATCH (e)<-[:sungBy]-(f) WITH a, e, bc, COUNT(DISTINCT f) as fc WHERE bc = fc RETURN a.name, e.name"),
- ///
- () -> g.V().match(
- as("a").in("followedBy").as("b"),
- as("a").out("sungBy").as("c"),
- as("b").out("sungBy").as("c")).select("a", "b"),
- () -> n.cypher("MATCH (a)<-[:followedBy]-(b), (a)-[:sungBy]->(c), (b)-[:sungBy]->(c) RETURN a, b"),
- ///
- () -> g.V().match(
- as("a").in("followedBy").as("b"),
- as("a").out("sungBy").as("c"),
- as("a").out("writtenBy").as("d"),
- as("b").out("sungBy").as("c"),
- as("b").out("writtenBy").as("d"),
- where("c", P.neq("d"))).select("a", "b").by("name"),
- () -> n.cypher("MATCH (a)<-[:followedBy]-(b), (a)-[:sungBy]->(c), (a)-[:writtenBy]->(d), (b)-[:sungBy]->(c), (b)-[:writtenBy]->(d) WHERE c <> d RETURN a.name, b.name"),
- ///
- () -> g.V().match(
- as("a").in("sungBy").as("b"),
- as("a").in("writtenBy").as("b"),
- as("b").out("followedBy").as("c"),
- as("c").out("sungBy").as("a"),
- as("c").out("writtenBy").as("a")).select("a").by("name"),
- () -> n.cypher("MATCH (a)<-[:sungBy]-(b), (a)<-[:writtenBy]-(b), (b)-[:followedBy]->(c), (c)-[:sungBy]->(a), (c)-[:writtenBy]->(a) RETURN a.name"),
- ///
- () -> g.V().match(
- as("a").has("name", "Garcia").has(T.label, "artist"),
- as("a").in("writtenBy").as("b"),
- as("b").out("followedBy").as("c"),
- as("c").out("writtenBy").as("d"),
- as("d").where(P.neq("a"))).select("a", "d").by("name"),
- () -> n.cypher("MATCH (a)<-[:writtenBy]-(b), (b)-[:followedBy]->(c), (c)-[:writtenBy]->(d) WHERE a <> d AND a.name = 'Garcia' AND 'artist' IN labels(a) RETURN a.name, d.name"),
- ///
- () -> g.V().match(
- as("a").out("followedBy").as("b"),
- as("b").out("followedBy").as("c")).select("a").by("name"),
- () -> n.cypher("MATCH (a)-[:followedBy]->(b), (b)-[:followedBy]->(c) RETURN a.name"),
- ///
- () -> g.V().match(
- as("a").out("followedBy").as("b"),
- as("a").has(T.label, "song").has("performances", P.gt(10)),
- as("a").out("writtenBy").as("c"),
- as("b").out("writtenBy").as("c")).select("a", "b", "c").by("name"),
- () -> n.cypher("MATCH (a)-[:followedBy]->(b), (a)-[:writtenBy]->(c), (b)-[:writtenBy]->(c) WHERE a.performances > 10 AND 'song' IN labels(a) RETURN a, b, c").select("a", "b", "c").by("name")
- );
-
- for (int i = 0; i < traversals.size(); i = i + 2) {
- final Supplier<GraphTraversal<?, ?>> gremlin = traversals.get(i);
- final Supplier<GraphTraversal<?, ?>> cypher = traversals.get(i + 1);
- for (final Supplier<GraphTraversal<?, ?>> sub : Arrays.asList(cypher, gremlin)) {
- logger.info("pre-strategy: {}", sub.get());
- logger.info("post-strategy: {}", sub.get().iterate());
- logger.info(TimeUtil.clockWithResult(25, () -> sub.get().count().next()).toString());
- logger.info("------------------");
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/Neo4jGraphProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/Neo4jGraphProcessStandardTest.java
deleted file mode 100644
index f710fa9b1c..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/Neo4jGraphProcessStandardTest.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;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.neo4j.Neo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.process.ProcessEmbeddedStandardSuite;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(ProcessEmbeddedStandardSuite.class)
-@GraphProviderClass(provider = Neo4jGraphProvider.class, graph = Neo4jGraph.class)
-public class Neo4jGraphProcessStandardTest {
-}
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
deleted file mode 100644
index 2a749c5286..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/strategy/optimization/Neo4jGraphStepStrategyTest.java
+++ /dev/null
@@ -1,139 +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.traversal.strategy.optimization;
-
-import org.apache.tinkerpop.gremlin.neo4j.process.traversal.step.sideEffect.Neo4jGraphStep;
-import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
-import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.FilterRankingStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.LazyBarrierStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies;
-import org.apache.tinkerpop.gremlin.process.traversal.util.EmptyTraversal;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-
-import static org.apache.tinkerpop.gremlin.process.traversal.P.eq;
-import static org.apache.tinkerpop.gremlin.process.traversal.P.gt;
-import static org.apache.tinkerpop.gremlin.process.traversal.P.lt;
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.filter;
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.has;
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.not;
-import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.properties;
-import static org.junit.Assert.assertEquals;
-
-/**
- * @author Marko Rodriguez (http://markorodriguez.com)
- * @author Daniel Kuppitz (http://gremlin.guru)
- */
-@RunWith(Parameterized.class)
-public class Neo4jGraphStepStrategyTest {
-
- @Parameterized.Parameter(value = 0)
- public Traversal original;
-
- @Parameterized.Parameter(value = 1)
- public Traversal optimized;
-
- @Parameterized.Parameter(value = 2)
- public Collection<TraversalStrategy> otherStrategies;
-
- @Test
- public void doTest() {
- final TraversalStrategies strategies = new DefaultTraversalStrategies();
- strategies.addStrategies(Neo4jGraphStepStrategy.instance());
- for (final TraversalStrategy strategy : this.otherStrategies) {
- strategies.addStrategies(strategy);
- }
- this.original.asAdmin().setStrategies(strategies);
- this.original.asAdmin().applyStrategies();
- assertEquals(this.optimized, this.original);
- }
-
- private static GraphTraversal.Admin<?, ?> g_V(final Object... hasKeyValues) {
- final GraphTraversal.Admin<?, ?> traversal = new DefaultGraphTraversal<>();
- final Neo4jGraphStep<Vertex, Vertex> graphStep = new Neo4jGraphStep<>(new GraphStep<>(traversal, Vertex.class, true));
- for (int i = 0; i < hasKeyValues.length; i = i + 2) {
- graphStep.addHasContainer(new HasContainer((String) hasKeyValues[i], (P) hasKeyValues[i + 1]));
- }
- return traversal.addStep(graphStep);
- }
-
- private static GraphStep<?, ?> V(final Object... hasKeyValues) {
- final Neo4jGraphStep<Vertex, Vertex> graphStep = new Neo4jGraphStep<>(new GraphStep<>(EmptyTraversal.instance(), Vertex.class, true));
- for (int i = 0; i < hasKeyValues.length; i = i + 2) {
- graphStep.addHasContainer(new HasContainer((String) hasKeyValues[i], (P) hasKeyValues[i + 1]));
- }
- return graphStep;
- }
-
- @Parameterized.Parameters(name = "{0}")
- public static Iterable<Object[]> generateTestParameters() {
- final int LAZY_SIZE = 2500;
- return Arrays.asList(new Object[][]{
- {__.V().out(), g_V().out(), Collections.emptyList()},
- {__.V().has("name", "marko").out(), g_V("name", eq("marko")).out(), Collections.emptyList()},
- {__.V().has("name", "marko").has("age", gt(31).and(lt(10))).out(),
- g_V("name", eq("marko"), "age", gt(31), "age", lt(10)).out(), Collections.emptyList()},
- {__.V().has("name", "marko").or(has("age"), has("age", gt(32))).has("lang", "java"),
- g_V("name", eq("marko"), "lang", eq("java")).or(has("age"), has("age", gt(32))), Collections.singletonList(FilterRankingStrategy.instance())},
- {__.V().has("name", "marko").as("a").or(has("age"), has("age", gt(32))).has("lang", "java"),
- g_V("name", eq("marko")).as("a").or(has("age"), has("age", gt(32))).has("lang", "java"), Collections.emptyList()},
- {__.V().has("name", "marko").as("a").or(has("age"), has("age", gt(32))).has("lang", "java"),
- g_V("name", eq("marko"), "lang", eq("java")).or(has("age"), has("age", gt(32))).as("a"), Collections.singletonList(FilterRankingStrategy.instance())},
- {__.V().dedup().has("name", "marko").or(has("age"), has("age", gt(32))).has("lang", "java"),
- g_V("name", eq("marko"), "lang", eq("java")).or(has("age"), has("age", gt(32))).dedup(), Collections.singletonList(FilterRankingStrategy.instance())},
- {__.V().as("a").dedup().has("name", "marko").or(has("age"), has("age", gt(32))).has("lang", "java"),
- g_V("name", eq("marko"), "lang", eq("java")).or(has("age"), has("age", gt(32))).dedup().as("a"), Collections.singletonList(FilterRankingStrategy.instance())},
- {__.V().as("a").has("name", "marko").as("b").or(has("age"), has("age", gt(32))).has("lang", "java"),
- g_V("name", eq("marko"), "lang", eq("java")).or(has("age"), has("age", gt(32))).as("b", "a"), Collections.singletonList(FilterRankingStrategy.instance())},
- {__.V().as("a").dedup().has("name", "marko").or(has("age"), has("age", gt(32))).filter(has("name", "bob")).has("lang", "java"),
- g_V("name", eq("marko"), "lang", eq("java"), "name", eq("bob")).or(has("age"), has("age", gt(32))).dedup().as("a"), Arrays.asList(InlineFilterStrategy.instance(), FilterRankingStrategy.instance())},
- {__.V().as("a").dedup().has("name", "marko").or(has("age", 10), has("age", gt(32))).filter(has("name", "bob")).has("lang", "java"),
- g_V("name", eq("marko"), "lang", eq("java"), "name", eq("bob"), "age", eq(10).or(gt(32))).dedup().as("a"), TraversalStrategies.GlobalCache.getStrategies(Neo4jGraph.class).toList()},
- {__.V().has("name", "marko").or(not(has("age")), has("age", gt(32))).has("name", "bob").has("lang", "java"),
- g_V("name", eq("marko"), "name", eq("bob"), "lang", eq("java")).or(not(filter(properties("age"))), has("age", gt(32))), TraversalStrategies.GlobalCache.getStrategies(Neo4jGraph.class).toList()},
- {__.V().has("name", P.eq("marko").or(P.eq("bob").and(P.eq("stephen")))).out("knows"),
- g_V("name", eq("marko").or(P.eq("bob").and(P.eq("stephen")))).out("knows"), Collections.emptyList()},
- {__.V().has("name", P.eq("marko").and(P.eq("bob").and(P.eq("stephen")))).out("knows"),
- g_V("name", eq("marko"), "name", eq("bob"), "name", eq("stephen")).out("knows"), Collections.emptyList()},
- {__.V().has("name", P.eq("marko").and(P.eq("bob").or(P.eq("stephen")))).out("knows"),
- g_V("name", eq("marko"), "name", P.eq("bob").or(eq("stephen"))).out("knows"), Collections.emptyList()},
- ///////
- {__.V().out().out().V().has("name", "marko").out(), g_V().out().barrier(LAZY_SIZE).out().barrier(LAZY_SIZE).asAdmin().addStep(V("name", eq("marko"))).barrier(LAZY_SIZE).out(), Arrays.asList(InlineFilterStrategy.instance(), FilterRankingStrategy.instance(), LazyBarrierStrategy.instance())},
- {__.V().out().out().V().has("name", "marko").as("a").out(), g_V().out().barrier(LAZY_SIZE).out().barrier(LAZY_SIZE).asAdmin().addStep(V("name", eq("marko"))).barrier(LAZY_SIZE).as("a").out(), Arrays.asList(InlineFilterStrategy.instance(), FilterRankingStrategy.instance(), LazyBarrierStrategy.instance())},
- {__.V().out().V().has("age", gt(32)).barrier(10).has("name", "marko").as("a"), g_V().out().barrier(LAZY_SIZE).asAdmin().addStep(V("age", gt(32), "name", eq("marko"))).barrier(LAZY_SIZE).barrier(10).as("a"), Arrays.asList(InlineFilterStrategy.instance(), FilterRankingStrategy.instance(), LazyBarrierStrategy.instance())},
- {__.V().out().V().has("age", gt(32)).barrier(10).has("name", "marko").as("a"), g_V().out().barrier(LAZY_SIZE).asAdmin().addStep(V("age", gt(32), "name", eq("marko"))).barrier(LAZY_SIZE).barrier(10).as("a"), TraversalStrategies.GlobalCache.getStrategies(Neo4jGraph.class).toList()},
- });
- }
-}
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jIndexCheck.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jIndexCheck.java
deleted file mode 100644
index 20626299d0..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jIndexCheck.java
+++ /dev/null
@@ -1,275 +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.FeatureRequirement;
-import org.apache.tinkerpop.gremlin.neo4j.AbstractNeo4jGremlinTest;
-import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-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.util.TimeUtil;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class NativeNeo4jIndexCheck extends AbstractNeo4jGremlinTest {
- private static final Logger logger = LoggerFactory.getLogger(NativeNeo4jIndexCheck.class);
-
- @Test
- public void shouldHaveFasterRuntimeWithLabelKeyValueIndex() throws Exception {
- final Neo4jGraph neo4j = (Neo4jGraph) this.graph;
- int maxVertices = 10000;
- for (int i = 0; i < maxVertices; 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();
-
- // traversal
- final Runnable traversal = () -> {
- final Traversal<Vertex, Vertex> t = g.V().hasLabel("something").has("myId", 2000);
- final Vertex vertex = t.tryNext().get();
- assertFalse(t.hasNext());
- assertEquals(1, IteratorUtils.count(vertex.properties("myId")));
- assertEquals("something", vertex.label());
- };
-
- // no index
- this.graph.tx().readWrite();
- assertFalse(this.getBaseGraph().hasSchemaIndex("something", "myId"));
- TimeUtil.clock(20, traversal);
- final double noIndexTime = TimeUtil.clock(20, traversal);
- // index time
- neo4j.cypher("CREATE INDEX ON :something(myId)").iterate();
- this.graph.tx().commit();
- this.graph.tx().readWrite();
- Thread.sleep(5000); // wait for indices to be built
- assertTrue(this.getBaseGraph().hasSchemaIndex("something", "myId"));
- TimeUtil.clock(20, traversal);
- final double indexTime = TimeUtil.clock(20, traversal);
- logger.info("Query time (no-index vs. index): {}", noIndexTime + " vs. {}", indexTime);
- assertTrue((noIndexTime / 10) > indexTime); // should be at least 10x faster
- }
-
- @Test
- public void shouldReturnResultsLabeledIndexOnVertexWithHasHas() {
- this.graph.tx().readWrite();
- this.getBaseGraph().execute("CREATE INDEX ON :Person(name)", null);
- 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(T.label, "Person").has("name", "marko").count().next(), 0);
- assertEquals(2, this.g.V().has("name", "marko").count().next(), 0);
- }
-
- @Test
- public void shouldEnsureColonedKeyIsTreatedAsNormalKey() {
- this.graph.tx().readWrite();
- this.getBaseGraph().execute("CREATE INDEX ON :Person(name)", null);
- 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(T.label, "Person").has("name", "marko").count().next(), 0);
- assertEquals(0, this.g.V().has("Person:name", "marko").count().next(), 0);
- }
-
- @Test
- public void shouldReturnResultsUsingLabeledIndexOnVertexWithHasHasHas() {
- this.graph.tx().readWrite();
- this.getBaseGraph().execute("CREATE INDEX ON :Person(name)", null);
- this.graph.tx().commit();
- this.graph.addVertex(T.label, "Person", "name", "marko", "color", "blue");
- this.graph.addVertex(T.label, "Person", "name", "marko", "color", "green");
- this.graph.tx().commit();
- assertEquals(1, this.g.V().has(T.label, "Person").has("name", "marko").has("color", "blue").count().next(), 0);
- assertEquals(2, this.g.V().has("name", "marko").count().next(), 0);
- }
-
- @Test
- public void shouldReturnResultsOnVertexWithHasHasHasNoIndex() {
- this.graph.tx().commit();
- this.graph.addVertex(T.label, "Person", "name", "marko", "color", "blue");
- this.graph.addVertex(T.label, "Person", "name", "marko", "color", "green");
- this.graph.tx().commit();
- assertEquals(1, this.g.V().has(T.label, "Person").has("name", "marko").has("color", "blue").count().next(), 0);
- assertEquals(2, this.g.V().has("name", "marko").count().next(), 0);
- }
-
- @Test
- public void shouldReturnResultsUsingLabeledIndexOnVertexWithColonFails() {
- this.graph.tx().readWrite();
- this.getBaseGraph().execute("CREATE INDEX ON :Person(name)", null);
- this.graph.tx().commit();
- this.graph.addVertex(T.label, "Person", "name", "marko");
- this.graph.addVertex(T.label, "Person", "name", "marko");
- this.graph.tx().commit();
- assertNotEquals(2l, this.g.V().has("Person:name", "marko").count().next().longValue());
- assertEquals(2, this.g.V().has("name", "marko").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);
- this.graph.tx().commit();
- this.graph.tx().commit();
- this.graph.addVertex(T.label, "Person", "name", "marko");
- this.graph.tx().commit();
- assertEquals("marko", g.V().has(T.label, "Person").has("name", "marko").next().value("name"));
- }
-
- @Test
- public void shouldEnforceMultipleUniqueConstraint() {
- this.graph.tx().readWrite();
- 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");
- this.graph.tx().commit();
- boolean failSurname = false;
- try {
- this.graph.addVertex(T.label, "Person", "surname", "aaaa");
- } catch (RuntimeException e) {
- if (isConstraintViolation(e)) failSurname = true;
- }
- assertTrue(failSurname);
- boolean failName = false;
- try {
- this.graph.addVertex(T.label, "Person", "name", "marko");
- } catch (RuntimeException e) {
- if (isConstraintViolation(e)) failName = true;
- }
- assertTrue(failName);
- this.graph.tx().commit();
- }
-
- private boolean isConstraintViolation(RuntimeException e) {
- return e.getClass().getSimpleName().equals("ConstraintViolationException");
- }
-
- @Test
- public void shouldDropMultipleUniqueConstraint() {
- this.graph.tx().readWrite();
- 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");
- this.graph.tx().commit();
- boolean failSurname = false;
- try {
- this.graph.addVertex(T.label, "Person", "surname", "aaaa");
- } catch (RuntimeException e) {
- if (isConstraintViolation(e)) failSurname = true;
- }
- assertTrue(failSurname);
- boolean failName = false;
- try {
- this.graph.addVertex(T.label, "Person", "name", "marko");
- } catch (RuntimeException e) {
- if (isConstraintViolation(e)) failName = true;
- }
- assertTrue(failName);
- this.graph.tx().commit();
-
- this.graph.tx().readWrite();
- 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);
- assertEquals(1, this.g.V().has(T.label, "Person").has("surname", "aaaa").count().next(), 0);
- this.graph.addVertex(T.label, "Person", "surname", "aaaa");
- this.graph.addVertex(T.label, "Person", "name", "marko");
- this.graph.tx().commit();
- assertEquals(2, this.g.V().has(T.label, "Person").has("name", "marko").count().next(), 0);
- assertEquals(2, this.g.V().has(T.label, "Person").has("surname", "aaaa").count().next(), 0);
- }
-
- @Test(expected = RuntimeException.class)
- public void shouldFailUniqueConstraint() {
- this.graph.tx().readWrite();
- 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();
- assertEquals("marko", g.V().has(T.label, "Person").has("name", "marko").next().value("name"));
- this.graph.addVertex(T.label, "Person", "name", "marko");
- }
-
- @Test
- public void shouldDoLabelAndIndexSearch() {
- graph.tx().readWrite();
- this.getBaseGraph().execute("CREATE INDEX ON :Person(name)", null);
- 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("Person", "name", "marko").count().next(), 0);
- assertEquals(3, this.g.V().has(T.label, "Person").count().next(), 0);
- assertEquals(1, this.g.V().has(T.label, "Person").has("name", "marko").count().next(), 0);
- }
-
- @Test
- public void shouldDoLabelsNamespaceBehavior() {
- graph.tx().readWrite();
-
- 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");
- this.graph.addVertex(T.label, "Person", "name", "john");
- this.graph.addVertex(T.label, "Person", "name", "pete");
- this.graph.addVertex(T.label, "Product", "name", "marko");
- this.graph.addVertex(T.label, "Product", "name", "john");
- this.graph.addVertex(T.label, "Product", "name", "pete");
- this.graph.addVertex(T.label, "Corporate", "name", "marko");
- this.graph.addVertex(T.label, "Corporate", "name", "john");
- this.graph.addVertex(T.label, "Corporate", "name", "pete");
- this.graph.tx().commit();
- assertEquals(1, this.g.V().has(T.label, "Person").has("name", "marko").has(T.label, "Person").count().next(), 0);
- assertEquals(1, this.g.V().has(T.label, "Product").has("name", "marko").has(T.label, "Product").count().next(), 0);
- assertEquals(1, this.g.V().has(T.label, "Corporate").has("name", "marko").has(T.label, "Corporate").count().next(), 0);
- assertEquals(0, this.g.V().has(T.label, "Person").has("name", "marko").has(T.label, "Product").count().next(), 0);
- assertEquals(0, this.g.V().has(T.label, "Product").has("name", "marko").has(T.label, "Person").count().next(), 0);
- assertEquals(0, this.g.V().has(T.label, "Corporate").has("name", "marko").has(T.label, "Person").count().next(), 0);
- }
-}
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureCheck.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureCheck.java
deleted file mode 100644
index 54770ffe16..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureCheck.java
+++ /dev/null
@@ -1,242 +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.FeatureRequirement;
-import org.apache.tinkerpop.gremlin.neo4j.AbstractNeo4jGremlinTest;
-import org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-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.util.iterator.IteratorUtils;
-import org.junit.Test;
-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 org.neo4j.tinkerpop.api.Neo4jTx;
-
-import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class NativeNeo4jStructureCheck extends AbstractNeo4jGremlinTest {
-
- @Test
- public void shouldOpenWithOverriddenConfig() throws Exception {
- assertNotNull(this.graph);
- }
-
- @Test
- public void shouldSupportHasContainersWithMultiLabels() throws Exception {
- final Neo4jVertex vertex = (Neo4jVertex) this.graph.addVertex(T.label, "person", "name", "marko");
- graph.tx().commit();
- assertTrue(g.V().has(T.label, "person").hasNext());
- assertEquals("marko", g.V().has(T.label, LabelP.of("person")).values("name").next());
- assertEquals("marko", g.V().has(T.label, "person").values("name").next());
- // more labels
- vertex.addLabel("animal");
- vertex.addLabel("object");
- graph.tx().commit();
- // no indices (neo4j graph step)
- assertFalse(g.V().has(T.label, "person").hasNext());
- assertEquals("marko", g.V().has(T.label, LabelP.of("person")).values("name").next());
- assertEquals("marko", g.V().has(T.label, LabelP.of("animal")).values("name").next());
- assertEquals("marko", g.V().has(T.label, LabelP.of("object")).values("name").next());
- // no indices (has step)
- assertFalse(g.V().as("a").select("a").has(T.label, "person").hasNext());
- assertEquals("marko", g.V().as("a").select("a").has(T.label, LabelP.of("person")).values("name").next());
- assertEquals("marko", g.V().as("a").select("a").has(T.label, LabelP.of("animal")).values("name").next());
- assertEquals("marko", g.V().as("a").select("a").has(T.label, LabelP.of("object")).values("name").next());
- // indices (neo4j graph step)
- this.getGraph().cypher("CREATE INDEX ON :person(name)").iterate();
- graph.tx().commit();
- Thread.sleep(500);
- assertFalse(g.V().has(T.label, "person").has("name", "marko").hasNext());
- assertEquals("marko", g.V().has(T.label, LabelP.of("person")).has("name", "marko").values("name").next());
- assertEquals("marko", g.V().has(T.label, LabelP.of("animal")).has("name", "marko").values("name").next());
- assertEquals("marko", g.V().has(T.label, LabelP.of("object")).has("name", "marko").values("name").next());
- this.getGraph().cypher("CREATE INDEX ON :animal(name)").iterate();
- graph.tx().commit();
- Thread.sleep(500);
- assertFalse(g.V().has(T.label, "animal").has("name", "marko").hasNext());
- assertEquals("marko", g.V().has(T.label, LabelP.of("person")).has("name", "marko").values("name").next());
- assertEquals("marko", g.V().has(T.label, LabelP.of("animal")).has("name", "marko").values("name").next());
- assertEquals("marko", g.V().has(T.label, LabelP.of("object")).has("name", "marko").values("name").next());
- this.getGraph().cypher("CREATE INDEX ON :object(name)").iterate();
- graph.tx().commit();
- Thread.sleep(500);
- assertFalse(g.V().has(T.label, "object").has("name", "marko").hasNext());
- assertEquals("marko", g.V().has(T.label, LabelP.of("person")).has("name", "marko").values("name").next());
- assertEquals("marko", g.V().has(T.label, LabelP.of("animal")).has("name", "marko").values("name").next());
- assertEquals("marko", g.V().has(T.label, LabelP.of("object")).has("name", "marko").values("name").next());
- }
-
- @Test
- public void shouldNotThrowConcurrentModificationException() {
- this.graph.addVertex("name", "a");
- this.graph.addVertex("name", "b");
- this.graph.addVertex("name", "c");
- this.graph.addVertex("name", "d");
- this.graph.vertices().forEachRemaining(Vertex::remove);
- this.graph.tx().commit();
- assertEquals(0, IteratorUtils.count(this.graph.vertices()), 0);
- }
-
- @Test
- public void shouldTraverseWithoutLabels() {
- final Neo4jGraphAPI service = this.getGraph().getBaseGraph();
-
- final Neo4jTx tx = service.tx();
- final Neo4jNode n = service.createNode();
- tx.success();
- tx.close();
-
- final Neo4jTx tx2 = service.tx();
- assertEquals(0, IteratorUtils.count(n.labels().iterator()));
- assertEquals(1, IteratorUtils.count(graph.vertices()));
- graph.tx().close();
- tx2.close();
- }
-
- @Test
- public void shouldDoLabelSearch() {
- this.graph.addVertex(T.label, "Person", "name", "marko");
- this.graph.addVertex(T.label, "Person", "name", "john");
- Vertex pete = this.graph.addVertex(T.label, "Person", "name", "pete");
- this.graph.addVertex(T.label, "Monkey", "name", "pete");
- this.graph.tx().commit();
- assertEquals(3, this.g.V().has(T.label, "Person").count().next(), 0);
- pete.remove();
- this.graph.tx().commit();
- assertEquals(2, this.g.V().has(T.label, "Person").count().next(), 0);
- }
-
- @Test
- public void shouldNotGenerateVerticesOrEdgesForGraphVariables() {
- graph.tx().readWrite();
- graph.variables().set("namespace", "rdf-xml");
- tryCommit(graph, graph -> {
- assertEquals("rdf-xml", graph.variables().get("namespace").get());
- assertEquals(0, g.V().count().next().intValue());
- assertEquals(0, g.E().count().next().intValue());
- assertEquals(0, IteratorUtils.count(this.getBaseGraph().allNodes()));
- assertEquals(0, IteratorUtils.count(this.getBaseGraph().allRelationships()));
- });
- }
-
- @Test
- public void shouldNotGenerateNodesAndRelationships() {
- graph.tx().readWrite();
- tryCommit(graph, graph -> validateCounts(0, 0, 0, 0));
- Vertex vertex = graph.addVertex(T.label, "person");
- tryCommit(graph, graph -> validateCounts(1, 0, 1, 0));
- vertex.property("name", "marko");
- assertEquals("marko", vertex.value("name"));
- tryCommit(graph, graph -> validateCounts(1, 0, 1, 0));
- vertex.property("name", "okram");
- tryCommit(graph, g -> {
- validateCounts(1, 0, 1, 0);
- assertEquals("okram", vertex.value("name"));
- });
- VertexProperty vertexProperty = vertex.property("name");
- tryCommit(graph, graph -> {
- assertTrue(vertexProperty.isPresent());
- assertEquals("name", vertexProperty.key());
- assertEquals("okram", vertexProperty.value());
- validateCounts(1, 0, 1, 0);
- });
- try {
- vertexProperty.property("acl", "private");
- } catch (UnsupportedOperationException e) {
- assertEquals(VertexProperty.Exceptions.metaPropertiesNotSupported().getMessage(), e.getMessage());
- }
- }
-
- @Test
- public void shouldSupportNeo4jMultiLabels() {
- final Neo4jVertex vertex = (Neo4jVertex) graph.addVertex(T.label, "animal::person", "name", "marko");
- tryCommit(graph, graph -> {
- assertTrue(vertex.label().equals("animal::person"));
- assertEquals(2, vertex.labels().size());
- assertTrue(vertex.labels().contains("person"));
- assertTrue(vertex.labels().contains("animal"));
- assertEquals(2, IteratorUtils.count(vertex.getBaseVertex().labels().iterator()));
- });
-
- vertex.addLabel("organism");
- tryCommit(graph, graph -> {
- assertTrue(vertex.label().equals("animal::organism::person"));
- assertEquals(3, vertex.labels().size());
- assertTrue(vertex.labels().contains("person"));
- assertTrue(vertex.labels().contains("animal"));
- assertTrue(vertex.labels().contains("organism"));
- assertEquals(3, IteratorUtils.count(vertex.getBaseVertex().labels().iterator()));
- });
-
- vertex.removeLabel("person");
- tryCommit(graph, graph -> {
- assertTrue(vertex.label().equals("animal::organism"));
- assertEquals(2, vertex.labels().size());
- assertTrue(vertex.labels().contains("animal"));
- assertTrue(vertex.labels().contains("organism"));
- });
-
- vertex.addLabel("organism"); // repeat add
- vertex.removeLabel("person"); // repeat remove
- tryCommit(graph, graph -> {
- assertTrue(vertex.label().equals("animal::organism"));
- assertEquals(2, vertex.labels().size());
- assertTrue(vertex.labels().contains("animal"));
- assertTrue(vertex.labels().contains("organism"));
- assertEquals(2, IteratorUtils.count(vertex.getBaseVertex().labels().iterator()));
- });
-
- assertEquals(Long.valueOf(0), g.V().has(T.label, "organism").count().next());
- assertEquals(Long.valueOf(1), g.V().has(T.label, LabelP.of("organism")).count().next());
- assertEquals(Long.valueOf(1), g.V().has(T.label, LabelP.of("animal")).count().next());
-
- vertex.removeLabel("organism");
- vertex.removeLabel("animal");
- assertEquals(0, vertex.labels().size());
- vertex.addLabel("organism-animal");
- tryCommit(graph, graph -> {
- assertEquals(Long.valueOf(0), g.V().has(T.label, LabelP.of("organism")).count().next());
- assertEquals(Long.valueOf(0), g.V().has(T.label, LabelP.of("animal")).count().next());
- assertEquals(Long.valueOf(0), g.V().map(Traverser::get).has(T.label, LabelP.of("organism")).count().next());
- assertEquals(Long.valueOf(0), g.V().map(Traverser::get).has(T.label, LabelP.of("animal")).count().next());
- //
- assertEquals(Long.valueOf(1), g.V().has(T.label, LabelP.of("organism-animal")).count().next());
- assertEquals(Long.valueOf(1), g.V().has(T.label, "organism-animal").count().next());
- assertEquals(Long.valueOf(1), g.V().map(Traverser::get).has(T.label, LabelP.of("organism-animal")).count().next());
- assertEquals(Long.valueOf(1), g.V().map(Traverser::get).has(T.label, "organism-animal").count().next());
- });
- }
-
-}
\ No newline at end of file
diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraphStructureStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraphStructureStandardTest.java
deleted file mode 100644
index 56396b19e6..0000000000
--- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraphStructureStandardTest.java
+++ /dev/null
@@ -1,32 +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.Neo4jGraphProvider;
-import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
-import org.junit.runner.RunWith;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-@RunWith(StructureStandardSuite.class)
-@GraphProviderClass(provider = Neo4jGraphProvider.class, graph = Neo4jGraph.class)
-public class Neo4jGraphStructureStandardTest {
-}
diff --git a/neo4j-gremlin/src/test/resources/cucumber.properties b/neo4j-gremlin/src/test/resources/cucumber.properties
deleted file mode 100644
index bbb9128a27..0000000000
--- a/neo4j-gremlin/src/test/resources/cucumber.properties
+++ /dev/null
@@ -1 +0,0 @@
-guice.injector-source=org.apache.tinkerpop.gremlin.neo4j.Neo4jGraphFeatureTest$WorldInjectorSource
\ No newline at end of file
diff --git a/neo4j-gremlin/src/test/resources/logback-silent.xml b/neo4j-gremlin/src/test/resources/logback-silent.xml
deleted file mode 100644
index cb9d2525be..0000000000
--- a/neo4j-gremlin/src/test/resources/logback-silent.xml
+++ /dev/null
@@ -1,28 +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.
--->
-<configuration>
- <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>[%p] %C - %m%n</pattern>
- </encoder>
- </appender>
- <!-- need to turn this on so that we know the test seed -->
- <logger name="org.apache.tinkerpop.gremlin.TestHelper" level="INFO"/>
- <root level="OFF">
- <appender-ref ref="stdout"/>
- </root>
-</configuration>
\ No newline at end of file
diff --git a/neo4j-gremlin/src/test/resources/logback-test.xml b/neo4j-gremlin/src/test/resources/logback-test.xml
deleted file mode 100644
index f1bca0d507..0000000000
--- a/neo4j-gremlin/src/test/resources/logback-test.xml
+++ /dev/null
@@ -1,28 +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.
--->
-<configuration>
- <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>[%p] %C - %m%n</pattern>
- </encoder>
- </appender>
- <!-- need to turn this on so that we know the test seed -->
- <logger name="org.apache.tinkerpop.gremlin.TestHelper" level="INFO"/>
- <root level="WARN">
- <appender-ref ref="stdout"/>
- </root>
-</configuration>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index b67dfd0c92..414fc5efb1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -138,7 +138,6 @@ limitations under the License.
<module>gremlin-go</module>
<module>hadoop-gremlin</module>
<module>spark-gremlin</module>
- <module>neo4j-gremlin</module>
<module>sparql-gremlin</module>
<module>gremlin-console</module>
<module>gremlin-tools</module>