In this lab, you are going to implement a graph database for a simple online electronic shop.
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 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)
Modern Systems Analysis And Design
ISBN: 9780134204925
8th Edition
Authors: Joseph Valacich, Joey George