Question
In this lab, you are going to implement a graph database for a simple online electronic shop. The entities that need to be managed consist
In this lab, you are going to implement a graph database for a simple online electronic shop. The entities that need to be managed consist of products and customer details. Table 1 shows the list of products and its related category. Table 2 lists the current customers. You are required to store this information as nodes in the graph database.
The store also needs to maintain the activities of the customers. It is designed to track how many times a product has been viewed by a user, the wish list of each customer, and the list of products that have been purchased by a certain customer. Table 3 shows the list of products that each customer has viewed and the number of times each product has been viewed by the corresponding customer. Table 4 shows the list of products that have been added to the customer's wish list. Table 5 shows the products that the customers have purchased. The data listed in Table 3-5 should be stored as relationships in the graph database that you are going to build.
Table 1. Products
Name | Availability | Shippability | Price | Category |
Sony Experia Z22 | true | true | 765.00 | Smartphones |
Samsung Galaxy S8 | true | true | 784.00 | Smartphones |
Sony Xperia XA1 Dual G3112 | false | true | 229.50 | Smartphones |
Apple iPhone 8 Plus 64GB | false | true | 874.20 | Smartphones |
Xiaomi Mi Mix 2 | true | true | 420.87 | Smartphones |
Huawei P8 Lite | true | true | 191.00 | Smartphones |
Acer Swift 3 SF314-51-34TX | false | true | 595.00 | Notebooks |
HP ProBook 440 G4 | true | true | 771.30 | Notebooks |
Dell Inspiron 15 7577 | true | true | 1477.50 | Notebooks |
Apple MacBook A1534 12' Rose Gold | true | false | 1293.00 | Notebooks |
Canon EOS 6D Mark II Body | false | true | 1794.00 | Cameras |
Nikon D7500 Kit 18-105mm VR | true | true | 1612.35 | Cameras |
Table 2. Customers
Name | Age | |
Joe B..n@example.com | 25 | |
Daniel J..j@example.com | 31 | |
Alex M..x@example.com | 22 | |
Allison Y..1@example.com | 24 |
Table 3. Products viewed by customer
Customer | Product Viewed | View counts |
Joe | Sony Experia Z22 | 10 |
Daniel | Sony Experia Z22 | 10 |
Daniel | Dell Inspiron 15 7577 | 20 |
Alex | Canon EOS 6D Mark II Body | 20 |
Table 4. Wishlist
Customer | Product |
Joe | Apple iPhone 8 Plus 64GB |
Daniel | Dell Inspiron 15 7577 |
Alex | Sony Xperia XA1 Dual G3112 |
Alex | Nikon D7500 Kit 18-105mm VR |
Allison | Acer Swift 3 SF314-51-34TX |
Allison | HP ProBook 440 G4 |
Table 5. Purchase
Customer | Product |
Joe | Apple MacBook A1534 12' Rose Gold |
Alex | Xiaomi Mi Mix 2 |
Allison | Huawei P8 Lite |
Allison | Sony Xperia XA1 Dual G3112 |
The figure below displays the graph database you will be building in this lab.
B.Task
- Start the Neo4J docker container then open Neo4j Browser.
2.Create the nodes for Categorise and products. Include the relationships between products and categories when you create the nodes. (use the code below and continue for all remaining products)
Noteboo... IS IN HP ProBook 440 G4 IS IN IS IN IS IN Apple MacBook A1534 12 BOUGHT Cameras Joe Baxton Dell Inspiron 15 7577 Acer SF314... ADDED TO WISH LIST- Swift 3 ADDED TO WISH LIST IS_IN IS_IN -ADDED TO WISH_LIST Allison York Nikon D7500 Kit 18-... VIEWED ADDED TO WISH LIST Canon EOS 6D Mark II Apple iPhone 8 Plus 64GB -ADDED TO WISH LIST VIEWED BOUGHT BOUGHT Daniel Johnston VIEWED Sony Xperia XA1 Dual G31... Huawei P8 Lite VIEWED Alex McGyver ADDED_TO_WISH LIST IS IN IS_IN IS_IN Sony Experia Z22 BOUGHT IS IN Xiaomi Mi Mix 2 IS_IN Smartph... IS IN Samsung Galaxy
Step by Step Solution
3.42 Rating (158 Votes )
There are 3 Steps involved in it
Step: 1
Answer Create the Category node CREATE categoryCategory name Smartphones Create the ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started