Attempting to execute a list of Cypher instructions in Neo4j through the admin interface

I have a file containing a long list of Cypher statements, for example:

create (n:oeuvre {ide12:"41",numpers:[87603],titre:"JE PARS"}); create (n:oeuvre {ide12:"151",numpers:[395225,364617,396308,306762],titre:"I DID IT FOR LOVE"}); create (n:oeuvre {ide12:"67",numpers:[54001],titre:"GRAND PERE N AIME PAS LE"}); create (n:oeuvre {ide12:"80",numpers:[58356],titre:"MON HEURE DE SWING"}); create (n:oeuvre {ide12:"91",numpers:[58356],titre:"AU QUATRIEME TOP"}); 

When I drag my file in the Cypher admin console area "Drop the file to import Cypher or Grass" and then click on the small game icon, I get the message "Exactly one statement is expected for each request, but received: 1405".

Is there a way to execute Cypher requests through the admin console? It appears that the wording is "Drop the file to import Cypher."

thanks

Yann

+6
source share
1 answer

Yes, the console just allows you to run one statement at a time. Fortunately, a statement can have several CREATE clauses, so if you just remove the semicolons, it should work.

Alternatively, you can use the neo4j-shell command with the -file argument to run the cypher script file. This method allows you to use scripts with multiple commands, separated by semi-colonies.

+10
source

Source: https://habr.com/ru/post/985118/


All Articles