possible to connect to multiple neo4j databases via bulbs/Rexster?
Asked Answered
A

1

2

I would like to be able to specify the neo4j (2.0+) database folder when I open a connection to a graph using bulbs. The goal is to be able to open different or multiple neo4j databases (folders in data/) on the same machine without starting the neo4j server. This works with the Gremlin console. I suspect the route to doing this with bulbs would be to use the bulbs Rexster client (http://bulbflow.com/docs/api/bulbs/rexster/client/) and somehow automatically start a Rexster server pointing to the folder. Has anybody done this or can anyone contribute advice toward such goals?

many thanks

Autocracy answered 19/6, 2014 at 20:21 Comment(0)
T
3

Bulbs was designed to make it easy to work with multiple graph databases.

Configure your rexster.xml for each Neo4j database you want to run (each will have a different name and thus a different URL path), and then create a separate Bulbs Config and Graph object for each database:

>>> from bulbs.rexster import Graph, Config
>>>
>>> config = Config('http://localhost:8182/graphs/somegraph')
>>> g1 = Graph(config)
>>>
>>> config = Config('http://localhost:8182/graphs/anothergraph')
>>> g2 = Graph(config)

Here are the relevant docs...

Tallowy answered 20/6, 2014 at 2:50 Comment(2)
this works nice and setup isn't difficult. have to add config info to rexster.xml for each new graph, so it's not as automatic as gremlin console manages, but still very useful. Thanks!Autocracy
@ZiggyEunicien Rexster is being reborn as Gremlin Server in TinkerPop3, and Gremlin Server may enable you to create graphs dynamically via Gremlin.Tallowy

© 2022 - 2024 — McMap. All rights reserved.