From a79998eac6b61a13538d2060bdf897dcd2aa2e21 Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 16 Dec 2025 13:10:51 +0000
Subject: [PATCH 01/11] incomplete time test code
---
.../five-safes-crate/shape_library.ttl | 72 +++++++++++++++++++
.../five-safes-crate/should/4_sign_off.ttl | 37 +++-------
2 files changed, 80 insertions(+), 29 deletions(-)
create mode 100644 rocrate_validator/profiles/five-safes-crate/shape_library.ttl
diff --git a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
new file mode 100644
index 00000000..b0122855
--- /dev/null
+++ b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
@@ -0,0 +1,72 @@
+# 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 rdfs: .
+@prefix schema: .
+@prefix sh: .
+@prefix validator: .
+@prefix xsd: .
+@prefix shp: .
+
+
+
+
+
+five-safes-crate:TimeStamp
+ a sh:NodeShape ;
+ sh:datatype xsd:string ;
+ 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})$" .
+
+
+
+five-safes-crate:EndTimeStamp
+ a sh:NodeShape ;
+ sh:property [
+ sh:node five-safes-crate:TimeStamp ;
+ sh:description "End Time Check" ;
+ sh:path schema:endTime ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ sh:name "EndTime" ;
+ sh:severity sh:Warning ;
+ sh:message "Object SHOULD have endTime property if action completed or failed. This must follow ISO-8601 syntax" ;
+ ] .
+
+
+five-safes-crate:EndTimeSearch
+ a sh:SPARQLTargetType ;
+ rdfs:subClassOf sh:Target ;
+ sh:parameter [
+ sh:path five-safes-crate:addtype ;
+ sh:description "Additional Type for Class" ;
+ sh:class sh:additionalType ;
+ ] ;
+ sh:select """
+ PREFIX schema:
+ PREFIX shp:
+ SELECT ?this
+ WHERE {
+ ?this schema:additionalType $addtype ;
+ schema:actionStatus ?status .
+ FILTER(?status IN (
+ "http://schema.org/CompletedActionStatus",
+ "http://schema.org/FailedActionStatus"
+ ))
+ }
+ """ .
+
diff --git a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
index d671a0d9..bc03dbcb 100644
--- a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
@@ -22,6 +22,9 @@
@prefix xsd: .
@prefix shp: .
+<> a sh:ShapesGraph ;
+ sh:import <../shape_library.ttl> .
+
# There SHOULD be a Sign-Off Phase
five-safes-crate:SignOffPhase
@@ -147,32 +150,8 @@ five-safes-crate:SignOffPhaseProperties
five-safes-crate:SignOffPhaseEndTime
a sh:NodeShape ;
sh:description "Sign Off end time check" ;
-
- sh:target [
- a sh:SPARQLTarget ;
- sh:select """
- PREFIX schema:
- PREFIX shp:
- SELECT ?this
- WHERE {
- ?this schema:additionalType shp:SignOff ;
- schema:actionStatus ?status .
- FILTER(?status IN (
- "http://schema.org/CompletedActionStatus",
- "http://schema.org/FailedActionStatus"
- ))
- }
- """ ;
- ] ;
-
- sh:property [
- a sh:PropertyShape ;
- sh:name "EndTime" ;
- 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" ;
- ] .
+ sh:node five-safes-crate:EndTimeStamp ;
+ sh:target [
+ a five-safes-crate:EndTimeSearch ;
+ sh:additionalType shp:SignOff ;
+ ].
From ce2e393ac2d698c2d6797ec1dd61037ad95d90ff Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 23 Dec 2025 10:57:08 +0000
Subject: [PATCH 02/11] reduce endtimestamp nesting
---
.../profiles/five-safes-crate/shape_library.ttl | 7 +++++--
.../profiles/five-safes-crate/should/4_sign_off.ttl | 8 ++++++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
index b0122855..a30aa800 100644
--- a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
@@ -29,15 +29,18 @@
five-safes-crate:TimeStamp
a sh:NodeShape ;
+ sh:description "why a description" ;
sh:datatype xsd:string ;
- 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})$" .
+ 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})$" ;
+ sh:message "why is this needed?" .
five-safes-crate:EndTimeStamp
a sh:NodeShape ;
sh:property [
- sh:node five-safes-crate:TimeStamp ;
+ sh:datatype xsd:string ;
+ 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})$" ;
sh:description "End Time Check" ;
sh:path schema:endTime ;
sh:minCount 1 ;
diff --git a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
index bc03dbcb..9269e2dc 100644
--- a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
@@ -153,5 +153,9 @@ five-safes-crate:SignOffPhaseEndTime
sh:node five-safes-crate:EndTimeStamp ;
sh:target [
a five-safes-crate:EndTimeSearch ;
- sh:additionalType shp:SignOff ;
- ].
+ five-safes-crate:addtype shp:SignOff ;
+ ] ;
+ sh:message "Sign Off phase SHOULD have a compliant EndTime"
+ .
+
+
From bed01cf034353900d8fdb22dc8bb4cbb8183d1dd Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 23 Dec 2025 11:34:32 +0000
Subject: [PATCH 03/11] sign-off endtime tests extended expected error list
---
.../five-safes-crate/test_5src_4_signoff_phase.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py b/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
index 7f9cd8f3..b364e1cb 100644
--- a/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
+++ b/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
@@ -206,9 +206,10 @@ def test_5src_signoff_phase_no_endtime():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.RECOMMENDED,
expected_validation_result=False,
- expected_triggered_requirements=["SignOffPhaseEndTime"],
+ expected_triggered_requirements=["SignOffPhaseEndTime", "EndTimeStamp"],
expected_triggered_issues=[
- "Sign Off object SHOULD have endTime property if action completed or failed."
+ "Sign Off phase SHOULD have a compliant EndTime",
+ "Object SHOULD have endTime property if action completed or failed."
+ " This must follow ISO-8601 syntax"
],
profile_identifier="five-safes-crate",
@@ -242,9 +243,10 @@ def test_5src_signoff_phase_malformed_endtime():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.RECOMMENDED,
expected_validation_result=False,
- expected_triggered_requirements=["SignOffPhaseEndTime"],
+ expected_triggered_requirements=["SignOffPhaseEndTime", "EndTimeStamp"],
expected_triggered_issues=[
- "Sign Off object SHOULD have endTime property if action completed or failed."
+ "Sign Off phase SHOULD have a compliant EndTime",
+ "Object SHOULD have endTime property if action completed or failed."
+ " This must follow ISO-8601 syntax"
],
profile_identifier="five-safes-crate",
From c0bd05f110dc8aa802557c5dc1d807e15df0bc2f Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 23 Dec 2025 11:36:51 +0000
Subject: [PATCH 04/11] update endtimestamp pattern
---
.../profiles/five-safes-crate/shape_library.ttl | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
index a30aa800..8b5c26db 100644
--- a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
@@ -24,23 +24,11 @@
@prefix shp: .
-
-
-
-five-safes-crate:TimeStamp
- a sh:NodeShape ;
- sh:description "why a description" ;
- sh:datatype xsd:string ;
- 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})$" ;
- sh:message "why is this needed?" .
-
-
-
five-safes-crate:EndTimeStamp
a sh:NodeShape ;
sh:property [
sh:datatype xsd:string ;
- 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})$" ;
+ 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:description "End Time Check" ;
sh:path schema:endTime ;
sh:minCount 1 ;
From fca8f94ee1c3fb48df6652f336d0edd40b934c2e Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 23 Dec 2025 11:52:57 +0000
Subject: [PATCH 05/11] start and end timestamp updates
---
.../five-safes-crate/shape_library.ttl | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
index 8b5c26db..0505a8a8 100644
--- a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
@@ -33,13 +33,28 @@ five-safes-crate:EndTimeStamp
sh:path schema:endTime ;
sh:minCount 1 ;
sh:maxCount 1 ;
+ sh:name "EndTimeStamp" ;
+ sh:severity sh:Warning ;
+ sh:message "Object SHOULD have endTime property. This must follow ISO-8601 syntax." ;
+ ] .
+
+
+five-safes-crate:StartTimeStamp
+ a sh:NodeShape ;
+ sh:property [
+ sh:datatype xsd:string ;
+ 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:description "End Time Check" ;
+ sh:path schema:startTime ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
sh:name "EndTime" ;
sh:severity sh:Warning ;
- sh:message "Object SHOULD have endTime property if action completed or failed. This must follow ISO-8601 syntax" ;
+ sh:message "Object SHOULD have startTime property. This must follow ISO-8601 syntax" ;
] .
-five-safes-crate:EndTimeSearch
+five-safes-crate:ActionCFSearch
a sh:SPARQLTargetType ;
rdfs:subClassOf sh:Target ;
sh:parameter [
From 56c545f346a9f130ccd93daa6bc0621f6adc7d12 Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 23 Dec 2025 11:56:35 +0000
Subject: [PATCH 06/11] action search functions
---
.../five-safes-crate/shape_library.ttl | 25 ++++++++++++++++++-
.../five-safes-crate/should/4_sign_off.ttl | 4 +--
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
index 0505a8a8..749d109f 100644
--- a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
@@ -54,7 +54,7 @@ five-safes-crate:StartTimeStamp
] .
-five-safes-crate:ActionCFSearch
+five-safes-crate:ActionCompFailSearch
a sh:SPARQLTargetType ;
rdfs:subClassOf sh:Target ;
sh:parameter [
@@ -76,3 +76,26 @@ five-safes-crate:ActionCFSearch
}
""" .
+
+five-safes-crate:ActionActiveCompFailSearch
+ a sh:SPARQLTargetType ;
+ rdfs:subClassOf sh:Target ;
+ sh:parameter [
+ sh:path five-safes-crate:addtype ;
+ sh:description "Additional Type for Class" ;
+ sh:class sh:additionalType ;
+ ] ;
+ sh:select """
+ PREFIX schema:
+ PREFIX shp:
+ SELECT ?this
+ WHERE {
+ ?this schema:additionalType $addtype ;
+ schema:actionStatus ?status .
+ FILTER(?status IN (
+ "http://schema.org/ActiveActionStatus",
+ "http://schema.org/CompletedActionStatus",
+ "http://schema.org/FailedActionStatus"
+ ))
+ }
+ """ .
diff --git a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
index 9269e2dc..d9890ddf 100644
--- a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
@@ -152,10 +152,10 @@ five-safes-crate:SignOffPhaseEndTime
sh:description "Sign Off end time check" ;
sh:node five-safes-crate:EndTimeStamp ;
sh:target [
- a five-safes-crate:EndTimeSearch ;
+ a five-safes-crate:ActionCompFailSearch ;
five-safes-crate:addtype shp:SignOff ;
] ;
- sh:message "Sign Off phase SHOULD have a compliant EndTime"
+ sh:message "Sign Off phase SHOULD have a compliant EndTime if action completed or failed."
.
From 1ad0f2b86fec9f33e3b5ef47f81deb3db26e5357 Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 23 Dec 2025 11:57:18 +0000
Subject: [PATCH 07/11] signoff endtime tests updated
---
.../five-safes-crate/test_5src_4_signoff_phase.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py b/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
index b364e1cb..2bb278d3 100644
--- a/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
+++ b/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
@@ -208,9 +208,8 @@ def test_5src_signoff_phase_no_endtime():
expected_validation_result=False,
expected_triggered_requirements=["SignOffPhaseEndTime", "EndTimeStamp"],
expected_triggered_issues=[
- "Sign Off phase SHOULD have a compliant EndTime",
- "Object SHOULD have endTime property if action completed or failed."
- + " This must follow ISO-8601 syntax"
+ "Sign Off phase SHOULD have a compliant EndTime if action completed or failed.",
+ "Object SHOULD have endTime property. This must follow ISO-8601 syntax."
],
profile_identifier="five-safes-crate",
rocrate_entity_mod_sparql=sparql,
@@ -245,9 +244,8 @@ def test_5src_signoff_phase_malformed_endtime():
expected_validation_result=False,
expected_triggered_requirements=["SignOffPhaseEndTime", "EndTimeStamp"],
expected_triggered_issues=[
- "Sign Off phase SHOULD have a compliant EndTime",
- "Object SHOULD have endTime property if action completed or failed."
- + " This must follow ISO-8601 syntax"
+ "Sign Off phase SHOULD have a compliant EndTime if action completed or failed.",
+ "Object SHOULD have endTime property. This must follow ISO-8601 syntax."
],
profile_identifier="five-safes-crate",
rocrate_entity_mod_sparql=sparql,
From 7f1b0cc412f29f6f10edc76afc9090384fe19697 Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 23 Dec 2025 12:07:54 +0000
Subject: [PATCH 08/11] clean up endTime warnings
---
.../profiles/five-safes-crate/shape_library.ttl | 4 ++--
.../profiles/five-safes-crate/should/4_sign_off.ttl | 2 +-
.../five-safes-crate/test_5src_4_signoff_phase.py | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
index 749d109f..96b2ece5 100644
--- a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
@@ -35,7 +35,7 @@ five-safes-crate:EndTimeStamp
sh:maxCount 1 ;
sh:name "EndTimeStamp" ;
sh:severity sh:Warning ;
- sh:message "Object SHOULD have endTime property. This must follow ISO-8601 syntax." ;
+ sh:message "endTime property MUST follow ISO-8601 syntax. e.g. 2023-04-19T10:15:12+01:00" ;
] .
@@ -50,7 +50,7 @@ five-safes-crate:StartTimeStamp
sh:maxCount 1 ;
sh:name "EndTime" ;
sh:severity sh:Warning ;
- sh:message "Object SHOULD have startTime property. This must follow ISO-8601 syntax" ;
+ sh:message "startTime property MUST follow ISO-8601 syntax. e.g. 2023-04-19T10:15:12+01:00" ;
] .
diff --git a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
index d9890ddf..92ab7bfa 100644
--- a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
@@ -155,7 +155,7 @@ five-safes-crate:SignOffPhaseEndTime
a five-safes-crate:ActionCompFailSearch ;
five-safes-crate:addtype shp:SignOff ;
] ;
- sh:message "Sign Off phase SHOULD have a compliant EndTime if action completed or failed."
+ sh:message "Sign Off phase SHOULD have a compliant endTime if action completed or failed."
.
diff --git a/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py b/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
index 2bb278d3..a6ec2e1f 100644
--- a/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
+++ b/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
@@ -208,8 +208,8 @@ def test_5src_signoff_phase_no_endtime():
expected_validation_result=False,
expected_triggered_requirements=["SignOffPhaseEndTime", "EndTimeStamp"],
expected_triggered_issues=[
- "Sign Off phase SHOULD have a compliant EndTime if action completed or failed.",
- "Object SHOULD have endTime property. This must follow ISO-8601 syntax."
+ "Sign Off phase SHOULD have a compliant endTime if action completed or failed.",
+ "endTime property MUST follow ISO-8601 syntax. e.g. 2023-04-19T10:15:12+01:00"
],
profile_identifier="five-safes-crate",
rocrate_entity_mod_sparql=sparql,
@@ -244,8 +244,8 @@ def test_5src_signoff_phase_malformed_endtime():
expected_validation_result=False,
expected_triggered_requirements=["SignOffPhaseEndTime", "EndTimeStamp"],
expected_triggered_issues=[
- "Sign Off phase SHOULD have a compliant EndTime if action completed or failed.",
- "Object SHOULD have endTime property. This must follow ISO-8601 syntax."
+ "Sign Off phase SHOULD have a compliant endTime if action completed or failed.",
+ "endTime property MUST follow ISO-8601 syntax. e.g. 2023-04-19T10:15:12+01:00"
],
profile_identifier="five-safes-crate",
rocrate_entity_mod_sparql=sparql,
From ba3524e55e0b2e8e41810d4c0a99a0cb40631b55 Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 23 Dec 2025 12:17:56 +0000
Subject: [PATCH 09/11] update sign-off startTime test, and move severity out
of library code
---
.../five-safes-crate/may/4_sign_off.ttl | 38 ++++---------------
.../five-safes-crate/shape_library.ttl | 4 +-
.../five-safes-crate/should/4_sign_off.ttl | 1 +
3 files changed, 10 insertions(+), 33 deletions(-)
diff --git a/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl
index b30dedc2..8e5b5d0b 100644
--- a/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl
@@ -25,34 +25,12 @@
five-safes-crate:SignOffPhaseStartTime
a sh:NodeShape ;
- sh:name "SignOffPhaseStartTime" ;
-
- sh:target [
- a sh:SPARQLTarget ;
- sh:select """
- PREFIX schema:
- PREFIX shp:
- SELECT ?this
- WHERE {
- ?this schema:additionalType shp:SignOff ;
- schema:actionStatus ?status .
- FILTER(?status IN (
- "http://schema.org/ActiveActionStatus",
- "http://schema.org/CompletedActionStatus",
- "http://schema.org/FailedActionStatus"
- ))
- }
- """ ;
+ sh:description "Sign Off start time check" ;
+ sh:node five-safes-crate:StartTimeStamp ;
+ sh:severity sh:Info ;
+ sh:target [
+ a five-safes-crate:ActionActiveCompFailSearch ;
+ five-safes-crate:addtype shp:SignOff ;
] ;
-
- sh:property [
- a sh:PropertyShape ;
- sh:name "StartTime" ;
- sh:path schema:startTime ;
- 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:Info ;
- sh:description "Sign Off object MAY have a startTime property if action is active, completed or failed. This must follow ISO-8601 syntax" ;
- sh:message "Sign Off object MAY have a startTime property if action is active, completed or failed. This must follow ISO-8601 syntax" ;
- ] .
+ sh:message "Sign Off phase MAY have a compliant startTime if action is active, completed or failed."
+ .
diff --git a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
index 96b2ece5..282354d8 100644
--- a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
@@ -34,7 +34,6 @@ five-safes-crate:EndTimeStamp
sh:minCount 1 ;
sh:maxCount 1 ;
sh:name "EndTimeStamp" ;
- sh:severity sh:Warning ;
sh:message "endTime property MUST follow ISO-8601 syntax. e.g. 2023-04-19T10:15:12+01:00" ;
] .
@@ -48,8 +47,7 @@ five-safes-crate:StartTimeStamp
sh:path schema:startTime ;
sh:minCount 1 ;
sh:maxCount 1 ;
- sh:name "EndTime" ;
- sh:severity sh:Warning ;
+ sh:name "StartTime" ;
sh:message "startTime property MUST follow ISO-8601 syntax. e.g. 2023-04-19T10:15:12+01:00" ;
] .
diff --git a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
index 92ab7bfa..30cc15fc 100644
--- a/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl
@@ -151,6 +151,7 @@ five-safes-crate:SignOffPhaseEndTime
a sh:NodeShape ;
sh:description "Sign Off end time check" ;
sh:node five-safes-crate:EndTimeStamp ;
+ sh:severity sh:Warning ;
sh:target [
a five-safes-crate:ActionCompFailSearch ;
five-safes-crate:addtype shp:SignOff ;
From 945a64db42d963b6367738812218795429873c72 Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 23 Dec 2025 12:19:31 +0000
Subject: [PATCH 10/11] update signoff startTime tests
---
.../five-safes-crate/test_5src_4_signoff_phase.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py b/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
index a6ec2e1f..5f4fdb86 100644
--- a/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
+++ b/tests/integration/profiles/five-safes-crate/test_5src_4_signoff_phase.py
@@ -274,10 +274,10 @@ def test_5src_signoff_phase_no_starttime():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.OPTIONAL,
expected_validation_result=False,
- expected_triggered_requirements=["SignOffPhaseStartTime"],
+ expected_triggered_requirements=["SignOffPhaseStartTime", "StartTimeStamp"],
expected_triggered_issues=[
- "Sign Off object MAY have a startTime property if action is active, completed or failed."
- + " This must follow ISO-8601 syntax"
+ "Sign Off phase MAY have a compliant startTime if action is active, completed or failed.",
+ "startTime property MUST follow ISO-8601 syntax. e.g. 2023-04-19T10:15:12+01:00"
],
profile_identifier="five-safes-crate",
rocrate_entity_mod_sparql=sparql,
@@ -310,10 +310,10 @@ def test_5src_signoff_phase_malformed_starttime():
rocrate_path=ValidROC().five_safes_crate_result,
requirement_severity=Severity.OPTIONAL,
expected_validation_result=False,
- expected_triggered_requirements=["SignOffPhaseStartTime"],
+ expected_triggered_requirements=["SignOffPhaseStartTime", "StartTimeStamp"],
expected_triggered_issues=[
- "Sign Off object MAY have a startTime property if action is active, completed or failed."
- + " This must follow ISO-8601 syntax"
+ "Sign Off phase MAY have a compliant startTime if action is active, completed or failed.",
+ "startTime property MUST follow ISO-8601 syntax. e.g. 2023-04-19T10:15:12+01:00"
],
profile_identifier="five-safes-crate",
rocrate_entity_mod_sparql=sparql,
From f82c7002888cd31c6707d41f37a97d92d8dbeddd Mon Sep 17 00:00:00 2001
From: Douglas Lowe <10961945+douglowe@users.noreply.github.com>
Date: Tue, 23 Dec 2025 16:13:05 +0000
Subject: [PATCH 11/11] move towards modular explicit must reqs for time
strings
---
.../profiles/five-safes-crate/may/4_sign_off.ttl | 9 ++++++---
.../must/11_workflow_execution_phase.ttl | 4 +++-
.../profiles/five-safes-crate/must/4_sign_off.ttl | 7 ++++++-
.../profiles/five-safes-crate/shape_library.ttl | 12 ++++++------
4 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl
index 8e5b5d0b..ebb55b45 100644
--- a/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/may/4_sign_off.ttl
@@ -26,11 +26,14 @@
five-safes-crate:SignOffPhaseStartTime
a sh:NodeShape ;
sh:description "Sign Off start time check" ;
- sh:node five-safes-crate:StartTimeStamp ;
sh:severity sh:Info ;
sh:target [
a five-safes-crate:ActionActiveCompFailSearch ;
five-safes-crate:addtype shp:SignOff ;
] ;
- sh:message "Sign Off phase MAY have a compliant startTime if action is active, completed or failed."
- .
+ sh:property [
+ sh:path schema:startTime ;
+ sh:minCount 1 ;
+ sh:maxCount 1 ;
+ sh:message "Sign Off phase MAY have a startTime if action is active, completed or failed." ;
+ ] .
diff --git a/rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl b/rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl
index 4551da6c..bf10ac56 100644
--- a/rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl
@@ -72,7 +72,9 @@ five-safes-crate:WorkflowexecutionObjectHasCompliantEndTimeFormat
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))." ;
- ] .
+ ] ;
+
+ sh:node five-safes-crate:EndTimeStamp .
five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues
diff --git a/rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl b/rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl
index 2b61a259..854cd9e6 100644
--- a/rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/must/4_sign_off.ttl
@@ -21,6 +21,7 @@
@prefix sh: .
@prefix validator: .
@prefix xsd: .
+@prefix shp: .
five-safes-crate:SignOffObjectActionAndName
a sh:NodeShape ;
@@ -53,7 +54,11 @@ five-safes-crate:SignOffObjectActionAndName
sh:hasValue schema:AssessAction;
sh:severity sh:Violation ;
sh:message "Sign Off phase MUST be a `schema:AssessAction`." ;
- ] .
+ ] ;
+
+ sh:node five-safes-crate:StartTimeStamp ;
+
+ sh:node five-safes-crate:EndTimeStamp .
five-safes-crate:SignOffObjectHasActionStatus
a sh:NodeShape ;
diff --git a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
index 282354d8..6607e3bc 100644
--- a/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/shape_library.ttl
@@ -31,10 +31,10 @@ five-safes-crate:EndTimeStamp
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:description "End Time Check" ;
sh:path schema:endTime ;
- sh:minCount 1 ;
- sh:maxCount 1 ;
+ sh:minCount 0 ;
sh:name "EndTimeStamp" ;
sh:message "endTime property MUST follow ISO-8601 syntax. e.g. 2023-04-19T10:15:12+01:00" ;
+ sh:severity sh:Violation ;
] .
@@ -43,12 +43,12 @@ five-safes-crate:StartTimeStamp
sh:property [
sh:datatype xsd:string ;
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:description "End Time Check" ;
+ sh:description "Start Time Check" ;
sh:path schema:startTime ;
- sh:minCount 1 ;
- sh:maxCount 1 ;
- sh:name "StartTime" ;
+ sh:minCount 0 ;
+ sh:name "StartTimeStamp" ;
sh:message "startTime property MUST follow ISO-8601 syntax. e.g. 2023-04-19T10:15:12+01:00" ;
+ sh:severity sh:Violation ;
] .