0
votes

I am trying to load nodes and its relations from csv file using neo4j bulk importer my script like this

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

: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

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. 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

1

1 Answers

2
votes

The :START_ID and :END_ID fields can take an optional ID space, as in :START_ID(CUSTOMER).

But an ID space is not the same thing as a node label. 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. Doing so would associate the CUSTOMER ID space with the nodes created by that file, and you should no longer see that specific error.

You may also need to do something similar for the AGENT ID space.

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. In that case, your relationship file header can simply use :START_ID and :END_ID without any qualification.