Paradigm.Graph.Diff (paradigm v0.3.0)
Summary
Functions
Asserts that two graphs are equal by computing their diff and throwing an error if there are any differences.
Computes the difference between two graphs, capturing missing nodes, added nodes, and changed attributes.
Functions
@spec assert_equal(Paradigm.Graph.t(), Paradigm.Graph.t()) :: :ok
Asserts that two graphs are equal by computing their diff and throwing an error if there are any differences.
Raises an error if the graphs differ, otherwise returns :ok.
@spec diff(Paradigm.Graph.t(), Paradigm.Graph.t()) :: %{ added: [Paradigm.Graph.node_id()], removed: [Paradigm.Graph.node_id()], changed: %{required(Paradigm.Graph.node_id()) => map()} }
Computes the difference between two graphs, capturing missing nodes, added nodes, and changed attributes.
Returns a map with:
:added- list of node_ids present innew_graphbut not inold_graph:removed- list of node_ids present inold_graphbut not innew_graph:changed- map of node_id => %{class: %{old: class, new: class}, data: %{key => %{old: value, new: value}}} for nodes with different attributes or class