forked from crs4/rocrate-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
32 sign off phase checks 5s rocrate #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
0055318
test for sign-off phase existence
douglowe 2b1044c
tidy up shacl code layout
douglowe 3e53927
add severity for signoffphase check
douglowe 08d3e89
signoff existence check gets correct shape and we target main data en…
douglowe 450153b
test for mentioning sign-off phase
douglowe 2aa359d
test for endTime in SignOff object
douglowe 4601e94
test for actionStatus for SignOff phase
douglowe 6638185
add check for signoff agent
douglowe e877b80
sign-off instrument check
douglowe bee8fc3
tests for TRE policy instrument
douglowe 90b9c7a
test for sign-off phase name
douglowe f9324eb
clean up sign-off instrument check
douglowe bfb981c
5-safes crate, workflow object in sign-off phase
douglowe 7eb107b
signoff name and type are now must requirements, with tests
douglowe fd7fada
signoff phase must have valid action status
douglowe 58668bb
correct expected error message for sign off instrument test
douglowe 0c7b366
source organisation test for 5 safes signoff phase
douglowe cbc1778
use only shp:SignOff to ID sign off actions
douglowe 995edb9
test for RootDataEntity as well as sourceOrganization
douglowe 643646b
tests for start and end time for SignOff phase
douglowe d8e747e
removed unneeded code from workflow object tests
douglowe 3d6e14c
rename file to follow convention
elichad 73df452
update timestamp regex; add iri check for signoff phase instrument
elichad efa366a
linting
elichad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Copyright (c) 2025 eScience Lab, The University of Manchester | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| @prefix ro: <./> . | ||
| @prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> . | ||
| @prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> . | ||
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
| @prefix schema: <http://schema.org/> . | ||
| @prefix sh: <http://www.w3.org/ns/shacl#> . | ||
| @prefix validator: <https://github.com/crs4/rocrate-validator/> . | ||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
| @prefix shp: <https://w3id.org/shp#> . | ||
|
|
||
|
|
||
| five-safes-crate:SignOffPhaseStartTime | ||
| a sh:NodeShape ; | ||
| sh:name "SignOffPhaseStartTime" ; | ||
|
|
||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX shp: <https://w3id.org/shp#> | ||
| SELECT ?this | ||
| WHERE { | ||
| ?this schema:additionalType shp:SignOff ; | ||
| schema:actionStatus ?status . | ||
| FILTER(?status IN ( | ||
| "http://schema.org/ActiveActionStatus", | ||
| "http://schema.org/CompletedActionStatus", | ||
| "http://schema.org/FailedActionStatus" | ||
| )) | ||
| } | ||
| """ ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "StartTime" ; | ||
| sh:path schema:startTime ; | ||
| sh:minCount 1 ; | ||
| sh:maxCount 1 ; | ||
| sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}[Tt][0-9]{2}:[0-9]{2}:[0-9]{2}([.|,][0-9]+)?(Z|z|[+-][0-9]{2}:[0-9]{2})$" ; | ||
| sh:severity sh:Info ; | ||
| sh:description "Sign Off object MAY have a startTime property if action is active, completed or failed. This must follow ISO-8601 syntax" ; | ||
| sh:message "Sign Off object MAY have a startTime property if action is active, completed or failed. This must follow ISO-8601 syntax" ; | ||
| ] . |
89 changes: 89 additions & 0 deletions
89
rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Copyright (c) 2025 eScience Lab, The University of Manchester | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| @prefix ro: <./> . | ||
| @prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> . | ||
| @prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> . | ||
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
| @prefix schema: <http://schema.org/> . | ||
| @prefix purl: <http://purl.org/dc/terms/> . | ||
| @prefix sh: <http://www.w3.org/ns/shacl#> . | ||
| @prefix validator: <https://github.com/crs4/rocrate-validator/> . | ||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
|
||
| five-safes-crate:SignOffObjectActionAndName | ||
| a sh:NodeShape ; | ||
| sh:name "SignOff" ; | ||
| sh:description "Sign Off phase" ; | ||
|
|
||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX shp: <https://w3id.org/shp#> | ||
| SELECT ?this | ||
| WHERE { | ||
| ?this schema:additionalType shp:SignOff . | ||
| } | ||
| """ ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| sh:path schema:name ; | ||
| sh:datatype xsd:string ; | ||
| sh:minCount 1 ; | ||
| sh:severity sh:Violation ; | ||
| sh:message "Sign Off phase MUST have a human-readable name string." ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| sh:path rdf:type ; | ||
| sh:minCount 1 ; | ||
| sh:hasValue schema:AssessAction; | ||
| sh:severity sh:Violation ; | ||
douglowe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| sh:message "Sign Off phase MUST be a `schema:AssessAction`." ; | ||
elichad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ] . | ||
|
|
||
| five-safes-crate:SignOffObjectHasActionStatus | ||
| a sh:NodeShape ; | ||
| sh:name "SignOffStatus" ; | ||
| sh:description "Sign Off Phase Action Status" ; | ||
|
|
||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX shp: <https://w3id.org/shp#> | ||
| SELECT ?this | ||
| WHERE { | ||
| ?this schema:additionalType shp:SignOff ; | ||
| schema:actionStatus ?status . | ||
| } | ||
| """ ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "actionStatus" ; | ||
| sh:description "The value of actionStatus MUST be one of the allowed values." ; | ||
| sh:path schema:actionStatus ; | ||
| sh:in ( | ||
| "http://schema.org/PotentialActionStatus" | ||
| "http://schema.org/ActiveActionStatus" | ||
| "http://schema.org/CompletedActionStatus" | ||
| "http://schema.org/FailedActionStatus" | ||
| ) ; | ||
| sh:severity sh:Violation ; | ||
| sh:message "The value of actionStatus MUST be one of the allowed values: PotentialActionStatus; ActiveActionStatus; CompletedActionStatus; FailedActionStatus." ; | ||
| ] . | ||
178 changes: 178 additions & 0 deletions
178
rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,178 @@ | ||
| # Copyright (c) 2025 eScience Lab, The University of Manchester | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| @prefix ro: <./> . | ||
| @prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> . | ||
| @prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> . | ||
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
| @prefix schema: <http://schema.org/> . | ||
| @prefix sh: <http://www.w3.org/ns/shacl#> . | ||
| @prefix validator: <https://github.com/crs4/rocrate-validator/> . | ||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
| @prefix shp: <https://w3id.org/shp#> . | ||
|
|
||
|
|
||
| # There SHOULD be a Sign-Off Phase | ||
| five-safes-crate:SignOffPhase | ||
| a sh:NodeShape ; | ||
| sh:targetNode <./> ; | ||
| sh:description "Check the Sign-Off Phase" ; | ||
| sh:sparql [ | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX shp: <https://w3id.org/shp#> | ||
| SELECT $this | ||
| WHERE { | ||
| FILTER NOT EXISTS { | ||
| ?action schema:additionalType shp:SignOff . | ||
| } | ||
| } | ||
| """ ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "There SHOULD be a Sign-Off Phase in the Final RO-Crate" ; | ||
| ] ; | ||
| sh:sparql [ | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX shp: <https://w3id.org/shp#> | ||
| SELECT $this | ||
| WHERE { | ||
| ?action schema:additionalType shp:SignOff . | ||
| FILTER NOT EXISTS { | ||
| $this schema:mentions ?action . | ||
| } | ||
| } | ||
| """ ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "The Root Data Entity SHOULD mention a Sign-Off Phase Object" ; | ||
| ] . | ||
|
|
||
|
|
||
| five-safes-crate:SignOffPhaseProperties | ||
| a sh:NodeShape ; | ||
| sh:description "Check Sign-Off Phase Properties" ; | ||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX shp: <https://w3id.org/shp#> | ||
| SELECT ?this | ||
| WHERE { | ||
| ?this schema:additionalType shp:SignOff . | ||
| } | ||
| """ | ||
| ] ; | ||
| sh:property [ | ||
| sh:description "Check if the Sign Off phase has an actionStatus" ; | ||
| sh:path schema:actionStatus ; | ||
| sh:minCount 1 ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "The Sign-Off Phase SHOULD have an actionStatus" ; | ||
| ] ; | ||
| sh:property [ | ||
| sh:description "Check if the Sign Off phase has an agent" ; | ||
| sh:path schema:agent ; | ||
| sh:minCount 1 ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "The Sign-Off Phase SHOULD have an agent" ; | ||
| ] ; | ||
| sh:property [ | ||
| sh:description "Check if the Sign Off phase has an instrument (TRE Policy)" ; | ||
| sh:path schema:instrument ; | ||
| sh:class schema:CreativeWork ; | ||
| sh:nodeKind sh:IRI; | ||
| sh:minCount 1 ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "The Sign-Off Phase SHOULD have an TRE policy (instrument) with type CreativeWork" ; | ||
| ] ; | ||
| sh:property [ | ||
| sh:description "Check if the Sign Off phase has an instrument (TRE Policy)" ; | ||
| sh:path ( schema:instrument schema:name ) ; | ||
| sh:datatype xsd:string ; | ||
| sh:minCount 1 ; | ||
douglowe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| sh:severity sh:Warning ; | ||
| sh:message "The Sign-Off Phase SHOULD have an TRE policy (instrument) with a human-readable name" ; | ||
| ] ; | ||
| sh:sparql [ | ||
| a sh:SPARQLConstraint ; | ||
| sh:description "Check if the Sign Off phase lists the workflow as an object" ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX rocrate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> | ||
| SELECT $this | ||
| WHERE { | ||
| ?root a schema:Dataset ; | ||
| schema:mainEntity ?mainEntity ; | ||
| rdf:type rocrate:RootDataEntity . | ||
| FILTER NOT EXISTS { | ||
| $this schema:object ?mainEntity . | ||
| } | ||
| } | ||
| """ ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "The Sign-Off Phase SHOULD list the workflow (mainEntity) as an object" ; | ||
| ]; | ||
| sh:sparql [ | ||
| a sh:SPARQLConstraint ; | ||
| sh:description "Check if the Sign Off phase lists the Responsible Project as an object" ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX rocrate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> | ||
| SELECT $this | ||
| WHERE { | ||
| ?root a schema:Dataset ; | ||
| rdf:type rocrate:RootDataEntity ; | ||
| schema:sourceOrganization ?sourceOrg . | ||
douglowe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| FILTER NOT EXISTS { | ||
| $this schema:object ?sourceOrg . | ||
| } | ||
| } | ||
| """ ; | ||
| sh:severity sh:Warning ; | ||
| sh:message "The Sign-Off Phase SHOULD list the Responsible Project (sourceOrganization) as an object" ; | ||
| ]. | ||
|
|
||
|
|
||
| five-safes-crate:SignOffPhaseEndTime | ||
| a sh:NodeShape ; | ||
| sh:description "Sign Off end time check" ; | ||
|
|
||
| sh:target [ | ||
| a sh:SPARQLTarget ; | ||
| sh:select """ | ||
| PREFIX schema: <http://schema.org/> | ||
| PREFIX shp: <https://w3id.org/shp#> | ||
| SELECT ?this | ||
| WHERE { | ||
| ?this schema:additionalType shp:SignOff ; | ||
| schema:actionStatus ?status . | ||
| FILTER(?status IN ( | ||
| "http://schema.org/CompletedActionStatus", | ||
| "http://schema.org/FailedActionStatus" | ||
| )) | ||
| } | ||
| """ ; | ||
| ] ; | ||
|
|
||
| sh:property [ | ||
| a sh:PropertyShape ; | ||
| sh:name "EndTime" ; | ||
| sh:path schema:endTime ; | ||
| sh:minCount 1 ; | ||
| sh:maxCount 1 ; | ||
| sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}[Tt][0-9]{2}:[0-9]{2}:[0-9]{2}([.|,][0-9]+)?(Z|z|[+-][0-9]{2}:[0-9]{2})$" ; | ||
| sh:severity sh:Warning ; | ||
| sh:description "Sign Off object SHOULD have endTime property if action completed or failed. This must follow ISO-8601 syntax" ; | ||
| sh:message "Sign Off object SHOULD have endTime property if action completed or failed. This must follow ISO-8601 syntax" ; | ||
| ] . | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.