Behaviour for graph lookup via symbolic selectors.
This module provides graph access by ID or symbolic selector (e.g., :primary,
:repository_manifest). Each container type defines its own selectors for
commonly needed graphs.
Structural operations (member enumeration, directory traversal) are in
DCATR.Directory.Type, while this behaviour adds named graph access on top.
Core Callback
resolve_graph_selector/2- Resolve symbolic selectors to graphs
Generated Functions
The __using__ macro generates:
graph/2— callsresolve_graph_selector/2, falls back tofind_graph/2(fromDCATR.Directory.Type)has_graph?/2—graph/2 != nil
Both are defoverridable.
Summary
Callbacks
Resolves a symbolic selector to a graph.
Types
@type container() :: Grax.Schema.t()
@type id_or_selector() :: selector() | RDF.IRI.coercible()
@type selector() :: atom()
@type t() :: module()
Callbacks
@callback resolve_graph_selector(container(), selector()) :: DCATR.Graph.t() | nil | :undefined
Resolves a symbolic selector to a graph.
Each container type defines selectors for its commonly needed graphs
(e.g., :primary on repositories, :service_manifest on service data).
Return values
%DCATR.Graph{}- Selector resolved successfully to a graphnil- Selector is recognized but references no graph (e.g.,:primarywhen no primary graph is defined):undefined- Selector is not recognized by this implementation (enables delegation in hierarchies)
Implementations should only handle their own selectors and return :undefined for unknown ones.