schema-sidecar
Theme
Text size
GitHub Menu

Where a LinkML schema lives

Document reference layouts schema discovery adopt config.public.mk references/schema-layouts

Checked by automation only

still a draft

Written 2026-11-12 by ktl-librarian (automation). Last checked 2026-10-22 by ktl-librarian (automation).

The full record
Checks
  • 2026-10-22 by ktl-librarian (automation)
Sources
References
Pointed to by
Graph
Open this concept in the knowledge graph
IRI
https://w3id.org/lmodel/schema-sidecar/knowledge/references/schema-layouts
Licence
CC BY 4.0
Files
Markdown JSON-LD Source on GitHub History on GitHub

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#

  • A .copier-answers.yml whose _src_path names linkml-project-copier marks a copier project, for as long as copier is used.
  • A config.public.mk marks a project from copier or from the older cookiecutter, and names the schema. Upstream may retire the file, and the answers’ project_slug then names the schema.
  • A *.yaml or *.yml file that imports linkml:types or names the linkml: prefix, and has a top-level classes:, slots:, enums:, types:, subsets: or imports: 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#

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#

--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 gets no copy in .lokf/schema/, so the scaffold makes no domain vocabulary from it.