Bring in changes from upstream v0.11.2#127
Conversation
…ntifier properties of the Root Data Entity
…e 1.2 checkers - Reorder imports consistently (stdlib → third-party → local) - Extract helper methods (_resolve_cite_as_url, _not_downloadable_message, _needs_sddatepublished_check, _check_entity_local_path, _check_distribution) - Replace try/except/pass with contextlib.suppress - Flatten nested conditionals with combined guards - Use e!s over str(e) in f-strings - Normalize quote style and multi-line formatting
…-Crate 1.2 test suite
…t-ci-precommit ♻️ refactor: address code quality issues
feat(ro-crate-1.2): introduce validation profile for RO-Crate 1.2
- certifi (2026.5.20 -> 2026.6.17) - mistune (3.2.1 -> 3.3.2) - msgpack (1.2.0 -> 1.2.1) - coverage (7.14.1 -> 7.14.3) - prettytable (3.17.0 -> 3.18.0) - pytest (9.1.0 -> 9.1.1) - virtualenv (21.5.0 -> 21.5.1) - ruff (0.15.17 -> 0.15.19)
Add an abort mechanism to the validation framework so a check can stop the whole run when the metadata is unreadable (e.g. the file descriptor is not valid JSON), instead of letting later checks emit false positives.
…lidation Make the "File Descriptor JSON format" check (RO-Crate 1.1 and 1.2) catch JSONDecodeError explicitly: report a precise issue with the parse error message and line/column, then call context.abort_validation() so no metadata is read and downstream checks don't emit false positives.
…on-abort feat(validation): ✨ abort validation when the file descriptor is not valid JSON
Set `path_type=Path` on the `--output-file` click option so the value is parsed as a `pathlib.Path` instead of a plain string, ensuring consistent path handling.
fix(cli): 🐛 write validation report to --output-file (crs4#182)
a1b7b67 to
1c6b29e
Compare
| json.dump(rocrate, f) | ||
| if rocrate_entity_mod_sparql is not None: | ||
| rocrate_graph = load_graph_and_preserve_relative_ids(rocrate) | ||
| if _uses_https_schema(rocrate_graph): |
There was a problem hiding this comment.
code smell - don't think we expect to have https schema in crates at all
There was a problem hiding this comment.
This was introduced to mirror the fact that in the upstream RO-Crate 1.2 material there are explicit guards for both http://schema.org/ and https://schema.org/.
For example, in rocrate_validator/profiles/ro-crate/1.2/must/6_contextual_entity_metadata.ttl lines 65-66 we have:
FILTER(!STRSTARTS(STR(?this), "http://schema.org/"))
FILTER(!STRSTARTS(STR(?this), "https://schem
Similarly in rocrate_validator/profiles/ro-crate/1.2/should/0_entity_metadata.ttl lines 40-41.
It may be safe to remove the function but I'd rather keep it in order to maintain consistency on these guards across the codebase.
What do you think @elichad ?
|
Hi @elichad. Not sure what you mean by "edit: now merged with our develop & conflicts resolved" in the description of this PR, as the PR is still open and with the expected test fails. Is this PR ready to be merged, before we proceed with the fixes needed to integrate our five-safes work with the upstream changes? |
I meant that I have merged our develop branch into this PR.
I need to check that we only see test failures in our five-safes work before merging - in order to check this I'm going to briefly change the CI workflow so the tests don't depend on the linting. I'll change it back before merging. |
|
I am pleasantly surprised to see all the tests passing (except linting) - looks like all the upstream refactoring doesn't have a major impact on us. I'll revert my CI changes and then I think we're good to merge this PR (and live with the CI failing until #126 is done). |
This reverts commit d559ade.
This PR has just the upstream changes; expecting to see test failures & merge conflicts
edit: now merged with our develop & conflicts resolved