Mirror an upstream ontology
Publish a W3C, OGC or other standard ontology exactly as its publishers ship it, in RDF/XML, JSON-LD, N-Triples or Turtle, with report mode for what Erden does not reason over.
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: authors who build on a standard they cannot edit, such as SKOS, PROV-O, OWL-Time or schema.org. When: once per standard and upstream version, before your own layers depend on it. Status: always available; report mode and the four input formats need no switch on the registry. Publishing a large upstream may need the Erden team to raise its reasoner budget (step 6).
A mirror is a layer whose ontology is somebody else's file, byte for byte. You keep the upstream's canonical IRI, so everything that already uses its terms keeps working, and you publish it under an alias in your own namespace, so your layers can depend on it like any other.
This walkthrough mirrors W3C SKOS from its RDF/XML file. Every command and every output below is real.
What Erden reads
| Format | File extensions | Notes |
|---|---|---|
| Turtle | .ttl | Also what a folder in sources.ontology means: every .ttl file in it |
| N-Triples | .nt | One statement per line |
| RDF/XML | .rdf, .owl | UTF-8 only. Internal entities (<!ENTITY owl "…">) are fine; an external DTD or entity is refused |
| JSON-LD | .jsonld | The @context must be inside the file: Erden never downloads anything while reading a source |
Name each non-Turtle file in sources.ontology itself. Erden reads the format its extension says; a file that does not
parse is refused with its name and the parser's message. Every source describes one graph: N-Quads (.nq), TriG
(.trig), N3 (.n3), and a JSON-LD file with named graphs are refused by name.
Walk through it
You need the CLI from Install the CLI, curl, and an organization namespace.
The examples use the namespace demo; use yours.
Create the project with the upstream identity
Go to your ontologies folder and create a project that carries the upstream's canonical IRI, its term prefix, and your alias:
cd ~/ontologies
erden init skos --format json \
--canonical-iri http://www.w3.org/2004/02/skos/core \
--alias @demo/skos \
--owned-prefix 'http://www.w3.org/2004/02/skos/core#'What you should see:
$ erden init skos --format json --canonical-iri http://www.w3.org/2004/02/skos/core --alias @demo/skos --owned-prefix http://www.w3.org/2004/02/skos/core#
Initialized @demo/skos (http://www.w3.org/2004/02/skos/core)
- erden.config.json
- erden.lock
- ontology.ttlDownload the upstream file as published
Replace the starter ontology with the upstream file. Do not edit it.
cd skos
rm ontology.ttl
curl -fsSL -o skos.rdf https://www.w3.org/2004/02/skos/core.rdf
sha256sum skos.rdfWhat you should see: e79633b8d0564816cee8a99f5c9acf9a0e6fc7257c7209acd684ecad53a89dd6 skos.rdf, the SKOS
file W3C has published since 2009. Write the digest down: it is how you will later prove the mirror is unmodified.
Point the manifest at the file
Open erden.config.json in your editor. Set sources.ontology to the file, describe the mirror, and add your
registry's address as registry:
{
"$schema": "https://erden.dev/schemas/manifest/v1.json",
"schemaVersion": 1,
"canonicalIri": "http://www.w3.org/2004/02/skos/core",
"alias": "@demo/skos",
"ownedIriPrefixes": [
"http://www.w3.org/2004/02/skos/core#"
],
"title": "SKOS Core (W3C mirror)",
"description": "The W3C SKOS vocabulary, mirrored unmodified from https://www.w3.org/2004/02/skos/core.rdf.",
"sources": {
"ontology": [
"skos.rdf"
]
},
"registry": "https://registry.example"
}Then refresh the lockfile, because the manifest changed:
erden install --offlineWhat you should see:
$ erden install --offline
Installed @demo/skos (http://www.w3.org/2004/02/skos/core)
Lock: existing 48849775fabf264b17e1fec5b8183ea519f35846fb778391b35fd99de8cc7cba (clean)
Packages: 0 total, 0 reused, 0 fetched, 0 repaired
Materialization: materialized (clean; clone 0, hardlink 0, copy 0)Check it strictly, and read what is not reasoned over yet
erden check --offlineWhat you should see: the check reads the RDF/XML, then refuses before reasoning and lists every statement the
reasoner does not reason over yet at once (exit code 3). The first lines:
$ erden check --offline
Erden check could not complete [reasoning/CHECK_OUTSIDE_PROFILE]: 77 statements in 71 findings are outside what Erden reasons over yet, starting with rdf:Property on http://www.w3.org/2004/02/skos/core#note; set outsideProfile to report to reason over the rest and list these
- skos.rdf:184:5 [OUTSIDE_PROFILE] [annotation/rdf:Property] http://www.w3.org/2004/02/skos/core#note http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/1999/02/22-rdf-syntax-ns#Property: <http://www.w3.org/2004/02/skos/core#note> rdf:type rdf:Property
- skos.rdf:178:5 [OUTSIDE_PROFILE] [annotation/rdfs:isDefinedBy] http://www.w3.org/2004/02/skos/core#note http://www.w3.org/2000/01/rdf-schema#isDefinedBy http://www.w3.org/2004/02/skos/core is AnnotationAssertion: AnnotationAssertion(rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core#note> <http://www.w3.org/2004/02/skos/core>)
- skos.rdf:352:5 [OUTSIDE_PROFILE] [unreasoned/union-range] http://www.w3.org/2004/02/skos/core#member http://www.w3.org/2000/01/rdf-schema#range (7 statements) is ObjectUnionOf: ObjectPropertyRange(<http://www.w3.org/2004/02/skos/core#member> ObjectUnionOf(<http://www.w3.org/2004/02/skos/core#Concept> <http://www.w3.org/2004/02/skos/core#Collection>))
...Each line names the file, line and column of the statement, Erden's group for it, and the exact OWL construct; see
not reasoned over yet for how to read one. This is expected for
almost every complete standard while the reasoner's coverage grows toward all of OWL 2. It reasons over SKOS's
sub-properties between object properties and its symmetric, transitive and functional properties; what is left is a
union range, sub-properties between annotation properties, rdf:Property and rdfs:isDefinedBy. You cannot fix these
by editing a file you are mirroring, so tell Erden to report them instead. The annotations SKOS uses without declaring them, such as dct:title, are not among them: a check accepts
those in either mode and warns about each one.
Turn on report mode for this project
Add one line to the manifest:
{
"$schema": "https://erden.dev/schemas/manifest/v1.json",
"schemaVersion": 1,
"canonicalIri": "http://www.w3.org/2004/02/skos/core",
"alias": "@demo/skos",
"ownedIriPrefixes": [
"http://www.w3.org/2004/02/skos/core#"
],
"title": "SKOS Core (W3C mirror)",
"description": "The W3C SKOS vocabulary, mirrored unmodified from https://www.w3.org/2004/02/skos/core.rdf.",
"sources": {
"ontology": [
"skos.rdf"
]
},
"registry": "https://registry.example",
"outsideProfile": "report"
}"outsideProfile": "report" means: reason over everything the reasoner covers, and list the rest under Not
reasoned instead of refusing. It applies to this project only, so your own layers stay strict even when they depend
on the mirror. Refresh the lockfile again:
erden install --offlineCheck it in report mode
erden check --offlineWhat you should see: every stage passes, and the report lists what was not reasoned, grouped by construct, with the OWL constructs counted and the position of one example each, then a warning for each annotation property SKOS uses without declaring it:
$ erden check --offline
Erden check @demo/skos: PASSED
Manifest: erden.config.json
Ontology: http://www.w3.org/2004/02/skos/core
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: skipped
Competency questions: skipped
Citations: passed
Not reasoned: 77 statements in 71 findings that Erden does not reason over yet (erden.profile-partition/v3). The consequences of these statements were not checked.
- [annotation/rdf:Property] 28 findings, 28 statements, e.g. http://www.w3.org/2004/02/skos/core#note at skos.rdf:184:5
- [annotation/rdfs:isDefinedBy] 32 findings, 32 statements (AnnotationAssertion 32), e.g. http://www.w3.org/2004/02/skos/core#note at skos.rdf:178:5
- [unreasoned/rdfs:subPropertyOf] 9 findings, 9 statements (SubAnnotationPropertyOf 9), e.g. http://www.w3.org/2004/02/skos/core#example at skos.rdf:226:5
- [unreasoned/reserved-term-role] 1 finding, 1 statement, e.g. http://www.w3.org/2004/02/skos/core#memberList at skos.rdf:374:5
- [unreasoned/union-range] 1 finding, 7 statements (ObjectUnionOf 1), e.g. http://www.w3.org/2004/02/skos/core#member at skos.rdf:352:5
Warnings:
- [reasoning/undeclared-annotation-property] http://purl.org/dc/terms/contributor is used in 3 statements without a declaration, so it is read as an annotation property and not reasoned over (first use at skos.rdf:27:5); declare it to make this explicit
- [reasoning/undeclared-annotation-property] http://purl.org/dc/terms/creator is used in 2 statements without a declaration, so it is read as an annotation property and not reasoned over (first use at skos.rdf:31:5); declare it to make this explicit
- [reasoning/undeclared-annotation-property] http://purl.org/dc/terms/description is used in 1 statement without a declaration, so it is read as an annotation property and not reasoned over (first use at skos.rdf:30:5); declare it to make this explicit
- [reasoning/undeclared-annotation-property] http://purl.org/dc/terms/title is used in 1 statement without a declaration, so it is read as an annotation property and not reasoned over (first use at skos.rdf:26:5); declare it to make this explicitThe whole check takes about a second. The reasoner decides inside a wall-time budget, 30 seconds unless someone
changed it, which SKOS stays far inside. A larger upstream that runs out of time is refused with budget-exhausted, and
the error names the setting that raises the budget, ERDEN_REASONER_MAX_WALL_TIME_MS, and its bounds (1,000 to 600,000
ms). A larger budget never changes a verdict that both budgets reach; it only lets a slow check finish. See
when a check is refused for the other limits.
The registry has its own budget
Publishing runs the same check on the registry, with the registry's budget. If your check needed a raised budget,
ask the Erden team at researchers@erden.sh for a higher publication budget. Say which ontology you are publishing
and how long its local check needed.
Publish the mirror
Log in once if you have not (see connect the CLI), then publish. erden publish packs and uploads; the registry runs the check, with its own budget, and the command waits for its verdict:
erden publish 0.1.0 --create --visibility public --yesWhat you should see:
$ erden publish 0.1.0 --create --visibility public --yes
Waiting for attempt:4dRvmFHufK2V2szhHXiFfk5PP9I77-APPA-77I9PP5k (queued). Use --no-wait to return without waiting.
attempt:4dRvmFHufK2V2szhHXiFfk5PP9I77-APPA-77I9PP5k: validating
attempt:4dRvmFHufK2V2szhHXiFfk5PP9I77-APPA-77I9PP5k: succeeded
Publication attempt:4dRvmFHufK2V2szhHXiFfk5PP9I77-APPA-77I9PP5k: succeeded
Project: @demo/skos@0.1.0 (http://www.w3.org/2004/02/skos/core)
Visibility: public
Report page: https://registry.example/publications/attempt%3A4dRvmFHufK2V2szhHXiFfk5PP9I77-APPA-77I9PP5k/reportRead the report with the attempt ID it printed:
erden publication <attempt-id> --wait --reportWhat you should see:
$ erden publication attempt:4dRvmFHufK2V2szhHXiFfk5PP9I77-APPA-77I9PP5k --wait --report
Publication attempt:4dRvmFHufK2V2szhHXiFfk5PP9I77-APPA-77I9PP5k: succeeded
Project: @demo/skos@0.1.0 (http://www.w3.org/2004/02/skos/core)
Visibility: public
Report: succeeded
Validation: passed
Stages: citations=passed, competencyQuestions=skipped, core=passed, reasoning=passed, shacl=skipped, sources=passed
Warnings: 0
Report page: https://registry.example/publications/attempt%3A4dRvmFHufK2V2szhHXiFfk5PP9I77-APPA-77I9PP5k/reportSee what readers see
Open the release page, /@demo/skos/v/0.1.0. A mirror published in report mode says so in a Partially reasoned
section, with the same counts by construct, so a reader knows which consequences Erden did not check.
Other formats
The steps are the same for every format; only the file name changes. Two upstream habits need care:
- JSON-LD with a remote context. Many JSON-LD files start with
"@context": "https://…". Erden never fetches it, so the source is refused with the file's name. Download the context once and put its object in place of the URL; that is the one edit a JSON-LD mirror needs, and it changes no statement. - Content negotiation. Some ontology addresses answer with Turtle, RDF/XML or HTML depending on what you ask for.
Ask for the format you want and keep the extension consistent with it, for example
curl -fsSL -H 'Accept: application/rdf+xml' -o prov-o.owl https://www.w3.org/ns/prov-o.
Depend on the mirror
Your own layer adds the mirror like any other layer (see use layers as dependencies):
erden add @demo/skos@^0.1.0Your layer stays strict: its own manifest has no outsideProfile, so a statement the reasoner does not cover in
your files is still refused.
If it looks different
The check could not complete with CHECK_LOCK_STALE
The manifest changed since the lockfile was written. Run erden install --offline and check again.
A source is refused before anything else runs
The message names the file and why: it did not parse, its extension is not one of the four formats, a JSON-LD context is a URL, or an RDF/XML file declares an external entity. Fix the download, not the content.
budget-exhausted even with a larger budget
Some ontologies are too large or shaped in a way the bundled reasoner cannot decide in any reasonable time, for example many ranged properties or many individuals. Report mode does not change that. Mirror a smaller module of the standard if its publishers ship one, and tell the Erden team which ontology it was.
The registry refused the publication with budget-exhausted
Your check had more time than the registry's. Ask the Erden team for the publication budget, check again locally with that value, and ask them to raise it if the check needs more.