From 0d640e102148d06ced05aabe2d747080c28cacbe Mon Sep 17 00:00:00 2001 From: EttoreM Date: Sat, 24 Jan 2026 10:09:31 +0000 Subject: [PATCH] Merged 6_workflow_reference.tll files. --- .../{must => }/6_workflow_reference.ttl | 34 +++++++++++++ .../should/6_workflow_reference.ttl | 49 ------------------- 2 files changed, 34 insertions(+), 49 deletions(-) rename rocrate_validator/profiles/five-safes-crate/{must => }/6_workflow_reference.ttl (72%) delete mode 100644 rocrate_validator/profiles/five-safes-crate/should/6_workflow_reference.ttl 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 72% 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 34dd73d6..fcfbab90 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 ; @@ -55,6 +56,7 @@ five-safes-crate:mainEntityHasProperConformsTo a sh:NodeShape ; sh:name "mainEntity" ; sh:description "The mainEntity of the RootDataEntity MUST have a conformsTo property with an IRI starting with https://w3id.org/workflowhub/workflow-ro-crate" ; + sh:severity sh:Violation ; sh:targetObjectsOf schema:mainEntity ; sh:property [ a sh:PropertyShape ; @@ -78,3 +80,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:severity sh:Warning ; + + 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: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/should/6_workflow_reference.ttl b/rocrate_validator/profiles/five-safes-crate/should/6_workflow_reference.ttl deleted file mode 100644 index 98c28565..00000000 --- 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