Dgraph DQL Tour

Introduction

Graphs

We’ve started Dgraph, but first things first: What is a graph and what has that got to do with databases?

Graphs describe objects and the interconnections among them. Many people have heard of friendship graphs, or social network graphs, so let’s start there.

We have loaded Ratel UI in an iFrame for this lesson and have ran the following query against your endpoint you provided in the earlier lesson.

In the resulting graph, circles denote people and pets, and lines denote connections or labeled relationships among them. See if you can find Michael and his pet sheep, Rammy.

Graphs lend themselves so naturally to visualization that you’ll find yourself thinking in terms of graphs and visualizations of them.

In a graph, the objects (or entities) are called nodes and the relationships are called edges or predicates.

Graphs aren’t just for social networks. Other examples include

  • Interconnected data, like SQL tables requiring joins
  • Advanced search
  • Recommendation engines
  • Pattern detection
  • Networks, like computers, roads, and telecommunications
  • Processes, like business and biological processes
  • Events and the causality or other links between them
  • Structures of firms or markets

These and the many more applications of graphs lead us to graph databases.

1.6 Graphs