Neo4j partial dump with cypher in java

Yesterday I asked a question, but it was unclear, so I created a new one with really better explanations to find the answer I need :).

So, in my Java application, I need to make a copy of the neo4j system, here is an example:

A <--- this is a project / \ <--- With relationships BC <--- and subnodes + Labels / \ / \ <--- with a depth unknown ......... 

I need to make a copy of this in my database with a different identifier, for example:

  A A1 / \ / \ BC B1 C1 / \ / \ / \ / \ ......... .......... 

In neo4j shell, I can simply use dump A to n to return a cypher statement that I can copy and paste into neo4j's web interface to create my copy.

But actually, I am in an application with java, so I need to find how to do the same, but with java (I use VAADIN framework + JDK7 + Neo4j 2.1.4).

I tried to use Neo4j-shell in java, but could not find how to get a response from dump command (cypher suggestion), so I am stuck now and ask about stack overflow to get help :).

A good day

+1
source share
1 answer

A dump is a command shell, theoretically you can create and run it yourself.

It uses SubgraphExporter from Cypher module, Neo4j - OSS, you can find it on GitHub

In general, it will be easier for you to perform a cypher query on the database yourself, and then recreate the data of interest to you with the results.

Something like this should help you:

https://github.com/neo4j-contrib/developer-resources/blob/gh-pages/examples/java/jdbc/src/main/java/example/jdbc/movies/MovieService.java#L58

0
source

All Articles