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 50% 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 1d466251..30de9c26 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,11 +23,93 @@ @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" ; sh:targetClass ro-crate:RootDataEntity ; sh:description "RootDataEntity SHOULD mention a disclosure object." ; + sh:severity sh:Warning ; sh:sparql [ a sh:SPARQLConstraint ; @@ -45,7 +127,6 @@ five-safes-crate:RootDataEntityShouldMentionDisclosureObject } } """ ; - sh:severity sh:Warning ; sh:message "`RootDataEntity` SHOULD mention a disclosure object." ; ] . @@ -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." ; + ] . + + +#=== 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." ; ] . \ No newline at end of file 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 46943191..00000000 --- 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/8_disclosure_phase.ttl b/rocrate_validator/profiles/five-safes-crate/must/8_disclosure_phase.ttl deleted file mode 100644 index 3e6a2de0..00000000 --- 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)." ; - ] .