|
1 | 1 | # RO-Crate Validation Service |
2 | 2 |
|
3 | | -[RO-Crates](https://www.researchobject.org/ro-crate/) are a lightweight approach to packaging research data and metadata. |
4 | | -They are designed to be easy to create and consume, and can be used to share research data in a way that is both human and machine-readable. |
5 | | - |
6 | | -To ensure that RO-Crates are valid and can be consumed by others, we need to validate them against a set of standards. |
7 | | -The base RO-Crate standards are defined in the [RO-Crate Metadata Specification](https://www.researchobject.org/ro-crate/1.2/metadata.html), |
8 | | -and include requirements for the structure of the RO-Crate, the metadata it contains, and the files it includes. |
9 | | -On top of this, there are also community-specific extensions to the RO-Crate standards, |
10 | | -such as the [Five Safes RO-Crate extension](https://trefx.uk/5s-crate/), for working with sensitive data within Trusted Research Environments (TREs). |
11 | | - |
12 | | -This validation process can be complex, requiring both structural and semantic checks to ensure that the RO-Crate is compliant with the relevant standards. |
13 | | -The [rocrate-validator](https://rocrate-validator.readthedocs.io/en/latest/) provides a means for the structural validation of RO-Crates, |
14 | | -checking that they conform to the required structure and contain the necessary metadata. |
15 | | -These checks are carried out using a combination of [SHACL](https://www.w3.org/TR/shacl/) shapes, a language for validating RDF graphs against a set of constraints, and python functions. |
16 | | -It is available on [PyPI](https://pypi.org/project/roc-validator/) and can be installed using pip. |
17 | | - |
18 | | -This RO-Crate Validation Service provides a REST API for validating RO-Crates using the rocrate-validator. |
19 | | -It is built in python using flask, and is provided as a docker image for ease of deployment. |
20 | | -Several base profiles are included, while more can be added as needed when the service is deployed. |
21 | | -The service accepts RO-Crates as zip files, and returns a validation report in JSON format, detailing any issues found with the RO-Crate. |
| 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 crates over HTTP without running the validator themselves. |
| 4 | + |
| 5 | +## RO-Crates and profiles in brief |
| 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. |
| 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. |
| 10 | + |
| 11 | +## Validation methods |
| 12 | + |
| 13 | +1. **Metadata-only**. Send the contents of an `ro-crate-metadata.json` file and receive the validation result in the response. This is synchronous and stateless, so nothing is stored, and no object store or worker is required. This approach is simpler to use, and is intended for quick evaluations whilst metadata is being written, or before a full crate has been assembled. |
| 14 | + |
| 15 | +2. **Storage-backed**. The service reads complete RO-Crates (zip or directory) from an S3-compatible object store, such as RustFS, AWS S3, MinIO, and others. Validation runs asynchronously on a worker process; the result is stored for later retrieval and can optionally be delivered to a webhook. This is more suited to pipelines and workflows. |
| 16 | + |
| 17 | +```mermaid |
| 18 | +flowchart LR |
| 19 | + Client([Your application]) |
| 20 | + API["REST API"] |
| 21 | + Validator["rocrate-validator"] |
| 22 | + Worker["Celery worker"] |
| 23 | + Store[("S3-compatible store")] |
| 24 | +
|
| 25 | + Client -->|HTTP| API |
| 26 | + API -->|metadata-only: validated inline| Validator |
| 27 | + API -->|storage-backed: queued| Worker |
| 28 | + Worker --> Validator |
| 29 | + Worker <--> Store |
| 30 | +``` |
| 31 | + |
| 32 | +## Documentation |
| 33 | + |
| 34 | +- To run the service yourself, start with [Installation & Setup](installation.md), or with the [Upgrade Guide](upgrading.md) if you already run a 1.\* version. |
| 35 | +- The [API Reference](api.md) documents the endpoints for anyone integrating against a running instance. |
| 36 | +- The [Five Safes RO-Crate](five-safes.md) page walks through validating RO-Crates in a TRE. |
| 37 | +- To help contribute to the service, see [Development](development.md). |
| 38 | + |
| 39 | +## About |
| 40 | + |
| 41 | +The RO-Crate Validation Service is developed by the [eScience Lab](https://esciencelab.org.uk/) at The University of Manchester, and available on [GitHub](https://github.com/eScienceLab/RO-Crate-Validation-Service) under the MIT licence. |
0 commit comments