简体   繁体   English

在neo4j中使用批量导入器导入csv文件时遇到问题

[英]Facing problem to importing csv file with bulk importer in neo4j

I am trying to load nodes and its relations from csv file using neo4j bulk importer my script like this 我正在尝试使用neo4j bulk importer从csv文件加载节点及其关系

neo4j-admin import \
--id-type=string \
--nodes:AGENT="nodes_AGENT_C_20190610.csv" \
--nodes:CUSTOMER="nodes_CUSTOMER_C_20190610.csv" \
--relationships:CASHOUT="relcashoutTest-header.csv,relcashoutTest.csv"

and my csv file like this for relationship files 和我的csv文件这样的关系文件

:TYPE,:START_ID(CUSTOMER),:END_ID(AGENT),TXNID:string,TIMESTAMP:datetime,AMOUNT:int,CHANNEL

Here TYPE indicates the column named RELATIONSHIP and my relational csv file look like this 在这里,TYPE表示名为RELATIONSHIP的列,而我的关系csv文件如下所示

CASHOUT,abc,xyz,6C19MX7DXL,2019-03-01T11:02:55,40,charge
CASHOUT,pqr,jkl,6C19MX7E2V,2019-03-01T11:02:57,10,charge

after running my import.sh script I am getting bellow error unexpected error: Group 'CUSTOMER' not found. 运行import.sh脚本后, 出现以下错误:意外错误:找不到组'CUSTOMER'。 Available groups are: [] 可用的组是:[]

I have gone through the document but didn't figure it out my mistakes. 我浏览了这份文件,但没有弄清楚我的错误。 Any help will be appreciated neo4j version is 3.5.8 任何帮助将不胜感激neo4j版本是3.5.8

The :START_ID and :END_ID fields can take an optional ID space , as in :START_ID(CUSTOMER) . :START_ID:END_ID字段可以采用可选的ID空间 ,例如:START_ID(CUSTOMER)

But an ID space is not the same thing as a node label . 但是,一个ID空间一样的事,作为一个节点标签 In order for :START_ID(CUSTOMER) to work, one of your node CSV files (presumably the one for the CUSTOMER label) must specify, in its header, :ID(CUSTOMER) instead of just :ID . 为了使:START_ID(CUSTOMER)工作,您的节点CSV文件之一(可能是CUSTOMER标签的文件)必须在其标头中指定:ID(CUSTOMER)而不是:ID Doing so would associate the CUSTOMER ID space with the nodes created by that file, and you should no longer see that specific error. 这样做会将CUSTOMER ID空间与该文件创建的节点相关联,并且您应该不再看到该特定错误。

You may also need to do something similar for the AGENT ID space. 您可能还需要对AGENT ID空间做类似的事情。

NOTE: If all your nodes have unique values in the :ID field (across CSV files), then you do not need to use ID spaces at all. 注意:如果所有节点在:ID字段中(跨CSV文件)都具有唯一值,则根本不需要使用ID空间。 In that case, your relationship file header can simply use :START_ID and :END_ID without any qualification. 在这种情况下,您的关系文件标题可以简单地使用:START_ID:END_ID而无需任何限定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM