ExposoGraph.storage¶
SQLite-backed graph revision storage for local mode.
Revision summaries carry a visibility field so saved revisions can track
whether they contain the full graph or a filtered validated/exploratory slice.
GraphRepository also supports context-manager usage for clean SQLite
connection shutdown.
- class ExposoGraph.storage.GraphRevisionSummary(revision_id: 'int', graph_key: 'str', graph_name: 'str', revision_number: 'int', created_at: 'str', node_count: 'int', edge_count: 'int', note: 'str | None' = None, visibility: 'GraphVisibility' = <GraphVisibility.ALL: 'all'>)[source]¶
- Parameters:
- visibility: GraphVisibility = 'all'¶
- class ExposoGraph.storage.GraphRevision(revision_id: 'int', graph_key: 'str', graph_name: 'str', revision_number: 'int', created_at: 'str', node_count: 'int', edge_count: 'int', note: 'str | None' = None, visibility: 'GraphVisibility' = <GraphVisibility.ALL: 'all'>, graph_json: 'str' = '', html: 'str' = '')[source]¶
- Parameters:
- class ExposoGraph.storage.GraphRepository(db_path)[source]¶
Persist graphs and their revisions in a local SQLite database.
- Parameters:
db_path (str | Path)
- property connection: Connection¶
Return the persistent connection, reconnecting if closed.
- save_graph(*, graph_key, graph_name, kg, html, visibility=GraphVisibility.ALL, note=None)[source]¶
- Parameters:
graph_key (str)
graph_name (str)
kg (KnowledgeGraph)
html (str)
visibility (GraphVisibility | str)
note (str | None)
- Return type:
- save_engine(*, graph_key, graph_name, engine, template_path=None, visibility=GraphVisibility.ALL, note=None)[source]¶
- Parameters:
graph_key (str)
graph_name (str)
engine (GraphEngine)
visibility (GraphVisibility | str)
note (str | None)
- Return type:
- get_revision(revision_id)[source]¶
- Parameters:
revision_id (int)
- Return type:
GraphRevision | None
- get_latest_revision(graph_key)[source]¶
- Parameters:
graph_key (str)
- Return type:
GraphRevision | None