Storing data as graphs workshop

Cheuk Ting Ho

So...
What's a Graph?
And Why?

  • much easier to interpret the model
     

  • understand how it maps to real world entities compared to the relational example

SELECT Name from TABLE where Person_ID = (SELECT mother from TABLE where Name="John")
SELECT Name from TABLE where Person_ID = (SELECT mother from TABLE WHERE Person_ID = (SELECT mother from TABLE where Name="John"))
WOQL.and(
   WOQL.triple("v:Person", "mother", "v:MotherID"),
   WOQL.triple("v:MotherID", "name", "v:MotherName"),
   WOQL.triple("v:MotherID", "mother", "v:GrandmotherID"),
   WOQL.triple("v:GrandmotherID", "name", "v:GrandmotherName"),
)

Storing data semantically (No more data type confussion and cleaning)

???

OWL Graphs

  • by far the most powerful in terms of data modelling capabilities
     
  • 3 simple predicates that enable relationships between object types to be defined:

    rdfs:domain and rdfs:range support strongly typed relationships between objects

    rdfs:subClassOf supports type inheritance

Live Example

Store data like git - Branch, Merge, Rollback and Collaborate 

  • since the database is also a graph (yup, it is, why not) we can perform git magics
     

  • Git is great for code, but not data
     

  • In the database data are stored in layers for optimum efficiency

  • share and collaborate your data on hub (just like GitHub but for graph data)
     

  • Enable DataOps on Machine Learning
     

  • TerminusHub (comming soon)

My first graph with 

Setup Checklist

Do you have TerminusDB installed?

Yes

No

Good to go

Do you have Docker?

Yes

No

Which OS?

Mac / Linux / Window 10 Pro

No

Others

Do you have TerminusDB installed?

1. Make sure TerminusDB is running

2. http://localhost:6363/console
3. Create a new Database

4. Create schema

5. Inspect the data

6. Load the data

7. Query the data

 

Buckle up and follow along 🏃🏻🏃🏻‍♀️🏃🏻‍♂️

Data that we use: https://terminusdb.com/t/data/bike_tutorial.csv

In case you are lost:
https://terminusdb.com/docs/getting-started/start-tutorials/console_js/

Let's Time travel

 

 

To get the newest update👍:

Follow us on Twitter: @TerminusDB

Website: https://terminusdb.com/

Join the community:

https://discord.gg/Gvdqw97

Wants to know more?

Sotring data as graphs workshop

By Cheuk Ting Ho

Sotring data as graphs workshop

Brief introduction of graph database and why

  • 360
Loading comments...

More from Cheuk Ting Ho