Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
- uses: astral-sh/setup-uv@v6
# Validation runs on oold-python. --meta . reads the meta-schemas and the rule
# catalogue from THIS checkout, so a rule added in this branch is enforced by the
# run that introduces it; a released version could not see it. Node is no longer
# installed here: scripts/validate.mjs is frozen as the reference oold-python is
# compared against, and is run by that comparison rather than by this workflow.
# run that introduces it; a released version could not see it. Node is not installed
# here: the reference implementation lives in OO-LD/oold-js and is run by oold-python's
# parity suite, which compares the two over this repository's examples.
- run: make validate
# Re-render the spec and fail if the committed docs/spec/index.html is stale
# (drift guard), then lint its structure. Renderer deps are pinned inline
Expand Down
13 changes: 0 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,11 @@ ZENSICAL := uvx --with pyyaml==6.0.2 zensical@$(ZENSICAL_VERSION)
OOLD_VERSION ?= 0.18.1
OOLD := uv run --with "oold[validation]==$(OOLD_VERSION)" oold

# scripts/validate.mjs is frozen: kept runnable as the reference the Python port is
# compared against (oold-python's parity suite), but no longer what CI runs. Override
# when `node` is not on PATH: make validate-reference NODE="/c/.../node.exe"
NODE ?= node

.PHONY: install
install: ## Install the Node dependencies (schema validation)
@npm install

.PHONY: validate
validate: ## Validate example schemas + instances against this working tree's meta-schemas
@$(OOLD) validate examples --meta . --offline
@$(OOLD) compliance examples/compliance --meta . --offline

.PHONY: validate-reference
validate-reference: ## Run the frozen JS reference validator (not run by CI)
@"$(NODE)" scripts/validate.mjs

.PHONY: spec
spec: ## Regenerate docs/spec/index.html + meta/oold-rules.json from spec/sections (via uv)
@echo "🚀 Extracting the rule catalog from spec/"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ make preview # re-render the spec, then serve the site
make check # validate + spec lint + site build (what CI runs)
```

The docs and the spec renderer run on Python via [uv](https://docs.astral.sh/uv/) - no local Python setup required; the schema validator runs on Node (`make install` once).
The docs, the spec renderer and the schema validator all run on Python via [uv](https://docs.astral.sh/uv/) - no local Python setup required.

If you edit the specification prose, install the git hooks once:

Expand Down
3 changes: 1 addition & 2 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ You can explore this exact example - validation, UI generation, and RDF output -
This repository ships example schemas under [`examples/`](https://github.com/OO-LD/oold-schema/tree/main/examples) and the OO-LD meta-schema under [`meta/`](https://github.com/OO-LD/oold-schema/tree/main/meta). To validate them locally:

```bash
npm install
npm run validate
make validate
```

### Next steps
Expand Down
8 changes: 4 additions & 4 deletions docs/tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ Because OO-LD documents are ordinary JSON Schema and JSON-LD, the full ecosystem

## Validation and test suites

The [`oold-schema`](https://github.com/OO-LD/oold-schema) repository ships a validation harness ([`scripts/validate.mjs`](https://github.com/OO-LD/oold-schema/blob/main/scripts/validate.mjs)) with two tiers. Run both with `make validate`, or `make check` (which also re-renders the spec and builds the site); CI runs `make check` on every push.
Validation runs on [`oold`](https://github.com/OO-LD/oold-python), the maintained implementation, in two tiers. Run both with `make validate`, or `make check` (which also re-renders the spec and builds the site); CI runs `make check` on every push. A second implementation, [`oold-js`](https://github.com/OO-LD/oold-js), is kept in agreement with it by a cross-implementation parity suite.

### General workflow (any schema, no fixtures)

These run on every schema and instance in [`examples/`](https://github.com/OO-LD/oold-schema/tree/main/examples) with no per-schema test data, so they apply to any OO-LD schema you write. They are also **reusable on your own schemas**: the harness is exposed as an `oold-validate` CLI, so a downstream repo can conformance-check its generated schemas against this exact pipeline without copying it -
These run on every schema and instance in [`examples/`](https://github.com/OO-LD/oold-schema/tree/main/examples) with no per-schema test data, so they apply to any OO-LD schema you write. They are also **reusable on your own schemas** - a downstream repo can conformance-check its generated schemas against this exact pipeline without copying it:

```
npx --yes github:OO-LD/oold-schema oold-validate path/to/schemas
uvx --from "oold[validation]" oold validate path/to/schemas
```

Given a directory argument, `oold-validate <dir>` runs only the general-workflow tier below (well-formedness, auto-generated instance, branch iteration, RDF roundtrip, pattern lint) over that directory's `*.schema.json`, using this package's meta-schemas; the deterministic per-feature suites and vocabulary coverage stay scoped to this repo's own `examples/`. The checks are:
Given a directory, `oold validate <dir>` runs the general-workflow tier below (well-formedness, auto-generated instance, branch iteration, RDF roundtrip, pattern lint) over that directory's `*.schema.json`; the deterministic per-feature suites and vocabulary coverage stay scoped to this repo's own `examples/`. The checks are:

- **Well-formedness** - the schema validates against the OO-LD meta-schema and its `$ref` composition resolves.
- **Auto-generated instance** - an instance is generated (via [json-schema-faker](https://github.com/json-schema-faker/json-schema-faker), all properties, declared `format`s respected) and must validate against the schema; this catches unsatisfiable schemas. Generation runs with `useExamplesValue` and `useDefaultValue` enabled, so any `examples` or `default` value in the schema is used as-is and must satisfy its own subschema. JSON Schema treats those keywords as annotations and does not validate them; this harness effectively does, which catches example values that contradict their own constraints (a `pattern` violated by its example, a string example on a `type: number` property). A `GEN-INVALID` whose instance path points at such a value indicates the annotation, not an unsatisfiable schema.
Expand Down
2 changes: 1 addition & 1 deletion examples/compliance/oold-vocab.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"$comment": "Keep in sync with meta/oold-meta-schema.json and meta/oold-ui-meta-schema.json: scripts/validate.mjs asserts every x-oold-* / x-oold-ui-* keyword defined there is covered by at least one case below. Each `schemas` entry is checked against the OO-LD meta-schema (well-formedness), not an instance.",
"$comment": "Keep in sync with meta/oold-meta-schema.json and meta/oold-ui-meta-schema.json: the validators assert every x-oold-* / x-oold-ui-* keyword defined there is covered by at least one case below. Each `schemas` entry is checked against the OO-LD meta-schema (well-formedness), not an instance.",
"description": "a fully annotated OO-LD schema is well-formed (covers every x-oold-* and x-oold-ui-* keyword)",
"schemas": [
{
Expand Down
2 changes: 1 addition & 1 deletion examples/compliance/roundtrip-patterns.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
},
{
"feature": "reverse round-trip: an exported instance reconstructs from RDF through the minimal schema-derived frame (literals and references by compaction, embedded objects by framing, arrays kept stable by @container:@set)",
"$comment": "The instance carries its materialized root type (schema:Organization), as a compliant export must, so the schema-derived frame can pick it as the frame root and nest the embedded object beneath it. Reconstruction uses scripts/schema_to_frame.mjs; [roundtrip] asserts instance == reconstruction after canonicalization.",
"$comment": "The instance carries its materialized root type (schema:Organization), as a compliant export must, so the schema-derived frame can pick it as the frame root and nest the embedded object beneath it. Reconstruction uses the schema-derived frame; [roundtrip] asserts instance == reconstruction after canonicalization.",
"schema": {
"$schema": "https://oo-ld.org/latest/meta/oold-meta-schema.json",
"$id": "https://oo-ld.test/compliance/reverse-round-trip-an-exported-instance-reconstr.schema.json",
Expand Down
14 changes: 1 addition & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@
"name": "oold-schema",
"private": true,
"type": "module",
"description": "OO-LD schema specification and validation tooling",
"bin": {
"oold-validate": "scripts/validate.mjs"
},
"description": "OO-LD schema specification",
"scripts": {
"validate": "node scripts/validate.mjs",
"extract-legacy": "node scripts/extract-legacy-keywords.mjs"
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^11.0.0",
"ajv": "^8.12.0",
"ajv-formats": "^3.0.1",
"ajv-formats-draft2019": "^1.6.1",
"json-schema-faker": "0.6.2",
"jsonld": "^8.3.2"
}
}
61 changes: 0 additions & 61 deletions scripts/pattern_lint.mjs

This file was deleted.

105 changes: 0 additions & 105 deletions scripts/schema_to_frame.mjs

This file was deleted.

Loading
Loading