Skip to content

Five safes on upstream develop#126

Open
EttoreM wants to merge 5 commits into
upstream-developfrom
five-safes-on-upstream-develop
Open

Five safes on upstream develop#126
EttoreM wants to merge 5 commits into
upstream-developfrom
five-safes-on-upstream-develop

Conversation

@EttoreM

@EttoreM EttoreM commented Jul 2, 2026

Copy link
Copy Markdown

Closes #112


Five Safes Crate on Upstream RO-Crate 1.2

Goal

The goal of the issue that this PR addresses is checking whether the Five Safes Crate profile, fixtures, and tests from this repository still work when placed on top of the upstream crs4/rocrate-validator develop branch, where the RO-Crate base profile has moved to RO-Crate 1.2.

Steps Taken

1. Created a branch from upstream develop

A new local branch was created from crs4/rocrate-validator/develop:

git remote add upstream-a https://github.com/crs4/rocrate-validator.git
git fetch upstream-a
git switch -c five-safes-on-upstream-develop upstream-a/develop

This made the upstream project the base of the work. This approach was deemed to be more suitable than backporting upstream RO-Crate 1.2 changes into the child repository.

2. Imported Five Safes Crate material

The Five Safes Crate material was copied from this repository's develop branch into the new upstream-based branch:

  • rocrate_validator/profiles/five-safes-crate/
  • tests/integration/profiles/five-safes-crate/
  • tests/data/crates/valid/five-safes-crate-request/
  • tests/data/crates/valid/five-safes-crate-result/
  • tests/data/crates/valid/five-safes-crate-multiple-context/
  • tests/data/crates/valid/five-safes-profile-crate/
  • tests/data/crates/invalid/five_safes_crate/

3. Added Five Safes fixture helpers

tests/ro_crates.py was updated with helpers for the imported Five Safes fixtures.

It also adds Invalid5sROC for the invalid Five Safes context-version fixtures.

4. Restored Five Safes SPARQL prefixes

tests/shared.py was updated so SPARQL-based fixture mutation tests could use the necessary prefixes (shp:, rdf:, rocrate:, and dct:, in addition to schema:).

The rocrate: prefix was set to the upstream RO-Crate 1.2 internal namespace:

https://github.com/crs4/rocrate-validator/profiles/ro-crate-1.2/

5. Updated Five Safes to inherit RO-Crate 1.2

The Five Safes profile was updated from:

prof:isTransitiveProfileOf <https://w3id.org/ro/crate/1.1> ;

to:

prof:isTransitiveProfileOf <https://w3id.org/ro/crate/1.2> ;

This makes the Five Safes profile inherit the upstream RO-Crate 1.2 checks.

6. Updated internal RO-Crate shape namespace references

The imported Five Safes SHACL files referred to the old internal RO-Crate namespace:

https://github.com/crs4/rocrate-validator/profiles/ro-crate/

Those references were updated to the upstream RO-Crate 1.2 namespace:

https://github.com/crs4/rocrate-validator/profiles/ro-crate-1.2/

This was needed because upstream RO-Crate 1.2 marks internal inferred classes, such as RootDataEntity, under the ro-crate-1.2 namespace.

7. Updated one valid fixture for RO-Crate 1.2

The result fixture contains a SoftwareApplication entity:

"@id": "https://tre72.example.com/#crate-validator"

RO-Crate 1.2 requires SoftwareApplication entities to have name, url, and version. The fixture already had name, so url and version were added.

Tests Run

Positive tests:

poetry run pytest tests/integration/profiles/five-safes-crate/test_valid_5src.py -q -n 0

Result:

4 passed, 1 xfailed

Full Five Safes Crate profile suite (including negative tests based on graph modifications:

poetry run pytest tests/integration/profiles/five-safes-crate -q -n 0

Result:

115 passed, 1 xfailed

The test output includes many rdflib and pyparsing deprecation warnings. These warnings were already present during successful runs and did not indicate validation failures.

@EttoreM EttoreM self-assigned this Jul 2, 2026
@EttoreM
EttoreM requested a review from elichad July 3, 2026 15:08
@elichad
elichad changed the base branch from develop to upstream-develop July 10, 2026 12:57
@elichad

elichad commented Jul 10, 2026

Copy link
Copy Markdown

@EttoreM this PR is so big it makes the GitHub interface really slow!

I have created #127 as an intermediate point (WIP while I merge it with our dev branch properly) - that brings in the updates from upstream, and then your updates to the profiles will sit in this PR and are easier to review in isolation.

@elichad elichad left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EttoreM your changes look good. I think a couple of checks are now obsolete with this update (see comments)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the profile is based on 1.2, we should be able to remove the 15_metadata_file checks altogether

Comment on lines 29 to 30
# required as disable_inherited_profiles_reporting does not disable Python checks from
# inherited profiles (https://github.com/crs4/rocrate-validator/issues/135)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this referenced issue has now been fixed, so this comment can be removed. I think we may as well keep the code the same though now we have it set up

[],
[],
profile_identifier=(
# ro-crate-1.1 can't be used for Five Safes crates as they conform to 1.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please keep this comment as it's still relevant for now. FYI I've raised crs4#187 upstream to see if it's time for DEFAULT_PROFILE_IDENTIFIER to be updated to 1.2

Comment thread tests/shared.py
PREFIX shp: <https://w3id.org/shp#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rocrate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/>
PREFIX rocrate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate-1.2/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't think we use this prefix in any of our tests, so suggest we remove it

Suggested change
PREFIX rocrate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate-1.2/>

@elichad

elichad commented Jul 14, 2026

Copy link
Copy Markdown

Clarifying the plan here as I'm not sure I was clear enough in the meeting:

it's fine to go ahead with all of this while I'm away!

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.

Review RO-Crate 1.2 spec from CRS

2 participants