SpecialtyID,Specialty,SubSpecialty
7001,Accounting
7002,Administrative Services
7003,Adult Education
7025,Consulting,Building and Construction
// Create Specialties
LOAD CSV WITH HEADERS FROM 'https://github.com/johnmillstead/pmg_connect/blob/f90605e306d54ee85c7eceba70f4fc093c8edac4/specialties.csv' AS row
MERGE (specialty:Specialty {specialtyID: row.SpecialtyID})
ON CREATE SET specialty.specialty = row.Specialty, specialty.subSpecialty = row.SubSpecialty;
results in: Cannot merge the following node because of null property value for 'specialtyID': (:Specialty {specialtyID: null})
// Create Specialties
LOAD CSV WITH HEADERS FROM 'https://github.com/johnmillstead/pmg_connect/blob/fbec96e04c8209cb922d5b3cd31c1fd5b792acb5/specialties.csv' AS row
MERGE (specialty:Specialty {specialtyID: toInteger(row.SpecialtyID)})
ON CREATE SET specialty.specialty = row.Specialty;
I have tried it with the coalesce and without. I have tried it with the toInteger and without.
I so desperately want to win at this game and finish the very simple project I am tasked with. Thanks for any help you can provide.
In case the csv format is likely to change over a period of time then it is better to encode them as procedures and include them as libraries on your own installation.
LOAD CSV WITH HEADERS FROM 'https://github.com/johnmillstead/pmg_connect/blob/fbec96e04c8209cb922d5b3cd31c1fd5b792acb5/specialties.csv' AS row return row;
which should do nothing more than read the csv from github and return each row the results I get are
If you run the same LOAD CSV do yo get similar results?
I think the issue is you have the wrong URL for if you run
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/johnmillstead/pmg_connect/f90605e306d54ee85c7eceba70f4fc093c8edac4/specialties.csv' AS row return row.SpecialtyID, row.Specialty, row.SubSpecialty;
note the different URL, namely https://raw......... then now I get more expected results and as
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/johnmillstead/pmg_connect/f90605e306d54ee85c7eceba70f4fc093c8edac4/specialties.csv' AS row MERGE (specialty:Specialty {specialtyID: row.SpecialtyID})
ON CREATE SET specialty.specialty = row.Specialty, specialty.subSpecialty = row.SubSpecialty;
results in
Added 149 labels, created 149 nodes, set 324 properties, completed after 136 ms.