0
votes

I'm trying to put data in my graph DB using neo4j. I'm new in the field and I don't find it easy to use the batch import tool that Michael Hunger wrote. My goal is to generate at least 10000 nodes with just one property set. So I wrote a python script that generates 10000 lines of Cypher queries like "CREATE (:label{ number : '3796142470'})". I put them in the console and execute them but I get this exception:

StackTrace:

scala.collection.immutable.List.take(List.scala:84)
org.neo4j.cypher.internal.compiler.v2_0.ast.SingleQuery.checkOrder(Query.scala:33)

Am I doing something wrong? In case the only way to generate those nodes is to use a batch/rest API, could you suggest me a easier way to do it?

1

1 Answers

0
votes

Change:

CREATE (:label{ number : '3796142470'})

to look like:

CREATE (n1:Label { number : '3796142470'})

So you are following convention:

CREATE (n:Person { name : 'Andres', title : 'Developer' })

Put them into a file (say import.txt) and then:

bin/neo4j-shell -file import.txt

See http://blog.neo4j.org/2014/01/importing-data-to-neo4j-spreadsheet-way.html for more details.