Importing Order Nodes

Importing Order Nodes

You imported Product and Customer nodes. Now import Order nodes.

The orders.csv file is already loaded in your Import tool.

Map the Order node

In the Data Modeling tab:

  1. Click the + Node Label button to add a new node

  2. Set the label: Under Definition, set the label to Order

  3. Select the table: Under Table, select orders.csv

Configure properties

Use the Map from table button and select these columns:

Column Type Rename To

orderID

Integer

id

orderDate

DateTime

date

shipCountry

String

shipCity

String

Verify the ID property is set to id.

Date Properties

The orderDate column should be converted to a DateTime type.

The Import tool will coerce the string value into a DateTime object during import.

To run comparisons on this property in Cypher, use the datetime() function:

cypher
MATCH (o:Order)
WHERE o.date > datetime('2024-01-01')
RETURN o

Run the import

Click the Run Import button. You should see confirmation that 830 Order nodes were created.

Validate Import

Once you have imported the Order nodes, click the Check Database button to verify that the task is complete.

Hint

Follow the same steps as the previous lessons where you imported Product and Customer nodes.

Make sure to:

  • Set the label to Order

  • Map from orders.csv

  • Set orderId as the ID property

  • Click Preview to review

  • Click Run Import

Solution

The Order node should be configured with:

  • Label: Order

  • File: orders.csv

  • ID property: orderId

  • Key properties: orderDate, shipCountry, shipCity

After running the import, you should have 830 Order nodes in your graph.

Download Solution

If you are having trouble, you can download the solution model and open it using the Open model (with data) option.

  1. Download 6-import-orders.zip

  2. In the Import tool, click the 3-dot menu (…​) and select Open model (with data)

  3. Select the downloaded zip file

Summary

You imported Order nodes into your graph:

  • Created 830 Order nodes

  • Renamed orderID to id and orderDate to date

  • Converted date strings to DateTime type

In the next module, you’ll create relationships to connect these nodes together.

Chatbot

How can I help you today?

Data Model

Your data model will appear here.