Batched mutations for the knowledge graph.
A changeset accumulates node additions and link operations that can
be applied atomically to a Mnemosyne.Graph.
Summary
Functions
Records a typed link between two node IDs in the changeset.
Appends a node to the changeset's addition list.
Merges two changesets by concatenating their additions, links, and metadata maps.
Creates an empty changeset.
Associates metadata with a node ID in the changeset.
Types
@type t() :: %Mnemosyne.Graph.Changeset{ additions: [struct()], links: [{String.t(), String.t(), Mnemosyne.Graph.Edge.edge_type()}], metadata: %{required(String.t()) => Mnemosyne.NodeMetadata.t()} }
Functions
@spec add_link(t(), String.t(), String.t(), Mnemosyne.Graph.Edge.edge_type()) :: t()
Records a typed link between two node IDs in the changeset.
Appends a node to the changeset's addition list.
Merges two changesets by concatenating their additions, links, and metadata maps.
@spec new() :: t()
Creates an empty changeset.
@spec put_metadata(t(), String.t(), Mnemosyne.NodeMetadata.t()) :: t()
Associates metadata with a node ID in the changeset.