Verify Data Sharing Agreement hash, citation, and vocabulary terms
Verify a Data Sharing Agreement (DSA) directory or single version: checks that every JSON-LD term in agreement.jsonld and dcat.jsonld is defined in the SHA-256-pinned official W3C ODRL 2.2, W3C DCAT 3 (with SPDX 2.2.2 and ADMS), or DCMI Metadata Terms contexts; checks that the ODRL 2.2 Agreement’s uid is the version’s fixed-version URL and its dcterms:source cites the DCAT 3 dcat:Distribution whose spdx:checksum is checked; verifies that the SHA-256 digest of agreement.md matches spdx:checksumValue; and checks dcat:previousVersion and hash distinctness across versions.
Skills it satisfies
A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.
dsa-checksum
Compute and record the SHA-256 cryptographic digest of a signed Data Sharing Agreement’s legal text as a W3C DCAT 3 spdx:checksum (spdx:Checksum with spdx:checksumAlgorithm_sha256 and 64-character lowercase hex spdx:checksumValue), verified by check:dsa-hash (DSA building block B3, process steps P2.2 Task_Hash and P2.2a Task_HashSummary).
Source: folio-assistant-core/skills/content/folio-document-adapter/dsa-checksum.md.
The skill declares no I/O contract (schemas/skills/dsa-checksum/{input,output}.schema.json).
Inputs and outputs
Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.
| port | type | required | description | constraint | |
|---|---|---|---|---|---|
| in | dir | RepoPath | Path to a versioned DSA directory (holding v1/, v2/, …) or a single version directory holding agreement.md, dcat.jsonld, and agreement.jsonld. Defaults to folio-assistant-core/scripts/test-fixtures/dsa. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| out | verdict | Text | Per-version verification line (dcat:version, dcat:downloadURL, sha256) on stdout when valid; diagnostic findings on stderr with exit code 1 when any check fails. | string · A short single-line human string. Not admissible as a command-line argument. |
Processes and tasks
Steps this Tool can carry out, because each names a skill it satisfies:
| process | step | lane | via skill |
|---|---|---|---|
| Data sharing agreement document life cycle | P2.2 · Record each file’s SHA-256 | Publisher (data provider’s publication manager) | dsa-checksum |
| Data sharing agreement document life cycle | P2.2a · Hash the plain summary | Publisher (data provider’s publication manager) | dsa-checksum |
How it is deployed and reached
- Command line. From the repository root:
bun run folio-assistant-core/scripts/check-dsa-hash.ts. - GitHub Actions. No workflow in this checkout runs its command.
As an API: its operation in the OpenAPI document and the MCP tool list of its layer.
| install | none |
| runtime | bun |
| network | no |
| when to choose it | |
|---|---|
| when | Verifying a Data Sharing Agreement’s checksum, ODRL citation, DCAT 3 record and dcat:previousVersion chain, or adms:status. |
| limits | Checks structural, cryptographic, and vocabulary conformance of agreement.md, dcat.jsonld, and agreement.jsonld; does not evaluate legal prose semantics or sign Verifiable Credentials. |
| cost | Local file reads and SHA-256 hashing; runs in milliseconds with no network access. |
What it is made of
| role | file | |
|---|---|---|
| definition | folio-assistant-core/tools/check-dsa-hash/check-dsa-hash.ts | |
| script | folio-assistant-core/scripts/check-dsa-hash.ts |
Linked data
The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/folio-assistant-core/tools/check-dsa-hash.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.
{
"@context": "https://litlfred.github.io/folio-assistant/folio-assistant-core/folio-assistant-core.context.jsonld",
"@id": "https://litlfred.github.io/folio-assistant/folio-assistant-core/tools/check-dsa-hash.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "https://litlfred.github.io/folio-assistant/folio-assistant-core/folio-assistant-core.jsonld",
"name": "check-dsa-hash",
"title": "Verify Data Sharing Agreement hash, citation, and vocabulary terms",
"description": "Verify a Data Sharing Agreement (DSA) directory or single version: checks that every JSON-LD term in `agreement.jsonld` and `dcat.jsonld` is defined in the SHA-256-pinned official W3C ODRL 2.2, W3C DCAT 3 (with SPDX 2.2.2 and ADMS), or DCMI Metadata Terms contexts; checks that the ODRL 2.2 Agreement's `uid` is the version's fixed-version URL and its `dcterms:source` cites the DCAT 3 `dcat:Distribution` whose `spdx:checksum` is checked; verifies that the SHA-256 digest of `agreement.md` matches `spdx:checksumValue`; and checks `dcat:previousVersion` and hash distinctness across versions.",
"install": {
"none": true
},
"invoke": {
"shell": "bun run folio-assistant-core/scripts/check-dsa-hash.ts"
},
"io": {
"inputs": [
{
"name": "dir",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "Path to a versioned DSA directory (holding `v1/`, `v2/`, ...) or a single version directory holding `agreement.md`, `dcat.jsonld`, and `agreement.jsonld`. Defaults to `folio-assistant-core/scripts/test-fixtures/dsa`.",
"required": false,
"arg": {
"positional": 0
}
}
],
"outputs": [
{
"name": "verdict",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Text",
"description": "Per-version verification line (`dcat:version`, `dcat:downloadURL`, `sha256`) on stdout when valid; diagnostic findings on stderr with exit code 1 when any check fails."
}
]
},
"satisfies": [
"dsa-checksum"
],
"requirements": {
"runtime": [
"bun"
],
"network": false
},
"selection": {
"when": "Verifying a Data Sharing Agreement's checksum, ODRL citation, DCAT 3 record and `dcat:previousVersion` chain, or `adms:status`.",
"limits": "Checks structural, cryptographic, and vocabulary conformance of `agreement.md`, `dcat.jsonld`, and `agreement.jsonld`; does not evaluate legal prose semantics or sign Verifiable Credentials.",
"cost": "Local file reads and SHA-256 hashing; runs in milliseconds with no network access."
}
}