Reputation: 175
Is there a nice and clean mechanism out of the box which can be used to populate a test instance of neo4j. I'm looking for something similar to DBUnit. I'm imagining an xml file which is then sucked in to populate neo4j.
Upvotes: 1
Views: 1457
Reputation: 6331
you can easily load a GraphML file, see for instance http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-load-a-sample-graph
Also, you could have a template populated datastore that you point your database engine at.
Thirdly, in neo4j itself we are using annotation-based test harnesses, so you can do
@Graph("I know you")
To create a sample graph, see https://github.com/neo4j/neo4j/blob/master/community/kernel/src/test/java/org/neo4j/metatest/TestJavaTestDocsGenerator.java#L117 (original link: https://github.com/neo4j/community/blob/master/kernel/src/test/java/org/neo4j/metatest/TestJavaTestDocsGenerator.java#L107)
Upvotes: 1
Reputation: 634
You may check out mirko's wikipedia data import solution which builds up a graph database containing 9,006,704 nodes (pages, titles only) and 82,537,500 relationships (links) as he mentions => http://www.encodedknowledge.com/2012/02/neo4j-wikipedia-graph/
Upvotes: 2