在 Scala 中使用 neo4j [英] Using neo4j with scala

查看:68
本文介绍了在 Scala 中使用 neo4j的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Scala 和 Neo4j 的新手.我想使用 Scala 创建一个 Neo4j 数据库.是否有任何资源可以找到用于创建节点、删除节点、添加属性、创建索引等的现成代码.

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.

谢谢.

推荐答案

实际上有几个选项取决于(a)你想如何与neo4j通信(休息与否)(b) 您的运行时环境.

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

当您的应用程序仅支持 REST 通信并且您可以使用 ANORM 访问您的应用程序时(数据).有一个很有前途的驱动程序,它目前足以使用 Cypher 作为请求语言做很多事情.您可以在那里找到它 (AnormCypher):https://github.com/AnormCypher/AnormCypher.ANORM 的强大功能引起了很多争论,但我认为它有很多好的特性.

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.

还有非常完整的 FaKod scala 驱动程序,第二个版本(现在是 M1)也将包含 REST 功能.此驱动程序 (neo4j-scala) 的强大之处在于它提供了用于抽象遍历内部结构,非常直观且文档齐全.

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.

另一方面,我已经启动了我的驱动程序一段时间,但没有时间付出很多努力(它很快就会改变).当前版本仍然粗糙且与播放应用程序紧密耦合.但是这个驱动程序试图使用 amap 未来的反应性(现在基于 akka)和 play 的 json api.但是,由于缺乏文档和清洁,这种方式不会是最有效的......欢迎任何帮助;-).这也是一个播放插件,很容易配置和注入.

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.

有关驱动程序的更多信息,您应该去那里: http://www.neo4j.org/develop/drivers

这篇关于在 Scala 中使用 neo4j的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆