Dgraph Model
Explore how Dgraph structures data using an RDF-inspired model that omits external IDs and supports mutations with RDF and JSON formats. Learn to define schemas, add properties through edges and facets, and query data using GraphQL-based DQL. This lesson helps you understand Dgraph's unique approach to graph data and how to manipulate it effectively.
We'll cover the following...
Dgraph vs. RDF
The Dgraph data model is a little curious. Superficially, it resembles RDF in that nodes connect to both nodes and literal values via edges. But critically, it does away with a key feature of RDF—external IDs. This is the very feature that allows for web-scale data integration. As such, it corresponds to an RDF that uses blank nodes.
Dgraph uses an RDF-like N-Triples syntax for data mutations. Note that this is not strict RDF as properties are typically expressed using local names, whereas RDF requires properties to be identified using absolute URI names. Be warned that this RDF mutation format will not validate with an RDF parser. It does, however, provide a simple means of ...