Inspect the Structs
Explore how to refine Elixir struct displays by hiding sensitive fields and truncating large graph data. Learn to implement a custom Inspect protocol for clearer, concise struct representation when working with property graph models in your Elixir projects.
We'll cover the following...
We'll cover the following...
Let’s try out the %GraphCommons.Graph{} struct by creating a new graph. We’ll use a property graph model example here, which generates a minimal graph with two nodes and one edge between them.
Note: Our
query.exfile will be similar to thegraph.exfile with the term “graph” replaced with “query.”
Default graph
The following example will serve as our default graph.
We can create this simple graph with the Cypher string:
iex> CREATE (a)-[:EX]->(b)
Here ...