Resources / Technical evidence
SQL or RDF? A Worked Architecture Decision
Thompson Axiomata · Published December 2, 2026 · Example version 1
Compare two query patterns over the same synthetic asset records and inspect the assumptions behind an architecture recommendation.
Synthetic worked example. Prepared with AI assistance; the reported fixture results were checked by running the supplied code. These are teaching examples, not client outcomes, production benchmarks or independently reviewed accuracy results.
Start with questions, not a database preference
Do these requirements need RDF, or can an existing relational design answer them? This example uses the accepted records from the mapping exercise. SQLite stores assets and source-record links; RDFLib loads the equivalent graph. Both are local, in-process teaching implementations.
Observed answer comparison
| Question | SQLite answer | SPARQL answer |
|---|---|---|
| Which assets are operational? | A-100 at north; A-300 at south | A-100 at north; A-300 at south |
| Which records describe A-100? | erp/E1; maintenance/M1 | erp/E1; maintenance/M1 |
Both query patterns produce the same expected answers. This establishes fixture answer equivalence only. It demonstrates that record provenance is possible in either design; it does not show a performance advantage for either technology.
Decision record: a fixed asset register
Illustrative recommendation: retain SQL when the register, joins and questions are stable and the team already operates a relational system. The fixture supplies no unmet query requirement that would by itself justify a graph migration.
Tradeoff: relational tables still need identity and mapping governance. An RDF layer adds explicit identifiers and a shared vocabulary, but also adds model maintenance and operating responsibilities.
Decision record: partner semantic exchange
Proposal requiring evaluation: assess RDF as a semantic layer when partners need common identifiers, vocabulary and exchangeable models. Keep source systems authoritative until migration responsibilities are explicitly agreed.
Evidence still needed: representative changing schemas, query coverage, permission tests, maintenance effort and workload measurements. Revisit the recommendation if existing database views satisfy the requirements more simply.
Download and reproduce
Read the README, extract the ZIP, create an isolated Python environment and run the commands below. The ZIP includes inputs, source, expected outputs, an MIT license and a SHA-256 manifest. The runner fails if its fixture expectations change.
python -m pip install -r requirements.txt
python reproduce.py
Inspect the two decision records and executed comparison results. Both SQL and SPARQL query files are included.
Limits
No latency, throughput, scale, cost savings, security isolation or RAG answer quality was measured. SQLite and RDFLib here are not proxies for every enterprise database. The scenario recommendations are reasoned judgments under stated assumptions, not outcomes from a customer engagement.
A useful architecture review makes the requirements, alternatives, evidence and revisit conditions explicit. See knowledge graph consulting. Query semantics are documented in SPARQL 1.1 Query.
Inspect the related evidence
For project-specific evaluation, share a non-sensitive problem summary. We agree the sources, scope and acceptance criteria before handling project records.