tinkerpop/blueprints — Issue #206: make Neo4jGraph NOT fresh by default
Author: holyj
Created: 2012-01-20 11:30:45+00:00
State: open

In my code, since ever, I have been handling graph dbs through the native neo4j API . If I need to access blueprint APIs (like inside Gremlin) then I call the Neo4jGraph(GraphDatabaseService) constructor on the existing neo4j instance.

This used to work fine until now, when I finally migrated to Gremlin 1.4 and together with that to Blueprints 1.1. Now the constructor assumes by default, that the db is fresh and deliberately deletes the db reference node (Node[0]) - check out the source at

https://github.com/tinkerpop/blueprints/blob/master/blueprints-neo4j-graph/src/main/java/com/tinkerpop/blueprints/pgm/impls/neo4j/Neo4jGraph.java#L66 .

I think the Node[0] removal should happen ONLY when the Neo4jGraph constructor is being called with unexisting directory path - in such a case it's completely in the gesture of blueprints implementation to create 'fresh' db.

In other cases (=when called with pre-existing path, or with the GDBS instance) the graph db shouldn't be treated as fresh unless specified explicitly (by the boolean fresh parameter).