Use layers as dependencies
Build your own ontology on top of published releases with erden add, install, remove, path, and the local store.
The examples use https://registry.example as an illustrative test origin. Use https://registry.erden.sh for the hosted service.
Who needs this, and when
Who: ontology authors who reuse other layers' terms. When: when your ontology refers to terms another layer defines. Status: always available. Private dependencies need a signed-in CLI with read access.
A dependency is an exact release your project builds on. Erden downloads it, checks it against the digest the
registry recorded, and includes its ontology and shapes when you run erden check. The exact versions live in
erden.lock, so everyone who checks your project checks it against the same files.
Start from a project that names its registry
Use an existing project, or create one with its own alias and identity:
erden init my-app --format json --alias @demo/my-app --canonical-iri https://example.invalid/erden/my-app --owned-prefix https://example.invalid/erden/my-app#Then add the hosted registry address (https://registry.erden.sh) to its erden.config.json:
{
"$schema": "https://erden.dev/schemas/manifest/v1.json",
"schemaVersion": 1,
"canonicalIri": "https://example.invalid/erden/my-app",
"alias": "@demo/my-app",
"ownedIriPrefixes": ["https://example.invalid/erden/my-app#"],
"title": "Erden project",
"description": "Replace the example.invalid identity before publishing.",
"sources": {
"ontology": ["ontology.ttl"]
},
"registry": "https://registry.example"
}Add a dependency
Copy the install command from a release page's Install box and run it inside the project:
erden add @demo/erden-demo@0.2.0-beta.1What you should see:
$ erden add @demo/erden-demo@0.2.0-beta.1
Added @demo/erden-demo
State: written (102119cbd05184dbc09dc4cf7955a8d639afba19edcf05ff1d7a3025d5d916f7)
Resolution: full-graph; 1 exact package change(s)
Installation: materialized
Warning: full-graph-reresolvederden add records the dependency in the manifest, pins the exact release in erden.lock, and installs it into the
project's .erden/ folder.
Check with the dependency
erden check --offlineThe check now includes the dependency's ontology and shapes. --offline is fine: the dependency is already
installed.
$ erden check --offline
Erden check @demo/my-app: PASSED
Manifest: erden.config.json
Ontology: https://example.invalid/erden/my-app
Reasoner: erden-reasoner@0.3.0+purrdf.0.12.0.dfb1df7 (decided, consistent)
Completeness: checked at qualification, not on this run
Sources: passed
Reasoning: passed
Core ontology: passed
SHACL: passed
Competency questions: passed
Citations: passedInstall exactly, in CI
On a build server, install exactly what erden.lock says, and fail if anything would change:
erden install --frozen-lockfile$ erden install --frozen-lockfile
Installed @demo/my-app (https://example.invalid/erden/my-app)
Lock: existing 102119cbd05184dbc09dc4cf7955a8d639afba19edcf05ff1d7a3025d5d916f7 (clean)
Packages: 1 total, 1 reused, 0 fetched, 0 repaired
Materialization: hit (clean; clone 0, hardlink 0, copy 0)Add --offline to reuse only what your computer already has.
Everyday commands
| Command | What it does |
|---|---|
erden path @demo/erden-demo | Prints the folder where the dependency is installed |
erden remove @demo/erden-demo | Removes the dependency from the manifest and erden.lock |
erden store status | Shows the health of your computer's shared download store |
erden store prune --dry-run | Lists cached archives nothing uses any more; drop --dry-run to delete them |
erden store path | Prints where the store lives |
$ erden path @demo/erden-demo
~/ontologies/my-app/.erden/layers/141298b6c0768da7c154cef10e6f2fb4abbc3397bb936891b96b6c19b7a53608$ erden store status
Erden store: healthy
Registrations: 3 current, 0 superseded, 0 orphaned, 0 stale
Objects: 1 referenced, 0 unreferenced, 0 missing referenced, 0 corrupt, 0 busyerden update does not work against a registry yet
erden update currently stops with PROJECT_DEPENDENCIES_REGISTRY_UNAVAILABLE. To move to a newer release, run
erden add again with the new version.
Pruning and private layers
erden store prune can delete the only copy of a private or since-revoked release. If you can't download it again,
offline installs of projects that need it will fail.
If it looks different
erden add cannot find the layer
Check the alias and version on the release page. If the layer is private, sign the CLI in with an account that can read it: see Connect the CLI.
An old alias stopped working after a rename
Browsers follow renamed aliases, but the CLI does not. Update the alias in your manifest to the new namespace.