From 4a4138f46d0dbf2dc09894699bb3b36d109846fc Mon Sep 17 00:00:00 2001 From: EttoreM Date: Wed, 21 Jan 2026 13:57:04 +0000 Subject: [PATCH 1/3] Removed MUST/SHOULD/MAY folder structure from five-safes-crate profile. --- .../{should => }/10_outputs.ttl | 8 + .../11_workflow_execution_phase.ttl | 88 ++++- .../{should => }/12_check_phase.ttl | 109 ++++++ .../{must => }/13_validation_phase.ttl | 0 .../14_workflow_retrieval_phase.ttl | 342 ++++++++++++++++++ .../{must => }/15_metadata_file.py | 0 .../{must => }/15_metadata_file.ttl | 11 + .../{must => }/16_publishing_phase.ttl | 10 + .../{must => }/1_requesting_agent.ttl | 34 +- .../{should => }/1_responsible_project.ttl | 77 ++++ .../{must => }/1_root_data_entity.ttl | 10 + .../{must => }/2_requesting_agent.ttl | 36 +- .../{must => }/3_timestamp_format.ttl | 10 + .../{should => }/4_sign_off.ttl | 110 +++++- .../{must => }/6_workflow_reference.ttl | 33 ++ .../{must => }/7_requested_workflow_run.ttl | 24 +- .../{should => }/8_disclosure_phase.ttl | 121 ++++++- .../{should => }/9_inputs.ttl | 11 +- .../may/11_workflow_execution_phase.ttl | 64 ---- .../five-safes-crate/may/12_check_phase.ttl | 56 --- .../may/13_validation_phase.ttl | 57 --- .../may/14_workflow_retrieval_phase.ttl | 102 ------ .../may/1_responsible_project.ttl | 56 --- .../five-safes-crate/may/4_sign_off.ttl | 58 --- .../may/8_disclosure_phase.ttl | 58 --- .../must/11_workflow_execution_phase.ttl | 64 ---- .../five-safes-crate/must/12_check_phase.ttl | 93 ----- .../must/14_workflow_retrieval_phase.ttl | 157 -------- .../must/1_responsible_project.ttl | 59 --- .../five-safes-crate/must/4_sign_off.ttl | 89 ----- .../must/8_disclosure_phase.ttl | 100 ----- .../should/13_validation_phase.ttl | 165 --------- .../should/14_workflow_retrieval_phase.ttl | 125 ------- .../should/1_requesting_agent.ttl | 46 --- .../should/2_requesting_agent.ttl | 49 --- .../should/6_workflow_reference.ttl | 49 --- .../should/7_requested_workflow_run.ttl | 36 -- 37 files changed, 1027 insertions(+), 1490 deletions(-) rename rocrate_validator/profiles/five-safes-crate/{should => }/10_outputs.ttl (97%) rename rocrate_validator/profiles/five-safes-crate/{should => }/11_workflow_execution_phase.ttl (51%) rename rocrate_validator/profiles/five-safes-crate/{should => }/12_check_phase.ttl (65%) rename rocrate_validator/profiles/five-safes-crate/{must => }/13_validation_phase.ttl (100%) create mode 100644 rocrate_validator/profiles/five-safes-crate/14_workflow_retrieval_phase.ttl rename rocrate_validator/profiles/five-safes-crate/{must => }/15_metadata_file.py (100%) rename rocrate_validator/profiles/five-safes-crate/{must => }/15_metadata_file.ttl (96%) rename rocrate_validator/profiles/five-safes-crate/{must => }/16_publishing_phase.ttl (95%) rename rocrate_validator/profiles/five-safes-crate/{must => }/1_requesting_agent.ttl (81%) rename rocrate_validator/profiles/five-safes-crate/{should => }/1_responsible_project.ttl (56%) rename rocrate_validator/profiles/five-safes-crate/{must => }/1_root_data_entity.ttl (95%) rename rocrate_validator/profiles/five-safes-crate/{must => }/2_requesting_agent.ttl (71%) rename rocrate_validator/profiles/five-safes-crate/{must => }/3_timestamp_format.ttl (96%) rename rocrate_validator/profiles/five-safes-crate/{should => }/4_sign_off.ttl (65%) rename rocrate_validator/profiles/five-safes-crate/{must => }/6_workflow_reference.ttl (73%) rename rocrate_validator/profiles/five-safes-crate/{must => }/7_requested_workflow_run.ttl (84%) rename rocrate_validator/profiles/five-safes-crate/{should => }/8_disclosure_phase.ttl (51%) rename rocrate_validator/profiles/five-safes-crate/{should => }/9_inputs.ttl (95%) delete mode 100644 rocrate_validator/profiles/five-safes-crate/may/11_workflow_execution_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/may/12_check_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/may/13_validation_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/may/14_workflow_retrieval_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/may/1_responsible_project.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/may/8_disclosure_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/must/12_check_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/must/14_workflow_retrieval_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/must/1_responsible_project.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/must/8_disclosure_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/should/14_workflow_retrieval_phase.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/should/1_requesting_agent.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/should/2_requesting_agent.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/should/6_workflow_reference.ttl delete mode 100644 rocrate_validator/profiles/five-safes-crate/should/7_requested_workflow_run.ttl diff --git a/rocrate_validator/profiles/five-safes-crate/should/10_outputs.ttl b/rocrate_validator/profiles/five-safes-crate/10_outputs.ttl similarity index 97% rename from rocrate_validator/profiles/five-safes-crate/should/10_outputs.ttl rename to rocrate_validator/profiles/five-safes-crate/10_outputs.ttl index f3d56ed56..74368b8fc 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/10_outputs.ttl +++ b/rocrate_validator/profiles/five-safes-crate/10_outputs.ttl @@ -22,6 +22,11 @@ @prefix xsd: . +#=== MUST shapes ===# +# (none) + + +#=== SHOULD shapes ===# five-safes-crate:CreateActionHasResultIfActionCompleted a sh:NodeShape ; @@ -87,3 +92,6 @@ five-safes-crate:CreateActionResultOutputsHaveAllowedTypes ] ) . + +#=== MAY shapes ===# +# (none) \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl b/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl similarity index 51% rename from rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl rename to rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl index 0c1523102..849ec83d3 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl +++ b/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl @@ -23,6 +23,48 @@ @prefix xsd: . +#=== MUST shapes ===# + +five-safes-crate:WorkflowMustHaveDescriptiveName + a sh:NodeShape ; + sh:name "WorkflowExecution" ; + sh:targetClass schema:CreateAction ; + + sh:property [ + a sh:PropertyShape ; + sh:name "name" ; + sh:minCount 1 ; + sh:description "Workflow (CreateAction) 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 "Workflow (CreateAction) MUST have a name string of at least 10 characters." ; + ] . + + +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 (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 "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; + ] . + + +#=== SHOULD shapes ===# five-safes-crate:RootDataEntityShouldMentionWorkflow a sh:NodeShape ; @@ -82,4 +124,48 @@ five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded 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." ; - ] . \ No newline at end of file + ] . + + +#=== 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 rdf: + + 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: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/should/12_check_phase.ttl b/rocrate_validator/profiles/five-safes-crate/12_check_phase.ttl similarity index 65% rename from rocrate_validator/profiles/five-safes-crate/should/12_check_phase.ttl rename to rocrate_validator/profiles/five-safes-crate/12_check_phase.ttl index faf744594..1337b7f2f 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/12_check_phase.ttl +++ b/rocrate_validator/profiles/five-safes-crate/12_check_phase.ttl @@ -23,6 +23,80 @@ @prefix xsd: . +#=== MUST shapes ===# + +five-safes-crate:CheckValueObjectHasDescriptiveNameAndIsAssessAction + a sh:NodeShape ; + sh:name "CheckValue" ; + sh:description "" ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + + SELECT ?this + WHERE { + ?this schema:additionalType shp:CheckValue . + } + """ ; + ] ; + + sh:property [ + sh:path rdf:type ; + sh:minCount 1 ; + sh:hasValue schema:AssessAction; + sh:severity sh:Violation ; + sh:message "CheckValue MUST be a `AssessAction`." ; + ] ; + + sh:property [ + sh:a sh:PropertyShape ; + sh:name "name" ; + sh:description "CheckValue MUST have a human readable name string." ; + sh:path schema:name ; + sh:datatype xsd:string ; + sh:severity sh:Violation ; + sh:message "CheckValue MUST have a human readable name string." ; + ] . + +five-safes-crate:CheckValueActionStatusMustHaveAllowedValues + a sh:NodeShape ; + sh:name "CheckValue" ; + sh:description "" ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + + SELECT ?this + WHERE { + ?this schema:additionalType shp:CheckValue ; + schema:actionStatus ?status . + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "ActionStatus" ; + 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 "`CheckValue` --> `actionStatus` MUST have one of the allowed values." ; + ] . + + +#=== SHOULD shapes ===# + five-safes-crate:RootDataEntityShouldMentionCheckValueObject a sh:NodeShape ; sh:name "RootDataEntity" ; @@ -188,3 +262,38 @@ five-safes-crate:CheckValueShouldHaveActionStatus sh:severity sh:Warning ; sh:message "CheckValue SHOULD have actionStatus property." ; ] . + + +#=== MAY shapes ===# + +five-safes-crate:CheckValueMayHaveStartTime + a sh:NodeShape ; + sh:name "CheckValue" ; + sh:description "" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + SELECT ?this + WHERE { + ?this schema:additionalType shp:CheckValue ; + 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:message "`CheckValue` MAY have the `startTime` property." ; + ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/13_validation_phase.ttl b/rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl similarity index 100% rename from rocrate_validator/profiles/five-safes-crate/must/13_validation_phase.ttl rename to rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl diff --git a/rocrate_validator/profiles/five-safes-crate/14_workflow_retrieval_phase.ttl b/rocrate_validator/profiles/five-safes-crate/14_workflow_retrieval_phase.ttl new file mode 100644 index 000000000..4f9211152 --- /dev/null +++ b/rocrate_validator/profiles/five-safes-crate/14_workflow_retrieval_phase.ttl @@ -0,0 +1,342 @@ +# 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:DownloadActionObjectMUSTHavesDescriptiveName + a sh:NodeShape ; + sh:name "DownloadAction" ; + sh:targetClass schema:DownloadAction ; + sh:description "" ; + + sh:property [ + a sh:PropertyShape ; + sh:name "name" ; + sh:description "DownloadAction MUST have a human readable name string." ; + sh:path schema:name ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:datatype xsd:string ; + sh:severity sh:Violation ; + sh:message "DownloadAction MUST have a human readable name string." ; + ] . + + + +five-safes-crate:WorkflowSameAsAndRootDataEntityMainEntityMUSTBeTheSame + a sh:NodeShape ; + sh:name "Downloaded Workflow" ; + sh:description "" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX rdf: + + SELECT ?this + WHERE { + ?this rdf:type schema:Dataset . + ?s rdf:type schema:DownloadAction ; + schema:result ?this . + } + """ ; + ]; + + sh:sparql [ + a sh:SPARQLConstraint ; + sh:select """ + PREFIX schema: + PREFIX rdf: + + SELECT $this + WHERE { + FILTER NOT EXISTS { + $this schema:sameAs ?o . + ?s schema:mainEntity ?o . + # ?o rdf:type schema:Dataset . + } + } + """ ; + sh:severity sh:Violation ; + sh:description "The property `sameAs` of the entity representing the downloaded workflow MUST point to the same entity as `RootDataEntity` --> `mainEntity`." ; + sh:message "The property `sameAs` of the entity representing the downloaded workflow MUST point to the same entity as `RootDataEntity` --> `mainEntity`." ; + ] . + + +five-safes-crate:DownloadedWorkflowDistributionAndDownloadActionObjectMUSTBeTheSame + a sh:NodeShape ; + sh:name "Downloaded Workflow" ; + sh:description "" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX rdf: + + SELECT ?this + WHERE { + ?this rdf:type schema:Dataset . + ?s rdf:type schema:DownloadAction ; + schema:result ?this . + } + """ ; + ]; + + sh:sparql [ + a sh:SPARQLConstraint ; + sh:name "" ; + sh:select """ + PREFIX schema: + PREFIX rdf: + + SELECT $this + WHERE { + ?action rdf:type schema:DownloadAction . + FILTER NOT EXISTS { + $this schema:distribution ?url . + ?action schema:object ?url . + } + } + """ ; + sh:severity sh:Violation ; + sh:message "DownloadedWorkflow --> `distribution` MUST reference the same entity as `DownloadAction` --> `object`." ; + ] . + + +five-safes-crate:DownloadActionActionStatusMUSTHaveAllowedValues + a sh:NodeShape ; + sh:name "DownloadAction" ; + sh:description "" ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX rdf: + + SELECT ?this + WHERE { + ?this rdf:type schema:DownloadAction ; + schema:actionStatus ?status . + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "ActionStatus" ; + 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 ===# + +five-safes-crate:DownloadActionEntitySHOULDExist + a sh:NodeShape ; + sh:name "RootDataEntity" ; + sh:description "" ; + sh:targetClass ro-crate:RootDataEntity ; + + sh:sparql [ + a sh:SPARQLConstraint ; + sh:name "" ; + sh:select """ + PREFIX schema: + PREFIX rdf: + + SELECT $this + WHERE { + FILTER NOT EXISTS { + ?s rdf:type schema:DownloadAction . + } + } + """ ; + sh:severity sh:Warning ; + sh:message "An entity typed DownloadAction SHOULD exist." ; + ] . + + + +five-safes-crate:RootDataEntitySHOULDMentionDownloadActionIfPresent + a sh:NodeShape ; + sh:name "RootDataEntity" ; + sh:description "" ; + sh:targetClass ro-crate:RootDataEntity ; + + sh:sparql [ + a sh:SPARQLConstraint ; + sh:name "" ; + sh:select """ + PREFIX schema: + PREFIX rdf: + + SELECT $this ?da + WHERE { + ?da rdf:type schema:DownloadAction . + FILTER NOT EXISTS { + $this schema:mentions ?da . + } + } + """ ; + sh:severity sh:Warning ; + sh:message "RootDataEntity SHOULD mention DownloadAction if this exists." ; + ] . + + +five-safes-crate:DownloadActionShouldHaveEndTimeIfEnded + a sh:NodeShape ; + sh:name "DownloadAction" ; + sh:description "" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX rdf: + + SELECT ?this + WHERE { + ?this rdf:type schema:DownloadAction ; + 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:message "`DownloadAction` SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; + ] . + + +five-safes-crate:DownloadActionShouldHaveActionStatus + a sh:NodeShape ; + sh:name "DownloadAction" ; + sh:targetClass schema:DownloadAction ; + sh:description "" ; + + sh:property [ + a sh:PropertyShape ; + sh:name "ActionStatus" ; + sh:path schema:actionStatus ; + sh:minCount 1 ; + sh:severity sh:Warning ; + sh:message "`DownloadAction` SHOULD have `actionStatus` property." ; + ] . + + +#=== MAY shapes ===# + +five-safes-crate:DownloadedWorkflowSHOULDExistAndBeReferencedByDownloadActionResult + a sh:NodeShape ; + sh:name "DownloadAction" ; + sh:description "Validates that DownloadAction result references an existing entity" ; + sh:targetClass schema:DownloadAction ; + + sh:property [ + a sh:PropertyShape ; + sh:name "Result" ; + sh:description "The result property must reference an existing entity in the RO-Crate" ; + sh:path schema:result ; + sh:minCount 1 ; + sh:nodeKind sh:IRI ; + + sh:sparql [ + a sh:SPARQLConstraint ; + sh:select """ + PREFIX rdf: + PREFIX schema: + + SELECT $this $value + WHERE { + $this schema:result $value . + + # Entity must have BOTH type AND name (proper definition) + FILTER NOT EXISTS { + $value rdf:type schema:Dataset . + } + } + """ ; + sh:severity sh:Info ; + sh:message "The entity representing the downloaded workflow is not defined, OR is not referenced by `DownloadAction` --> `result`, OR is not of type `Dataset`." ; + ] ; + ] . + + +five-safes-crate:DownloadActionMayHaveStartTimeIfBegun + a sh:NodeShape ; + sh:name "DownloadAction" ; + sh:description ( + "`DownloadAction` MAY have the `startTime` property if `actionStatus` " + "is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." + ); + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX rdf: + + SELECT ?this + WHERE { + ?this rdf:type schema:DownloadAction ; + 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 ( + "`DownloadAction` MAY have the `startTime` property if `actionStatus` " + "is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." + ); + sh:message "`DownloadAction` MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; + ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/15_metadata_file.py b/rocrate_validator/profiles/five-safes-crate/15_metadata_file.py similarity index 100% rename from rocrate_validator/profiles/five-safes-crate/must/15_metadata_file.py rename to rocrate_validator/profiles/five-safes-crate/15_metadata_file.py diff --git a/rocrate_validator/profiles/five-safes-crate/must/15_metadata_file.ttl b/rocrate_validator/profiles/five-safes-crate/15_metadata_file.ttl similarity index 96% rename from rocrate_validator/profiles/five-safes-crate/must/15_metadata_file.ttl rename to rocrate_validator/profiles/five-safes-crate/15_metadata_file.ttl index 14d939f06..8b5f25300 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/15_metadata_file.ttl +++ b/rocrate_validator/profiles/five-safes-crate/15_metadata_file.ttl @@ -22,6 +22,9 @@ @prefix xsd: . @prefix dct: . + +#=== MUST shapes ===# + five-safes-crate:MetadataFileDescriptorProperties a sh:NodeShape ; sh:name "RO-Crate conforms to 1.2 or later minor version" ; sh:description """The RO-Crate metadata file descriptor MUST have a `conformsTo` property with RO-Crate specification version 1.2 or later minor version"""; @@ -39,3 +42,11 @@ five-safes-crate:MetadataFileDescriptorProperties a sh:NodeShape ; ] . ro-crate:conformsToROCrateSpec sh:deactivated true . + + +#=== SHOULD shapes ===# +# (none) + + +#=== MAY shapes ===# +# (none) diff --git a/rocrate_validator/profiles/five-safes-crate/must/16_publishing_phase.ttl b/rocrate_validator/profiles/five-safes-crate/16_publishing_phase.ttl similarity index 95% rename from rocrate_validator/profiles/five-safes-crate/must/16_publishing_phase.ttl rename to rocrate_validator/profiles/five-safes-crate/16_publishing_phase.ttl index 5a591a4e9..9ec42f5cd 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/16_publishing_phase.ttl +++ b/rocrate_validator/profiles/five-safes-crate/16_publishing_phase.ttl @@ -23,6 +23,8 @@ @prefix xsd: . +#=== MUST shapes ===# + five-safes-crate:AllAssessActionsMentioned a sh:NodeShape ; sh:name "All AssessActions are mentioned from Root Data Entity" ; @@ -39,3 +41,11 @@ five-safes-crate:AllAssessActionsMentioned sh:severity sh:Violation ; sh:message "All AssessAction entities in the crate MUST be referenced from the Root Dataset via `mentions`." ; ] . + + +#=== SHOULD shapes ===# +# (none) + + +#=== MAY shapes ===# +# (none) diff --git a/rocrate_validator/profiles/five-safes-crate/must/1_requesting_agent.ttl b/rocrate_validator/profiles/five-safes-crate/1_requesting_agent.ttl similarity index 81% rename from rocrate_validator/profiles/five-safes-crate/must/1_requesting_agent.ttl rename to rocrate_validator/profiles/five-safes-crate/1_requesting_agent.ttl index 2cc0d434d..590c694ce 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/1_requesting_agent.ttl +++ b/rocrate_validator/profiles/five-safes-crate/1_requesting_agent.ttl @@ -22,6 +22,8 @@ @prefix xsd: . +#=== MUST shapes ===# + five-safes-crate:AgentIsMemberOf a sh:NodeShape ; sh:name "Requesting Agent" ; @@ -79,4 +81,34 @@ five-safes-crate:AgentProjectIntersection """ ; sh:severity sh:Violation ; sh:message """At least one Project referenced by Agent -> memberOf MUST be included in the set of Projects referenced by RootDataEntity -> sourceOrganization.""" ; - ] . \ No newline at end of file + ] . + + +#=== SHOULD shapes ===# + +five-safes-crate:AgentIsMemberOf + a sh:NodeShape ; + sh:name "Requesting Agent" ; + sh:target [ + a sh:SPARQLTarget ; + sh:prefixes ro-crate:sparqlPrefixes ; + sh:select """ + SELECT DISTINCT ?this WHERE { + ?action a schema:CreateAction ; + schema:agent ?this . + } + """ + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "memberOf" ; + sh:path schema:memberOf; + sh:minCount 1 ; + sh:severity sh:Warning ; + sh:message """The Requesting Agent SHOULD have a `memberOf` property.""" ; + ] . + + +#=== MAY shapes ===# +# (none) \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/1_responsible_project.ttl b/rocrate_validator/profiles/five-safes-crate/1_responsible_project.ttl similarity index 56% rename from rocrate_validator/profiles/five-safes-crate/should/1_responsible_project.ttl rename to rocrate_validator/profiles/five-safes-crate/1_responsible_project.ttl index 28d1c1eef..69a1129ea 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/1_responsible_project.ttl +++ b/rocrate_validator/profiles/five-safes-crate/1_responsible_project.ttl @@ -22,6 +22,47 @@ @prefix xsd: . +#=== MUST shapes ===# + +five-safes-crate:ResponsibleProject + a sh:NodeShape ; + sh:name "Responsible Project" ; + sh:target [ + a sh:SPARQLTarget ; + sh:prefixes ro-crate:sparqlPrefixes ; + sh:select """ + SELECT DISTINCT ?this WHERE { + ?action a schema:CreateAction ; + schema:agent ?agent . + ?agent schema:memberOf ?this . + } + """ + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "funding" ; + sh:path schema:funding; + sh:class schema:Grant ; + sh:severity sh:Violation ; + sh:message """The property 'funding' of the Responsible Project MUST be of type Grant.""" ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "member" ; + sh:path schema:member; + sh:or ( + [ sh:class schema:Organization ] + [ sh:class schema:Person ] + ) ; + sh:severity sh:Violation ; + sh:message """The property 'member' of the Responsible Project MUST be of type schema:Organization or Person.""" ; + ] . + + +#=== SHOUD shapes ===# + five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection a sh:NodeShape ; sh:name "Organizations (members of Responsible Project)" ; @@ -57,4 +98,40 @@ five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection """ ; sh:severity sh:Warning ; sh:message """At least one of the organisations that are members of the responsible project SHOULD be included in the Requesting Agent's affiliations, if such properties exist.""" ; + ] . + + +#=== MAY shapes ===# + +five-safes-crate:ResponsibleProject + a sh:NodeShape ; + sh:name "Responsible Project" ; + sh:target [ + a sh:SPARQLTarget ; + sh:prefixes ro-crate:sparqlPrefixes ; + sh:select """ + SELECT DISTINCT ?this WHERE { + ?action a schema:CreateAction ; + schema:agent ?agent . + ?agent schema:memberOf ?this . + } + """ + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "funding" ; + sh:path schema:funding; + sh:minCount 1 ; + sh:severity sh:Info ; + sh:message """The Responsible Project does not have the property `funding`.""" ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "member" ; + sh:path schema:member; + sh:minCount 1 ; + sh:severity sh:Info ; + sh:message """The Responsible Project does not have the property `member`.""" ; ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/must/1_root_data_entity.ttl b/rocrate_validator/profiles/five-safes-crate/1_root_data_entity.ttl similarity index 95% rename from rocrate_validator/profiles/five-safes-crate/must/1_root_data_entity.ttl rename to rocrate_validator/profiles/five-safes-crate/1_root_data_entity.ttl index bb9a51471..fe0516b4f 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/1_root_data_entity.ttl +++ b/rocrate_validator/profiles/five-safes-crate/1_root_data_entity.ttl @@ -22,6 +22,8 @@ @prefix xsd: . +#=== MUST shapes ===# + five-safes-crate:RootDataEntityRequiredProperties a sh:NodeShape ; sh:name "RootDataEntity" ; @@ -44,3 +46,11 @@ five-safes-crate:RootDataEntityRequiredProperties sh:severity sh:Violation ; sh:message """The `sourceOrganization` property of the RootDataEntity MUST point to a Project entity.""" ; ] . + + +#=== SHOULD shapes ===# +# (none) + + +#=== MAY shapes ===# +# (none) diff --git a/rocrate_validator/profiles/five-safes-crate/must/2_requesting_agent.ttl b/rocrate_validator/profiles/five-safes-crate/2_requesting_agent.ttl similarity index 71% rename from rocrate_validator/profiles/five-safes-crate/must/2_requesting_agent.ttl rename to rocrate_validator/profiles/five-safes-crate/2_requesting_agent.ttl index 4f3a4d898..17fd37724 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/2_requesting_agent.ttl +++ b/rocrate_validator/profiles/five-safes-crate/2_requesting_agent.ttl @@ -22,6 +22,7 @@ @prefix xsd: . +#=== MUST shapes ===# five-safes-crate:CreateActionHasAgent a sh:NodeShape ; @@ -60,4 +61,37 @@ five-safes-crate:CreateActionHasAgent sh:nodeKind sh:IRI ; sh:severity sh:Violation ; sh:message "The affiliation of a CreateAction's agent MUST be a contextual entity with type Organization." ; - ] . \ No newline at end of file + ] . + + +#=== SHOULD shapes ===# + +# Person who is the agent of a CreateAction SHOULD have an affiliation +five-safes-crate:PersonAgentHasAffiliation + a sh:NodeShape ; + sh:name "Agent of CreateAction" ; + sh:description "The agent of a CreateAction entity" ; + sh:target [ + a sh:SPARQLTarget ; + sh:prefixes ro-crate:sparqlPrefixes ; + sh:select """ + SELECT DISTINCT ?this WHERE { + ?action a schema:CreateAction ; + schema:agent ?this . + } + """ + ] ; + + # The agent of a CreateAction entity SHOULD have an affiliation + sh:property [ + a sh:PropertyShape ; + sh:name "Presence of affiliations" ; + sh:path schema:affiliation ; + sh:minCount 1 ; + sh:severity sh:Warning ; + sh:message "The agent of a CreateAction entity SHOULD have an affiliation" ; + ] . + + +#=== MAY shapes ===# +# (none) \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/must/3_timestamp_format.ttl b/rocrate_validator/profiles/five-safes-crate/3_timestamp_format.ttl similarity index 96% rename from rocrate_validator/profiles/five-safes-crate/must/3_timestamp_format.ttl rename to rocrate_validator/profiles/five-safes-crate/3_timestamp_format.ttl index c4f2ddb5b..edb20bec0 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/3_timestamp_format.ttl +++ b/rocrate_validator/profiles/five-safes-crate/3_timestamp_format.ttl @@ -23,6 +23,8 @@ @prefix xsd: . +#=== MUST shapes ===# + # to ensure the entity id will be included in any error message, # target all entities which have startTime and/or endTime properties using sh:targetSubjectsOf, # then we use sh:property to validate the values of those properties. @@ -52,3 +54,11 @@ five-safes-crate:TimeStampFormat sh:message "All `startTime` and `endTime` values MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ; sh:description "Start timestamps MUST follow the RFC 3339 standard." ; ] . + + +#=== SHOULD shapes ===# +# (none) + + +#=== MAY shapes ===# +# (none) \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/4_sign_off.ttl similarity index 65% rename from rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl rename to rocrate_validator/profiles/five-safes-crate/4_sign_off.ttl index 129c02df0..b23459196 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl +++ b/rocrate_validator/profiles/five-safes-crate/4_sign_off.ttl @@ -17,12 +17,83 @@ @prefix five-safes-crate: . @prefix rdf: . @prefix schema: . +@prefix purl: . @prefix sh: . @prefix validator: . @prefix xsd: . -@prefix 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: + PREFIX 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: + PREFIX 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 ; @@ -175,3 +246,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: + PREFIX 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." ; + ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/6_workflow_reference.ttl b/rocrate_validator/profiles/five-safes-crate/6_workflow_reference.ttl similarity index 73% rename from rocrate_validator/profiles/five-safes-crate/must/6_workflow_reference.ttl rename to rocrate_validator/profiles/five-safes-crate/6_workflow_reference.ttl index 34dd73d62..446a64eac 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/6_workflow_reference.ttl +++ b/rocrate_validator/profiles/five-safes-crate/6_workflow_reference.ttl @@ -23,6 +23,7 @@ @prefix xsd: . +#=== MUST shapes ===# five-safes-crate:ReferenceToWorkflowCrate a sh:NodeShape ; @@ -78,3 +79,35 @@ five-safes-crate:mainEntityHasProperConformsTo } """ ; ] . + + +#=== SHOULD shapes ===# + +five-safes-crate:DatasetMustHaveDistributionIfURI + a sh:NodeShape ; + sh:name "mainEntity" ; + sh:targetObjectsOf schema:mainEntity ; + sh:description "If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ; + + sh:sparql [ + a sh:SPARQLConstraint ; + sh:name "distribution" ; + sh:description "If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ; + sh:prefixes ro-crate:sparqlPrefixes ; + sh:select """ + SELECT $this + WHERE { + FILTER (STRSTARTS(STR($this), "http://") || STRSTARTS(STR($this), "https://")) . + FILTER NOT EXISTS { + $this schema:distribution ?dist . + FILTER (STRSTARTS(STR(?dist), "http://") || STRSTARTS(STR(?dist), "https://")) . + } + } + """ ; + sh:severity sh:Warning ; + sh:message "If mainEntity has an HTTP(S) @id SHOULD have at least one distribution with an HTTP(S) URL." ; + ] . + + +#=== MAY shapes ===# +# (none) \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/must/7_requested_workflow_run.ttl b/rocrate_validator/profiles/five-safes-crate/7_requested_workflow_run.ttl similarity index 84% rename from rocrate_validator/profiles/five-safes-crate/must/7_requested_workflow_run.ttl rename to rocrate_validator/profiles/five-safes-crate/7_requested_workflow_run.ttl index d1a9ff6d3..6c8453d66 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/7_requested_workflow_run.ttl +++ b/rocrate_validator/profiles/five-safes-crate/7_requested_workflow_run.ttl @@ -22,6 +22,8 @@ @prefix xsd: . +#=== MUST shapes ===# + five-safes-crate:RootDataEntityMentionsCreateAction a sh:NodeShape ; sh:name "RootDataEntity" ; @@ -83,4 +85,24 @@ five-safes-crate:CreateActionInstrumentAndStatus """ ; sh:severity sh:Violation ; sh:message "Each `object` in `CreateAction` MUST reference an existing entity." ; - ] . \ No newline at end of file + ] . + + +#=== SHOULD shapes ===# + +# CreateAction SHOULD have object property with minimum cardinality 1 +five-safes-crate:CreateActionShouldHaveObjectProperty + a sh:NodeShape ; + sh:targetClass schema:CreateAction ; + sh:name "CreateAction" ; + sh:property [ + sh:path schema:object ; + sh:minCount 1 ; + sh:nodeKind sh:IRI ; + sh:severity sh:Warning ; + sh:message "`CreateAction` SHOULD have the property `object` with IRI values." ; + ] . + + +#=== MAY shapes ===# +# (none) \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/8_disclosure_phase.ttl b/rocrate_validator/profiles/five-safes-crate/8_disclosure_phase.ttl similarity index 51% rename from rocrate_validator/profiles/five-safes-crate/should/8_disclosure_phase.ttl rename to rocrate_validator/profiles/five-safes-crate/8_disclosure_phase.ttl index 1d4662512..550be73af 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/8_disclosure_phase.ttl +++ b/rocrate_validator/profiles/five-safes-crate/8_disclosure_phase.ttl @@ -23,6 +23,87 @@ @prefix xsd: . +#=== MUST shapes ===# + +five-safes-crate:DisclosureObjectHasDescriptiveNameAndIsAssessAction + a sh:NodeShape ; + sh:name "DisclosureCheck" ; + sh:description "DisclosureCheck" ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + + SELECT ?this + WHERE { + ?this schema:additionalType shp:DisclosureCheck . + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "AssessAction" ; + sh:description "`DisclosureCheck` MUST be a `AssessAction`." ; + sh:path rdf:type ; + sh:minCount 1 ; + sh:hasValue schema:AssessAction; + sh:severity sh:Violation ; + sh:message "`DisclosureCheck` MUST be a `AssessAction`." ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "name" ; + sh:description "`DisclosureCheck` MUST have a name string of at least 10 characters." ; + sh:minCount 1 ; + sh:path schema:name ; + sh:datatype xsd:string ; + sh:minLength 10 ; + sh:severity sh:Violation ; + sh:message "`DisclosureCheck` MUST have a name string of at least 10 characters." ; + ] . + + +five-safes-crate:DisclosureObjectHasActionStatusWithAcceptedValue + a sh:NodeShape ; + sh:name "DisclosureCheck" ; + sh:description "`DisclosureCheck` MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + + SELECT ?this + WHERE { + ?this schema:additionalType shp:DisclosureCheck ; + schema:actionStatus ?status . + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "actionStatus" ; + sh:description "`DisclosureCheck` 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 "`DisclosureCheck` MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; + ] . + + +#=== SHOULD shapes ===# + five-safes-crate:RootDataEntityShouldMentionDisclosureObject a sh:NodeShape ; sh:name "RootDataEntity" ; @@ -111,4 +192,42 @@ five-safes-crate:DisclosureObjectHasEndTimeIfcompletedOrFailed sh:severity sh:Warning ; sh:description "`DisclosureCheck` SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; sh:message "`DisclosureCheck` SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; - ] . \ No newline at end of file + ] . + + +#=== MAY shapes ===# + +five-safes-crate:DisclosureObjectHasStartTimeIfBegun + a sh:NodeShape ; + sh:name "DisclosureCheck" ; + sh:description "DisclosureCheck" ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + + SELECT ?this + WHERE { + ?this schema:additionalType shp:DisclosureCheck ; + 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 "`DisclosureCheck` MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; + sh:message "`DisclosureCheck` MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; + ] . diff --git a/rocrate_validator/profiles/five-safes-crate/should/9_inputs.ttl b/rocrate_validator/profiles/five-safes-crate/9_inputs.ttl similarity index 95% rename from rocrate_validator/profiles/five-safes-crate/should/9_inputs.ttl rename to rocrate_validator/profiles/five-safes-crate/9_inputs.ttl index 572610962..a4a237a67 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/9_inputs.ttl +++ b/rocrate_validator/profiles/five-safes-crate/9_inputs.ttl @@ -24,6 +24,11 @@ @prefix xsd: . +#=== MUST shapes ===# +# (none) + + +#=== SHOULD shapes ===# five-safes-crate:InputEntityReferencesFormalParameterViaExampleOfWork a sh:NodeShape ; @@ -55,4 +60,8 @@ five-safes-crate:InputEntityReferencesFormalParameterViaExampleOfWork """ ; sh:severity sh:Warning ; sh:message "Input SHOULD reference a FormalParameter using exampleOfWork" ; - ] . \ No newline at end of file + ] . + + +#=== MAY shapes ===# +# (none) \ No newline at end of file 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 6c331913b..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 rdf: - - 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: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/12_check_phase.ttl b/rocrate_validator/profiles/five-safes-crate/may/12_check_phase.ttl deleted file mode 100644 index 0e741f6ca..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/12_check_phase.ttl +++ /dev/null @@ -1,56 +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:CheckValueMayHaveStartTime - a sh:NodeShape ; - sh:name "CheckValue" ; - sh:description "" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - SELECT ?this - WHERE { - ?this schema:additionalType shp:CheckValue ; - 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:message "`CheckValue` MAY have the `startTime` property." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/may/13_validation_phase.ttl b/rocrate_validator/profiles/five-safes-crate/may/13_validation_phase.ttl deleted file mode 100644 index b7adcb3bc..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/13_validation_phase.ttl +++ /dev/null @@ -1,57 +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:DownloadActionMayHaveStartTimeIfBegun - a sh:NodeShape ; - sh:name "ValidationCheck" ; - sh:description "" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - SELECT ?this - WHERE { - ?this schema:additionalType shp:ValidationCheck ; - 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 "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; - sh:message "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/may/14_workflow_retrieval_phase.ttl b/rocrate_validator/profiles/five-safes-crate/may/14_workflow_retrieval_phase.ttl deleted file mode 100644 index d392c8fb2..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/14_workflow_retrieval_phase.ttl +++ /dev/null @@ -1,102 +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:DownloadedWorkflowSHOULDExistAndBeReferencedByDownloadActionResult - a sh:NodeShape ; - sh:name "DownloadAction" ; - sh:description "Validates that DownloadAction result references an existing entity" ; - sh:targetClass schema:DownloadAction ; - - sh:property [ - a sh:PropertyShape ; - sh:name "Result" ; - sh:description "The result property must reference an existing entity in the RO-Crate" ; - sh:path schema:result ; - sh:minCount 1 ; - sh:nodeKind sh:IRI ; - - sh:sparql [ - a sh:SPARQLConstraint ; - sh:select """ - PREFIX rdf: - PREFIX schema: - - SELECT $this $value - WHERE { - $this schema:result $value . - - # Entity must have BOTH type AND name (proper definition) - FILTER NOT EXISTS { - $value rdf:type schema:Dataset . - } - } - """ ; - sh:severity sh:Info ; - sh:message "The entity representing the downloaded workflow is not defined, OR is not referenced by `DownloadAction` --> `result`, OR is not of type `Dataset`." ; - ] ; - ] . - - -five-safes-crate:DownloadActionMayHaveStartTimeIfBegun - a sh:NodeShape ; - sh:name "DownloadAction" ; - sh:description ( - "`DownloadAction` MAY have the `startTime` property if `actionStatus` " - "is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." - ); - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX rdf: - - SELECT ?this - WHERE { - ?this rdf:type schema:DownloadAction ; - 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 ( - "`DownloadAction` MAY have the `startTime` property if `actionStatus` " - "is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." - ); - sh:message "`DownloadAction` MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/may/1_responsible_project.ttl b/rocrate_validator/profiles/five-safes-crate/may/1_responsible_project.ttl deleted file mode 100644 index 5dd46fd27..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/1_responsible_project.ttl +++ /dev/null @@ -1,56 +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:ResponsibleProject - a sh:NodeShape ; - sh:name "Responsible Project" ; - sh:target [ - a sh:SPARQLTarget ; - sh:prefixes ro-crate:sparqlPrefixes ; - sh:select """ - SELECT DISTINCT ?this WHERE { - ?action a schema:CreateAction ; - schema:agent ?agent . - ?agent schema:memberOf ?this . - } - """ - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "funding" ; - sh:path schema:funding; - sh:minCount 1 ; - sh:severity sh:Info ; - sh:message """The Responsible Project does not have the property `funding`.""" ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "member" ; - sh:path schema:member; - sh:minCount 1 ; - sh:severity sh:Info ; - sh:message """The Responsible Project does not have the property `member`.""" ; - ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl deleted file mode 100644 index 3890e2b31..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.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 sh: . -@prefix validator: . -@prefix xsd: . -@prefix shp: . - - -five-safes-crate:SignOffPhaseStartTime - a sh:NodeShape ; - sh:name "SignOffPhaseStartTime" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX 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." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/may/8_disclosure_phase.ttl b/rocrate_validator/profiles/five-safes-crate/may/8_disclosure_phase.ttl deleted file mode 100644 index 46943191d..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/8_disclosure_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 sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:DisclosureObjectHasStartTimeIfBegun - a sh:NodeShape ; - sh:name "DisclosureCheck" ; - sh:description "DisclosureCheck" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:DisclosureCheck ; - 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 "`DisclosureCheck` MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; - sh:message "`DisclosureCheck` MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; - ] . \ No newline at end of file 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 2f723c938..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/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 purl: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:WorkflowMustHaveDescriptiveName - a sh:NodeShape ; - sh:name "WorkflowExecution" ; - sh:targetClass schema:CreateAction ; - - sh:property [ - a sh:PropertyShape ; - sh:name "name" ; - sh:minCount 1 ; - sh:description "Workflow (CreateAction) 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 "Workflow (CreateAction) MUST have a name string of at least 10 characters." ; - ] . - - - - -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 (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 "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/12_check_phase.ttl b/rocrate_validator/profiles/five-safes-crate/must/12_check_phase.ttl deleted file mode 100644 index caecb1651..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/12_check_phase.ttl +++ /dev/null @@ -1,93 +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:CheckValueObjectHasDescriptiveNameAndIsAssessAction - a sh:NodeShape ; - sh:name "CheckValue" ; - sh:description "" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:CheckValue . - } - """ ; - ] ; - - sh:property [ - sh:path rdf:type ; - sh:minCount 1 ; - sh:hasValue schema:AssessAction; - sh:severity sh:Violation ; - sh:message "CheckValue MUST be a `AssessAction`." ; - ] ; - - sh:property [ - sh:a sh:PropertyShape ; - sh:name "name" ; - sh:description "CheckValue MUST have a human readable name string." ; - sh:path schema:name ; - sh:datatype xsd:string ; - sh:severity sh:Violation ; - sh:message "CheckValue MUST have a human readable name string." ; - ] . - -five-safes-crate:CheckValueActionStatusMustHaveAllowedValues - a sh:NodeShape ; - sh:name "CheckValue" ; - sh:description "" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:CheckValue ; - schema:actionStatus ?status . - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "ActionStatus" ; - 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 "`CheckValue` --> `actionStatus` MUST have one of the allowed values." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/14_workflow_retrieval_phase.ttl b/rocrate_validator/profiles/five-safes-crate/must/14_workflow_retrieval_phase.ttl deleted file mode 100644 index a1108add3..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/14_workflow_retrieval_phase.ttl +++ /dev/null @@ -1,157 +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:DownloadActionObjectMUSTHavesDescriptiveName - a sh:NodeShape ; - sh:name "DownloadAction" ; - sh:targetClass schema:DownloadAction ; - sh:description "" ; - - sh:property [ - a sh:PropertyShape ; - sh:name "name" ; - sh:description "DownloadAction MUST have a human readable name string." ; - sh:path schema:name ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:datatype xsd:string ; - sh:severity sh:Violation ; - sh:message "DownloadAction MUST have a human readable name string." ; - ] . - - - -five-safes-crate:WorkflowSameAsAndRootDataEntityMainEntityMUSTBeTheSame - a sh:NodeShape ; - sh:name "Downloaded Workflow" ; - sh:description "" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX rdf: - - SELECT ?this - WHERE { - ?this rdf:type schema:Dataset . - ?s rdf:type schema:DownloadAction ; - schema:result ?this . - } - """ ; - ]; - - sh:sparql [ - a sh:SPARQLConstraint ; - sh:select """ - PREFIX schema: - PREFIX rdf: - - SELECT $this - WHERE { - FILTER NOT EXISTS { - $this schema:sameAs ?o . - ?s schema:mainEntity ?o . - # ?o rdf:type schema:Dataset . - } - } - """ ; - sh:severity sh:Violation ; - sh:description "The property `sameAs` of the entity representing the downloaded workflow MUST point to the same entity as `RootDataEntity` --> `mainEntity`." ; - sh:message "The property `sameAs` of the entity representing the downloaded workflow MUST point to the same entity as `RootDataEntity` --> `mainEntity`." ; - ] . - - -five-safes-crate:DownloadedWorkflowDistributionAndDownloadActionObjectMUSTBeTheSame - a sh:NodeShape ; - sh:name "Downloaded Workflow" ; - sh:description "" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX rdf: - - SELECT ?this - WHERE { - ?this rdf:type schema:Dataset . - ?s rdf:type schema:DownloadAction ; - schema:result ?this . - } - """ ; - ]; - - sh:sparql [ - a sh:SPARQLConstraint ; - sh:name "" ; - sh:select """ - PREFIX schema: - PREFIX rdf: - - SELECT $this - WHERE { - ?action rdf:type schema:DownloadAction . - FILTER NOT EXISTS { - $this schema:distribution ?url . - ?action schema:object ?url . - } - } - """ ; - sh:severity sh:Violation ; - sh:message "DownloadedWorkflow --> `distribution` MUST reference the same entity as `DownloadAction` --> `object`." ; - ] . - - -five-safes-crate:DownloadActionActionStatusMUSTHaveAllowedValues - a sh:NodeShape ; - sh:name "DownloadAction" ; - sh:description "" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX rdf: - - SELECT ?this - WHERE { - ?this rdf:type schema:DownloadAction ; - schema:actionStatus ?status . - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "ActionStatus" ; - 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." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/1_responsible_project.ttl b/rocrate_validator/profiles/five-safes-crate/must/1_responsible_project.ttl deleted file mode 100644 index 4748655ea..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/1_responsible_project.ttl +++ /dev/null @@ -1,59 +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:ResponsibleProject - a sh:NodeShape ; - sh:name "Responsible Project" ; - sh:target [ - a sh:SPARQLTarget ; - sh:prefixes ro-crate:sparqlPrefixes ; - sh:select """ - SELECT DISTINCT ?this WHERE { - ?action a schema:CreateAction ; - schema:agent ?agent . - ?agent schema:memberOf ?this . - } - """ - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "funding" ; - sh:path schema:funding; - sh:class schema:Grant ; - sh:severity sh:Violation ; - sh:message """The property 'funding' of the Responsible Project MUST be of type Grant.""" ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "member" ; - sh:path schema:member; - sh:or ( - [ sh:class schema:Organization ] - [ sh:class schema:Person ] - ) ; - sh:severity sh:Violation ; - sh:message """The property 'member' of the Responsible Project MUST be of type schema:Organization or Person.""" ; - ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl deleted file mode 100644 index dfbd85d0c..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl +++ /dev/null @@ -1,89 +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:SignOffObjectActionAndName - a sh:NodeShape ; - sh:name "SignOff" ; - sh:description "Sign Off phase" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX 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: - PREFIX 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." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/8_disclosure_phase.ttl b/rocrate_validator/profiles/five-safes-crate/must/8_disclosure_phase.ttl deleted file mode 100644 index 3e6a2de08..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/8_disclosure_phase.ttl +++ /dev/null @@ -1,100 +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:DisclosureObjectHasDescriptiveNameAndIsAssessAction - a sh:NodeShape ; - sh:name "DisclosureCheck" ; - sh:description "DisclosureCheck" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:DisclosureCheck . - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "AssessAction" ; - sh:description "`DisclosureCheck` MUST be a `AssessAction`." ; - sh:path rdf:type ; - sh:minCount 1 ; - sh:hasValue schema:AssessAction; - sh:severity sh:Violation ; - sh:message "`DisclosureCheck` MUST be a `AssessAction`." ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "name" ; - sh:description "`DisclosureCheck` MUST have a name string of at least 10 characters." ; - sh:minCount 1 ; - sh:path schema:name ; - sh:datatype xsd:string ; - sh:minLength 10 ; - sh:severity sh:Violation ; - sh:message "`DisclosureCheck` MUST have a name string of at least 10 characters." ; - ] . - - -five-safes-crate:DisclosureObjectHasActionStatusWithAcceptedValue - a sh:NodeShape ; - sh:name "DisclosureCheck" ; - sh:description "`DisclosureCheck` MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:DisclosureCheck ; - schema:actionStatus ?status . - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "actionStatus" ; - sh:description "`DisclosureCheck` 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 "`DisclosureCheck` MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl b/rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl deleted file mode 100644 index cb2b18137..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl +++ /dev/null @@ -1,165 +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:RootDataEntityShouldMentionValidationCheckObject - a sh:NodeShape ; - sh:name "RootDataEntity" ; - sh:targetClass ro-crate:RootDataEntity ; - sh:description "" ; - - sh:sparql [ - a sh:SPARQLConstraint ; - sh:name "mentions" ; - sh:description "RootDataEntity SHOULD mention a ValidationCheck object." ; - sh:select """ - PREFIX schema: - PREFIX shp: - SELECT $this - WHERE { - FILTER NOT EXISTS{ - $this schema:mentions ?action . - ?action schema:additionalType shp:ValidationCheck . - } - } - """ ; - sh:severity sh:Warning ; - sh:message "RootDataEntity SHOULD mention a ValidationCheck object." ; - ] . - - -five-safes-crate:ValidationCheckObjectShouldPointToRootDataEntity - a sh:NodeShape ; - sh:name "ValidationCheck" ; - sh:description "" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - SELECT ?this - WHERE { - ?this schema:additionalType shp:ValidationCheck . - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "object" ; - sh:path schema:object ; - sh:minCount 1 ; - sh:class ro-crate:RootDataEntity ; - sh:severity sh:Warning ; - sh:message "`ValidationCheck` --> `object` SHOULD point to the root of the RO-Crate" ; - ] . - -five-safes-crate:ValidationCheckInstrumentShouldPointToEntityWithSpecificId - a sh:NodeShape ; - sh:name "ValidationCheck" ; - sh:description "" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - SELECT ?this - WHERE { - ?this schema:additionalType shp:ValidationCheck . - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "instrument" ; - sh:description "" ; - sh:path schema:instrument ; - sh:minCount 1 ; - sh:nodeKind sh:IRI ; - sh:hasValue ; - sh:severity sh:Warning ; - sh:message "`ValidationCheck` --> `instrument` SHOULD point to an entity with @id https://w3id.org/5s-crate/0.4" ; - ] . - - -five-safes-crate:ValidationCheckShouldHaveActionStatus - a sh:NodeShape ; - sh:name "ValidationCheck" ; - sh:description "" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:ValidationCheck . - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "ActionStatus" ; - sh:path schema:actionStatus ; - sh:minCount 1 ; - sh:severity sh:Warning ; - sh:message "ValidationCheck SHOULD have actionStatus property." ; - ] . - - -five-safes-crate:DownloadActionShouldHaveEndTimeIfBegun - a sh:NodeShape ; - sh:name "ValidationCheck" ; - sh:description "" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - SELECT ?this - WHERE { - ?this schema:additionalType shp:ValidationCheck ; - 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 "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; - sh:message "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/should/14_workflow_retrieval_phase.ttl b/rocrate_validator/profiles/five-safes-crate/should/14_workflow_retrieval_phase.ttl deleted file mode 100644 index f2bd9dd85..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/14_workflow_retrieval_phase.ttl +++ /dev/null @@ -1,125 +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:DownloadActionEntitySHOULDExist - a sh:NodeShape ; - sh:name "RootDataEntity" ; - sh:description "" ; - sh:targetClass ro-crate:RootDataEntity ; - - sh:sparql [ - a sh:SPARQLConstraint ; - sh:name "" ; - sh:select """ - PREFIX schema: - PREFIX rdf: - - SELECT $this - WHERE { - FILTER NOT EXISTS { - ?s rdf:type schema:DownloadAction . - } - } - """ ; - sh:severity sh:Warning ; - sh:message "An entity typed DownloadAction SHOULD exist." ; - ] . - - - -five-safes-crate:RootDataEntitySHOULDMentionDownloadActionIfPresent - a sh:NodeShape ; - sh:name "RootDataEntity" ; - sh:description "" ; - sh:targetClass ro-crate:RootDataEntity ; - - sh:sparql [ - a sh:SPARQLConstraint ; - sh:name "" ; - sh:select """ - PREFIX schema: - PREFIX rdf: - - SELECT $this ?da - WHERE { - ?da rdf:type schema:DownloadAction . - FILTER NOT EXISTS { - $this schema:mentions ?da . - } - } - """ ; - sh:severity sh:Warning ; - sh:message "RootDataEntity SHOULD mention DownloadAction if this exists." ; - ] . - - -five-safes-crate:DownloadActionShouldHaveEndTimeIfEnded - a sh:NodeShape ; - sh:name "DownloadAction" ; - sh:description "" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX rdf: - - SELECT ?this - WHERE { - ?this rdf:type schema:DownloadAction ; - 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:message "`DownloadAction` SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; - ] . - - -five-safes-crate:DownloadActionShouldHaveActionStatus - a sh:NodeShape ; - sh:name "DownloadAction" ; - sh:targetClass schema:DownloadAction ; - sh:description "" ; - - sh:property [ - a sh:PropertyShape ; - sh:name "ActionStatus" ; - sh:path schema:actionStatus ; - sh:minCount 1 ; - sh:severity sh:Warning ; - sh:message "`DownloadAction` SHOULD have `actionStatus` property." ; - ] . - diff --git a/rocrate_validator/profiles/five-safes-crate/should/1_requesting_agent.ttl b/rocrate_validator/profiles/five-safes-crate/should/1_requesting_agent.ttl deleted file mode 100644 index 332c67d3d..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/1_requesting_agent.ttl +++ /dev/null @@ -1,46 +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:AgentIsMemberOf - a sh:NodeShape ; - sh:name "Requesting Agent" ; - sh:target [ - a sh:SPARQLTarget ; - sh:prefixes ro-crate:sparqlPrefixes ; - sh:select """ - SELECT DISTINCT ?this WHERE { - ?action a schema:CreateAction ; - schema:agent ?this . - } - """ - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "memberOf" ; - sh:path schema:memberOf; - sh:minCount 1 ; - sh:severity sh:Warning ; - sh:message """The Requesting Agent SHOULD have a `memberOf` property.""" ; - ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/2_requesting_agent.ttl b/rocrate_validator/profiles/five-safes-crate/should/2_requesting_agent.ttl deleted file mode 100644 index c21b3f977..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/2_requesting_agent.ttl +++ /dev/null @@ -1,49 +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: . - - -# Person who is the agent of a CreateAction SHOULD have an affiliation -five-safes-crate:PersonAgentHasAffiliation - a sh:NodeShape ; - sh:name "Agent of CreateAction" ; - sh:description "The agent of a CreateAction entity" ; - sh:target [ - a sh:SPARQLTarget ; - sh:prefixes ro-crate:sparqlPrefixes ; - sh:select """ - SELECT DISTINCT ?this WHERE { - ?action a schema:CreateAction ; - schema:agent ?this . - } - """ - ] ; - - # The agent of a CreateAction entity SHOULD have an affiliation - sh:property [ - a sh:PropertyShape ; - sh:name "Presence of affiliations" ; - sh:path schema:affiliation ; - sh:minCount 1 ; - sh:severity sh:Warning ; - sh:message "The agent of a CreateAction entity SHOULD have an affiliation" ; - ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/6_workflow_reference.ttl b/rocrate_validator/profiles/five-safes-crate/should/6_workflow_reference.ttl deleted file mode 100644 index 98c285652..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/6_workflow_reference.ttl +++ /dev/null @@ -1,49 +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:DatasetMustHaveDistributionIfURI - a sh:NodeShape ; - sh:name "mainEntity" ; - sh:targetObjectsOf schema:mainEntity ; - sh:description "If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ; - - sh:sparql [ - a sh:SPARQLConstraint ; - sh:name "distribution" ; - sh:description "If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ; - sh:prefixes ro-crate:sparqlPrefixes ; - sh:select """ - SELECT $this - WHERE { - FILTER (STRSTARTS(STR($this), "http://") || STRSTARTS(STR($this), "https://")) . - FILTER NOT EXISTS { - $this schema:distribution ?dist . - FILTER (STRSTARTS(STR(?dist), "http://") || STRSTARTS(STR(?dist), "https://")) . - } - } - """ ; - sh:severity sh:Warning ; - sh:message "If mainEntity has an HTTP(S) @id SHOULD have at least one distribution with an HTTP(S) URL." ; - ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/7_requested_workflow_run.ttl b/rocrate_validator/profiles/five-safes-crate/should/7_requested_workflow_run.ttl deleted file mode 100644 index 41af739c0..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/7_requested_workflow_run.ttl +++ /dev/null @@ -1,36 +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: . - - -# CreateAction SHOULD have object property with minimum cardinality 1 -five-safes-crate:CreateActionShouldHaveObjectProperty - a sh:NodeShape ; - sh:targetClass schema:CreateAction ; - sh:name "CreateAction" ; - sh:property [ - sh:path schema:object ; - sh:minCount 1 ; - sh:nodeKind sh:IRI ; - sh:severity sh:Warning ; - sh:message "`CreateAction` SHOULD have the property `object` with IRI values." ; - ] . \ No newline at end of file From f53a8f2daba16a087849f7178067f3c5d2234f5e Mon Sep 17 00:00:00 2001 From: EttoreM Date: Wed, 21 Jan 2026 14:45:53 +0000 Subject: [PATCH 2/3] Removed lint errors. --- .../profiles/five-safes-crate/1_responsible_project.ttl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rocrate_validator/profiles/five-safes-crate/1_responsible_project.ttl b/rocrate_validator/profiles/five-safes-crate/1_responsible_project.ttl index 69a1129ea..2f51081ec 100644 --- a/rocrate_validator/profiles/five-safes-crate/1_responsible_project.ttl +++ b/rocrate_validator/profiles/five-safes-crate/1_responsible_project.ttl @@ -61,7 +61,7 @@ five-safes-crate:ResponsibleProject ] . -#=== SHOUD shapes ===# +#=== SHOULD shapes ===# five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection a sh:NodeShape ; From 767e47fd9eb10f63971a02e9e0974a68333a7348 Mon Sep 17 00:00:00 2001 From: EttoreM Date: Wed, 21 Jan 2026 16:20:16 +0000 Subject: [PATCH 3/3] Fixed failing tests (due to unsaved files, not to the tests themselves). --- .../five-safes-crate/13_validation_phase.ttl | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) diff --git a/rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl b/rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl index 735ba27b8..0a46cc813 100644 --- a/rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl +++ b/rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl @@ -23,6 +23,8 @@ @prefix xsd: . +#=== MUST shapes ===# + five-safes-crate:ValidationCheckObjectHasDescriptiveNameAndIsAssessAction a sh:NodeShape ; sh:name "ValidationCheck" ; @@ -124,3 +126,183 @@ five-safes-crate:ValidationCheckActionStatusMustHaveAllowedValue sh:severity sh:Violation ; sh:message "actionStatus MUST be either PotentialActionStatus, ActiveActionStatus, CompletedActionStatus, or FailedActionStatus." ; ] . + + +#=== SHOULD shapes ===# + +five-safes-crate:RootDataEntityShouldMentionValidationCheckObject + a sh:NodeShape ; + sh:name "RootDataEntity" ; + sh:targetClass ro-crate:RootDataEntity ; + sh:description "" ; + + sh:sparql [ + a sh:SPARQLConstraint ; + sh:name "mentions" ; + sh:description "RootDataEntity SHOULD mention a ValidationCheck object." ; + sh:select """ + PREFIX schema: + PREFIX shp: + SELECT $this + WHERE { + FILTER NOT EXISTS{ + $this schema:mentions ?action . + ?action schema:additionalType shp:ValidationCheck . + } + } + """ ; + sh:severity sh:Warning ; + sh:message "RootDataEntity SHOULD mention a ValidationCheck object." ; + ] . + + +five-safes-crate:ValidationCheckObjectShouldPointToRootDataEntity + a sh:NodeShape ; + sh:name "ValidationCheck" ; + sh:description "" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + SELECT ?this + WHERE { + ?this schema:additionalType shp:ValidationCheck . + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "object" ; + sh:path schema:object ; + sh:minCount 1 ; + sh:class ro-crate:RootDataEntity ; + sh:severity sh:Warning ; + sh:message "`ValidationCheck` --> `object` SHOULD point to the root of the RO-Crate" ; + ] . + +five-safes-crate:ValidationCheckInstrumentShouldPointToEntityWithSpecificId + a sh:NodeShape ; + sh:name "ValidationCheck" ; + sh:description "" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + SELECT ?this + WHERE { + ?this schema:additionalType shp:ValidationCheck . + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "instrument" ; + sh:description "" ; + sh:path schema:instrument ; + sh:minCount 1 ; + sh:nodeKind sh:IRI ; + sh:hasValue ; + sh:severity sh:Warning ; + sh:message "`ValidationCheck` --> `instrument` SHOULD point to an entity with @id https://w3id.org/5s-crate/0.4" ; + ] . + + +five-safes-crate:ValidationCheckShouldHaveActionStatus + a sh:NodeShape ; + sh:name "ValidationCheck" ; + sh:description "" ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + + SELECT ?this + WHERE { + ?this schema:additionalType shp:ValidationCheck . + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "ActionStatus" ; + sh:path schema:actionStatus ; + sh:minCount 1 ; + sh:severity sh:Warning ; + sh:message "ValidationCheck SHOULD have actionStatus property." ; + ] . + + +five-safes-crate:DownloadActionShouldHaveEndTimeIfBegun + a sh:NodeShape ; + sh:name "ValidationCheck" ; + sh:description "" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + SELECT ?this + WHERE { + ?this schema:additionalType shp:ValidationCheck ; + 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 "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; + sh:message "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; + ] . + + +#=== MAY shapes ===# + +five-safes-crate:DownloadActionMayHaveStartTimeIfBegun + a sh:NodeShape ; + sh:name "ValidationCheck" ; + sh:description "" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + SELECT ?this + WHERE { + ?this schema:additionalType shp:ValidationCheck ; + 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 "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; + sh:message "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; + ] .