简体   繁体   English

如何使用ArangoDB与灯泡和rexster?

[英]How to use ArangoDB with bulbs & rexster?

I'm currently trying to access an ArangoDB database by using Bulbs and Rexster. 我目前正在尝试使用Bulbs和Rexster访问ArangoDB数据库。 I need to do that because I want to use Bulbs ( http://bulbflow.com ) to launch some gremlin queries from Python. 我需要这样做,因为我想使用Bulbs( http://bulbflow.com )从Python启动一些gremlin查询。 (I really like AQL and arangosh but I already have a lot of working gremlin scripts) (我真的很喜欢AQL和arangosh,但我已经有很多工作的gremlin脚本)

Here is what I did before trying to use Rexster from Bulbs : 以下是我在尝试使用灯泡中的Rexster之前所做的事情:

  • I successfully compiled ArangoDB BluePrint driver and got : blueprints-arangodb-graph-1.0.4-SNAPSHOT-jar-with-dependencies.jar 我成功编译了ArangoDB BluePrint驱动程序并获得:blueprints-arangodb-graph-1.0.4-SNAPSHOT-jar-with-dependencies.jar
  • I downloaded Gremlin2.4 an Rexster 2.4 binaries and copied blueprints-arangodb-graph-1.0.4-SNAPSHOT-jar-with-dependencies.jar in (respectively) lib and ext folder 我下载了Gremlin2.4一个Rexster 2.4二进制文件,并在(分别)lib和ext文件夹中复制了blueprints-arangodb-graph-1.0.4-SNAPSHOT-jar-with-dependencies.jar

I then faced several issues : 然后我遇到了几个问题:

1st, (not an Bulbs issue) I didn't succeed in making ArangoDB work correctly with current version of Gremlin (2.4.0) and/or Rexster (2.4.0) 1,(不是灯泡问题)我没有成功使ArangoDB与当前版本的Gremlin(2.4.0)和/或Rexster(2.4.0)一起正常工作

In gremlin 2.4 : 在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]

In bash, while launching Rexster 2.4 : 在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)

Seing some examples using version 2.2 of both Gremlin and Rexster, I downloaded them and installed again arangodb blueprint driver 使用Gremlin和Rexster 2.2版本的一些例子,我下载了它们并再次安装了arangodb蓝图驱动程序

This time, it worked in both Gremlin 2.2 and Rexster 2.2 : 这次,它在Gremlin 2.2和Rexster 2.2中都有效:

  • gEcount() returned something (<-> thus is supported) gEcount()返回一些东西(< - >因此得到支持)
  • Rexster server launched and I could access Rexster api on port 8182 启动了Rexster服务器,我可以在端口8182上访问Rexster api

BUT, the 2nd issue is that the following Python code : 但是,第二个问题是以下Python代码:

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

returned : 回 :

({'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":[...]

I don't know how this could be fixed (I'm not a Java programmer, btw) 我不知道如何解决这个问题(我不是Java程序员,顺便说一句)

Here is my env : 这是我的环境:

  • Ubuntu 11.10 Ubuntu 11.10
  • java version "1.7.0_45" java版“1.7.0_45”
  • Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java(TM)SE运行时环境(版本1.7.0_45-b18)
  • Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) Java HotSpot(TM)64位服务器VM(内置24.45-b08,混合模式)

Here is my Arango config in rexster.xml (which let me access arangodb from Rexster REST API) : 这是我在rexster.xml中的Arango配置(让我从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>
[...]

Thanks in advance for any ideas/help :) 在此先感谢任何想法/帮助:)

I've not used the ArangoDB Blueprints implementation, but you definitely have some versioning issues contributing to the problem. 我没有使用ArangoDB Blueprints实现,但你肯定有一些版本问题导致了这个问题。 According to the pom , it looks like the 1.0.4-SNAPSHOT works with TinkerPop 2.3.0. 根据pom ,看起来1.0.4-SNAPSHOT与TinkerPop 2.3.0一起使用。 I would start by making sure you use Gremlin/Rexster 2.3.0 as a first step to solving this problem. 首先,我要确保您使用Gremlin / Rexster 2.3.0作为解决此问题的第一步。 As a second step, make sure that the Rexster is serving properly prior to trying Bulbs. 第二步,确保在尝试灯泡之前Rexster正常运行。 In other words, executing a few scripts through Rexster's Gremlin Extension and validating the results would be a good start to ensuring Bulbs works nicely when you try to connect via Python. 换句话说,通过Rexster的Gremlin扩展执行一些脚本并验证结果将是确保灯泡在您尝试通过Python连接时工作良好的良好开端。

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

Yes, what Stephen Mallete said, and make sure the gremlin extension is configured in your rexster.xml config file. 是的, Stephen Mallete所说的,并确保在rexster.xml配置文件中配置了gremlin扩展。 Then use curl to test Rexster from the command line to ensure it's working. 然后使用curl从命令行测试Rexster以确保它正常工作。 This will help you isolate any issues since it's a new DB. 这将帮助您隔离任何问题,因为它是一个新的数据库。

According to the connection to ArangoDB: there seems to be a problem with the gremlin server included in rexster and our driver implementation. 根据与ArangoDB的连接:rexster中包含的gremlin服务器和我们的驱动程序实现似乎存在问题。 i managed to execute your code successfully in stand-alone gremlin, but get the problem in rexster server. 我设法在独立的gremlin中成功执行你的代码,但在rexster服务器中得到了问题。 We are fixing the blueprint driver + documentation st it will work again. 我们正在修复蓝图驱动程序+文档,它将再次起作用。

Concerning your problem with 关于你的问题

g.E.count()

I tried to use the same syntax with orient-DB. 我尝试使用与orient-DB相同的语法。 It's not supported there, too. 它也不受支持。 So I think it has a smell of a bug within gremlin 2.4 所以我认为它在gremlin 2.4中有一个臭虫味

A workaround is simple, use 解决方法很简单,使用方法

g.getEdges().count()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM