Introduction
You are going to import a relational dataset into your Neo4j Aura instance using the Import tool.
You will:
-
Create a new graph data model from the Northwind dataset
-
Build the graph data model in stages by mapping tables to nodes and relationships
-
Run the import after each stage and reviewing the data using the Query tool
Northwind Dataset
The Northwind dataset contains data about a fictional company called Northwind Traders, which imports and exports specialty foods from around the world.
The dataset contains tables for Customers, Orders, Products, Categories, and Employees.
erDiagram
CATEGORIES {
int categoryID PK
string categoryName
string etc
}
CUSTOMERS {
string customerID PK
string companyName
string etc
}
EMPLOYEES {
int employeeID PK
string firstName
string lastName
int reportsTo FK
string etc
}
PRODUCTS {
int productID PK
string productName
int supplierID FK
int categoryID FK
decimal unitPrice
string etc
}
ORDERS {
int orderID PK
string customerID FK
int employeeID FK
datetime orderDate
string etc
}
ORDER_DETAILS {
int orderID FK
int productID FK
decimal unitPrice
int quantity
}
SUPPLIERS {
int supplierID PK
string companyName
string etc
}
SHIPPERS {
int shipperID PK
string companyName
string etc
}
REGIONS {
int regionID PK
string regionDescription
}
TERRITORIES {
string territoryID PK
string territoryDescription
int regionID FK
}
EMPLOYEE_TERRITORIES {
int employeeID FK
string territoryID FK
}
%% Relationships
CATEGORIES ||--o{ PRODUCTS : "categorizes"
SUPPLIERS ||--o{ PRODUCTS : "supplies"
CUSTOMERS ||--o{ ORDERS : "places"
EMPLOYEES ||--o{ ORDERS : "handles"
EMPLOYEES ||--o{ EMPLOYEES : "reports to"
SHIPPERS ||--o{ ORDERS : "ships"
ORDERS ||--o{ ORDER_DETAILS : "contains"
PRODUCTS ||--o{ ORDER_DETAILS : "included in"
REGIONS ||--o{ TERRITORIES : "contains"
EMPLOYEES ||--o{ EMPLOYEE_TERRITORIES : "assigned to"
TERRITORIES ||--o{ EMPLOYEE_TERRITORIES : "covers"Create a graph data model
Your task is to:
-
Download the Northwind dataset
-
Create a new graph data model in the Import tool
-
Open the Northwind dataset
-
Review the data source
-
Run the import to create
Customernodes
Continue with the lesson to create the graph data model
Import the Northwind dataset
You need to download the Northwind dataset and create a new blank graph data model:
-
Open the Import tool in Aura and select Graph Models.
Open Import Tool →
-
Create a new graph data model.
-
Use the
…menu toOpen model (with data)and select thenorthwind-customer.zipfile you downloaded.
-
You will see the tables (csv files) from the Northwind dataset in the left-hand panel, and a single Customer node in the graph data model.
Review the Data Source
Review the data source tables and try to identify:
-
What tables will become Node labels
-
The associated relationships between tables through their primary/foreign keys
-
What fields will become properties on nodes and relationships
Customer node
The Customer node has already been created for you.
Select the node in the graph data model and review the data model in the right hand panel.
You should be able to identify the following:
-
The node label -
Customer. -
The source table -
customers.csv. -
The node properties - the
name, what datatypeis used, and whatcolumnfrom the source table is used for each property. -
What property is used as the unique ID for the node label -
customerId.
Run the import
Run the import to create the Customer nodes:
-
Click Run Import
-
Select your instance
-
Enter your instance credentials
-
A summary of the import will be displayed
Query the graph
You can view the customers in the graph using the Query tool.
Run the following query to return the Customer nodes:
MATCH (c:Customer)
RETURN c
Lesson Summary
In this lesson, you imported customer data from the Northwind dataset and started to build a graph data model.
In the next lesson, you will continue to build the graph data model by adding Order nodes and PURCHASED relationships between customers and orders.