cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

CSV Import error - Type mismatch - expected Node but was Map

Sorry, I am completely new to neo4j and finding it tough. I successfully imported one set of nodes from a CVS file (with only one property), but have been unable to import my second set of nodes with seven properties (columns). I get the following error message "Type mismatch: expected Node but was Map (line 1, column 106 (offset: 105))" I have not been able to find any other posts with a similar problem. The cypher code I am using is:

Preformatted text``load csv with headers from "file:///organisations.csv" as organisations CREATE (a:Organisation {OrgCode: organisations:OrgCode, OrgName: organisations:OrgName, OrgAcronym: organisations:OrgAcronym, UnitAcronym: organisations:UnitAcronym, OrgType: organisations:OrgType, OrgTown: organisations:OrgTown, UnitName: organisations:UnitName})``Preformatted text

The CSV headers are:
OrgCode,OrgName,OrgAcronym,UnitAconym,OrgType,OrgTown,UnitName

And a typical row entry is:
UoS*IoA,University of Stirling,UoS,IoA,UNI,Stirling,Institute of Aquaculture

I thought the "*" in the first column may be causing problems, but replacing it with an underscore made no difference.
I must be missing something simple here, but I have lost a day on this and reading manuals and tutorials has not helped.
Thank you.

1 REPLY 1

akaur
Node Link

Hi @astacus ,

Try replacing ':' with '.' after alias name(organisations) of your CSV file in Cypher Query.
For example-

load csv with headers from "file:///organisations.csv" as organisations CREATE (a:Organisation {OrgCode: (organisations.OrgCode), OrgName: (organisations.OrgName) , OrgAcronym: (organisations.OrgAcronym), UnitAcronym:( organisations.UnitAcronym), OrgType: (organisations.OrgType), OrgTown:( organisations.OrgTown), UnitName: (organisations.UnitName)})

It should work.