RDF/SPARQL Implementation Patterns — Status Record

Unit: rdf-sparql-patterns-phase Status: Slices 1 and 2 complete. ADR-A78/A79/A80 ratified. The compiler’s re-sync with the vocabulary extended on 2026-09-23 is complete in persistence-compiler-iri-sync (Slices 1–5 done, human-validated, 774/774 passing; Slice 6 documentation close-out in progress). Slice 3 (housekeeping first cut) not started. Last updated: 2026-09-25 (persistence-compiler-iri-sync re-sync complete) Owner: Agent (autonomous execution authorised by the human; Slice 2 delivered without further pause)


Executive summary

Slice 1 is complete: rdf-sparql-patterns-guide.md consolidates the four source notes into one corrected, cross-referenced reference.

ADR-A78, ADR-A79, and ADR-A80 are ratified (Status: Accepted).

Slice 2 is complete as delivered on 2026-09-22. ontology/persistence is authored (vocabulary, self-validating SHACL shapes, 14 example fixtures, two design-note documents) and tools/persistence is a working Python compiler: 239 tests pass under mise run check:persistence, covering the resolver, validator, capability self-check, boundary-shape walker, an 11-template Mustache library, a 164-case injection corpus, determinism under triple-order permutation, full compile→instantiate→parse round trips, and three Python architecture-policy checks. Doc deltas (root README.md, ontology-architecture.md, mise.toml) are done. Traceability matrix and validation pack are in place.

2026-09-23 update (superseded by the paragraph that follows): ontology/persistence/spec/persistence.ttl and shapes/constraints.ttl were substantially extended by the IRI-patterns remediation (commit c276afb) — three new profile dimensions, extensions to six existing ones, eight new SHACL shapes. None of it is consumed by tools/persistence; the 239 passing tests above exercise only the pre-c276afb vocabulary subset, which is still valid and unmodified, but no longer the complete picture. See persistence-compiler-iri-sync.md for the gap analysis and fix plan.

2026-09-23, current position: the sync unit has closed the epoch-guard correctness gap and the extension-property gap (526 tests), and a second review of the guide (iri-patterns-post-3866b21-remediation, complete) corrected the guide and realigned the templates. The generated SPARQL’s caller contract changed: payload and log-bucket lists are Mustache request-time slots, and every write records a request digest (see tools/persistence/README.md, “Using the generated SPARQL directly”). Identity profiles are resolved per resource role (sync Slice 3); privacy and claim-scheme profiles are still unwired (sync Slices 4–5).

2026-09-25, re-sync complete: persistence-compiler-iri-sync finished Slices 4 and 5 — privacy/erasure profile resolution and checks (Slice 4), and uniqueness dal:onViolation reconciler operations plus dal:ClaimScheme dal:Dual rotation (Slice 5) — both human-validated. The compiler is now fully re-synced against the post-c276afb vocabulary: every profile dimension and SHACL shape that vocabulary added is resolved, checked, and (where it drives generated SPARQL) selected by tools/persistence. 774/774 tests pass under mise run check:persistence. Slice 6 (documentation close-out) is that unit’s own final pass.

Slice 3 (housekeeping first cut) has not been started and remains scoped as written in the plan.

Key findings from building Slice 2, beyond what the sketch anticipated:


Completed artifacts

Guide: docs/architecture/rdf-sparql-patterns-guide.md

Status: ✅ Complete.

Sketch: docs/developer/sketches/persistence-profile-substrate.md

Status: ✅ Complete, remediated per human review (concurrency renamed for what it provides, the capability model rebuilt as an unconditional-requirement-plus-optional-self-check with no live-backend dependency, the compiler’s canonical output made TTL rather than SPARQL text, and the hand-declared composition-property authoring surface dropped in favour of SHACL only). Governs Slice 2 and Slice 3.

ADRs: A78, A79, A80

Status: ✅ Accepted.

Plan: docs/developer/plans/rdf-sparql-patterns-phase-plan.md

Status: ✅ Complete. Slice 2 executed as scoped; Slice 3 unchanged.

ontology/persistence

Path Contents
README.md purpose, the dal: prefix, three worked examples (single class, shared-class deployments, SHACL-declared composite boundary)
spec/persistence.ttl the vocabulary, ~300 triples, all eleven sections (scopes, six dimensions, capability triad, templates/operations, compiled output)
shapes/constraints.ttl self-validating SHACL shapes, including the mandatory-boundaryShape check and the SharedClassProfileWarningShape
examples/ 14 fixtures: 5 positive (including the lending/credit conflict and the SHACL-declared composite boundary), 5 cross-axis negative fixtures (one per sketch §3.5 row), 1 mixed-receipt-model warning fixture, 1 shared-class-profile warning fixture, 1 SHACL-level negative fixture (missing boundaryShape), 1 value-based-CAS positive fixture
docs/precedence-and-resolution.md, docs/aggregate-boundaries.md the two design notes the plan required

tools/persistence

Python package (persistence), pyproject.toml, installable via mise run bootstrap:persistence. Modules: terms (the injection-safety encoder hierarchy), render (the type-enforced Mustache renderer), namespaces, scopes (including the Target model), resolver (the precedence algorithm), boundary (the SHACL closure walker), capability (requirement/spec/check), validator (every cross-axis check, named exception types), operations (template selection), compiler (orchestration and RDF emission), instantiate (the optional SPARQL-rendering stage), cli. 11 Mustache templates. 239 tests across 7 test modules, all passing.

Validation pack: docs/developer/validation/persistence-substrate-and-compiler.md. Traceability: docs/traceability/matrix.csv.

Doc deltas


Slice status

Slice Identifier Status
1. Core patterns rdf-sparql-core-patterns ✅ Complete (fulfilled by the guide)
2. Substrate and compiler persistence-substrate-and-compiler ✅ Complete
3. Housekeeping first cut housekeeping-first-cut Scoped, not started

Open questions

Unchanged from before Slice 2 began. Building the compiler did not resolve any of these; it also did not need to.

# Question Where tracked
1 Request Query Mapping library design lattice-platform-agentic-development-v0.2.md Part 13, row 11
2 Query Execution component design lattice-platform-agentic-development-v0.2.md Part 13, row 12
3 Store SPI shape (proposed A75) Not yet an ADR. Both items above depend on it
4 Whether dal: receipt/capability terms align to fnd:Evidence/fnd:recordedAt Sketch §3.1, not settled by Slice 2
5 Whether a Java equivalent of tools/persistence is ever needed for JVM-embedded build pipelines ADR-A79 consequences, not scheduled

New, found during Slice 2 (not previously tracked):

# Question Notes
6 unconditional-write’s missing variants Only handles dal:NamedGraphBoundary. A target combining dal:ProvidedConcurrency/dal:LockingConcurrency with dal:CompositePropertyBoundary or dal:NoBoundary needs a second template variant, not yet built.
7 Multi-property CompositePropertyBoundary closures cas-replace-composite-property uses only the first composite property found, with + traversal. A shape with several sibling composite properties at one level needs a property-path alternation this first cut does not generate.

Blocking other work


Traceability

Sketch/implementation section Guide chapter
Precedence algorithm Chapter 25 (capabilities, strategies, planners)
Aggregate boundary mechanisms Part V, Chapter 19; §24.1 (tombstones)
Receipt model dimension Chapter 20
Ordering grain and dataset tier Chapter 21, Chapter 22
Uniqueness constraint Chapter 8, §6.2 (key-claim write/retire)
Housekeeping job taxonomy (Slice 3, not yet built) §7.5 (P7), S3, F5, §24.2
Injection safety Chapter 28 (QP1)

Full requirement-to-test mapping

See docs/traceability/matrix.csv.


Next steps

  1. Slice 3 (housekeeping first cut), per the plan, including the job changes listed in the plan’s Slice 3 “Changes since this slice was scoped” note: platform/housekeeping Maven module, job contracts, configuration model split, generated queries via persistence instantiate, README, and docs/architecture/platform-housekeeping.md.
  2. Resolve or continue deferring the two new open questions found during Slice 2 (items 6 and 7 above) before Slice 3 generates housekeeping job queries against CompositePropertyBoundary targets, if any exist.

Appendix: Validation pack locations