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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,9 @@ The RustFS console is at `http://localhost:9001` (default credentials are

To validate against profiles other than the bundled ones, mount a profiles
directory into **both** the flask and worker containers (metadata validation
runs in flask; crate validation runs in the worker) and set `PROFILES_PATH` to
the mounted path. See `docker-compose-develop.yml` for a working example.
runs in flask; crate validation runs in the worker) and set `EXTRA_PROFILES_PATH`
to the mounted path. This keeps the bundled base profiles available to the
custom profiles. See `docker-compose-develop.yml` for a working example.

## Development

Expand Down
8 changes: 4 additions & 4 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ This validates the contents of an `ro-crate-metadata.json` document and returns
| Field | Required | Description |
|-------|----------|-------------|
| `crate_json` | yes | The metadata document, as a JSON string |
| `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 |
| `profile_name` | no | Profile to validate against, e.g. `ro-crate-1.2`. The validator will default to `ro-crate-1.3` when this is omitted |

!!! warning
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.
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.3` when it is omitted.

To validate an ro-crate metadata file:

Expand Down Expand Up @@ -47,7 +47,7 @@ This queues validation of an RO-Crate held in the object store. The RO-Crate is

| Field | Required | Description |
|-------|----------|-------------|
| `profile_name` | no | Profile to validate against; defaults to `ro-crate-1.1` when omitted |
| `profile_name` | no | Profile to validate against; defaults to `ro-crate-1.3` when omitted |
| `webhook_url` | no | URL that receives the result when validation finishes |

```bash
Expand Down Expand Up @@ -101,7 +101,7 @@ An RO-Crate's `status` can be:
| `error` | The validation could not run; the reason is in an `error` field. No `detail` field is provided |

!!! note
`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.
`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.3`) was used.

For stored RO-Crates the same object is saved to `{S3_RESULTS_PREFIX}/<id>.json` and returned by the GET endpoint.

Expand Down
6 changes: 3 additions & 3 deletions docs/five-safes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ The `five-safes-crate` profile itself is defined in the [eScienceLab rocrate-val
A [complete example crate](https://github.com/eScienceLab/rocrate-validator/blob/five-safes-0.7.4-beta/tests/data/crates/valid/five-safes-crate-result/ro-crate-metadata.json) is available in the fork's test data.

!!! note
The current `-fivesafes-profile` image pairs the profile with a base profile for RO-Crate 1.1, whilst the profile itself expects RO-Crate 1.2. The walkthrough below mounts the matched profile set instead.
The repository's profile directory contains custom profiles that depend on the validator's bundled RO-Crate profiles. Use `EXTRA_PROFILES_PATH` to keep those base profiles available.

For this walkthrough, run the service from a checkout of this repository, with the repository's profile set mounted in place of the bundled profiles:
For this walkthrough, run the service from a checkout of this repository, with the repository's custom profiles mounted alongside the bundled profiles:

```bash
docker run --rm -p 5001:5000 \
-e FLASK_APP=wsgi.py \
-e PROFILES_PATH=/app/profiles \
-e EXTRA_PROFILES_PATH=/app/profiles \
-v "$PWD/tests/data/rocrate_validator_profiles:/app/profiles:ro" \
ghcr.io/esciencelab/ro-crate-validation-service-fivesafes-profile:latest
```
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ The following can all be set as environment variables for the service using an `

The validator comes with several RO-Crate profiles, and for the Five Safes RO-Crate, the prebuilt `ghcr.io/esciencelab/ro-crate-validation-service-fivesafes-profile` image has the `five-safes-crate` profile already included; see [Five Safes validation](five-safes.md).

Other profiles can be provided by mounting the directory containing these profiles as a volume for the `flask` container. Mount the same directory as a volume for the `celery_worker` container as well if you have enabled stored-crate validation. Then set either the `EXTRA_PROFILES_PATH` or `PROFILES_PATH` environment variable to match the volume path. There is a working example in `docker-compose-develop.yml`.
Other profiles can be provided by mounting the directory containing these profiles as a volume for the `flask` container. Mount the same directory as a volume for the `celery_worker` container as well if you have enabled stored-crate validation. Then set `EXTRA_PROFILES_PATH` to match the volume path so the bundled base profiles remain available. There is a working example in `docker-compose-develop.yml`.

!!! note
`EXTRA_PROFILES_PATH` adds the directory to the bundled profiles, whereas `PROFILES_PATH` replaces them entirely. The two can be set together, in which case the validator takes profiles from both locations.
`EXTRA_PROFILES_PATH` adds the directory to the bundled profiles. Use `PROFILES_PATH` only when supplying a complete set of replacement profiles, including any base profiles your custom profiles depend on. The two can be set together, in which case the validator takes profiles from both locations.

## Offline validation

Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ authors = [{ name = "eScience Lab, The University of Manchester" }]

# Direct runtime dependencies:
dependencies = [
"celery==5.6.3",
"boto3==1.43.97",
"celery==5.7.0",
"boto3==1.43.124",
"requests==2.34.2",
"Flask==3.1.3",
"Werkzeug==3.1.8",
"Werkzeug==3.1.9",
"redis==8.1.0",
"python-dotenv==1.2.3",
"apiflask==3.1.2",
"roc-validator==0.11.4",
"python-dotenv==1.2.4",
"apiflask==3.1.3",
"roc-validator==0.13.1",
Comment thread
douglowe marked this conversation as resolved.
Resolved
]

[project.optional-dependencies]
Expand Down
27 changes: 13 additions & 14 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@
#
# pip-compile --extra=dev --no-index --output-file=requirements-dev.txt
#
amqp==5.3.1
amqp==5.4.2
# via kombu
annotated-types==0.8.0
# via pydantic
apiflask==3.1.2
apiflask==3.1.3
# via ro-crate-validation-service (pyproject.toml)
apispec==6.10.0
# via apiflask
async-timeout==5.0.1
# via redis
attrs==26.1.0
# via
# cattrs
# requests-cache
billiard==4.3.0
billiard==4.3.2
# via celery
blinker==1.9.0
# via flask
boto3==1.43.97
boto3==1.43.124
# via
# moto
# ro-crate-validation-service (pyproject.toml)
botocore==1.43.97
botocore==1.43.124
# via
# boto3
# moto
Expand All @@ -33,7 +35,7 @@ build==1.6.1
# via pip-tools
cattrs==26.2.0
# via requests-cache
celery==5.6.3
celery==5.7.0
# via ro-crate-validation-service (pyproject.toml)
certifi==2026.7.22
# via requests
Expand All @@ -55,7 +57,7 @@ click-didyoumean==0.3.1
# via celery
click-plugins==1.1.1.2
# via celery
click-repl==0.4.0
click-repl==0.4.1
# via celery
colorlog==6.12.0
# via roc-validator
Expand Down Expand Up @@ -98,7 +100,7 @@ jmespath==1.1.0
# via
# boto3
# botocore
kombu==5.6.2
kombu==5.7.0
# via celery
markdown-it-py==4.2.0
# via rich
Expand All @@ -122,7 +124,6 @@ packaging==26.3
# via
# apispec
# build
# kombu
# pyshacl
# pytest
# webargs
Expand Down Expand Up @@ -172,7 +173,7 @@ python-dateutil==2.9.0.post0
# via
# botocore
# celery
python-dotenv==1.2.3
python-dotenv==1.2.4
# via ro-crate-validation-service (pyproject.toml)
pyyaml==6.0.3
# via
Expand Down Expand Up @@ -202,7 +203,7 @@ rich==13.9.4
# roc-validator
rich-click==1.9.9
# via roc-validator
roc-validator==0.11.4
roc-validator==0.13.1
# via ro-crate-validation-service (pyproject.toml)
ruff==0.16.8
# via ro-crate-validation-service (pyproject.toml)
Expand All @@ -222,8 +223,6 @@ typing-extensions==4.16.0
# typing-inspection
typing-inspection==0.4.4
# via pydantic
tzdata==2026.4
# via kombu
tzlocal==5.4.4
# via celery
url-normalize==3.0.0
Expand All @@ -245,7 +244,7 @@ wcwidth==0.8.4
# prompt-toolkit
webargs==8.7.1
# via apiflask
werkzeug==3.1.8
werkzeug==3.1.9
# via
# flask
# moto
Expand Down
27 changes: 13 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,33 @@
#
# pip-compile --no-index --output-file=requirements.txt
#
amqp==5.3.1
amqp==5.4.2
# via kombu
annotated-types==0.8.0
# via pydantic
apiflask==3.1.2
apiflask==3.1.3
# via ro-crate-validation-service (pyproject.toml)
apispec==6.10.0
# via apiflask
async-timeout==5.0.1
# via redis
attrs==26.1.0
# via
# cattrs
# requests-cache
billiard==4.3.0
billiard==4.3.2
# via celery
blinker==1.9.0
# via flask
boto3==1.43.97
boto3==1.43.124
# via ro-crate-validation-service (pyproject.toml)
botocore==1.43.97
botocore==1.43.124
# via
# boto3
# s3transfer
cattrs==26.2.0
# via requests-cache
celery==5.6.3
celery==5.7.0
# via ro-crate-validation-service (pyproject.toml)
certifi==2026.7.22
# via requests
Expand All @@ -47,7 +49,7 @@ click-didyoumean==0.3.1
# via celery
click-plugins==1.1.1.2
# via celery
click-repl==0.4.0
click-repl==0.4.1
# via celery
colorlog==6.12.0
# via roc-validator
Expand Down Expand Up @@ -86,7 +88,7 @@ jmespath==1.1.0
# via
# boto3
# botocore
kombu==5.6.2
kombu==5.7.0
# via celery
markdown-it-py==4.2.0
# via rich
Expand All @@ -107,7 +109,6 @@ owlrl==7.6.2
packaging==26.3
# via
# apispec
# kombu
# pyshacl
# webargs
pfzy==0.3.4
Expand Down Expand Up @@ -136,7 +137,7 @@ python-dateutil==2.9.0.post0
# via
# botocore
# celery
python-dotenv==1.2.3
python-dotenv==1.2.4
# via ro-crate-validation-service (pyproject.toml)
rdflib[html]==7.6.0
# via
Expand All @@ -158,7 +159,7 @@ rich==13.9.4
# roc-validator
rich-click==1.9.9
# via roc-validator
roc-validator==0.11.4
roc-validator==0.13.1
# via ro-crate-validation-service (pyproject.toml)
s3transfer==0.19.2
# via boto3
Expand All @@ -176,8 +177,6 @@ typing-extensions==4.16.0
# typing-inspection
typing-inspection==0.4.4
# via pydantic
tzdata==2026.4
# via kombu
tzlocal==5.4.4
# via celery
url-normalize==3.0.0
Expand All @@ -198,7 +197,7 @@ wcwidth==0.8.4
# prompt-toolkit
webargs==8.7.1
# via apiflask
werkzeug==3.1.8
werkzeug==3.1.9
# via
# flask
# ro-crate-validation-service (pyproject.toml)
Expand Down
4 changes: 2 additions & 2 deletions tests/data/ro-crate-metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": "https://w3id.org/ro/crate/1.1/context",
"@context": "https://w3id.org/ro/crate/1.3/context",
"@graph": [
{
"@id": "./",
Expand Down Expand Up @@ -32,7 +32,7 @@
"@id": "./"
},
"conformsTo": {
"@id": "https://w3id.org/ro/crate/1.1"
"@id": "https://w3id.org/ro/crate/1.3"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,9 @@ alpha-crate:RootDataEntityRequiredProperties

sh:property [
a sh:PropertyShape ;
sh:name "sourceOrganization" ;
sh:path schema:sourceOrganization;
sh:name "datePublished" ;
sh:path schema:datePublished;
sh:minCount 1 ;
sh:severity sh:Violation ;
sh:message """The Root Data Entity MUST have a `sourceOrganization` property.""" ;
] ;

sh:property [
a sh:PropertyShape ;
sh:name "sourceOrganization" ;
sh:path schema:sourceOrganization ;
sh:class schema:Project ;
sh:severity sh:Violation ;
sh:message """The `sourceOrganization` property of the RootDataEntity MUST point to a Project entity.""" ;
sh:message """The Root Data Entity MUST have a `datePublished` property.""" ;
] .
Loading
Loading