Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Import locks on disk

A project that imports other ontologies keeps one lock per import: the exact content Agrafe resolved for it. Export as zip (in the file tree) writes these locks to disk, so radeau and dolfin-lsp can use the same imports without network access.

What the zip contains

  • Every project file, package.dlf included.
  • One folder .dolfin/imports/<import>/ per locked import, named after the import’s IRI and version. Each holds four files: lock.json, interface.json, turtle.ttl and closure.ttl.

The unzipped folder passes radeau check offline. If the locks cannot be fetched, a notice says so and the zip holds the project files only.

Releases

A release is a frozen copy of a project, cut under the version of its package.dlf (Create release in the Package pane, or the MCP create_release). Releases exist only so that another project can import this one: the Imports picker lists them, and an import <package-iri> "version" line locks one. A deployment does not need a release: its store is reached over the API with its deployment id and a token alone (see Deployments).

The lock files

FileContent
lock.jsonThe lock itself: iri (the imported ontology), artifact_hash, requested_version (the version package.dlf asks for, if any), version (the artifact’s own version, for a release the release version) and source (the release or URL it came from).
interface.jsonThe import’s glossary interface: the names that prefixed refs into the import resolve against.
turtle.ttlThe imported ontology’s Turtle.
closure.ttlThe Turtle of the import’s own locked imports. It may be empty.

artifact_hash is a SHA-256 over the IRI, version, turtle.ttl, interface.json and closure.ttl, byte for byte. It is how a reader tells the files were edited by hand. Do not edit them: re-export the lock from Agrafe instead.

How radeau uses the locks

radeau check, build, fmt and metadata read .dolfin/imports/ in the package folder and match each import line of package.dlf with a lock: same IRI, and same version when the line asks for one (either the lock’s requested_version or its version). radeau serve does the same for the imports it sends to the page, and dolfin-lsp reads the locks too, re-reading them when a file under .dolfin/imports/ changes.

A missing or stale lock never aborts. It becomes a warning on stderr and the import is left out, so its prefixes fail to resolve exactly as they would with no lock at all:

CaseResult
No .dolfin/imports/ folderNothing, silently.
A lock folder with a missing or unreadable fileWarning; that lock is skipped.
artifact_hash does not match the filesWarning; the lock is still used.
An import line with no lock for its IRIWarning; the import is left out.
A lock for the IRI, but for another versionWarning naming both versions; the import is left out.
A lock with no matching import lineWarning; the lock is ignored.

radeau build --with-imports

radeau build --output dist/app.ttl --with-imports

Besides the output, writes each lock’s closure.ttl, copied verbatim, to <output-stem>.<slug>.closure.ttl beside it: here dist/app.acme.com_hr-1.0.0.closure.ttl for http://acme.com/hr at version 1.0.0.

  • The slug is the lock’s IRI minus its scheme and trailing / or #, then -<version> when the lock has one, with every character outside [A-Za-z0-9._-] turned into _.
  • --with-imports requires --output and Turtle output (the default --emit turtle); it is refused with --emit n3-rules.
  • With no lock, the build succeeds and says there is nothing more to write.
  • If two locks map to the same slug, the build fails: remove one of them from .dolfin/imports/.

Importing a zip

Importing a zip that holds .dolfin/imports/** restores those locks as the project’s import locks. See the Import row in Files.