|
| 1 | +// SPDX-License-Identifier: MPL-2.0 |
| 2 | +// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
| 3 | += Architecture Decision Record: 0002-query-language-deferred |
| 4 | +<!-- SPDX-License-Identifier: MPL-2.0 --> |
| 5 | +<!-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> --> |
| 6 | + |
| 7 | +# 2. Query language deferred — querying stays a mode of KRL |
| 8 | + |
| 9 | +Date: 2026-06-18 |
| 10 | + |
| 11 | +## Status |
| 12 | + |
| 13 | +Accepted |
| 14 | + |
| 15 | +## Context |
| 16 | + |
| 17 | +KRL is a *resolution language*, not a query language. Its identity is the four |
| 18 | +operations — *construct*, *transform*, *resolve*, *retrieve* — and the four-verb |
| 19 | +shape is deliberate: it stops "querying" from becoming the whole identity of the |
| 20 | +language. |
| 21 | + |
| 22 | +A recurring pressure works against this: |
| 23 | + |
| 24 | +- Databases are *expected* to ship a query language; its apparent absence reads as |
| 25 | + "toy" to evaluators arriving with SQL / Cypher / AQL muscle memory. |
| 26 | +- The *retrieve* operation, by name, can drag readers back toward "query language". |
| 27 | +- There is a genuine future need for non-resolution data operations: dashboards, |
| 28 | + arbitrary filters, administrative analytics, bulk reporting, exploratory search, |
| 29 | + index tuning. |
| 30 | + |
| 31 | +But the two failure modes are asymmetric: |
| 32 | + |
| 33 | +- *No query language* is a **messaging** problem — cheap, reversible, fixable with |
| 34 | + documentation. |
| 35 | +- *A premature, weak query language* is a **reputation** problem — it invites direct |
| 36 | + comparison with mature query languages on their own turf, where a young project |
| 37 | + loses, and first impressions in developer tooling are durable. A bounced evaluator |
| 38 | + is hard to win back. |
| 39 | + |
| 40 | +Query *access* already exists at the engine/API layer (Skein.jl composable |
| 41 | +predicates over SQLite; QuandleDB's filtered HTTP endpoints). What is declined here |
| 42 | +is a *first-class, branded query language* that competes as a paradigm. Those are |
| 43 | +different things. |
| 44 | + |
| 45 | +There is also a strategic-identity dimension. A capability framed as "a query |
| 46 | +sublanguage" is absorbable as a feature ("the next AQL add-in module"); a *named |
| 47 | +category* — resolution as a paradigm for equivalence / identity determination — is |
| 48 | +not. Keeping KRL a language rather than a query mode is therefore also how the work |
| 49 | +retains a distinct, attributable identity, especially if the broader bet (resolution |
| 50 | +as a general primitive for determining equivalent acts and things, including for AI) |
| 51 | +pays off. |
| 52 | + |
| 53 | +## Decision |
| 54 | + |
| 55 | +1. Querying remains a *mode of KRL* — the *retrieve* operation — not a first-class |
| 56 | + sibling language. No separate query language is built now. |
| 57 | + |
| 58 | +2. *Retrieve* is defined narrowly. It recovers **resolution-relevant artefacts**: |
| 59 | + presentations, invariants, witnesses, equivalence classes, prior resolutions, |
| 60 | + explanations, and provenance. It is **not** arbitrary database querying. |
| 61 | + |
| 62 | +3. Generic data access (arbitrary filters, dashboards, reporting, analytics, |
| 63 | + exploratory search, index tuning) is an *engine-layer* affordance (Skein.jl / |
| 64 | + SQLite; QuandleDB endpoints), deliberately not elevated to a KRL operation. |
| 65 | + |
| 66 | +4. A separate query language is *deferred, not rejected*. It becomes warranted only |
| 67 | + when sustained non-resolution database operations accumulate — the trigger list: |
| 68 | + dashboards, arbitrary filters, administrative analytics, bulk reporting, |
| 69 | + exploratory search, index tuning. |
| 70 | + |
| 71 | +5. *Pre-committed shape.* If/when that query language is built, it will be a |
| 72 | + *KRL-family projection / reporting dialect that compiles to the same TangleIR and |
| 73 | + engine* — one semantic core with a reporting surface — not an independent rival |
| 74 | + paradigm. This makes it structurally impossible for the future query language to |
| 75 | + be a "me-too" graph/relational language. |
| 76 | + |
| 77 | +## Consequences |
| 78 | + |
| 79 | +### Positive |
| 80 | + |
| 81 | +- KRL leads from strength (resolution — where it has no competitor) rather than |
| 82 | + fighting established query languages on their turf. |
| 83 | +- The distinctive, attributable identity ("knot resolution", a named paradigm) is |
| 84 | + preserved against commoditisation. |
| 85 | +- No premature surface to poison first impressions. |
| 86 | + |
| 87 | +### Negative |
| 88 | + |
| 89 | +- Evaluators expecting a headline query language must be pointed at the engine-layer |
| 90 | + access path and the *retrieve* clause; the absence must be *explained*, not shipped |
| 91 | + around. |
| 92 | + |
| 93 | +### Neutral |
| 94 | + |
| 95 | +- The decision is revisited when the trigger conditions accrue; this ADR is then |
| 96 | + superseded by the ADR that specifies the deferred dialect. |
0 commit comments