Skip to content

Commit fad2dfa

Browse files
committed
prepare-release-0.10.0
2 parents 1abd2a1 + 46b74d7 commit fad2dfa

14 files changed

Lines changed: 666 additions & 397 deletions

CHANGELOG.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,85 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.10.0] - 2026-06-01
9+
10+
Full changelog: https://github.com/crs4/rocrate-validator/compare/0.9.0...0.10.0
11+
12+
### ✨ Added
13+
14+
- feat(cli): add offline mode with an `--offline` flag and an HTTP `cache` subcommand to validate RO-Crates without network access ([e296f10](https://github.com/crs4/rocrate-validator/commit/e296f10), [f8b99bc](https://github.com/crs4/rocrate-validator/commit/f8b99bc))
15+
- feat(utils): add a cache-aware JSON-LD document loader and HTTP cache warm-up from profile artifacts ([eedabf1](https://github.com/crs4/rocrate-validator/commit/eedabf1), [949ec6f](https://github.com/crs4/rocrate-validator/commit/949ec6f))
16+
- feat(utils): add offline mode and cache management to `HttpRequester`, with configurable cache path ([c92d88c](https://github.com/crs4/rocrate-validator/commit/c92d88c), [7c9e825](https://github.com/crs4/rocrate-validator/commit/7c9e825))
17+
- feat(core): support offline mode when downloading remote RO-Crates ([57eceb5](https://github.com/crs4/rocrate-validator/commit/57eceb5))
18+
- feat(cli/cache): add `cache list` (alias `ls`) and allow caching of explicit URLs via `cache warm` ([f9b43ae](https://github.com/crs4/rocrate-validator/commit/f9b43ae), [6925d55](https://github.com/crs4/rocrate-validator/commit/6925d55))
19+
- feat(cli): extend the `describe` command to describe individual requirement checks ([f3fb7f3](https://github.com/crs4/rocrate-validator/commit/f3fb7f3))
20+
- feat(model): add a `SourceSnippet` class and `RequirementCheck.get_source_snippet`, implemented for both SHACL and Python checks ([9f48674](https://github.com/crs4/rocrate-validator/commit/9f48674), [25bc7b4](https://github.com/crs4/rocrate-validator/commit/25bc7b4), [fe740e4](https://github.com/crs4/rocrate-validator/commit/fe740e4))
21+
- feat(checks): support a `deactivated` flag on `RequirementCheck` to override/deactivate checks by name for Python and SHACL ([dd84c32](https://github.com/crs4/rocrate-validator/commit/dd84c32), [4196f0e](https://github.com/crs4/rocrate-validator/commit/4196f0e))
22+
- feat(rocrate): add `check_availability()` with `AvailabilityStatus` on entities and granular remote-scheme classification ([76e92a4](https://github.com/crs4/rocrate-validator/commit/76e92a4), [469bbe5](https://github.com/crs4/rocrate-validator/commit/469bbe5))
23+
- feat(checks): handle `UNAUTHORIZED`/`UNCHECKABLE` web data entities as warnings ([0196dc9](https://github.com/crs4/rocrate-validator/commit/0196dc9))
24+
- feat(uri): add an `is_external_reference()` scheme detector ([62f89c0](https://github.com/crs4/rocrate-validator/commit/62f89c0))
25+
- feat(model): extend the `Profile` model to compute descendants ([a9783ce](https://github.com/crs4/rocrate-validator/commit/a9783ce))
26+
- ISA profile: add RDF classes for ISA types and a dedicated `Process` class for process checks ([3ff4245](https://github.com/crs4/rocrate-validator/commit/3ff4245), [e3fda59](https://github.com/crs4/rocrate-validator/commit/e3fda59), [c3e2d5f](https://github.com/crs4/rocrate-validator/commit/c3e2d5f))
27+
28+
### 🔧 Changed
29+
30+
- refactor(models): introduce pre/post internal validation hooks on `Validator` ([e43364b](https://github.com/crs4/rocrate-validator/commit/e43364b))
31+
- refactor(SHACL): rewrite `build_node_subgraph` as an iterative BNode traversal ([23164b7](https://github.com/crs4/rocrate-validator/commit/23164b7))
32+
- refactor(errors): accept `str`, `Path` or `URI` in `ROCrateInvalidURIError` ([0b8289b](https://github.com/crs4/rocrate-validator/commit/0b8289b))
33+
- refactor(cli/cache): drop the `Status` column from the `cache list` table ([392df1a](https://github.com/crs4/rocrate-validator/commit/392df1a))
34+
- feat(constants): default the HTTP cache to never expire ([419fece](https://github.com/crs4/rocrate-validator/commit/419fece))
35+
36+
### 🐛 Fixed
37+
38+
- fix(shacl): build property shape subgraphs by reachability and derive `NodeShape` level from nested `PropertyShape`s ([f1c0cfd](https://github.com/crs4/rocrate-validator/commit/f1c0cfd), [50448145](https://github.com/crs4/rocrate-validator/commit/5044814))
39+
- fix(shacl): evaluate inherited shapes for zero-shape target profiles ([bcb5cac](https://github.com/crs4/rocrate-validator/commit/bcb5cac))
40+
- fix(shacl): drop sub-threshold PySHACL violations at the source ([254fb88](https://github.com/crs4/rocrate-validator/commit/254fb88))
41+
- fix(core): filter failed requirements/checks by the configured severity ([a306f7f](https://github.com/crs4/rocrate-validator/commit/a306f7f))
42+
- fix(models): forward `extra_profiles_path` when computing validation statistics ([7b3e8bc](https://github.com/crs4/rocrate-validator/commit/7b3e8bc))
43+
- fix(uri): treat `file://` URIs with a non-local authority as remote ([63acb6a](https://github.com/crs4/rocrate-validator/commit/63acb6a))
44+
- fix(cli/cache): resolve profile tokens in `cache warm` and avoid `stream=True` when fetching remote crates ([7926832](https://github.com/crs4/rocrate-validator/commit/7926832), [33012b6](https://github.com/crs4/rocrate-validator/commit/33012b6))
45+
- fix(validation): report offline cache misses once per URL ([757b86a](https://github.com/crs4/rocrate-validator/commit/757b86a))
46+
- fix(ISA): correct the error message for a bad position in `HowToStep` ([03a32fc](https://github.com/crs4/rocrate-validator/commit/03a32fc))
47+
48+
### 📚 Documentation
49+
50+
- docs: add a dedicated documentation page for the cache and offline mode features ([e10c3b5](https://github.com/crs4/rocrate-validator/commit/e10c3b5))
51+
- docs(profiles): document check override-by-name and deactivation ([0b6bff7](https://github.com/crs4/rocrate-validator/commit/0b6bff7))
52+
53+
## [0.9.0] - 2026-04-20
54+
55+
Full changelog: https://github.com/crs4/rocrate-validator/compare/0.8.1...0.9.0
56+
57+
### ✨ Added
58+
59+
- feat(profiles/isa): add the ISA RO-Crate profile, with checks and tests for Investigation, Study, Assay, Process, Protocol, Sample, Data, Person and PropertyValue entities ([852fb23](https://github.com/crs4/rocrate-validator/commit/852fb23), [d62e214](https://github.com/crs4/rocrate-validator/commit/d62e214), [727b6f0](https://github.com/crs4/rocrate-validator/commit/727b6f0))
60+
- feat(cli): add CLI options to configure the HTTP cache (`--cache-path`, `--cache-max-age`) ([564230f](https://github.com/crs4/rocrate-validator/commit/564230f))
61+
- feat(model): enable cache configuration in `ValidationSettings` ([b2b47ba](https://github.com/crs4/rocrate-validator/commit/b2b47ba))
62+
- feat(utils): extend the `HttpRequester` constructor to support cache configuration parameters ([2f2a873](https://github.com/crs4/rocrate-validator/commit/2f2a873))
63+
- feat(ro-crate): refine the constraint enforcing metadata descriptor existence ([2c6ea76](https://github.com/crs4/rocrate-validator/commit/2c6ea76))
64+
- feat(file-descriptor): add an internal remote-context retrieval method supporting the alternate `Link` header ([f8b0e55](https://github.com/crs4/rocrate-validator/commit/f8b0e55))
65+
66+
### 🔧 Changed
67+
68+
- refactor(ro-crate): relax the `ROCrateMetadataFileDescriptor` class definition ([61ddbb5](https://github.com/crs4/rocrate-validator/commit/61ddbb5))
69+
- refactor(file-descriptor): route checks through the new remote-context retrieval method ([0ce2619](https://github.com/crs4/rocrate-validator/commit/0ce2619))
70+
- chore(utils): increase the session cache max age to 300 seconds ([36ca0ac](https://github.com/crs4/rocrate-validator/commit/36ca0ac))
71+
- ci(gh-actions): update outdated GitHub Actions ([d565c5d](https://github.com/crs4/rocrate-validator/commit/d565c5d))
72+
73+
### 🐛 Fixed
74+
75+
- fix(ro-crate): target metadata descriptor shapes by class and select the candidate descriptor via SPARQL ([8219f27](https://github.com/crs4/rocrate-validator/commit/8219f27), [39bd761](https://github.com/crs4/rocrate-validator/commit/39bd761), [1a91aa4](https://github.com/crs4/rocrate-validator/commit/1a91aa4))
76+
- fix(shacl): extract `@base` from the JSON-LD document for ontology parsing ([57f5c54](https://github.com/crs4/rocrate-validator/commit/57f5c54))
77+
- fix(SHACL-core): improve SHACL violation parsing with better error handling ([90a9f06](https://github.com/crs4/rocrate-validator/commit/90a9f06))
78+
- fix(file-descriptor): accept `application/json` and treat the `Link` header case-insensitively for remote context retrieval ([fe5ba1c](https://github.com/crs4/rocrate-validator/commit/fe5ba1c))
79+
- fix(file-descriptor): refine the compacted JSON-LD key validation logic ([45a7017](https://github.com/crs4/rocrate-validator/commit/45a7017))
80+
- fix(core): allow terms defined by context prefixes ([5fe8171](https://github.com/crs4/rocrate-validator/commit/5fe8171))
81+
- fix(core): fix output formatting ([523fbf4](https://github.com/crs4/rocrate-validator/commit/523fbf4))
82+
83+
### 📚 Documentation
84+
85+
- docs(cli): document the `-1` value for no cache expiration in the `--cache-max-age` help ([c5848bc](https://github.com/crs4/rocrate-validator/commit/c5848bc))
86+
887
## [0.8.1] - 2026-02-18
988

1089
Full changelog: https://github.com/crs4/rocrate-validator/compare/0.8.0...0.8.1

docs/0_toc.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
..
2-
Copyright (c) 2024 CRS4
2+
Copyright (c) 2024-2026 CRS4
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
2121
2_usage_cli
2222
3_usage_api
2323
4_how_it_works
24+
5_offline_mode
2425

2526
.. toctree::
2627
:maxdepth: 5
@@ -30,3 +31,9 @@
3031
11_writing_a_profile
3132
10_api
3233
genindex
34+
35+
.. toctree::
36+
:maxdepth: 1
37+
:caption: About
38+
39+
ack

docs/10_api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
..
2-
Copyright (c) 2024 CRS4
2+
Copyright (c) 2024-2026 CRS4
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -135,7 +135,7 @@ Python Check API
135135
======================
136136

137137
Requirement Class
138-
----------
138+
-----------------
139139
.. autoclass:: rocrate_validator.requirements.python.PyRequirement
140140
:members:
141141

docs/1_installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
..
2-
Copyright (c) 2024 CRS4
2+
Copyright (c) 2024-2026 CRS4
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

docs/2_usage_cli.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
..
2-
Copyright (c) 2024 CRS4
2+
Copyright (c) 2024-2026 CRS4
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -31,3 +31,9 @@ CLI Validation
3131
:parser: myst_parser.sphinx_
3232
:start-line: 93
3333
:end-line: 120
34+
35+
.. seealso::
36+
37+
To validate without network access and manage the HTTP cache from the
38+
command line (the ``--offline`` and ``--no-cache`` flags and the ``cache``
39+
subcommand), see :ref:`offline_mode`.

docs/3_usage_api.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
..
2-
Copyright (c) 2024 CRS4
2+
Copyright (c) 2024-2026 CRS4
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -30,6 +30,12 @@ Programmatic Validation
3030
:start-line: 121
3131
:end-line: 162
3232

33+
.. seealso::
34+
35+
To resolve resources from a local cache or run validation without network
36+
access (the ``offline`` / ``no_cache`` settings of ``ValidationSettings``),
37+
see :ref:`offline_mode`.
38+
3339

3440
Metadata-only Validation
3541
------------------------

docs/4_how_it_works.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
..
2-
Copyright (c) 2024 CRS4
2+
Copyright (c) 2024-2026 CRS4
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

docs/5_offline_mode.rst

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
..
2+
Copyright (c) 2024-2026 CRS4
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
17+
.. _offline_mode:
18+
19+
Offline Mode and HTTP Caching
20+
=============================
21+
22+
To resolve remote resources — JSON-LD ``@context`` documents, profile artifacts
23+
and, optionally, remote RO-Crates — the validator performs HTTP requests. These
24+
requests go through a **persistent HTTP cache**, which makes validation faster
25+
and reproducible and enables an **offline mode** where requests are served
26+
exclusively from the cache.
27+
28+
This page covers how to use offline mode and manage the cache both from the
29+
:ref:`command line <offline_mode_cli>` and through the
30+
:ref:`Python API <offline_mode_api>`.
31+
32+
33+
How caching works
34+
-----------------
35+
36+
Every HTTP-backed resource fetched during validation is stored in a persistent
37+
cache (by default under the user cache directory, shared across runs). On the
38+
first online validation against a profile, the resources it declares are cached
39+
automatically, so a later run can reuse the same cache without any network
40+
access.
41+
42+
Offline mode (``--offline`` / ``offline=True``) forbids network access
43+
altogether: every request must be satisfied by the cache, otherwise the affected
44+
resource is reported as a cache miss. For this reason offline mode requires the
45+
cache to be enabled and cannot be combined with the cache-disabling options.
46+
47+
48+
.. _offline_mode_cli:
49+
50+
Command-line usage
51+
------------------
52+
53+
Offline validation
54+
~~~~~~~~~~~~~~~~~~~
55+
56+
Pass ``--offline`` to the ``validate`` command to forbid any network access:
57+
every HTTP request must then be satisfied by the cache.
58+
59+
.. code-block:: bash
60+
61+
rocrate-validator validate --offline path/to/ro-crate
62+
63+
Related options:
64+
65+
- ``--cache-path PATH`` — use a specific cache directory. By default a persistent
66+
directory under the user cache dir is used, so entries are shared across runs.
67+
- ``--cache-max-age SECONDS`` — maximum age of cached entries; ``-1`` (the
68+
default) means entries never expire.
69+
- ``--no-cache`` / ``-nc`` — disable the cache entirely: every request hits the
70+
network and nothing is persisted. This flag is **mutually exclusive** with
71+
``--offline``, since offline mode needs the cache to serve requests.
72+
73+
Managing the cache
74+
~~~~~~~~~~~~~~~~~~
75+
76+
The ``cache`` subcommand inspects and manages the HTTP cache:
77+
78+
.. code-block:: bash
79+
80+
# Show the cache location, backend, size and offline status
81+
rocrate-validator cache info
82+
83+
# List cached entries (alias: `ls`); filter, sort or emit JSON
84+
rocrate-validator cache list
85+
rocrate-validator cache list --url w3id.org --sort size
86+
rocrate-validator cache list --json
87+
88+
# Remove every cached entry
89+
rocrate-validator cache reset --yes
90+
91+
Pre-populating the cache (warm-up)
92+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93+
94+
Before going offline you can pre-fetch everything you will need with
95+
``cache warm``:
96+
97+
.. code-block:: bash
98+
99+
# Warm the resources declared by every installed profile
100+
rocrate-validator cache warm --all-profiles
101+
102+
# Warm only specific profiles
103+
rocrate-validator cache warm -p ro-crate-1.1 -p workflow-ro-crate-1.0
104+
105+
# Also fetch and cache remote RO-Crates or arbitrary URLs
106+
rocrate-validator cache warm --crate https://example.org/crate.zip
107+
rocrate-validator cache warm -u https://w3id.org/ro/crate/1.1/context
108+
109+
When invoked without any source option, ``cache warm`` defaults to warming all
110+
installed profiles. A summary table reports which URLs were cached, skipped or
111+
failed; the command exits with a non-zero status if any URL fails.
112+
113+
114+
.. _offline_mode_api:
115+
116+
Programmatic usage
117+
------------------
118+
119+
The same offline behaviour can be enabled programmatically through
120+
``ValidationSettings``:
121+
122+
.. code-block:: python
123+
124+
from rocrate_validator import services, models
125+
126+
settings = services.ValidationSettings(
127+
rocrate_uri='/path/to/ro-crate',
128+
profile_identifier='ro-crate-1.1',
129+
# Serve every HTTP request from the cache; uncached resources fail.
130+
offline=True,
131+
# Optional: use a dedicated cache directory (defaults to the user cache).
132+
# cache_path='/tmp/rocv-cache',
133+
# Optional: maximum age of cached entries; -1 (default) = never expire.
134+
# cache_max_age=-1,
135+
)
136+
137+
result = services.validate(settings)
138+
139+
The cache-related settings are:
140+
141+
- ``offline`` (``bool``, default ``False``) — when ``True``, HTTP requests are
142+
served only from the cache; uncached resources raise a cache-miss error.
143+
- ``no_cache`` (``bool``, default ``False``) — disable the cache entirely. It is
144+
**incompatible** with ``offline=True`` and raises ``ValueError`` if combined.
145+
- ``cache_path`` (``Path``, optional) — cache directory; defaults to the
146+
persistent user cache so online and offline runs share the same entries.
147+
- ``cache_max_age`` (``int``, optional) — maximum entry age in seconds; ``-1``
148+
means entries never expire.
149+
150+
When ``offline`` is ``False``, the resources declared by the selected profiles
151+
are warmed up automatically before validation, so that a later offline run
152+
reusing the same cache succeeds without network access. To pre-populate the cache
153+
explicitly (e.g. in a CI pipeline), use the ``rocrate-validator cache warm``
154+
command described in :ref:`offline_mode_cli`.

docs/ack.rst

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
..
2-
Copyright (c) 2024 CRS4
2+
Copyright (c) 2024-2026 CRS4
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -13,22 +13,11 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515

16-
.. _acknowledgements:
17-
18-
.. toctree::
19-
:maxdepth: 5
20-
:caption: Contents:
21-
2216
Acknowledgements
2317
================
2418

25-
This work has been partially funded by the following sources:
26-
27-
.. image:: https://raw.githubusercontent.com/crs4/rocrate-validator/develop/docs/img/eu-logo/EN_Co-fundedbytheEU_RGB_POS.png
28-
:alt: Co-funded by the EU
29-
:width: 250px
30-
:align: right
31-
32-
- the `BY-COVID <https://by-covid.org/>`_ project (HORIZON Europe grant agreement number 101046203);
33-
- the `LIFEMap <https://www.thelifemap.it/>`_ project, funded by the Italian Ministry of Health (Piano Operative Salute, Trajectory 3).
34-
19+
.. Body sourced from the README so it stays in sync with it (the README
20+
.. "## Acknowledgements" heading is skipped: the page title above replaces it).
21+
.. include:: ../README.md
22+
:parser: myst_parser.sphinx_
23+
:start-line: 182

docs/conf.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
# Set project metadata
3333
project = 'rocrate-validator'
34-
copyright = '2024, CRS4'
34+
copyright = '2024-2026, CRS4'
3535
author = 'Marco Enrico Piras, Luca Pireddu, Simone Leo'
3636
release = __version__
3737

@@ -68,6 +68,20 @@
6868
'sphinx_copybutton',
6969
]
7070

71+
# Only auto-generate section labels for the top two heading levels: deeper
72+
# subsections (e.g. the repeated "SHACL checks" / "Python checks" headings)
73+
# would otherwise produce duplicate-label warnings within the same document.
74+
autosectionlabel_maxdepth = 2
75+
76+
# Warnings raised while embedding the Markdown README into the Sphinx pages.
77+
# The README is the canonical GitHub document: its slices intentionally start
78+
# below H1 (myst.header) and use GitHub-relative anchor links that span pages
79+
# (myst.xref_missing). These are expected when including it here.
80+
suppress_warnings = [
81+
'myst.header',
82+
'myst.xref_missing',
83+
]
84+
7185
templates_path = ['_templates']
7286
# exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'experiments', 'ontologies', 'tests', 'logs', 'examples', 'debug']
7387
# List of patterns, relative to source directory, that match files and

0 commit comments

Comments
 (0)