You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
The examples below use the Compose stack's local address, `http://localhost:5001`. Note that the service serves its own OpenAPI specification at `/docs`.
4
4
5
5
!!! note
6
-
`POST /v1/ro_crates/validate_metadata` is always available, but the **storage-backed endpoints** are only available when the service runs with `STORAGE_ENABLED=true` (see [Installation & Setup](installation.md#enabling-object-storage)); without this set, requests return `404`.
6
+
`POST /v1/ro_crates/validate_metadata` is always available, but the **storage-backed endpoints** are only available when the service runs with `STORAGE_ENABLED=true` (see [Installation & Setup](installation.md#enabling-object-storage)); without this set, `POST /v1/ro_crates/{crate_id}/validation` or `GET /v1/ro_crates/{crate_id}/validation`requests will return a `404` result.
7
7
8
8
## Validate metadata
9
9
@@ -14,18 +14,22 @@ This validates the contents of an `ro-crate-metadata.json` document and returns
14
14
| Field | Required | Description |
15
15
|-------|----------|-------------|
16
16
|`crate_json`| yes | The metadata document, as a JSON string |
17
-
|`profile_name`| no | Profile to validate against, e.g. `ro-crate-1.2`; defaults to `ro-crate-1.1` when omitted |
17
+
|`profile_name`| no | Profile to validate against, e.g. `ro-crate-1.2`. The validator will default to `ro-crate-1.1` when this is omitted |
18
18
19
19
!!! warning
20
20
Currently, the validation profile is not detected from the RO-Crate. In other words, a `conformsTo` declaration in the metadata does not influence which validation profile is used by the validator, and the validation always runs against `profile_name`, or `ro-crate-1.1` when it is omitted.
@@ -36,7 +40,7 @@ To choose a profile, add it to the `jq` object: `jq -Rs '{crate_json: ., profile
36
40
37
41
`POST /v1/ro_crates/{crate_id}/validation`
38
42
39
-
This queues validation of an RO-Crate held in the object store. The RO-Crate is resolved first, so a missing or ambiguous crate ID may be reported; the validation itself runs on a worker.
43
+
This queues validation of an RO-Crate held in the object store. The RO-Crate is resolved first, so a missing or ambiguous crate ID may be reported immediately; the validation process itself runs asynchronously on a worker.
40
44
41
45
!!! note
42
46
See [Crate IDs](#crate-ids) for how `{crate_id}` maps to objects in the bucket.
@@ -54,7 +58,7 @@ curl -X POST http://localhost:5001/v1/ro_crates/my-dataset-2026/validation -H 'C
54
58
|------|---------|
55
59
|`202`| Queued; the body is `{"message": "Validation in progress"}`|
56
60
|`400`| Invalid Crate ID |
57
-
|`404`|No RO-Crate at the expected keys, or storage mode is not enabled|
61
+
|`404`|Either storage mode is not enabled, or there is no RO-Crate at the location defined by the given Crate ID|
58
62
|`409`| Both a zip and a directory exist for this Crate ID |
|`200`| The stored result, including persisted `error` results |
75
79
|`400`| Invalid Crate ID |
76
-
|`404`| No result stored for this Crate ID yet |
80
+
|`404`| No result stored for this Crate ID |
77
81
78
82
## Validation results
79
83
@@ -93,8 +97,8 @@ An RO-Crate's `status` can be:
93
97
|`status`| Meaning |
94
98
|----------|---------|
95
99
|`valid`| The RO-Crate conforms to the profile |
96
-
|`invalid`|Validated, but with conformance issues listed in `detail`|
97
-
|`error`| The validation could not run; the reason is in an `error` field instead of `detail`|
100
+
|`invalid`|The RO-Crate does not conform to the profile, issues listed in `detail` field|
101
+
|`error`| The validation could not run; the reason is in an `error` field. No `detail` field is provided|
98
102
99
103
!!! note
100
104
`detail` contains the complete validation report. `created_at` is the UTC time of a stored-crate validation, and `null` for metadata-only validation, which does not set it. `profile` is the requested profile name, or `null` when the default (`ro-crate-1.1`) was used.
The integration tests bring up the full Compose stack (including the object store) and seed crates with `boto3`, so they need Docker running:
46
+
The integration tests bring up the full Compose stack (including the object store) and seed crates with `boto3`, for which they need Docker Engine to be running:
Direct dependencies are declared in `pyproject.toml`; the `requirements*.txt` files are locks generated with pip-compile:
64
+
Direct dependencies are declared in `pyproject.toml`; while the `requirements*.txt` files are locks generated using `pip-compile`:
65
65
66
66
```bash
67
67
pip-compile pyproject.toml -o requirements.txt
@@ -73,11 +73,11 @@ pip-compile --extra dev pyproject.toml -o requirements-dev.txt
73
73
74
74
## Continuous Integration
75
75
76
-
Pull requests to `develop`run three workflows: unit tests, integration tests (which start the Compose stack), and lint (`ruff check` and `ruff format --check`).
76
+
Pull requests to `develop`will trigger three workflows: unit tests, integration tests (which start the Compose stack), and lint (`ruff check` and `ruff format --check`).
77
77
78
78
## How the API works
79
79
80
-
The API process handles HTTP and runs metadata-only validation inline. Object storage-backed validation is queued through Redis to a Celery worker, which reads the crate from the S3-compatible store, validates it, and writes the result back:
80
+
The API server handles HTTP and runs metadata-only validation inline. Object storage-backed validation is queued through Redis to a Celery worker, which reads the crate from the S3-compatible store, validates it, and writes the result back:
Copy file name to clipboardExpand all lines: docs/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# RO-Crate Validation Service
2
2
3
-
The RO-Crate Validation Service evaluates whether [RO-Crates](https://www.researchobject.org/ro-crate/)conform to the RO-Crate specification and to community profiles. The service wraps the [`rocrate-validator`](https://rocrate-validator.readthedocs.io/) library in a REST API, and is deployed as a Docker image. The RO-Crate Validation Service enables pipelines, other services, and Trusted Research Environments (TREs) to validate an RO-Crate over HTTP without running the validator themselves.
3
+
The RO-Crate Validation Service provides a REST API for evaluating whether an [RO-Crate](https://www.researchobject.org/ro-crate/)conforms to a given RO-Crate profile. The service wraps the [`rocrate-validator`](https://rocrate-validator.readthedocs.io/) library, enabling pipelines, other services, and Trusted Research Environments (TREs) to validate an RO-Crate over HTTP without having to install the validator themselves.
4
4
5
5
## RO-Crates and profiles in brief
6
6
7
-
An [RO-Crate](https://www.researchobject.org/ro-crate/) packages research data together with structured, machine-readable metadata: a JSON-LD file named `ro-crate-metadata.json`. Validating an RO-Crate evaluates that metadata against a **profile**. A profile is a set of requirements the RO-Crate must satisfy. That can be the base requirements of the [RO-Crate specification](https://www.researchobject.org/ro-crate/1.2/) itself, or a [community profile](https://www.researchobject.org/ro-crate/profiles) that adds domain-specific rules, such as the [Five Safes RO-Crate profile](https://trefx.uk/5s-crate/)for working with sensitive data in TREs.
7
+
An [RO-Crate](https://www.researchobject.org/ro-crate/) packages research data together with structured, machine-readable metadata: a JSON-LD file named `ro-crate-metadata.json`. Validating an RO-Crate involves evaluating that metadata against a given **profile**. A profile is a set of requirements the RO-Crate must satisfy, either the base requirements of the [RO-Crate specification](https://www.researchobject.org/ro-crate/1.2/) itself, or a [community profile](https://www.researchobject.org/ro-crate/profiles) that adds domain-specific rules to the base specification. An example of a community profile is the [Five Safes RO-Crate profile](https://trefx.uk/5s-crate/), designed for researchers working with sensitive data in Trusted Research Environments (TREs).
8
8
9
-
Whilst the validation checks themselves are performed by [`rocrate-validator`](https://rocrate-validator.readthedocs.io/), this service is a deployable HTTP wrapper around that tool: it adds a web API, asynchronous processing, and object-storage integration. The base validation rules come from the validator itself; we additionally package our own [Five Safes RO-Crate profile](five-safes.md) rules with the service for working in TREs.
9
+
Whilst the validation checks themselves are performed by the [`rocrate-validator`](https://rocrate-validator.readthedocs.io/), this service is a deployable HTTP wrapper around that tool: it adds a web API, asynchronous processing, and object-storage integration. The base RO-Crate specification, as well as several [community profiles](https://rocrate-validator.readthedocs.io/en/latest/#features), are provided with the validator itself. We additionally package our own [Five Safes RO-Crate profile](five-safes.md) rules with the service for working in TREs.
0 commit comments