Store Graphs in the Graph Store
Explore how to store and retrieve graphs efficiently in Elixir by using serialization techniques like the DOT format. Understand the use of libgraph functions to read and write graph data to disk, and learn how macros can reduce code duplication for handling multiple graph types in the storage process.
We'll cover the following...
We'll cover the following...
Although we can enter the graph data interactively, it can get a little tiresome after a while. We’d rather read our graphs back from a filestore, so we'll need to be able to write the graphs out to some text format—that is, to serialize the graph data structures—for disk-based storage.
DOT vs. plaintext
The libgraph package includes two serialization functions in the Graph module: to_dot/1 and to_edgelist/1.
to_dot/1 |
to_edgelist/1 |
|---|---|
| It |