The self-checking version of the tunnel knowledge graph.
The tunnel-ontology-visualizer tab
draws the KG; this tab makes the same graph queryable, provenance-carrying and
machine-validated. A small kglab
pipeline lifts the visualizer's D3 data into RDF, merges it with the previously
unused ontology file not_yet_used/tunnel-ontology-visualizer.ttl.txt,
reconciles the two by label, enforces an edge-provenance discipline with SHACL,
materialises OWL-RL inference, and answers plan questions as SPARQL → pandas
DataFrames. Everything below is the actual output of one pipeline run,
embedded at build time.
Reconciliation is done in SPARQL-adjacent fashion: a D3 node and an ontology
individual sharing an rdfs:label get owl:sameAs; an edge
present in both representations is marked corroborated. Confidence is
therefore not decoration — it records cross-representation agreement.
Two shapes (see shapes.ttl): every edge assertion
needs an edge-type, a confidence in [0,1] and a source; plan-critical edges
(dependsOn, precedes) additionally need a
use statement and an update trigger — the
contingent-edge discipline from the portfolio AGENTS.md.
Run 1 — raw lift:
Run 2 — after the repair pass added use statements and update triggers to plan-critical edges:
Census by upper-ontology class — answerable only because inference
materialised the rdfs:subClassOf bridge from the lifted D3 groups
into the Digital Construction Ontology:
Dependencies asserted only by the D3 demo and never corroborated by the curated ontology — the first candidates for review:
Everything SegmentInstallation depends on, via the property path
st:dependsOn+ (one line of SPARQL; no hand-rolled BFS):
The merged graph projected into NetworkX; betweenness centrality names the brokers everything routes through:
From the repo root: pip install kglab then
python3 apps/kglab-ontology-audit/pipeline/kglab_spike.py.
The script regenerates results.json,
solway_merged.ttl and this page.
Environment of the embedded run: .
apps/tunnel-ontology-visualizer/src/App.tsx (D3 layer),
not_yet_used/tunnel-ontology-visualizer.ttl.txt (ontology layer) ·
results embedded at build time by pipeline/kglab_spike.py.