Skip to content

Merge updates from upstream#113

Merged
elichad merged 100 commits into
eScienceLab:developfrom
crs4:develop
Jun 17, 2026
Merged

Merge updates from upstream#113
elichad merged 100 commits into
eScienceLab:developfrom
crs4:develop

Conversation

@elichad

@elichad elichad commented Jun 17, 2026

Copy link
Copy Markdown

No description provided.

kikkomep added 30 commits April 23, 2026 11:28
Extend HttpRequester with `offline` and `no_cache` options, plus
fetch_fresh/has_cached/clear_cache/cache_info/reset helpers. Add an
OfflineCacheMissError and an _OfflineFallbackSession that yields a 504
when requests_cache is unavailable, mirroring the only-if-cached
behavior. Emit standardized `CachedHttpRequester:` log lines describing
each request's cache outcome.
Introduce `get_user_cache_dir()` (honoring `XDG_CACHE_HOME`,
falling back to `~/.cache/rocrate-validator`) and `get_default_http_cache_path()`,
plus the `USER_CACHE_DIR_NAME` / `USER_CACHE_FILE_NAME` constants, so the HTTP cache
can be located under a stable, user-level directory instead of the previous `/tmp` prefix.
Cover the offline/no-cache flags, fetch_fresh, has_cached, clear_cache,
cache_info, reset and the _OfflineFallbackSession 504 behavior, plus
the standardized cache-outcome log messages.
Introduce `cache_warmup` helpers that discover external artifacts declared
by profile descriptors via `prof:hasResource`/`prof:hasArtifact` and
prefetch them so subsequent offline runs resolve every required resource
from the local HTTP cache. Add the `ROCRATE_VALIDATOR_AUTO_WARM`
environment variable to toggle automatic warm-up.
Introduce `install_document_loader()` that patches rdflib's
`source_to_json` so remote `@context` resolution goes through
HttpRequester, benefiting from the HTTP cache and honoring offline mode
(raising OfflineCacheMissError on offline cache misses). The install
is idempotent and reversible via `uninstall_document_loader()` for tests.
Expose `offline` and `no_cache` flags on ValidationSettings and default
`cache_path` to the persistent user HTTP cache so consecutive online/
offline runs share the same store.
Validate that `offline` and `no_cache` are mutually exclusive.
Install the JSON-LD document loader so rdflib's remote `@context`
resolution goes through the cache.
Introduce `rocrate-validator cache` with `info`, `reset` and `warm`
subcommands to inspect, clear and pre-populate the persistent HTTP
cache used by offline validation. `warm` discovers cacheable URLs from
profile descriptors and can also prefetch remote RO-Crates.
Redirect XDG_CACHE_HOME to a session-scoped tmp dir so tests never touch the
developer's real ~/.cache, and default ROCRATE_VALIDATOR_AUTO_WARM=0 per test
to prevent unintended network calls. Tests that need warm-up opt in explicitly.
When a NodeShape lives in the profile root and does not declare sh:severity,
fall back to the most severe level among its PropertyShapes instead of
defaulting to REQUIRED. Also corrects the return type annotation of
__compute_requirement_level__ from LevelCollection to RequirementLevel.
`ValidationResult.failed_requirements` and `failed_checks` now consider only
issues whose severity is at least the configured `requirement_severity`,
matching the behavior already documented for the validation context.
Previously every recorded issue was returned, regardless of the threshold.
Skip sh:ValidationResult nodes whose check severity is below the requested
`requirement_severity` while iterating pyshacl results, so they never become
Issues. This makes every consumer of `ValidationResult._issues` consistent
with the threshold (not just `failed_requirements`/`failed_checks`) and
avoids materializing non-actionable violations.
fix(validate): resolve profiles from --extra-profiles-path during validation
Rebuild `ShapesList.get_shape_property_graph` to include only triples
reachable from the target property shape (constraints and RDF lists used
by sh:and/sh:or/sh:xone) plus the `sh:property` link triple, instead of
subtracting sibling properties from the node-shape graph. The previous
subtractive approach could leak shared blank nodes and risked breaking
sibling constructs in the merged shapes graph.
kikkomep added 27 commits May 19, 2026 17:38
feat(cli): show requirement check via `describe profile`
feat(core): support offline validation and HTTP cache management
fix: support non-HTTP URI schemes for (Web)Data Entities (#176)
- 🚀 crate-ci/typos: v1.41.0 → v1.47.0
- 📦 actions/upload-artifact: v4 → v7
- 📥 actions/download-artifact: v4 → v8
- 🖊️ sigstore/gh-action-sigstore-python: v3.0.0 → v3.3.0
fix(http): reconfigure HttpRequester singleton in place instead of resetting it
@elichad

elichad commented Jun 17, 2026

Copy link
Copy Markdown
Author

Skimmed the changes and there's nothing that touches files that we have changed, so no conflicts. And all tests pass! So I will go ahead and merge

@elichad elichad merged commit fcd6ff1 into eScienceLab:develop Jun 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants