如何使用带灯泡和雷克斯特的ArangoDB?

2024-04-26 11:40:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用bulls和Rexster访问ArangoDB数据库。 我需要这样做,因为我想使用bulls(http://bulbflow.com)从Python启动一些gremlin查询。 (我真的很喜欢AQL和arangosh,但我已经有很多可以使用的gremlin脚本)

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

  • 我成功地编译了ArangoDB蓝图驱动程序,得到了:blueprints-ArangoDB-graph-1.0.4-SNAPSHOT-jar-with-依赖关系.jar在
  • 我下载了Gremlin2.4一个Rexster 2.4二进制文件并复制了blueprints-arangodb-graph-1.0.4-SNAPSHOT-jar-with-依赖关系.jar分别在lib和ext文件夹中

然后我面临几个问题:

当前版本的Aramlit(第1版或第2.0版)中的灯泡(第1版或第1版)无法正常工作(第1版)

在gremlin 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时:

^{pr2}$

我看到一些使用Gremlin和Rexster的2.2版本的示例,下载它们并重新安装了arangodb蓝图驱动程序

这一次,它在Gremlin 2.2和Rexster 2.2中都起作用:

  • g、 E.count()返回了一些内容(因此支持<;->;)
  • Rexster服务器启动,我可以访问端口8182上的Rexster api

但是,第二个问题是以下Python代码:

from bulbs.rexster import Graph
from bulbs.config import Config
config = Config('http://localhost:8182/graphs/arangodb')
g = Graph(config)

返回时间:

({'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位服务器VM(内部版本24.45-b08,混合模式)

这是我的Arango配置雷克斯特.xml(这让我可以从Rexster REST API访问arangodb):

[...]
<graph>
    <graph-name>arangodb</graph-name>
    <graph-type>com.tinkerpop.blueprints.impls.arangodb.utils.ArangoDBConfiguration</graph-type>
    <properties>
        <graph-name>arangodb-rexster-graph</graph-name>
        <vertex-name>arangodb-rexster-graph-vertices</vertex-name>
        <edge-name>arangodb-rexster-graph-edges</edge-name>
        <host>localhost</host>
        <port>8529</port>
    </properties>
</graph>
[...]

提前感谢您的任何建议/帮助:)


Tags: nameimport版本comlangfactoryjargraph
3条回答

关于rexster 2.4问题: 您可以在https://github.com/triAGENS/blueprints-arangodb-graph中找到一个2.4分支,它应该与rexster/gremlin2.4一起使用

是的,Stephen Mallete说了什么,并确保在雷克斯特.xml配置文件。然后使用curl从命令行测试Rexster,以确保它正常工作。这将帮助您隔离任何问题,因为它是一个新的数据库。在

我没有使用ArangoDB蓝图实现,但是您肯定有一些版本控制问题导致了这个问题。根据pom,看起来1.0.4快照可以与Tinkerpop2.3.0一起使用。首先,我要确保您使用Gremlin/Rexster 2.3.0作为解决此问题的第一步。第二步,在尝试灯泡之前,确保Rexster服务正常。换言之,通过Rexster的Gremlin Extension执行一些脚本并验证结果将是一个很好的开端,可以确保当您尝试通过Python连接时灯泡能够很好地工作。在

相关问题 更多 >