Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
@@ -0,0 +1,135 @@
# 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:WorkflowMustHaveDescriptiveName
a sh:NodeShape ;
sh:name "WorkflowExecution" ;
sh:targetClass schema:CreateAction ;

sh:property [
sh:a sh:PropertyShape ;
sh:name "name" ;
sh:minCount 1 ;
sh:description "Workflow (CreateAction) MUST have a name string of at least 20 characters." ;
sh:path schema:name ;
sh:datatype xsd:string ;
sh:minLength 20 ;
Comment thread
elichad marked this conversation as resolved.
Outdated
sh:severity sh:Violation ;
sh:message "Workflow (CreateAction) MUST have a name string of at least 20 characters." ;
] .


five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun
Comment thread
EttoreM marked this conversation as resolved.
Outdated
a sh:NodeShape ;
sh:name "WorkflowExecution" ;
sh:description "The workflow execution object MUST have a startTime property with a valid datetime if it has begun." ;

sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?this
WHERE {
?this rdf:type schema:CreateAction ;
schema:actionStatus ?status .
FILTER(?status IN (
"http://schema.org/CompletedActionStatus",
"http://schema.org/FailedActionStatus",
"http://schema.org/ActiveActionStatus"
))
}
""" ;
] ;

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}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$" ;
sh:severity sh:Violation ;
Comment thread
elichad marked this conversation as resolved.
sh:description "The workflow execution object MUST have a startTime property with a valid datetime if it has begun." ;
sh:message "The workflow execution object MUST have a startTime property with a valid datetime if it has begun." ;
Comment thread
elichad marked this conversation as resolved.
Outdated
] .


five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded
a sh:NodeShape ;
sh:name "WorkflowExecution" ;
sh:description "The workflow execution object MUST have the endTime property with a valid datetime if it has ended." ;

sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?this
WHERE {
?this rdf:type schema:CreateAction ;
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}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$" ;
sh:severity sh:Violation ;
Comment thread
elichad marked this conversation as resolved.
sh:description "The workflow execution object MUST have the endTime property with a valid datetime if it has ended." ;
sh:message "The workflow execution object MUST have the endTime property with a valid datetime if it has ended." ;
] .


five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues
a sh:NodeShape ;
sh:name "WorkflowExecution" ;
sh:targetClass schema:CreateAction ;
sh:property [
a sh:PropertyShape ;
sh:minCount 1 ;
sh:name "actionStatus" ;
sh:description "WorkflowExecution MUST have an actionStatus with an allowed value." ;
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 "WorkflowExecution MUST have an actionStatus with an allowed value." ;
Comment thread
EttoreM marked this conversation as resolved.
Outdated
] .
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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:RootDataEntityShouldMentionWorkflow
a sh:NodeShape ;
sh:name "RootDataEntity" ;
sh:description "The RootDataEntity SHOULD mention a workflow execution object typed as CreateAction." ;
Comment thread
elichad marked this conversation as resolved.
Outdated
sh:targetClass ro-crate:RootDataEntity ;
sh:sparql [
a sh:SPARQLConstraint ;
sh:name "mentions" ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT $this
WHERE {

FILTER NOT EXISTS {
$this schema:mentions ?workflowExecution .
?workflowExecution rdf:type schema:CreateAction .
}
}
""" ;
sh:severity sh:Warning ;
sh:message "RootDataEntity SHOULD mention workflow execution object (typed CreateAction)." ;
] .
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@
{
"@id": "#query-37252371-c937-43bd-a0a7-3680b48c0538",
"@type": "CreateAction",
"actionStatus": "http://schema.org/CompleteActionStatus",
"startTime": "2023-04-18T12:12:00+01:00",
"endTime": "2023-04-19T16:59:59+01:00",
"actionStatus": "http://schema.org/CompletedActionStatus",
"agent": {
"@id": "https://orcid.org/0000-0001-9842-9718"
},
Expand Down Expand Up @@ -160,7 +162,7 @@
"@type": "PropertyValue",
"name": "tre72",
"value": "project81"
},
},
{
"@id": "input1.txt",
"@type": "File",
Expand Down Expand Up @@ -303,6 +305,7 @@
"@id": "https://w3id.org/shp#DisclosureCheck"
},
"name": "Disclosure check of workflow results: approved",
"startTime": "2023-04-24T00:00:00+01:00",
"endTime": "2023-04-25T16:00:00+01:00",
"object": {
"@id": "./"
Expand Down
Loading