Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mneedham/neo4j-importer
https://github.com/mneedham/neo4j-importer
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mneedham/neo4j-importer
- Owner: mneedham
- Created: 2013-07-28T17:09:43.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-20T11:05:35.000Z (over 11 years ago)
- Last Synced: 2024-04-14T09:10:05.689Z (9 months ago)
- Language: Java
- Size: 1.95 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
*This is a work in progress, it doesn't do everything it says below yet*
# An easy to use tool for importing data into neo4j
neo4j importer is a command line tool which makes it easy to import data in a variety of different formats into your database. It will eventually support CSV, [GraphML](http://graphml.graphdrawing.org/) and [Geoff](http://nigelsmall.com/geoff) but we're open to suggestions for other formats that you'd like to see.
## Installation
1. Download the neo4j-importer zip file.
````
curl http://dist.neo4j.org/neo4j-importer.zip -o neo4j-importer.zip
````2. Unzip it somewhere on your machine.
````
unzip batch-importer.zip -d ~/neo4j-importer
````3. That's it!
## Usage
1. Ensure you have a neo4j server running
~~~ sh
/path/to/neo4j-installation/bin/neo4j start
~~~2. Navigate on your machine to the folder where you unzipped neo4j-importer.
~~~ sh
cd ~/neo4j-importer
~~~3. Create a file names [nodes.csv](examples/nodes.csv) which contains the nodes that you want to import.
The file should contain a header listing the node's fields. One of those fields *must* be called 'id' and is used to identify the node.e.g.
````
echo -e "id\tname\n1\tMark\n2\tAndreas" > nodes.csv
````````
cat nodes.csv
id name
1 Mark
2 Andreas
````4. Create a file named [relationships.csv](examples/relationships.csv) which contains relationships between the nodes defined in nodes.csv.
The file should contain a header with the fields 'from', 'to', 'type' and can also contain fields for properties on the relationship. The 'from' and 'to' fields use the values defined in the 'id' field in nodes.csv.e.g.
````
echo -e "from\tto\ttype\ttimeInMonths\n1\t2\tFRIEND\t3" > relationships.csv
````````
cat relationships.csv
from to type timeInMonths
1 2 FRIEND 3
````5. Import your data into neo4j
````
./bin/neo4j-importer
Successfully imported 1 node and 1 relationship
````