I have the plugin working:

gremlin> :install org.apache.tinkerpop neo4j-gremlin 3.0.0-SNAPSHOT
==>Loaded: [org.apache.tinkerpop, neo4j-gremlin, 3.0.0-SNAPSHOT] - restart
the console to use [tinkerpop.neo4j]
gremlin> :x

and after restart....

gremlin> :plugin use tinkerpop.neo4j
==>tinkerpop.neo4j activated
gremlin> conf = new BaseConfiguration()
==>org.apache.commons.configuration.BaseConfiguration@46c670a6
gremlin> conf.setProperty("gremlin.graph",Neo4jGraph.class.getName())
==>null
gremlin> conf.setProperty("gremlin.neo4j.directory", "/tmp/neo4j")
==>null
gremlin> graph = GraphFactory.open(conf)
==>simpleneo4jgraph[org.neo4j.tinkerpop.api.impl.Neo4jGraphAPIImpl@16258d33]
gremlin> graph.addVertex("name","stephen")
==>v[0]
gremlin> g = graph.traversal()
==>graphtraversalsource[simpleneo4jgraph[org.neo4j.tinkerpop.api.impl.Neo4jGraphAPIImpl@16258d33],
standard]
gremlin> g.V()
==>v[0]

If you're trying this out you'll need to build the local branch in TP3.  If
you don't you will likely pull down the "old" neo4j-gremlin SNAPSHOT and
things won't work.


On Fri, May 29, 2015 at 7:51 AM, Stephen Mallette <[email protected]>
wrote:

> I think I have the dependency stuff working out pretty nicely.  Works for
> both command line maven runs and for intellij.  It's easy for developers
> working on the neo4j-gremlin module and even includes some protections
> against accidental deployment of stuff that shouldn't be deployed under
> Apache.  This all works with just some basic maven profile work.
> Basically, if you do this at the root of the repo:
>
> mvn clean install
>
> the entire project will build, including neo4j-gremlin, however,
> neo4j-gremlin's tests will not execute.  That's analogous to the old model
> of the -DfeelingLucky model, where we would skip Neo4j tests as they ran
> too long.  That's basically the default.  Take a look at the dependency
> tree under the default profile for neo4-gremlin:
>
> $ mvn dependency:tree
> [INFO] Scanning for projects...
> [INFO]
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Apache TinkerPop :: Neo4j Gremlin 3.0.0-SNAPSHOT
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ neo4j-gremlin
> ---
> [INFO] org.apache.tinkerpop:neo4j-gremlin:jar:3.0.0-SNAPSHOT
> [INFO] +- org.apache.tinkerpop:gremlin-core:jar:3.0.0-SNAPSHOT:compile
> [INFO] |  +- org.apache.tinkerpop:gremlin-shaded:jar:3.0.0-SNAPSHOT:compile
> [INFO] |  +- commons-configuration:commons-configuration:jar:1.10:compile
> [INFO] |  |  \- commons-lang:commons-lang:jar:2.6:compile
> [INFO] |  +- org.yaml:snakeyaml:jar:1.15:compile
> [INFO] |  +- org.javatuples:javatuples:jar:1.2:compile
> [INFO] |  +- com.carrotsearch:hppc:jar:0.7.1:compile
> [INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.5.3:compile
> [INFO] |  |  +-
> com.fasterxml.jackson.core:jackson-annotations:jar:2.5.0:compile
> [INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.5.3:compile
> [INFO] |  +- com.jcabi:jcabi-manifests:jar:1.1:compile
> [INFO] |  |  \- com.jcabi:jcabi-log:jar:0.14:compile
> [INFO] |  +- org.slf4j:slf4j-log4j12:jar:1.7.12:compile
> [INFO] |  |  +- org.slf4j:slf4j-api:jar:1.7.12:compile
> [INFO] |  |  \- log4j:log4j:jar:1.2.17:compile
> [INFO] |  \- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
> [INFO] +- org.apache.tinkerpop:gremlin-groovy:jar:3.0.0-SNAPSHOT:compile
> [INFO] |  +- org.apache.ivy:ivy:jar:2.3.0:compile
> [INFO] |  +- org.codehaus.groovy:groovy-all:jar:indy:2.4.1:compile
> [INFO] |  +- jline:jline:jar:2.11:compile
> [INFO] |  +- org.apache.commons:commons-lang3:jar:3.3.1:compile
> [INFO] |  \- org.kohsuke:groovy-sandbox:jar:1.6:compile
> [INFO] +- org.neo4j:neo4j-tinkerpop-api:jar:0.1:compile
> [INFO] +- org.apache.tinkerpop:gremlin-test:jar:3.0.0-SNAPSHOT:test
> [INFO] |  +- com.carrotsearch:junit-benchmarks:jar:0.7.2:test
> [INFO] |  +- com.h2database:h2:jar:1.3.171:test
> [INFO] |  +- commons-io:commons-io:jar:2.4:test
> [INFO] |  +- junit:junit:jar:4.12:test
> [INFO] |  |  \- org.hamcrest:hamcrest-core:jar:1.3:test
> [INFO] |  +- org.mockito:mockito-all:jar:1.9.5:test
> [INFO] |  \- org.hamcrest:hamcrest-all:jar:1.3:test
> [INFO] \- org.apache.tinkerpop:gremlin-groovy-test:jar:3.0.0-SNAPSHOT:test
>
> It is free of all GPL'd dependencies and only includes this reference to
> anything "neo4j":
>
> [INFO] +- org.neo4j:neo4j-tinkerpop-api:jar:0.1:compile
>
> which is, of course, licensed via Apache 2.  Note that we don't package
> neo4j-gremlin with either of our binary distributions (server or console),
> but even so there would be nothing GPL'd laying about in there.
>
> Now, if someone is a developer who is working on the neo4j-gremlin module
> and they want to run the tests, they can just run with this profile:
>
> mvn clean install -DincludeNeo4j
>
> that profile includes the full stack of Neo4j dependencies so that tests
> can run, but only includes it as test scope.  In intellij, you would flip
> on the include-neo4j-for-test profile so that you could run tests in the
> debugger.  As an added precaution, i disabled the maven-deploy-plugin under
> this profile for neo4j-gremlin which would prevent someone from trying to
> do this:
>
> mvn deploy -DincludeNeo4j
>
> In this case, deploy for neo4j-gremlin would be ignored while the rest of
> the modules were allowed to execute under that phase.
>
> To conclude, I built up both the binary and source distributions and
> checked their contents.  The contain no GPL dependencies under this model.
> I guess the only question is whether or not we can distribute the pom.xml
> in the source distribution with this profile:
>
>
> https://github.com/apache/incubator-tinkerpop/blob/0285ef689491365e9dc9db25748be2ef9b4a37bb/neo4j-gremlin/pom.xml#L119-L168
>
> It would be good to hear from mentors on this topic to get some feedback.
>
> Thanks,
>
> Stephen
>
>
> On Thu, May 28, 2015 at 5:27 PM, Jason Plurad <[email protected]> wrote:
>
>> Thanks for the update, Marko.
>>
>> For clarification, when running the Neo4j test suite, the
>> AGPL/GPL-licensed Neo4j impl classes are pulled down from Central Repo.
>> Running the Neo4j test suite is OPTIONAL, and all other TinkerPop unit
>> tests can be run without running the Neo4j test suite. Did I understand
>> that correctly? Are there other Apache projects that have set a precedent
>> with this technique?
>>
>> I'll definitely try out the branch and see how it fits. Thanks again.
>>
>> -- Jason
>>
>>
>> On Thu, May 28, 2015 at 12:44 PM, Marko Rodriguez <[email protected]>
>> wrote:
>>
>>> Hello everyone,
>>>
>>> Michael Hunger and Philip Rathle of Neo4j have been working closely with
>>> Apache TinkerPop to get neo4j-gremlin/ back into the Apache TinkerPop
>>> distribution. For those that don't remember, the reason it was gutted was
>>> due to LICENSE conflicts. In order to find a solution to this problem,
>>> there have been numerous calls/emails with Neo4j, Apache TinkerPop PMC, the
>>> Apache TinkerPop mentors, and discussions on the general@incubator
>>> mailing list. Given all the recommendations, we have zero'd in on a
>>> solution that will allow Apache TinkerPop to provide neo4j-gremlin/ in the
>>> next release.
>>>
>>> For those interested in the technical solution to the license problem,
>>> please see the following branch which is sync'd with TinkerPop master/:
>>>
>>> https://github.com/apache/incubator-tinkerpop/tree/neo4j-gremlin-apache
>>>
>>> Everything builds, but there are some failing tests right now as 2
>>> months have passed since we have worked with neo4j-gremlin/. I believe they
>>> are trivial fixes.
>>>
>>> Here is the LICENSE trick that makes this all possible:
>>>
>>>
>>> https://github.com/apache/incubator-tinkerpop/blob/neo4j-gremlin-apache/neo4j-gremlin/pom.xml#L39-L43
>>>  (Apache2
>>> Licensed)
>>>
>>> https://github.com/apache/incubator-tinkerpop/blob/neo4j-gremlin-apache/neo4j-gremlin/pom.xml#L45-L53
>>>  (AGPL/GPL
>>> Licensed)
>>>
>>> What we need to do now is make it so that TinkerPop developers can (on
>>> their local machine) pull in Neo4j libraries for local testing. However,
>>> the apache-tinkerpop-x.y.z-source-release.zip will not have references to
>>> these libraries and thus, only references to the Apache2 Neo4j API.
>>> However, because the Neo4j Apache API has interface references, the package
>>> will compile (but will not test).
>>>
>>> I'm not to keen on mvn, shell tricks, etc., but here are some ideas:
>>>
>>> 1. We have a "bin/test-neo4j-gremlin.sh <boolean>" that inserts/removes
>>> the <dependency> stub into the pom.xml via some awk/sed-magic.
>>> 2. We have a -D profile that does some magic? Perhaps simply does what 1
>>> above does, but within a MVN call.
>>> - i.e. bin/test-neo4j-gremlin.sh true; mvn clean install (remove the
>>> -Dtest-neo4j parameter); bin/test-neo4j-gremlin.sh false;
>>> 3. If you are TinkerPop developer, you have to manually cut/paste the
>>> <dependency> into the neo4j-gremlin pom.xml if you want to test Neo4j.
>>> - we can have a "bin/strip-neo4j-test.sh" that will remove the
>>> <dependency/> so its less likely for developers to push the bad-licensed
>>> pom.xml.
>>>
>>> Anywho -- looks like we are on our way. Here is what is on our
>>>  immediate plate:
>>>
>>> 1. *@Kuppitz* (others?): Come up with a good solution to the pom.xml
>>> test <dependency/> issue articulated above.
>>> 2. *@Stephen*: Get the IO tests working with neo4j-gremlin.
>>> 3. *@Michael*: Look at the <dependency> naming conventions -- they are
>>> a bit "off":
>>> <groupId>org.neo4j</groupId> <artifactId>neo4j-tinkerpop-api</artifactId>
>>> <groupId>org.neo4j</groupId> <artifactId>tinkerpop-api-impl</artifactId>
>>> - also, should we go with <artifactId>neo4j-apache2-api</artifactId> as
>>> its general to anyone?
>>> 4. *@Marko*: Make two Neo4jGraph implementations -- one that supports
>>> multi-properties and one that doesn't (don't have all this if/else checking
>>> in one implementation).
>>> 5. *@Marko/Stephen*: Get the test suite for Neo4j up to par with latest
>>> TinkerPop3 -- I've put null-parameters here and there where test suite
>>> methods have changed and there is no obvious mapping.
>>> 6. *@Stephen*: Get the Neo4jGremlinPlugin to dynamically pull in the
>>> Neo4j impl library via Gremlin Console/Server.
>>>
>>> Here is what is required a little further down the road once all the
>>> code challenges above are complete:
>>>
>>> 1. The Neo4j team needs to to publish their new API packages to Central
>>> Repo.
>>> 2. TinkerPop will merge the neo4j-gremlin-apache/ branch into master/.
>>> 3. Send promotional tweets with images of Gremlin and Neo4j iconography
>>> doing stuff. :)
>>>
>>> Thanks Neo4j and mentors for the numerous hours you have dedicated to
>>> this problem. I'm exited to see neo4j-gremlin/ in TinkerPop3 GA.
>>>
>>> Take care,
>>> Marko.
>>>
>>> http://markorodriguez.com
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Gremlin-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/gremlin-users/5233348C-EF67-4F8E-B24E-E6AFBC993A4F%40gmail.com
>>> <https://groups.google.com/d/msgid/gremlin-users/5233348C-EF67-4F8E-B24E-E6AFBC993A4F%40gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Have a good one,
>> Jason
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Gremlin-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/gremlin-users/CAOk5v9OKzDDwRxWwvtsoBh2wABdj7MxmnPn_%2BHc52Nz4OoMPqA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/gremlin-users/CAOk5v9OKzDDwRxWwvtsoBh2wABdj7MxmnPn_%2BHc52Nz4OoMPqA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

Reply via email to