Skip to main content

Explore the data

Exploring the data in SQLite

Open the database in either DB Browser for SQLite or SQLite viewer plugin for Visual Studio Code

Launch DB Browser for SQLite

Open the database.db file in the project directory.

Click on the Browse Data tab and select the devicemodel table.

sqlite-schema

Each device is represented as a row in the devicemodel table.

The site_id column of each row references the ID of a row in the sitemodel table. This models a one to many relationship otherwise known as a ForeignKey relationship.

Exploring the data in the graph database (Neo4j)

Navigate to the Neo4j Browser.

Connect to the database using the username "neo4j" and password "admin". neo4j-auth

When you are connected, click on the database icon in the top left.

neo4j-menu

Click on the Device Node Label.

neo4j-device-base

There should be 5 device nodes displayed.

neo4j-device-base

Click one of the device nodes to see the properties of the node.

neo4j-device-base

We can see that attributes of an instance of a devicemodel are stored as the properties of the node.

Click on the device node again and select the relationships icon.

neo4j-device-base

The node has a relationship to site-1 with a label of LOCATED_IN that represents the type of the relationship. This relationship mimics a Foreign Key relationship.

neo4j-device-base

Currently, tags are a standalone model and do not have relationships with any other models. It may prove useful to allow multiple tags to be added to multiple devices.

The next steps will implement a Many-to-Many relationship between tags and devices within both types of databases.

success

Time to get our hands on some code!