Skip to content

Versioning with Neo4j

asaf edited this page Jan 16, 2013 · 9 revisions

Versioning with Neo4j

Neo4j is a very known graph database implementation and production ready,

Using Antiquity in conjunction with Neo4j is very simple, The only thing required is to initialize a Neo4j blueprints graph instance as the base graph and wrap it with Antiquity's graph implementation,

Creating an embedded Neo4j graph

//Create a neo4j database instance
GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase("target/database/location");
//Wrap it with blueprint API
Neo4jGraph baseGraph = new Neo4jGraph(graphDb);
//Wrap it with Antiquity version graph
TransactionalVersionedGraph<Neo4jGraph, Long> graph = new TransactionalVersionedGraph<Neo4jGraph, Long>(
	baseGraph, new LongGraphIdentifierBehavior());

Simply work with the graph instance.

Clone this wiki locally