Skip to content

Commit 4f3fced

Browse files
committed
Provided RFC 339 pattern for timestamps in relevant messages.
1 parent 23ac001 commit 4f3fced

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ five-safes-crate:WorkflowMustHaveDescriptiveName
4444
five-safes-crate:WorkflowexecutionObjectHasCompliantStartTimeFormat
4545
a sh:NodeShape ;
4646
sh:name "WorkflowExecution" ;
47-
sh:description "The startTime of the workflow execution object MUST follow the RFC 3339 standard." ;
47+
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))." ;
4848

4949
sh:target [
5050
a sh:SPARQLTarget ;
@@ -64,17 +64,16 @@ five-safes-crate:WorkflowexecutionObjectHasCompliantStartTimeFormat
6464
a sh:PropertyShape ;
6565
sh:name "StartTime" ;
6666
sh:path schema:startTime ;
67-
sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$" ;
67+
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})$" ;
6868
sh:severity sh:Violation ;
69-
sh:description "The startTime of the workflow execution object MUST follow the RFC 3339 standard." ;
70-
sh:message "The startTime of the workflow execution object MUST follow the RFC 3339 standard." ;
69+
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))." ;
7170
] .
7271

7372

7473
five-safes-crate:WorkflowexecutionObjectHasCompliantEndTimeFormat
7574
a sh:NodeShape ;
7675
sh:name "WorkflowExecution" ;
77-
sh:description "The endTime of the workflow execution object MUST follow the RFC 3339 standard." ;
76+
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))." ;
7877

7978
sh:target [
8079
a sh:SPARQLTarget ;
@@ -94,10 +93,9 @@ five-safes-crate:WorkflowexecutionObjectHasCompliantEndTimeFormat
9493
a sh:PropertyShape ;
9594
sh:name "EndTime" ;
9695
sh:path schema:endTime ;
97-
sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$" ;
96+
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})$" ;
9897
sh:severity sh:Violation ;
99-
sh:description "The endTime of the workflow execution object MUST follow the RFC 3339 standard." ;
100-
sh:message "The endTime of the workflow execution object MUST follow the RFC 3339 standard." ;
98+
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))." ;
10199
] .
102100

103101

tests/integration/profiles/five-safes-crate/test_5src_11_workflow_execution.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ def test_5src_workflow_object_has_no_properly_formatted_start_time():
121121
requirement_severity=Severity.REQUIRED,
122122
expected_validation_result=False,
123123
expected_triggered_requirements=["WorkflowExecution"],
124-
expected_triggered_issues=[
125-
"The startTime of the workflow execution object MUST follow the RFC 3339 standard."
126-
],
124+
expected_triggered_issues=[(
125+
"The startTime of the workflow execution object MUST follow the RFC 3339 standard. "
126+
"(YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))."
127+
)],
127128
profile_identifier="five-safes-crate",
128129
rocrate_entity_mod_sparql=sparql,
129130
)
@@ -148,9 +149,10 @@ def test_5src_workflow_object_has_no_properly_formatted_end_time():
148149
requirement_severity=Severity.REQUIRED,
149150
expected_validation_result=False,
150151
expected_triggered_requirements=["WorkflowExecution"],
151-
expected_triggered_issues=[
152-
"The endTime of the workflow execution object MUST follow the RFC 3339 standard."
153-
],
152+
expected_triggered_issues=[(
153+
"The endTime of the workflow execution object MUST follow the RFC 3339 standard. "
154+
"(YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))."
155+
)],
154156
profile_identifier="five-safes-crate",
155157
rocrate_entity_mod_sparql=sparql,
156158
)

0 commit comments

Comments
 (0)