mpollmeier / gremlin-scala-examples

Examples for different graph dbs
Apache License 2.0
67 stars 34 forks source link

2.11 neo4j #4

Open omidb opened 9 years ago

omidb commented 9 years ago

Hi,

what is exactly the problem of Neo4j and gremlin and Scala 2.11.4?

thanks,

mpollmeier commented 9 years ago

Neo4J has a (I think transitive) dependency on Scala 2.10, and one can't mix Scala versions. As soon as they upgrade to 2.11 or provide a cross compiled version (like Gremlin-Scala does) we can use 2.11.

On 09/12/14 10:10, Omid Bakhshandeh wrote:

Hi,

what is exactly the problem of Neo4j and gremlin and Scala 2.11.4?

thanks,

— Reply to this email directly or view it on GitHub https://github.com/mpollmeier/gremlin-scala-examples/issues/4.

max-leuthaeuser commented 9 years ago

This seems to be a quite old problem: https://github.com/neo4j/neo4j/issues/2881

chrisbeach commented 9 years ago

Currently in a nasty situation where another library in my project needs Scala 2.11 and Neo4J (embedded) is the only library I depend on that's holding me on Scala 2.10. Eagerly awaiting a Neo4J build against Scala 2.11.

omidb commented 9 years ago

neo4j/neo4j#4551 Is Gremlin-Scala now compatible?

mpollmeier commented 9 years ago

That looks promising indeed. The only thing to wait for is the TP3 neo4j driver - it already works with a custom local build of mine, but isn't officially released yet.

omidb commented 9 years ago

@mpollmeier can you send PR there?

mpollmeier commented 9 years ago

there's no code change necessary, it will be included in the next version of tinkerpop3 automatically. I built a snapshot locally which worked - you could do the same. once they release the next version I'll provide an example in gremlin-scala-examples. https://github.com/apache/incubator-tinkerpop

mpollmeier commented 9 years ago

there's discussions on the tinkerpop dev list about an RC1 release on monday, so it shouldn't take much longer.

mpollmeier commented 9 years ago

rc1 has been tagged and will probably get released this week

omidb commented 9 years ago

@mpollmeier So how is it going with 2.11?

mpollmeier commented 9 years ago

tp3 3.0.0-incubating was released yesterday. I just released gremlin-scala 3.0.0 and updated the neo4j project - it now works with scala 2.11!

omidb commented 9 years ago

@mpollmeier nice! BTW, why you keep Gremlin-Scala as the name, I think you can also change the name to Tinkerpop-Scala!

stanch commented 9 years ago

It seems that Neo4j did not publish their 2.11 jars properly. If I do dependency-graph in this project (with https://github.com/jrudolph/sbt-dependency-graph), I can see that it depends on org.neo4j:neo4j-cypher:2.2.2, which depends on Scala 2.10 :( There is cypher-compiler-2.2_2.11, but no cypher_2.11.

stanch commented 9 years ago

Upon closer inspection, Cypher is only published for Scala 2.11 since version 2.3.X. I got it working by setting neo4j.version to 2.3.0-M02 in https://github.com/neo4j-contrib/neo4j-tinkerpop-api-impl and republishing it.

mpollmeier commented 9 years ago

ouch. you're right. I guess they'll only release a new version of the tinkerpop api once they reached 2.3.0 stable. until then we'll probably have to manually build neo4j-tinkerpop-api-impl like you did.

stanch commented 9 years ago

Actually “I got it working” was a bit too optimistic — it compiled, but I’m getting

[ERROR] java.lang.NoSuchMethodError: org.neo4j.kernel.impl.core.NodeManager.newGraphProperties()Lorg/neo4j/kernel/impl/core/GraphPropertiesImpl;
[ERROR]     at org.neo4j.tinkerpop.api.impl.Neo4jGraphAPIImpl.<init>(Neo4jGraphAPIImpl.java:45)
[ERROR]     at org.neo4j.tinkerpop.api.impl.Neo4jFactoryImpl.newGraphDatabase(Neo4jFactoryImpl.java:44)
[ERROR]     at org.neo4j.tinkerpop.api.Neo4jFactory$Builder.open(Neo4jFactory.java:32)
[ERROR]     at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.<init>(Neo4jGraph.java:134)
[ERROR]     at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.open(Neo4jGraph.java:148)
mpollmeier commented 9 years ago

I just updated the implementation of the ShortestPath example: https://github.com/mpollmeier/gremlin-scala-examples/blob/master/neo4j/src/test/scala/ShortestPathSpec.scala

It works with Scala 2.11. @stanch: can you have a look what you're doing differently?

mpollmeier commented 9 years ago

@stanch any updates? I'd like to drop support for Scala 2.10 in Gremlin-Scala, e.g. because of https://github.com/mpollmeier/gremlin-scala/pull/77 But I'll only do that if Neo4j works with 2.11.

stanch commented 9 years ago

@mpollmeier Sorry for the late answer, in the end I went with 2.10. I’m afraid I won’t have time to experiment with it again in the upcoming weeks, but I would imagine that the difference could lie in how neo4j-tinkerpop-api-impl is modified.

joan38 commented 9 years ago

@mpollmeier What is really needed to do? Setup a test project with Gremlin-Scala 2.11 and Neo4j to see if all works good? I can do that sometime soon.

omidb commented 9 years ago

it's working with 2.11 on all DBs! All my current projects are 2.11

joan38 commented 9 years ago

Thanks @omidb So can we drop 2.10 and close this issue!?

omidb commented 9 years ago

@joan38 why should we do that? Now it works on both 2.10, 2.11

joan38 commented 9 years ago

See my PR https://github.com/mpollmeier/gremlin-scala/pull/81 I reimplemented the macros so that we can have a @label parameter or by default it takes the class name as a label. I also might add the @id support soon.

mpollmeier commented 9 years ago

I'd be happy to drop support for 2.10, it simplifies a few things, like joan's macros. As everything works with 2.11 I don't think we still need to support 2.10. Any objections? If not, you could just drop 2.10 in mpollmeier/gremlin-scala#81 @joan38

omidb commented 9 years ago

I'm getting the same exceptions that @stanch had, I think it has some problem with Spray, @stanch would you please paste your build file here?

omidb commented 9 years ago

I raised the issue here https://github.com/neo4j-contrib/neo4j-tinkerpop-api-impl/issues/1