Importing Categories and IN_CATEGORY Relationships

Add Product Categories

Import Category nodes and connect them to Products with IN_CATEGORY relationships. This enables category-based filtering in recommendations.

Create the Category node

In the Import tool, create a new node on the canvas.

Configure in the Definition pane:

  1. Label: Category

  2. Table: categories.csv

Map Category properties

Use Map from table to add:

  • categoryIDid (Integer) - Set as ID property

  • categoryNamename (String)

  • description (String)

Create the IN_CATEGORY relationship

Drag from the Product node to the Category node.

Configure in the Definition pane:

  1. Type: IN_CATEGORY

  2. Table: products.csv

  3. From node: Product.id ← productID column

  4. To node: Category.id ← categoryID column

Run the import

Click Run Import. You should see:

  • 8 Category nodes created

  • 77 IN_CATEGORY relationships created

Validate Import

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

Hint

Follow the steps in this lesson to create IN_CATEGORY relationships.

Make sure to:

  • Use products.csv which contains both productID and categoryID columns

  • Create relationships (not nodes) with type IN_CATEGORY

  • Match Product nodes using id property (mapped from productID column)

  • Match Category nodes using id property (mapped from categoryID column)

  • Set direction from Product to Category

  • Click Run Import

Solution

The IN_CATEGORY relationship should connect:

  • From: Product node (using id property, mapped from productID column)

  • To: Category node (using id property, mapped from categoryID column)

  • Relationship type: IN_CATEGORY

  • Source file: products.csv

After running the import, you should have 77 IN_CATEGORY relationships (one for each product).

Summary

You imported Category nodes and IN_CATEGORY relationships:

  • 8 Category nodes from categories.csv

  • 77 IN_CATEGORY relationships from products.csv

  • Enables category-based filtering in recommendation queries

Chatbot

How can I help you today?

Data Model

Your data model will appear here.