Order nodes
Create the Order nodes:
-
Create a new Node label -
Order
-
Add the
Orderas the Label -
Select
orders.csvas the Table -
Use the Map from table function to create the properties:
-
Select all the columns, except the
customerIdandemployeeId.
When you confirm the mapping, the properties, their data types, and column will be automatically mapped.
-
The
orderIdproperty should be selected as the unique ID. -
Run the import to create the
Ordernodes.
View the orders in the graph:
MATCH (o:Order)
RETURN o
LIMIT 100
PURCHASED
You can now create the (Customer)-[:PURCHASED]→(Order) relationship.
-
Drag a relationship from the
Customernode to theOrdernode.
-
Set the Relationship Type to
PURCHASED -
Select
orders.csvas the Table -
The Node ID mapping tells Import how to connect the nodes.
-
Select
customerIDfrom the theCustomernode -
Select
orderIDfrom theOrdernode
-
-
Run the import
Need a working solution?
To update the graph data model with the solution, you can:
-
Open Query and delete all the data from your instance:
cypherMATCH (n) DETACH DELETE n -
Download the Customer-PURCHASED-Order data model - northwind-customer-order.zip.
-
Use the
…menu, select Open Model (with data), and select the northwind-customer-order.zip file you downloaded.
-
Run the import.
Lesson Summary
In this lesson, you learned extend your graph data model by adding new nodes and relationships
In the next challenge, you will review the data set, identify new nodes and relationships and add them to the graph.