Skip to content
Merged
Show file tree
Hide file tree
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 Nov 10, 2025
2b1044c
tidy up shacl code layout
douglowe Nov 14, 2025
3e53927
add severity for signoffphase check
douglowe Nov 14, 2025
08d3e89
signoff existence check gets correct shape and we target main data en…
douglowe Nov 14, 2025
450153b
test for mentioning sign-off phase
douglowe Nov 14, 2025
2aa359d
test for endTime in SignOff object
douglowe Nov 14, 2025
4601e94
test for actionStatus for SignOff phase
douglowe Nov 14, 2025
6638185
add check for signoff agent
douglowe Nov 17, 2025
e877b80
sign-off instrument check
douglowe Nov 17, 2025
bee8fc3
tests for TRE policy instrument
douglowe Nov 17, 2025
90b9c7a
test for sign-off phase name
douglowe Nov 17, 2025
f9324eb
clean up sign-off instrument check
douglowe Nov 17, 2025
bfb981c
5-safes crate, workflow object in sign-off phase
douglowe Nov 20, 2025
7eb107b
signoff name and type are now must requirements, with tests
douglowe Nov 24, 2025
fd7fada
signoff phase must have valid action status
douglowe Nov 24, 2025
58668bb
correct expected error message for sign off instrument test
douglowe Nov 24, 2025
0c7b366
source organisation test for 5 safes signoff phase
douglowe Nov 24, 2025
cbc1778
use only shp:SignOff to ID sign off actions
douglowe Dec 1, 2025
995edb9
test for RootDataEntity as well as sourceOrganization
douglowe Dec 1, 2025
643646b
tests for start and end time for SignOff phase
douglowe Dec 2, 2025
d8e747e
removed unneeded code from workflow object tests
douglowe Dec 6, 2025
3d6e14c
rename file to follow convention
elichad Dec 10, 2025
73df452
update timestamp regex; add iri check for signoff phase instrument
elichad Dec 10, 2025
efa366a
linting
elichad Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl
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 rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl
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 ;
sh:message "Sign Off phase MUST be a `schema:AssessAction`." ;
] .

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 rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
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 ;
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 .
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" ;
] .
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
},
"name": "Sign-off of execution according to Agreement policy: approved",
"endTime": "2023-04-19T17:15:12+01:00",
"startTime": "2023-04-19T10:15:12+01:00",
"object": [
{
"@id": "./"
Expand Down
Loading