From c06c93f382e38985f8a1967fef8412143d16818b Mon Sep 17 00:00:00 2001 From: EttoreM Date: Sun, 25 Jan 2026 09:02:43 +0000 Subject: [PATCH 1/2] Merged 11_workflow_execution_phase.tll files. --- .../11_workflow_execution_phase.ttl | 170 ++++++++++++++++++ .../may/11_workflow_execution_phase.ttl | 64 ------- .../must/11_workflow_execution_phase.ttl | 62 ------- .../should/11_workflow_execution_phase.ttl | 58 ------ 4 files changed, 170 insertions(+), 184 deletions(-) create mode 100644 rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/may/11_workflow_execution_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl diff --git a/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl b/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl new file mode 100644 index 000000000..78b826dfa --- /dev/null +++ b/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl @@ -0,0 +1,170 @@ +# 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: . +@prefix five-safes-crate: . +@prefix rdf: . +@prefix schema: . +@prefix purl: . +@prefix sh: . +@prefix validator: . +@prefix xsd: . + + +#=== MUST shapes ===# + +five-safes-crate:WorkflowMustHaveDescriptiveName + a sh:NodeShape ; + sh:name "WorkflowExecution" ; + sh:targetClass ro-crate:WorkflowRunAction ; + + sh:property [ + a sh:PropertyShape ; + sh:name "name" ; + sh:minCount 1 ; + sh:description "The `CreateAction` corresponding to the workflow run MUST have a name string of at least 10 characters." ; + sh:path schema:name ; + sh:datatype xsd:string ; + sh:minLength 10 ; + sh:severity sh:Violation ; + sh:message "The `CreateAction` corresponding to the workflow run MUST have a name string of at least 10 characters." ; + ] . + + +five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues + a sh:NodeShape ; + sh:name "WorkflowExecution" ; + sh:targetClass ro-crate:WorkflowRunAction ; + sh:property [ + a sh:PropertyShape ; + sh:minCount 1 ; + sh:name "actionStatus" ; + sh:description "`CreateAction` MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; + 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 "`CreateAction` MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; + ] . + + +#=== SHOULD shapes ===# + +five-safes-crate:RootDataEntityShouldMentionWorkflow + a sh:NodeShape ; + sh:name "RootDataEntity" ; + sh:description "RootDataEntity SHOULD mention workflow execution object (typed WorkflowRunAction)." ; + sh:targetClass ro-crate:RootDataEntity ; + sh:severity sh:Warning ; + + sh:sparql [ + a sh:SPARQLConstraint ; + sh:name "mentions" ; + sh:select """ + PREFIX schema: + PREFIX rocrate: + SELECT $this + WHERE { + FILTER NOT EXISTS { + $this schema:mentions ?workflowExecution . + ?workflowExecution a rocrate:WorkflowRunAction . + } + } + """ ; + sh:message "RootDataEntity SHOULD mention workflow execution object (typed WorkflowRunAction)." ; + ] . + + +five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded + a sh:NodeShape ; + sh:name "WorkflowExecution" ; + sh:description "The workflow run object SHOULD have an endTime property if it has ended." ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX rocrate: + + SELECT ?this + WHERE { + ?this a rocrate:WorkflowRunAction ; + 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:severity sh:Warning ; + sh:description "The workflow execution object SHOULD have an endTime property if it has ended." ; + sh:message "The workflow execution object SHOULD have an endTime property if it has ended." ; + ] . + + +#=== MAY shapes ===# + +five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun + a sh:NodeShape ; + sh:name "WorkflowExecution" ; + sh:description ( + "The workflow execution object MAY have a startTime if actionStatus is " + "either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." + ) ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX rocrate: + + SELECT ?this + WHERE { + ?this a rocrate:WorkflowRunAction ; + 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:severity sh:Info ; + sh:description ( + "The workflow execution object MAY have a startTime if actionStatus is " + "either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." + ) ; + sh:message "The workflow execution object MAY have a startTime if actionStatus is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; + ] . diff --git a/rocrate_validator/profiles/five-safes-crate/may/11_workflow_execution_phase.ttl b/rocrate_validator/profiles/five-safes-crate/may/11_workflow_execution_phase.ttl deleted file mode 100644 index 1b777c835..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/11_workflow_execution_phase.ttl +++ /dev/null @@ -1,64 +0,0 @@ -# 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: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun - a sh:NodeShape ; - sh:name "WorkflowExecution" ; - sh:description ( - "The workflow execution object MAY have a startTime if actionStatus is " - "either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." - ) ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX rocrate: - - SELECT ?this - WHERE { - ?this a rocrate:WorkflowRunAction ; - 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:severity sh:Info ; - sh:description ( - "The workflow execution object MAY have a startTime if actionStatus is " - "either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." - ) ; - sh:message "The workflow execution object MAY have a startTime if actionStatus is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl b/rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl deleted file mode 100644 index f1c33bdff..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl +++ /dev/null @@ -1,62 +0,0 @@ -# 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: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix purl: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:WorkflowMustHaveDescriptiveName - a sh:NodeShape ; - sh:name "WorkflowExecution" ; - sh:targetClass ro-crate:WorkflowRunAction ; - - sh:property [ - a sh:PropertyShape ; - sh:name "name" ; - sh:minCount 1 ; - sh:description "The `CreateAction` corresponding to the workflow run MUST have a name string of at least 10 characters." ; - sh:path schema:name ; - sh:datatype xsd:string ; - sh:minLength 10 ; - sh:severity sh:Violation ; - sh:message "The `CreateAction` corresponding to the workflow run MUST have a name string of at least 10 characters." ; - ] . - - -five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues - a sh:NodeShape ; - sh:name "WorkflowExecution" ; - sh:targetClass ro-crate:WorkflowRunAction ; - sh:property [ - a sh:PropertyShape ; - sh:minCount 1 ; - sh:name "actionStatus" ; - sh:description "`CreateAction` MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; - 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 "`CreateAction` MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl b/rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl deleted file mode 100644 index f2061b5b9..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl +++ /dev/null @@ -1,58 +0,0 @@ -# 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: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix purl: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded - a sh:NodeShape ; - sh:name "WorkflowExecution" ; - sh:description "The workflow run object SHOULD have an endTime property if it has ended." ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX rocrate: - - SELECT ?this - WHERE { - ?this a rocrate:WorkflowRunAction ; - 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:severity sh:Warning ; - sh:description "The workflow execution object SHOULD have an endTime property if it has ended." ; - sh:message "The workflow execution object SHOULD have an endTime property if it has ended." ; - ] . From 725ed5005ecc018dda87305735ab72f311c78a22 Mon Sep 17 00:00:00 2001 From: EttoreM Date: Thu, 18 Jun 2026 08:08:38 +0100 Subject: [PATCH 2/2] removed obsolete code from flattened 11_workflow_execution_phase.ttl --- .../11_workflow_execution_phase.ttl | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl b/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl index 78b826dfa..6eab5680b 100644 --- a/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl +++ b/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl @@ -33,7 +33,7 @@ five-safes-crate:WorkflowMustHaveDescriptiveName sh:property [ a sh:PropertyShape ; sh:name "name" ; - sh:minCount 1 ; + sh:minCount 1 ; sh:description "The `CreateAction` corresponding to the workflow run MUST have a name string of at least 10 characters." ; sh:path schema:name ; sh:datatype xsd:string ; @@ -66,31 +66,6 @@ five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues #=== SHOULD shapes ===# -five-safes-crate:RootDataEntityShouldMentionWorkflow - a sh:NodeShape ; - sh:name "RootDataEntity" ; - sh:description "RootDataEntity SHOULD mention workflow execution object (typed WorkflowRunAction)." ; - sh:targetClass ro-crate:RootDataEntity ; - sh:severity sh:Warning ; - - sh:sparql [ - a sh:SPARQLConstraint ; - sh:name "mentions" ; - sh:select """ - PREFIX schema: - PREFIX rocrate: - SELECT $this - WHERE { - FILTER NOT EXISTS { - $this schema:mentions ?workflowExecution . - ?workflowExecution a rocrate:WorkflowRunAction . - } - } - """ ; - sh:message "RootDataEntity SHOULD mention workflow execution object (typed WorkflowRunAction)." ; - ] . - - five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded a sh:NodeShape ; sh:name "WorkflowExecution" ;