Yes you can insert into a Neo4j server database using the batch inserter with Java, if:
1. It's the first import (batch inserts aren't safe after that).
2. The server is shutdown
3. You have access to the filesystem where the Neo4j database is stored.
Then you can just use the batch inserter: http://docs.neo4j.org/chunked/stable/indexing-batchinsert.html
Jim
> 1. The server must be shutdown when insert data using batch inserter?
Yes.
> 2. I want to merger the data when there are some properties already
> exist in database during inserting data , how to do these ?
The batch inserter is *not* safe to use on a populated database.
You're going to have to do something transactional - the output of your Map/Reduce work should bind to the Java or REST API and fill the database that way.
Using the Java API will be less latent (no JSON overhead), and will give you better control over the scope of a transaction. You want your transactions to be large so that the cost of committing them is tiny compared to the amount of data you're storing, but not so large so that if they fail it is a pain.
If you really want to do this through the REST API, I would suggest writing an unmanaged extension to do this work, see:
http://docs.neo4j.org/chunked/1.6/server-unmanaged-extensions.html
Jim
> Hi, How to use the Java API in the standalone server ?
>
> Doesn`t The Java API only use in EmbeddedGraphDatabase ?
You have 2 choices:
1. Shutdown the server and run a standalone Java app against your store on disk.
2. Create an unmanaged extension to do this. Unmanaged extensions are hosted by the server, but have full access the Java API.
Jim
You can post with many threads in parallel to the server and the extension will run at full speed against the embedded graph database.
See here: http://docs.neo4j.org/chunked/milestone/server-unmanaged-extensions.html
Michael
Yes the managed extension uses the normal neo4j-api and can work with already existing databases without problems.
Make sure that you have a appropriate tx-size (10k) when creating data in the graph.
Cheers
Michael