Graph Database:

A gentle introduction

Graph theory (mathematics) - History

Euler abstraction and solution - 1735

Childhood

Graph theory - Concepts

  • Vertices
  • Edges
  • Degree of a node
  • Connected nodes
  • Cycle

Graph theory - Algorithms

  • BFS
  • DFS
  • Shortest Path (Dijkstra)
  • Traveling salesman

Graph representation (Computer Science)

  • Adjacency matrix
  • Edge list
  • Adjacency list

Graph databases (Technology)

On top of SQL

  • Complicated queries
  • Performance hit

Solution

  • Denormalization
  • Up to depth <n>

Graph databases (Technology)

Native

  • Simple queries
  • Good Performances
  • Whiteboard friendly
  • 1st class citizen

Graph modelling - RDF

  • Resource Description Framework
  • (Subject, predicate, object) triples
  • Knowledge graph

Graph Modelling - Labeled Property graph

  • Nodes have properties
  • Nodes have labels
  • Edges are instantiable
  • Edges have single labels
  • Edges have properties

Graph modelling - RDF limitations

  • Nodes have no properties
  • Edges are not instantiable
  • Good for graphs that are almost immutable
  • Google Knowledge graph

Graph Modelling - Labeled Property graph

Close to the way our brain think (David Lavenda)

https://dzone.com/articles/relational-vs-graph-data-modeling

Graph DB query language - CYPHER

LIVE DEMO

Graph DBs - applications

  • Web Pages connected by links
    • PageRank algorithm

Page C has a higher PageRank than Page E, even though there are fewer links to C.

Graph DBs - applications

  • Social networks
    • Edges
      • :FRIEND
      • :LIKES
      • :COMMENTS
    • Algorithms
      • Feed calculation
      • Users affinity
      • Average number of hops

Graph DBs - applications - NLP

Words A and B are paradigmatically related if they can be substituted for each other. This indicates they belong in the same class, such as “Monday” and “Thursday” or “Cat” and “Dog.

Collage Graph

  • Topics
  • People
  • Cloud Events

Collage Graph - TopicRank

Collage Graph - Insights

People that share topics with David

Questions?

Graph Databases: An introduction for Collage - Google Slides