Trying to execute a list of Cypher statements in Neo4j via the admin interface

情到浓时终转凉″ 提交于 2019-12-07 02:54:54

问题


I have a file that contains a long list of Cypher statements, something like:

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 on the Cypher admin console area "Drop a file to import Cypher or Grass" and then click on the little play icon, I get the message "Expected exactly one statement per query but got: 1405".

Is there a way to batch execute Cypher requests via the admin console? The wording "Drop a file to import Cypher" seems to suggest so.

Thanks

Yann


回答1:


Yeah, the console just let's you run one statement at a time. Fortunately a statement can have multiple CREATE clauses, so if you just remove the semi-colon characters it should work.

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



来源:https://stackoverflow.com/questions/29628204/trying-to-execute-a-list-of-cypher-statements-in-neo4j-via-the-admin-interface

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!