How to use a CSV field to define the node label in a LOAD statement

Viewed 1033

This example is taken from https://neo4j.com/developer/guide-importing-data-and-etl/#_importing_the_data_using_cypher"

LOAD CSV WITH HEADERS FROM "file:customers.csv" AS row
    CREATE (:Customer {companyName: row.CompanyName, customerID: row.CustomerID, fax: row.Fax, phone: row.Phone});

What I want to do is use a field in the CSV file to define the label in the node. For example:

LOAD CSV WITH HEADERS FROM "FILE:///Neo4j_AttributeProvenance.csv" AS CSVLine CREATE (q:CSVLine.NodeType { NodeID:CSVLine.NodeID, SchemaName:CSVLine.SchemaName, TableName:CSVLine.TableName, DataType:CSVLine.DataType, PreviousNodeID:CSVLine.PreviousNodeID });

Here is the error I get:

1 Answers
Related