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:
-
Label:
Category -
Table:
categories.csv
Map Category properties
Use Map from table to add:
-
categoryID→id(Integer) - Set as ID property -
categoryName→name(String) -
description(String)
Create the IN_CATEGORY relationship
Drag from the Product node to the Category node.
Configure in the Definition pane:
-
Type:
IN_CATEGORY -
Table:
products.csv -
From node: Product.id ←
productIDcolumn -
To node: Category.id ←
categoryIDcolumn
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.csvwhich contains both productID and categoryID columns -
Create relationships (not nodes) with type
IN_CATEGORY -
Match Product nodes using
idproperty (mapped from productID column) -
Match Category nodes using
idproperty (mapped from categoryID column) -
Set direction from Product to Category
-
Click Run Import
Solution
The IN_CATEGORY relationship should connect:
-
From: Product node (using
idproperty, mapped from productID column) -
To: Category node (using
idproperty, 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