2424
2525# ----- MUST fails tests
2626
27+
2728def test_5src_validation_check_not_of_type_assess_action ():
2829 sparql = (
29- SPARQL_PREFIXES + """
30+ SPARQL_PREFIXES
31+ + """
3032 DELETE {
3133 ?this rdf:type schema:AssessAction .
3234 }
@@ -52,7 +54,9 @@ def test_5src_validation_check_not_of_type_assess_action():
5254
5355
5456def test_5src_validation_check_name_not_a_string ():
55- sparql = (SPARQL_PREFIXES + """
57+ sparql = (
58+ SPARQL_PREFIXES
59+ + """
5660 DELETE {
5761 ?this schema:name ?name .
5862 }
@@ -62,14 +66,17 @@ def test_5src_validation_check_name_not_a_string():
6266 WHERE {
6367 ?this schema:additionalType shp:ValidationCheck .
6468 }
65- """ )
69+ """
70+ )
6671
6772 do_entity_test (
6873 rocrate_path = ValidROC ().five_safes_crate_result ,
6974 requirement_severity = Severity .REQUIRED ,
7075 expected_validation_result = False ,
7176 expected_triggered_requirements = ["ValidationCheck" ],
72- expected_triggered_issues = ["ValidationCheck MUST have a human readable name string." ],
77+ expected_triggered_issues = [
78+ "ValidationCheck MUST have a human readable name string."
79+ ],
7380 profile_identifier = "five-safes-crate" ,
7481 rocrate_entity_mod_sparql = sparql ,
7582 )
@@ -95,7 +102,10 @@ def test_5src_validation_check_has_action_status_with_not_allowed_value():
95102 expected_validation_result = False ,
96103 expected_triggered_requirements = ["ValidationCheck" ],
97104 expected_triggered_issues = [
98- "actionStatus MUST be either PotentialActionStatus, ActiveActionStatus, CompletedActionStatus, or FailedActionStatus."
105+ (
106+ "actionStatus MUST be either PotentialActionStatus, ActiveActionStatus, "
107+ "CompletedActionStatus, or FailedActionStatus."
108+ )
99109 ],
100110 profile_identifier = "five-safes-crate" ,
101111 rocrate_entity_mod_sparql = sparql ,
@@ -170,29 +180,37 @@ def test_5src_validation_check_end_time_not_iso_standard():
170180
171181# ----- SHOULD fails tests
172182
183+
173184def test_5src_root_data_entity_does_not_mention_validation_check_entity ():
174- sparql = (SPARQL_PREFIXES + """
185+ sparql = (
186+ SPARQL_PREFIXES
187+ + """
175188 DELETE {
176189 <./> schema:mentions ?o .
177190 }
178191 WHERE {
179192 ?o schema:additionalType shp:ValidationCheck ;
180193 }
181- """ )
194+ """
195+ )
182196
183197 do_entity_test (
184198 rocrate_path = ValidROC ().five_safes_crate_result ,
185199 requirement_severity = Severity .RECOMMENDED ,
186200 expected_validation_result = False ,
187201 expected_triggered_requirements = ["RootDataEntity" ],
188- expected_triggered_issues = ["RootDataEntity SHOULD mention a ValidationCheck object." ],
202+ expected_triggered_issues = [
203+ "RootDataEntity SHOULD mention a ValidationCheck object."
204+ ],
189205 profile_identifier = "five-safes-crate" ,
190206 rocrate_entity_mod_sparql = sparql ,
191207 )
192208
193209
194210def test_5src_validation_check_object_does_not_point_to_root_data_entity ():
195- sparql = (SPARQL_PREFIXES + """
211+ sparql = (
212+ SPARQL_PREFIXES
213+ + """
196214 DELETE {
197215 ?s schema:object <./> .
198216 }
@@ -202,29 +220,35 @@ def test_5src_validation_check_object_does_not_point_to_root_data_entity():
202220 WHERE {
203221 ?s schema:additionalType shp:ValidationCheck ;
204222 }
205- """ )
223+ """
224+ )
206225
207226 do_entity_test (
208227 rocrate_path = ValidROC ().five_safes_crate_result ,
209228 requirement_severity = Severity .RECOMMENDED ,
210229 expected_validation_result = False ,
211230 expected_triggered_requirements = ["ValidationCheck" ],
212- expected_triggered_issues = ["`ValidationCheck` --> `object` SHOULD point to the root of the RO-Crate" ],
231+ expected_triggered_issues = [
232+ "`ValidationCheck` --> `object` SHOULD point to the root of the RO-Crate"
233+ ],
213234 profile_identifier = "five-safes-crate" ,
214235 rocrate_entity_mod_sparql = sparql ,
215236 )
216237
217238
218239def test_5src_validation_check_instrument_does_not_point_to_5scrate_0p4 ():
219- sparql = (SPARQL_PREFIXES + """
240+ sparql = (
241+ SPARQL_PREFIXES
242+ + """
220243 DELETE {
221244 ?s schema:instrument <https://w3id.org/5s-crate/0.4> .
222245 }
223246 WHERE {
224247 ?s schema:additionalType shp:ValidationCheck ;
225248 schema:instrument <https://w3id.org/5s-crate/0.4> .
226249 }
227- """ )
250+ """
251+ )
228252
229253 do_entity_test (
230254 rocrate_path = ValidROC ().five_safes_crate_result ,
@@ -233,29 +257,34 @@ def test_5src_validation_check_instrument_does_not_point_to_5scrate_0p4():
233257 expected_triggered_requirements = ["ValidationCheck" ],
234258 expected_triggered_issues = [
235259 "`ValidationCheck` --> `instrument` SHOULD point to an entity with @id https://w3id.org/5s-crate/0.4"
236- ],
260+ ],
237261 profile_identifier = "five-safes-crate" ,
238262 rocrate_entity_mod_sparql = sparql ,
239263 )
240264
241265
242266def test_5src_Validation_check_does_not_have_action_status_property ():
243- sparql = (SPARQL_PREFIXES + """
267+ sparql = (
268+ SPARQL_PREFIXES
269+ + """
244270 DELETE {
245271 ?s schema:actionStatus ?o .
246272 }
247273 WHERE {
248274 ?s schema:additionalType shp:ValidationCheck ;
249275 schema:actionStatus ?o .
250276 }
251- """ )
277+ """
278+ )
252279
253280 do_entity_test (
254281 rocrate_path = ValidROC ().five_safes_crate_result ,
255282 requirement_severity = Severity .RECOMMENDED ,
256283 expected_validation_result = False ,
257284 expected_triggered_requirements = ["ValidationCheck" ],
258- expected_triggered_issues = ["ValidationCheck SHOULD have actionStatus property." ],
285+ expected_triggered_issues = [
286+ "ValidationCheck SHOULD have actionStatus property."
287+ ],
259288 profile_identifier = "five-safes-crate" ,
260289 rocrate_entity_mod_sparql = sparql ,
261290 )
@@ -293,6 +322,7 @@ def test_5src_download_action_does_not_have_end_time():
293322
294323# ----- MAY fails tests
295324
325+
296326def test_5src_download_action_does_not_have_start_time ():
297327 sparql = (
298328 SPARQL_PREFIXES
0 commit comments