Packaging Graphs and Queries
We’re going to save our graph serializations and database queries in the graph store, and we’ll need some data access properties to describe them. To keep things simple, let’s say we’re going to work with text-based formats only.
We’ll want to encapsulate those graph and query serializations, along with the properties for accessing them, into data packages for transporting to and from the graph store. Essentially, we’re building containers for the graphs and queries. We’ll use structs for those data packages—one for graphs and one for queries.
So let’s extend our module structure to add in a new module for a %GraphCommons.Graph{} struct to capture a graph serialization. We’ll also add a module for a %GraphCommons.Query{} ...
Get Exploring Graphs with Elixir now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.