Skip to content

feat: virtual edges — relationships resolved live from an external SQ… - #7

Merged
cunicopia-dev merged 1 commit into
mainfrom
feat/virtual-edges
Jun 22, 2026
Merged

cunicopia-dev merged 1 commit into
mainfrom
feat/virtual-edges

Conversation

@cunicopia-dev

Copy link
Copy Markdown
Owner

…L source

Adds Ontology-Based Data Access: bind an edge TYPE to a parameterized SQL query against an external store; kg_edges synthesizes those edges on traversal instead of materializing them. Read-only, so it sidesteps the gated-write/event-log/compensation path entirely — a binding is config, the edges are a view (flagged _virtual:true).

  • kgrdbms/virtual.py: VirtualEdge binding model, registry (reserved _VirtualEdge nodes carried in the ontology), and resolver (sqlite + postgres drivers, parameter-bound never interpolated, credentials by dsn_env reference).
  • mcp_server.py: kg_virtual_edge_add / _list / _remove; kg_edges unions the virtual overlay transparently.
  • tests/test_virtual.py: end-to-end virtualization over a sqlite stand-in source (no live Postgres needed), edge-type/direction filtering, prop:source, dsn_env resolution, binding roundtrip. Full suite: 114 passed, 7 skipped.
  • README: 'Virtual edges' section; version 0.1.5 -> 0.1.6.

This is the seam for a schema-graph / data-graph split: curated schema stays in a portable SQLite ontology; the populated extension is virtualized straight out of the system-of-record — no ETL, no drift.

…L source

Adds Ontology-Based Data Access: bind an edge TYPE to a parameterized SQL
query against an external store; kg_edges synthesizes those edges on
traversal instead of materializing them. Read-only, so it sidesteps the
gated-write/event-log/compensation path entirely — a binding is config, the
edges are a view (flagged _virtual:true).

- kgrdbms/virtual.py: VirtualEdge binding model, registry (reserved _VirtualEdge
  nodes carried in the ontology), and resolver (sqlite + postgres drivers,
  parameter-bound never interpolated, credentials by dsn_env reference).
- mcp_server.py: kg_virtual_edge_add / _list / _remove; kg_edges unions the
  virtual overlay transparently.
- tests/test_virtual.py: end-to-end virtualization over a sqlite stand-in
  source (no live Postgres needed), edge-type/direction filtering, prop:source,
  dsn_env resolution, binding roundtrip. Full suite: 114 passed, 7 skipped.
- README: 'Virtual edges' section; version 0.1.5 -> 0.1.6.

This is the seam for a schema-graph / data-graph split: curated schema stays in
a portable SQLite ontology; the populated extension is virtualized straight out
of the system-of-record — no ETL, no drift.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cunicopia-dev
cunicopia-dev merged commit 19522c8 into main Jun 22, 2026
4 checks passed
@cunicopia-dev
cunicopia-dev deleted the feat/virtual-edges branch June 22, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant