Python 如何使用带灯泡的ArangoDB&;雷克斯特?

Python 如何使用带灯泡的ArangoDB&;雷克斯特?,python,bulbs,rexster,arangodb,Python,Bulbs,Rexster,Arangodb,我目前正在尝试使用Bulls和Rexster访问ArangoDB数据库。 我需要这样做,因为我想使用bulls()从Python启动一些gremlin查询。 (我真的很喜欢AQL和arangosh,但我已经有了很多正在使用的小精灵脚本) 以下是我在尝试使用来自灯泡的Rexster之前所做的: 我成功编译了ArangoDB BluePrint驱动程序,得到了:blueprints-ArangoDB-graph-1.0.4-SNAPSHOT-jar-with-dependencies.jar 我下

我目前正在尝试使用Bulls和Rexster访问ArangoDB数据库。 我需要这样做,因为我想使用bulls()从Python启动一些gremlin查询。 (我真的很喜欢AQL和arangosh,但我已经有了很多正在使用的小精灵脚本)

以下是我在尝试使用来自灯泡的Rexster之前所做的:

  • 我成功编译了ArangoDB BluePrint驱动程序,得到了:blueprints-ArangoDB-graph-1.0.4-SNAPSHOT-jar-with-dependencies.jar
  • 我下载了Gremlin2.4和Rexster 2.4二进制文件,并分别在lib和ext文件夹中复制了blueprints-arangodb-graph-1.0.4-SNAPSHOT-jar-with-dependencies.jar
然后我面临几个问题:

第一,(不是灯泡问题)我没有成功地使ArangoDB在当前版本的Gremlin(2.4.0)和/或Rexster(2.4.0)中正常工作

在《小精灵2.4》中:

gremlin> import com.tinkerpop.blueprints.impls.arangodb.*
[...]
gremlin> g = ArangoDBGraphFactory.createArangoDBGraph();
==>arangodbgraph[{"_id":"_graphs\/factory_graph","_rev":"20228207","_key":"factory_graph","vertices":"factory_vertices","edges":"factory_edges"}]
gremlin> g.E.count()
Not supported yet.
Display stack trace? [yN]
在bash中,在发布Rexster 2.4时:

Exception in thread "main" java.lang.NoSuchFieldError: isRDFModel
    at com.tinkerpop.blueprints.impls.arangodb.ArangoDBGraph.<clinit>(ArangoDBGraph.java:44)
    at com.tinkerpop.blueprints.impls.arangodb.utils.ArangoDBConfiguration.configureGraphInstance(ArangoDBConfiguration.java:60)
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.getGraphFromConfiguration(GraphConfigurationContainer.java:119)
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.<init>(GraphConfigurationContainer.java:54)
    at com.tinkerpop.rexster.server.XmlRexsterApplication.reconfigure(XmlRexsterApplication.java:99)
    at com.tinkerpop.rexster.server.XmlRexsterApplication.<init>(XmlRexsterApplication.java:47)
    at com.tinkerpop.rexster.Application.<init>(Application.java:96)
    at com.tinkerpop.rexster.Application.main(Application.java:188)
返回:

({'status': '500', 'transfer-encoding': 'chunked', 'server': 'grizzly/2.2.18', 'connection': 'close', 'date': 'Wed, 08 Jan 2014 17:30:29 GMT', 'access-control-allow-origin': '*', 'content-type': 'application/json'}, '{"message":"","error":"javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: groovy.lang.MissingMethodException.rollback() is applicable for argument types: () values: []\\nPossible solutions: collect(), collect(groovy.lang.Closure), collect(java.util.Collection, groovy.lang.Closure)","api":{"description":"evaluate an ad-hoc Gremlin script for a graph.","parameters":{"rexster.returnKeys":[...]
我不知道如何解决这个问题(顺便说一句,我不是Java程序员)

这是我的环境:

  • Ubuntu 11.10
  • java版本“1.7.0_45”
  • Java(TM)SE运行时环境(build 1.7.0_45-b18)
  • Java HotSpot(TM)64位服务器虚拟机(构建24.45-b08,混合模式)
这是我在rexster.xml中的Arango配置(它允许我从rexster REST API访问arangodb):

[…]
阿兰戈德
com.tinkerpop.blueprints.impls.arangodb.utils.ArangoDBConfiguration
arangodb rexster图
arangodb rexster图顶点
arangodb rexster图边
本地服务器
8529
[...]

提前感谢您的任何想法/帮助:)

我没有使用ArangoDB Blueprints实现,但是您肯定有一些版本控制问题导致了这个问题。根据,1.0.4-SNAPSHOT似乎与TinkerPop 2.3.0配合使用。首先,我要确保您使用Gremlin/Rexster 2.3.0作为解决此问题的第一步。作为第二步,在尝试灯泡之前,确保雷克斯特的服务正常。换句话说,通过Rexster执行一些脚本并验证结果将是一个良好的开端,以确保在您尝试通过Python进行连接时灯泡能够正常工作。

是的,请注意,并确保在Rexster.xml配置文件中配置了gremlin扩展名。然后使用curl从命令行测试Rexster,以确保其正常工作。这将帮助您隔离任何问题,因为它是一个新的数据库。

根据与ArangoDB的连接: rexster中包含的gremlin服务器和我们的驱动程序实现似乎存在问题。 我在独立的gremlin中成功地执行了您的代码,但在rexster服务器中遇到了问题。
我们正在修复blueprint driver+documentation s.t.它将再次工作。

关于您的问题

g.E.count()
我尝试对orient DB使用相同的语法。那里也不支持它。所以我认为它在Gremlin2.4中有一种臭味

解决方法很简单,请使用

g.getEdges().count()

关于rexster 2.4问题:
您可以在中找到一个2.4分支,它应该与rexster/gremlin 2.4一起工作

非常感谢Stephen,通过gremlin扩展执行脚本是有效的,它为我指明了正确的方向:现在Bulls似乎正在启动时创建一些索引(至少对于rexster“后端”)而ArangoDB没有:supportsVertexIndex、SupportsDedgeIndex。作为概念证明,我尝试使用Titan后端访问Rexster/ArangoDB,它成功了(听起来很脏,但基本上Titan wrapper似乎是Rexster wrapper的副本,做了一些修改,使其在没有手动索引的情况下工作)。Titan服务器实际上是Rexster的引擎盖下,这就是Bulls.Titan基于Bulls.Rexster的原因。当时,Titan是唯一使用关键索引的DB。现在有了更多的DBs,也许我们可以推广Bulls.rexster来支持这两个。嗨,James,1号,非常感谢您在Bulls方面所做的大量工作。正如我在Stephen的回答评论中所说,基本上我的问题似乎与灯泡中的索引创建有关,而且ArangoDB没有supportsVertexIndex或SupportsDegeIndex(Titan也是如此)。我在一篇文章中看到,您最终将支持KeyIndex,但正在等待Tinkerpop 3.0的支持(如果我理解得很好的话)。顺便说一句,我的ArangoDB测试主要是探索性的,所以能够在Rexster/ArangoDB上运行一些gremlins脚本并了解它的工作原理是非常酷的。bulls.titan已经支持KeyIndex——试试看(它可能是现成的),如果不是,我们可以做一些更具体的Arango。这里有一个例子,好的,雷克斯特开始了。现在我将看一看灯泡/python问题。希望不久能报告一些成功的消息…您是否已与另一个db进行了检查?tinkergraph:config=config(')也出现了一个错误。在使用datomic的fluxgraph时,我遇到了一个非常类似的问题。我真的需要帮助让fluxgraph正常工作。。。
g.E.count()
g.getEdges().count()