我正在使用以下命令填充neo4j数据库中的数据 -
cat import1.txt | neo4j/bin/neo4j-shell -config neo4j/conf/neo4j.properties -path neo4j/data/graph.db
其中import1.txt
具有以下内容 -
BEGIN
create (n {id:'pid_1', name:'Jo', type:'Person'});
create (n {id:'pid_2', name:'Ma', type:'Person'});
create (n {id:'pid_3', name:'Ph', type:'Person'});
create (n {id:'pid_4', name:'Lu', type:'Person'});
create (n {id:'pid_5', name:'Mary', type:'Person'});
create (n {id:'mid_1', name:'mov1', type:'Movie'});
create (n {id:'mid_2', name:'mov2', type:'Movie'});
create (n {id:'mid_3', name:'mov3', type:'Movie'});
start n1=node:node_auto_index(id='pid_1'), n2=node:node_auto_index(id='pid_2') create (n1-[:friends]->n2);
start n1=node:node_auto_index(id='pid_1'), n2=node:node_auto_index(id='mid_1') create (n1-[:watched]->n2);
start n1=node:node_auto_index(id='pid_2'), n2=node:node_auto_index(id='pid_1') create (n1-[:friends]->n2);
start n1=node:node_auto_index(id='pid_2'), n2=node:node_auto_index(id='pid_3') create (n1-[:friends]->n2);
start n1=node:node_auto_index(id='pid_2'), n2=node:node_auto_index(id='pid_5') create (n1-[:friends]->n2);
start n1=node:node_auto_index(id='pid_2'), n2=node:node_auto_index(id='mid_3') create (n1-[:watched]->n2);
start n1=node:node_auto_index(id='pid_3'), n2=node:node_auto_index(id='pid_2') create (n1-[:friends]->n2);
start n1=node:node_auto_index(id='pid_3'), n2=node:node_auto_index(id='pid_4') create (n1-[:friends]->n2);
start n1=node:node_auto_index(id='pid_3'), n2=node:node_auto_index(id='pid_5') create (n1-[:friends]->n2);
start n1=node:node_auto_index(id='pid_3'), n2=node:node_auto_index(id='mid_1') create (n1-[:watched]->n2);
start n1=node:node_auto_index(id='pid_3'), n2=node:node_auto_index(id='mid_2') create (n1-[:watched]->n2);
start n1=node:node_auto_index(id='pid_4'), n2=node:node_auto_index(id='pid_3') create (n1-[:friends]->n2);
start n1=node:node_auto_index(id='pid_4'), n2=node:node_auto_index(id='mid_2') create (n1-[:watched]->n2);
start n1=node:node_auto_index(id='pid_5'), n2=node:node_auto_index(id='pid_2') create (n1-[:friends]->n2);
start n1=node:node_auto_index(id='pid_5'), n2=node:node_auto_index(id='pid_3') create (n1-[:friends]->n2);
start n1=node:node_auto_index(id='pid_5'), n2=node:node_auto_index(id='mid_3') create (n1-[:watched]->n2);
start n1=node:node_auto_index(id='pid_5'), n2=node:node_auto_index(id='mid_2') create (n1-[:watched]->n2);
COMMIT
在导入数据之前,我停止neo4j,导入后我再次启动它。但在http://localhost:7474/browser/
我没有看到任何节点存在。这可能是什么问题?
当我在控制台中运行相同的查询时,它可以正常工作,即创建节点和关系。