Where a LinkML schema lives
references/schema-layoutsChecked by automation only
still a draft
Written 2026-10-22 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
- 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/references/schema-layouts- Licence
- CC BY 4.0
- Files
- MarkdownJSON-LDSource on GitHubHistory on GitHub
Overview
Section titled “Overview”skills/linkml-sidecar/references/layouts.md states where a LinkML schema may live and how both skills find it. A schema need not come from linkml-project-copier or its predecessor, linkml-project-cookiecutter, and a project’s folder has no fixed name. So both skills find the schema by its files, never by its folder. The preflight applies the rule in shell, and the scaffold applies it in Python.
The signals
Section titled “The signals”- A
.copier-answers.ymlwhose_src_pathnameslinkml-project-copiermarks a copier project, for as long as copier is used. - A
config.public.mkmarks a project from copier or from the older cookiecutter, and names the schema. Upstream may retire the file, and the answers’project_slugthen names the schema. - A
*.yamlor*.ymlfile that importslinkml:typesor names thelinkml:prefix, and has a top-levelclasses:,slots:,enums:,types:,subsets:orimports:key, is a schema on its own.
A .linkml/ folder shows that LinkML is in use, but not what it holds: upstream LinkML may name it for configuration files, and the sidecar names it for a whole project. Only .linkml/.copier-answers.yml means the sidecar, and anything else there is left alone.
Both uses keep the generators’ settings at .linkml/generators.yaml: a sidecar renames the template’s config.yaml to that, and --repair generators.yaml moves a root project’s file there.
Where the preflight looks
Section titled “Where the preflight looks”It looks in .linkml/, at the repository root, in the directory it was started in, and then in every directory one level down, and the first match wins. A second project is reported as also, and a person says which one is meant. With no project anywhere, it finds schema files by content among the files git tracks or would track. It skips the folders that by convention hold copies, fixtures or rendered output, such as docs, tests, project and .lokf.
Adoption
Section titled “Adoption”--adopt <file> gives a schema found outside any project the sidecar’s toolchain without moving it. It points config.public.mk’s LINKML_SCHEMA_SOURCE_DIR at the file’s folder, so every recipe reads the schema where it is, and the file is never moved, copied, linked or edited. The file must be named <slug>.yaml. Beside a .lokf/ bundle, the adopted schema is not made the domain schema.