Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions qqOA

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright (c) 2025 eScience Lab, The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@prefix ro: <./> .
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix purl: <http://purl.org/dc/terms/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .


five-safes-crate:DownloadActionMayHaveStartTimeIfBegun
a sh:NodeShape ;
sh:name "DownloadAction" ;
sh:description "" ;
sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?this
WHERE {
?this rdf:type schema: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:message "`DownloadAction` MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
] .
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# Copyright (c) 2025 eScience Lab, The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

@prefix ro: <./> .
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix purl: <http://purl.org/dc/terms/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .


five-safes-crate: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 of at least 10 characters." ;
sh:path schema:name ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:string ;
sh:minLength 10 ;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should specific a minimum length for these strings.

Copy link
Author

@EttoreM EttoreM Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requirement is that the name MUST be a descriptive, human-readable summary of the download action. I totally agree that 10 characters (or any other number) for minimum length is arbitrary. On the other end this is a baseline rule encouraging users to insert meaningful names rather than, say "XY".
I think we should reach an agreement on this point (@elichad, @douglowe , @alexhambley @stain). Just as a reminder, a minimal length of 10 was already enforced for at least another phase that has been merge into dev.

sh:severity sh:Violation ;
sh:message "DownloadAction MUST have a human readable name string of at least 10 characters." ;
] .

five-safes-crate:DownloadActionStartTimeMUSTFollowISOStandard
a sh:NodeShape ;
sh:name "DownloadAction" ;
sh:description "" ;
sh:targetClass schema:DownloadAction ;

sh:property [
a sh:PropertyShape ;
sh:name "StartTime" ;
sh:minCount 0;
sh:path schema:startTime ;
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:Violation ;
sh:message "`DownloadAction` --> `startTime` MUST follows the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
] .


five-safes-crate:DownloadActionEndTimeMUSTFollowISOStandard
a sh:NodeShape ;
sh:name "DownloadAction" ;
sh:description "" ;
sh:targetClass schema:DownloadAction ;

sh:property [
a sh:PropertyShape ;
sh:name "EndTime" ;
sh:minCount 0;
sh:path schema:endTime ;
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:Violation ;
sh:message "`DownloadAction` --> `endTime` MUST follows the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
] .


five-safes-crate:WorkflowSameAsAndRootDataEntityMainEntityMUSTBeTheSame
a sh:NodeShape ;
sh:name "Downloaded Workflow" ;
sh:description "" ;
sh:target [
a sh:SPARQLTarget ;
sh:select """
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?this
WHERE {
?this rdf:type schema:Dataset .
?s rdf:type schema:DownloadAction ;
schema:result ?this .
}
""" ;
];

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

SELECT $this
WHERE {
FILTER NOT EXISTS {
$this schema: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: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

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: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

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: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

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." ;
] .
Loading