4

I'm currently trying to access an ArangoDB database by using Bulbs and Rexster. I need to do that because I want to use Bulbs (http://bulbflow.com) to launch some gremlin queries from Python. (I really like AQL and arangosh but I already have a lot of working gremlin scripts)

Here is what I did before trying to use Rexster from Bulbs :

  • I successfully compiled ArangoDB BluePrint driver and got : 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

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)

In 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 :

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

This time, it worked in both Gremlin 2.2 and Rexster 2.2 :

  • g.E.count() returned something (<-> thus is supported)
  • Rexster server launched and I could access Rexster api on port 8182

BUT, the 2nd issue is that the following Python code :

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)

Here is my env :

  • Ubuntu 11.10
  • java version "1.7.0_45"
  • Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
  • Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

Here is my Arango config in rexster.xml (which let me access arangodb from Rexster REST API) :

[...]
<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 :)

Raphaël Braud
  • 1,379
  • 9
  • 14
  • Have you checked it with another db? I get an error as well with tinkergraph: config = Config('http://localhost:8182/graphs/tinkergraph') – Floyd Jan 15 '14 at 10:00

5 Answers5

3

I've not used the ArangoDB Blueprints implementation, but you definitely have some versioning issues contributing to the problem. According to the pom, it looks like the 1.0.4-SNAPSHOT works with 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. As a second step, make sure that the Rexster is serving properly prior to trying Bulbs. 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.

stephen mallette
  • 39,757
  • 4
  • 49
  • 112
  • Thanks a lot Stephen, executing scripts through Gremlin extension was working and it points me in the right direction : it seems that currently Bulbs is creating some indices while starting (at least for Rexster "backend") whereas ArangoDB does not have : supportsVertexIndex, supportsEdgeIndex. As a proof of concept, I tried to use Titan backend to access Rexster/ArangoDB and it worked (it sounds quite dirty, but basically Bulbs Titan wrapper seems to be a copy of Rexster wrapper with some changes to make it work without manual index). – Raphaël Braud Jan 09 '14 at 11:01
  • TitanServer is actually Rexster under the hood so that's why bulbs.titan is based on bulbs.rexster. At the time, Titan was the only DB using key indices. Now that more DBs are, maybe we could generalize bulbs.rexster to support both. – espeed Jan 10 '14 at 02:22
2

Concerning the rexster 2.4 problem: You can find a 2.4-branch in https://github.com/triAGENS/blueprints-arangodb-graph, that should work with rexster/gremlin 2.4

Floyd
  • 361
  • 1
  • 3
  • 10
  • Ok, rexster starts. Now I will take a look at the bulbs/python problem. Hope to report some success soon... – Floyd Jan 14 '14 at 08:45
1

Yes, what Stephen Mallete said, and make sure the gremlin extension is configured in your rexster.xml config file. Then use curl to test Rexster from the command line to ensure it's working. This will help you isolate any issues since it's a new DB.

Community
  • 1
  • 1
espeed
  • 4,704
  • 1
  • 33
  • 50
  • Hi James, 1st, thanks a lot for the great work on Bulbs. As I said in Stephen's answer comment, basically my issue seems to be related to index creation in Bulbs and the fact that ArangoDB does not have supportsVertexIndex nor supportsEdgeIndex (which is also the case for Titan). I saw in a Bulbs issue thread that you will eventually support KeyIndex but were waiting for Tinkerpop 3.0 support (If I understood well). By the way, my ArangoDB tests are mainly exploratory, so it was quite cool to be able to run some gremlins script on Rexster/ArangoDB and get a feeling of how it could work. – Raphaël Braud Jan 09 '14 at 11:11
  • bulbs.titan already has support for KeyIndex -- try that (it may work out of the box), if not, we can make something more Arango-specific. Here's an example https://gist.github.com/espeed/3938820 – espeed Jan 10 '14 at 02:12
1

According to the connection to ArangoDB: there seems to be a problem with the gremlin server included in rexster and our driver implementation. i managed to execute your code successfully in stand-alone gremlin, but get the problem in rexster server. We are fixing the blueprint driver + documentation s.t. it will work again.

mchacki
  • 3,207
  • 11
  • 11
  • I get a very similar issue when using bulbs with datomic's fluxgraph. I really need help getting fluxgraph to work... – Adam Miller Mar 18 '14 at 00:08
1

Concerning your problem with

g.E.count()

I tried to use the same syntax with orient-DB. It's not supported there, too. So I think it has a smell of a bug within gremlin 2.4

A workaround is simple, use

g.getEdges().count()
Floyd
  • 361
  • 1
  • 3
  • 10