Skip to content

Publishing a schema others can import

Documentreferenceschema designimportsdistributionimportmapreferences/publishing

Checked 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)
Sources
References
Related to
Pointed to by
Graph
Open this concept in the knowledge graph
IRI
https://w3id.org/ktl/linkml-sidecar/knowledge/references/publishing
Licence
CC BY 4.0
Files
MarkdownJSON-LDSource on GitHubHistory on GitHub

skills/linkml-author/references/publishing.md is for the author whose schema will be imported, vendored or loaded by someone else’s project. It says how a schema reaches an importer, which addresses to serve it at, how an importer takes it, and how a vocabulary that was not designed to sit beside yours is brought in. Each behaviour is stamped with the LinkML version it was seen on. The schema design page decides the shape of the schema; this page decides where it is read from.

  • LinkML leaves distribution open. Its documentation says a release that keeps relative imports must keep every module at the same relative path, and that --mergeimports folds the closure into one file before distribution. A schema reaches an importer as a copy in the importer’s repository, as the data files of a Python package, or through a persistent identifier that serves the file.
  • Serve two addresses under the schema’s id: every source file at schema/<module>.yaml, at the same relative paths as in the repository, and one merged file with no imports, which gen-linkml --mergeimports writes and gen-project does not.
  • On LinkML 1.12.1 a module imported by URL or CURIE resolves its own relative imports from its own address, so a modular root imports over HTTP when every module is served at the same relative path. The merged file serves an offline build, a checksum pin and a direct load, because SchemaView(url) appends nothing. A tag in the path pins a release.
  • A tagged release attaches the schema with its checksum; KTL’s knowledge-release workflow and gist do this. The sidecar’s own workflow does not yet.
  • An importer vendors a copy pinned to a tag and upgrades on purpose, or imports by the persistent identifier; never by a raw code-host URL.
  • An importmap bridges import strings and file locations. An import resolves through the importmap first, then as a URL, then as a CURIE, else relative to the importing file, with .yaml appended in every case. A key is a CURIE, an IRI or a namespace; a value omits .yaml and resolves against the directory of the schema the tool was given, nested imports included. Each generator takes --importmap; gen-project takes it as importmap in a generator’s generator_args in generators.yaml; linkml-validate takes none yet.
  • lokf’s adapt, experimental and unreleased, makes a copy of a vocabulary that can sit beside lokf.yaml: it folds the imports, drops the identifier and type designator, renames every other shared name with the IRI pinned, and re-roots the top classes. Its --check says in CI when the published vocabulary has moved.

The page cites the lmodel redirect table as a worked example and says that lmodel is an experiment area, not a standard.