Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,91 @@
@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#> .
@prefix shp: <https://w3id.org/shp#> .


#=== MUST shapes ===#

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 `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." ;
] .


#=== SHOULD shapes ===#

# There SHOULD be a Sign-Off Phase
five-safes-crate:SignOffPhase
a sh:NodeShape ;
sh:targetClass ro-crate:RootDataEntity ;
sh:description "Check the Sign-Off Phase" ;
sh:severity sh:Warning ;
sh:name "SignOffPhase" ;

sh:sparql [
sh:select """
PREFIX schema: <http://schema.org/>
Expand All @@ -39,7 +113,6 @@ five-safes-crate:SignOffPhase
}
}
""" ;
sh:severity sh:Warning ;
sh:message "There SHOULD be a Sign-Off Phase in the Final RO-Crate" ;
] ;
sh:sparql [
Expand All @@ -54,14 +127,14 @@ five-safes-crate:SignOffPhase
}
}
""" ;
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:name "SignOffPhaseProperties" ;
sh:target [
a sh:SPARQLTarget ;
sh:select """
Expand Down Expand Up @@ -103,7 +176,27 @@ five-safes-crate:SignOffPhaseProperties
sh:minCount 1 ;
sh:severity sh:Warning ;
sh:message "The Sign-Off Phase SHOULD have an TRE policy (instrument) with a human-readable name" ;
] .


five-safes-crate:SignOffPhaseProperties2
a sh:NodeShape ;
sh:description "Check Sign-Off Phase Properties" ;
sh:severity sh:Warning ;
sh:name "SignOffPhaseProperties" ;

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:sparql [
a sh:SPARQLConstraint ;
sh:description "Check if the Sign Off phase lists the workflow as an object" ;
Expand All @@ -120,9 +213,9 @@ five-safes-crate:SignOffPhaseProperties
}
}
""" ;
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" ;
Expand All @@ -139,14 +232,14 @@ five-safes-crate:SignOffPhaseProperties
}
}
""" ;
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:name "SignOffPhaseEndTime" ;

sh:target [
a sh:SPARQLTarget ;
Expand Down Expand Up @@ -175,3 +268,40 @@ five-safes-crate:SignOffPhaseEndTime
sh:description "Sign Off object SHOULD have endTime property if action completed or failed." ;
sh:message "Sign Off object SHOULD have endTime property if action completed or failed." ;
] .


#=== MAY shapes ===#

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." ;
sh:message "Sign Off object MAY have a startTime property if action is active, completed or failed." ;
] .
58 changes: 0 additions & 58 deletions rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl

This file was deleted.

89 changes: 0 additions & 89 deletions rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl

This file was deleted.

Loading