Importing CONTAINS Relationships

Connect Orders to Products

Now connect Order nodes to Product nodes with CONTAINS relationships. This transforms the order-details.csv join table into graph relationships with properties.

Create the CONTAINS relationship

In the Import tool, drag from the Order node to the Product node to create a relationship.

Configure the relationship

In the Definition pane:

  1. Type: CONTAINS

  2. Table: order-details.csv

  3. From node: Order.id ← orderID column

  4. To node: Product.id ← productID column

Add relationship properties

Use Map from table to add these properties to the relationship:

  • quantity (Integer) - How many units ordered

  • unitPrice (Float) - Price at time of purchase

  • discount (Float) - Discount applied

Relationship properties

These properties describe the specific connection - how a product was ordered in a specific order. This data can’t be stored on either node.

Run the import

Click Run Import. You should see 2,155 CONTAINS relationships created.

Validate Import

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

Hint

Follow the steps in this lesson to create CONTAINS relationships.

Make sure to:

  • Upload order-details.csv (2,155 rows)

  • Create relationships (not nodes) with type CONTAINS

  • Match Order nodes using orderId

  • Match Product nodes using productId

  • Add relationship properties: quantity (Integer) and unitPrice (Float)

  • Click Run Import

Solution

The CONTAINS relationship should connect:

  • From: Order node (using orderId)

  • To: Product node (using productId)

  • Relationship type: CONTAINS

  • Properties: quantity (Integer), unitPrice (Float)

After running the import, you should have 2,155 CONTAINS relationships, transforming the entire order_details join table into graph relationships.

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 2-create-orders-relationships.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 created CONTAINS relationships with properties:

  • 2,155 CONTAINS relationships created

  • Added properties: quantity, unitPrice, discount

  • Completed the recommendation path: Customer→Order→Product

Chatbot

How can I help you today?

Data Model

Your data model will appear here.