MnemosyneZvex. Sidecar
(mnemosyne_zvex v0.1.0)
Copy Markdown
DETS-backed store for mutable per-node metadata and typed links between
nodes. Lookups by node_type go straight to Zvex via a filtered query —
no type-index is maintained here.
Records:
{{:links, node_id}, %{edge_type => MapSet.t(node_id)}}
{{:meta, node_id}, %Mnemosyne.NodeMetadata{}}
Summary
Functions
Closes the underlying DETS table.
Deletes metadata for the given ids.
Fetches the link map for a node id, defaulting to empty when absent.
Looks up metadata for many node ids; missing ids are absent from the map.
Opens a DETS table at the given path, creating it if needed.
Adds a bidirectional link between two nodes.
Adds many bidirectional links in one pass (no sync).
Upserts a batch of metadata entries.
Removes the given ids from all sidecar tables and scrubs back-references
from every surviving node's link set. Mirrors
Mnemosyne.GraphBackends.Persistence.DETS.strip_dead_refs/2.
Flushes pending writes to disk.
Types
@type t() :: %MnemosyneZvex.Sidecar{path: charlist(), ref: :dets.tab_name()}
Functions
Closes the underlying DETS table.
Deletes metadata for the given ids.
@spec get_links(t(), String.t()) :: %{ required(Mnemosyne.Graph.Edge.edge_type()) => MapSet.t() }
Fetches the link map for a node id, defaulting to empty when absent.
Looks up metadata for many node ids; missing ids are absent from the map.
Opens a DETS table at the given path, creating it if needed.
@spec put_link(t(), String.t(), String.t(), Mnemosyne.Graph.Edge.edge_type()) :: :ok | {:error, {:dets_error, term()}}
Adds a bidirectional link between two nodes.
@spec put_links_batch(t(), [ {String.t(), String.t(), Mnemosyne.Graph.Edge.edge_type()} ]) :: :ok | {:error, {:dets_error, term()}}
Adds many bidirectional links in one pass (no sync).
@spec put_metadata_many(t(), %{required(String.t()) => struct()}) :: :ok | {:error, {:dets_error, term()}}
Upserts a batch of metadata entries.
Removes the given ids from all sidecar tables and scrubs back-references
from every surviving node's link set. Mirrors
Mnemosyne.GraphBackends.Persistence.DETS.strip_dead_refs/2.
Flushes pending writes to disk.