Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,6 @@ five-safes-crate:WorkflowMustHaveDescriptiveName
] .


five-safes-crate:WorkflowexecutionObjectHasCompliantStartTimeFormat
a sh:NodeShape ;
sh:name "WorkflowExecution" ;
sh:description "The startTime of the workflow execution object MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
sh:targetClass schema:CreateAction ;

sh:property [
a sh:PropertyShape ;
sh:name "StartTime" ;
sh:path schema:startTime ;
sh:minCount 0 ;
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 "The startTime of the workflow execution object MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
] .


five-safes-crate:WorkflowexecutionObjectHasCompliantEndTimeFormat
a sh:NodeShape ;
sh:name "WorkflowExecution" ;
sh:description "The endTime of the workflow execution object MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
sh:targetClass schema:CreateAction ;

sh:property [
a sh:PropertyShape ;
sh:name "EndTime" ;
sh:path schema:endTime ;
sh:minCount 0 ;
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 "The endTime of the workflow execution object MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
] .


five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,10 @@ five-safes-crate:CheckValueStartTimeMustFollowISOStandard

}
""" ;
] ;

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



five-safes-crate:CheckValueEndTimeMustFollowISOStandard
a sh:NodeShape ;
sh:name "CheckValue" ;
Expand All @@ -103,15 +95,6 @@ five-safes-crate:CheckValueEndTimeMustFollowISOStandard

}
""" ;
] ;

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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,10 @@ five-safes-crate:ValidationCheckStartTimeMUSTFollowISOStandard
?this schema:additionalType shp:ValidationCheck .
}
""" ;
] ;

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 "ValidationCheck --> `startTime` MUST follows the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
] .



five-safes-crate:ValidationCheckEndTimeMUSTFollowISOStandard
a sh:NodeShape ;
sh:name "ValidationCheck" ;
Expand All @@ -169,14 +160,4 @@ five-safes-crate:ValidationCheckEndTimeMUSTFollowISOStandard
?this schema:additionalType shp:ValidationCheck .
}
""" ;
] ;

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 "ValidationCheck --> `endTime` MUST follows the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
] .
] .
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,6 @@ five-safes-crate:DownloadActionObjectMUSTHavesDescriptiveName
sh:message "DownloadAction MUST have a human readable name string." ;
] .

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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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:TimeStampFormat
a sh:NodeShape ;
sh:name "Timestamp Format" ;
sh:description "Timestamps MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
sh:targetSubjectsOf schema:startTime, schema:endTime;
sh:property [
a sh:PropertyShape ;
sh:name "End TimeStamp" ;
sh:path schema:endTime ;
sh:minCount 0 ;
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 "All `startTime` and `endTime` values MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
] ;
sh:property [
a sh:PropertyShape ;
sh:name "Start TimeStamp" ;
sh:path schema:startTime ;
sh:minCount 0 ;
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 "All `startTime` and `endTime` values MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
] .
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,9 @@ five-safes-crate:DisclosureObjectHasCompliantStartTimeFormat
schema:startTime ?o
}
""" ;
] ;

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



five-safes-crate:DisclosureObjectHasCompliantEndTimeFormat
a sh:NodeShape ;
Expand All @@ -145,14 +136,4 @@ five-safes-crate:DisclosureObjectHasCompliantEndTimeFormat
schema:endTime ?o
}
""" ;
] ;

sh:property [
a sh:PropertyShape ;
sh:name "EndTime" ;
sh:path schema:endTime ;
sh:minCount 0 ;
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 "`DisclosureCheck` --> `endTime` MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
] .
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,3 @@ five-safes-crate:CheckValueShouldHaveActionStatus
sh:severity sh:Warning ;
sh:message "CheckValue SHOULD have actionStatus property." ;
] .

Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ five-safes-crate:SignOffPhaseEndTime
sh:path schema:endTime ;
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:Warning ;
sh:description "Sign Off object SHOULD have endTime property if action completed or failed. This must follow ISO-8601 syntax" ;
sh:message "Sign Off object SHOULD have endTime property if action completed or failed. This must follow ISO-8601 syntax" ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ def test_5src_workflow_object_has_no_properly_formatted_start_time():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.REQUIRED,
expected_validation_result=False,
expected_triggered_requirements=["WorkflowExecution"],
expected_triggered_requirements=["Timestamp Format"],
expected_triggered_issues=[
(
"The startTime of the workflow execution object MUST follow the RFC 3339 standard "
"All `startTime` and `endTime` values MUST follow the RFC 3339 standard "
"(YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))."
)
],
Expand Down Expand Up @@ -169,10 +169,10 @@ def test_5src_workflow_object_has_no_properly_formatted_end_time():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.REQUIRED,
expected_validation_result=False,
expected_triggered_requirements=["WorkflowExecution"],
expected_triggered_requirements=["Timestamp Format"],
expected_triggered_issues=[
(
"The endTime of the workflow execution object MUST follow the RFC 3339 standard "
"All `startTime` and `endTime` values MUST follow the RFC 3339 standard "
"(YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))."
)
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ def test_5src_check_value_start_time_not_iso_standard():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.REQUIRED,
expected_validation_result=False,
expected_triggered_requirements=["CheckValue"],
expected_triggered_requirements=["Timestamp Format"],
expected_triggered_issues=[
(
"`CheckValue` --> `startTime` MUST follows the RFC 3339 standard "
"All `startTime` and `endTime` values MUST follow the RFC 3339 standard "
"(YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))."
)
],
Expand Down Expand Up @@ -142,10 +142,10 @@ def test_5src_check_value_end_time_not_iso_standard():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.REQUIRED,
expected_validation_result=False,
expected_triggered_requirements=["CheckValue"],
expected_triggered_requirements=["Timestamp Format"],
expected_triggered_issues=[
(
"`CheckValue` --> `endTime` MUST follows the RFC 3339 standard "
"All `startTime` and `endTime` values MUST follow the RFC 3339 standard "
"(YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))."
)
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ def test_5src_validation_check_start_time_not_iso_standard():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.REQUIRED,
expected_validation_result=False,
expected_triggered_requirements=["ValidationCheck"],
expected_triggered_requirements=["Timestamp Format"],
expected_triggered_issues=[
(
"ValidationCheck --> `startTime` MUST follows the RFC 3339 standard "
"All `startTime` and `endTime` values MUST follow the RFC 3339 standard "
"(YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))."
)
],
Expand Down Expand Up @@ -166,10 +166,10 @@ def test_5src_validation_check_end_time_not_iso_standard():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.REQUIRED,
expected_validation_result=False,
expected_triggered_requirements=["ValidationCheck"],
expected_triggered_requirements=["Timestamp Format"],
expected_triggered_issues=[
(
"ValidationCheck --> `endTime` MUST follows the RFC 3339 standard "
"All `startTime` and `endTime` values MUST follow the RFC 3339 standard "
"(YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))."
)
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ def test_5src_download_action_start_time_not_iso_standard():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.REQUIRED,
expected_validation_result=False,
expected_triggered_requirements=["DownloadAction"],
expected_triggered_requirements=["Timestamp Format"],
expected_triggered_issues=[
(
"`DownloadAction` --> `startTime` MUST follows the RFC 3339 standard "
"All `startTime` and `endTime` values MUST follow the RFC 3339 standard "
"(YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))."
)
],
Expand Down Expand Up @@ -135,10 +135,10 @@ def test_5src_check_value_end_time_not_iso_standard():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.REQUIRED,
expected_validation_result=False,
expected_triggered_requirements=["DownloadAction"],
expected_triggered_requirements=["Timestamp Format"],
expected_triggered_issues=[
(
"`DownloadAction` --> `endTime` MUST follows the RFC 3339 standard "
"All `startTime` and `endTime` values MUST follow the RFC 3339 standard "
"(YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))."
)
],
Expand Down Expand Up @@ -361,6 +361,7 @@ def test_5src_download_action_does_not_have_action_status_property():

# ----- MAY fails tests


def test_5src_downloaded_workflow_is_not_represented_by_its_own_entity():
sparql = (
SPARQL_PREFIXES
Expand Down
Loading