Search⌘ K
AI Features

Load a Schema into Dgraph

Explore how to load a schema into Dgraph using both GraphQL and DQL approaches. Learn to define types and predicates, post schemas to Dgraph, and manage auto-generated predicates for efficient querying. Understand how schema definition impacts data loading and querying with Dgraph.

Visual representation

The figure below shows how the reference book graph can be mapped in Dgraph.

Book graph mapped in Dgraph
Book graph mapped in Dgraph

Note that this resembles the RDF graph but with properties added to the edges.

How to load the data

We have some choices in how we load our book graph:

  • We can load the data directly, and Dgraph autogenerates predicates for us. ...