KTL mode
explanation/ktl-modeChecked by automation only
still a draft
Written 2026-10-29 by ktl-librarian (automation). Last checked 2026-10-22 by ktl-librarian (automation).
The full record
- Checks
- 2026-10-22 by
ktl-librarian(automation)
- 2026-10-22 by
- Sources
- References
- About
- Pointed to by
- linkml-author skill (references)
- linkml-sidecar skill (references)
- Graph
- Open this concept in the knowledge graph
- IRI
https://w3id.org/ktl/linkml-sidecar/knowledge/explanation/ktl-mode- Licence
- CC BY 4.0
- Files
- MarkdownJSON-LDSource on GitHubHistory on GitHub
Overview
Section titled “Overview”The sidecar stands alone. When the host carries a .lokf/ bundle, the preflight switches on KTL mode, and the sidecar’s dummy schema becomes the bundle’s domain schema. It imports LOKF’s core schema. Each class in it that is is_a: Concept is a type the bundle’s concepts may carry, and lokf validate --schema checks the bundle against both schemas.
A schema the host already held (--adopt) is not made the domain schema: the scaffold runs in plain mode beside the bundle and says so in the hand-off. A bundle beside a schema may be a bundle about the repository, as in a schema repository that documents itself. The schema is the bundle’s domain schema only when .lokf/justfile names it or it imports .lokf/lokf.yaml, and its maintainers decide that.
What the scaffold does in KTL mode
Section titled “What the scaffold does in KTL mode”- Pins the core schema beside the bundle:
.lokf/lokf.yamlis copied out of the installedlokftoolkit, at the floor.lokf/pyproject.tomlnames. - Writes a dummy that imports it: one class,
ExampleConcept,is_a: Concept, with one slot of its own. - Excuses LOKF’s camelCase relation slots in
.linkml/.linkmllint.yaml, and nothing else, so the host’s own slots are still held to snake_case. - Adds
--render-importsto gen-doc, sois_a: Conceptlinks to a page that exists. - Sets
schema :=in.lokf/justfile, and makes itslokf-validateandlokf-check-refsrecipes pass--schema. - Writes the same path as
[tool.lokf] schemain.lokf/pyproject.toml, so alokfcommand given no--schemareads the schema too. A table that already names another schema is printed, not patched.
The one workaround, for a lokf 0.8.0 floor
Section titled “The one workaround, for a lokf 0.8.0 floor”On a justfile from before the schema := variable, the two recipes run from the schema’s directory rather than from .lokf/. On lokf 0.8.0, lokf validate passes the schema to linkml.validator.validate(), which drops the schema’s path, so a relative import resolves from the working directory. lokf 0.9.0 requires linkml-runtime 1.12, which resolves the import from the schema’s own folder, so ktl-sidecar’s template passes --schema from .lokf/ with no cd. The cd form works on both floors, and only a .lokf/ still at lokf 0.8.0 needs it.
Two more upstream limits
Section titled “Two more upstream limits”- LOKF has a slot named
from, a Python keyword, so the generated dataclasses cannot be imported on linkml 1.11.1, and the template’s example runner needs them. KTL mode keeps its valid example undertests/data/problem/valid/, which the runner skips, and itstests/test_data.pyvalidates both folders throughlinkml.validator.validate(). copier update --pretendfails in a subproject, so there is no dry run ofjust update.
What the host still does by hand
Section titled “What the host still does by hand”It adds each domain class to the Known LOKF types setting of the KTL Registrar and KTL Curator plugins. When the lokf floor moves, it refreshes .lokf/lokf.yaml, regenerates .linkmllint.yaml and re-runs both gates. When the sidecar is removed, .lokf/justfile is reset to schema := "", and [tool.lokf] schema is removed from .lokf/pyproject.toml.