yAsH yAsH - 5 months ago 50
Scala Question

Using neo4j with scala

I'm new to both Scala and Neo4j. I want to create a Neo4j database using Scala. Is there any resource where i can find some ready made code for creating nodes, deleting nodes, adding properties, creating indexes and etc.



Actually there are several options it depends on (a) how you want to communicate with neo4j (Rest or not) (b) your runtime environment.

When your application is ok with a REST only communication and you're ok to use ANORM to access your (data). There is a promising driver that is currently good enough to do a plenty of thing using Cypher as request language. You can find it there (AnormCypher) : https://github.com/AnormCypher/AnormCypher. The power of ANORM is a source of a lot of debate, but I think it has a lot of good feature.

There is also the FaKod scala driver which is very complete, and the second version (M1 for now) will include REST capabilities as well. The power of this driver (neo4j-scala) is the clean DSL it provides to abstract traversal internals, it's pretty intuitive and well documented.

On the other hand, I had started my driver a while, but didn't had time to put much effort of it (it'll change soon). The current version is still rough and tightly coupled to a play application. But this driver tries to use amap the reactivity of future (now akka based) and the json api of play. However, this way shall not be the most productive due to a lack of doc and cleaning... any help is welcome ;-). Also this is a play plugin as well then is pretty easy to configure and inject.

For more information in general regarding drivers, you should go there: http://www.neo4j.org/develop/drivers