Skip to content

Commit 57dba21

Browse files
committed
Addressed Eli's comments.
1 parent 613c925 commit 57dba21

3 files changed

Lines changed: 20 additions & 14 deletions

File tree

rocrate_validator/profiles/five-safes-crate/should/10_outputs.ttl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
five-safes-crate:CreateActionHasResultIfActionCompleted
2727
a sh:NodeShape ;
2828
sh:name "CreateAction" ;
29-
sh:description "`CreateAction` with CompleteActionStatus SHOULD have the `schema:result` property." ;
29+
sh:description "`CreateAction` with CompletedActionStatus SHOULD have the `schema:result` property." ;
3030

3131
sh:target [
3232
a sh:SPARQLTarget ;
3333
sh:name "Result" ;
34-
sh:description "`CreateAction` with CompleteActionStatus SHOULD have the `schema:result` property." ;
34+
sh:description "`CreateAction` with CompletedActionStatus SHOULD have the `schema:result` property." ;
3535
sh:prefixes ro-crate:sparqlPrefixes ;
3636
sh:select """
3737
SELECT ?this WHERE {
3838
?this a schema:CreateAction ;
39-
schema:actionStatus "http://schema.org/CompleteActionStatus" .
39+
schema:actionStatus "http://schema.org/CompletedActionStatus" .
4040
}
4141
"""
4242
] ;
@@ -48,7 +48,7 @@ five-safes-crate:CreateActionHasResultIfActionCompleted
4848
sh:path schema:result ;
4949
sh:minCount 1 ;
5050
sh:severity sh:Warning ;
51-
sh:message "`CreateAction` with CompleteActionStatus SHOULD have the `schema:result` property." ;
51+
sh:message "`CreateAction` with CompletedActionStatus SHOULD have the `schema:result` property." ;
5252
] .
5353

5454

tests/data/crates/valid/five-safes-crate-result/ro-crate-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
{
107107
"@id": "#query-37252371-c937-43bd-a0a7-3680b48c0538",
108108
"@type": "CreateAction",
109-
"actionStatus": "http://schema.org/CompleteActionStatus",
109+
"actionStatus": "http://schema.org/CompletedActionStatus",
110110
"agent": {
111111
"@id": "https://orcid.org/0000-0001-9842-9718"
112112
},

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828
def test_completed_createaction_does_not_have_result():
2929
"""
30-
Test a Five Safes Crate where `CreateAction` has `CompleteActionStatus` but
30+
Test a Five Safes Crate where `CreateAction` has `CompletedActionStatus` but
3131
does not have the property `result`.
32-
(We remove `result` from `CreateAction` if this has `CompleteActionStatus`)
32+
(We remove `result` from `CreateAction` if this has `CompletedActionStatus`)
3333
"""
3434
sparql = (
3535
SPARQL_PREFIXES
@@ -39,16 +39,20 @@ def test_completed_createaction_does_not_have_result():
3939
}
4040
WHERE {
4141
?action a schema:CreateAction ;
42-
schema:actionStatus "http://schema.org/CompleteActionStatus" . }
42+
schema:actionStatus "http://schema.org/CompletedActionStatus" ;
43+
schema:result ?o
44+
}
4345
"""
4446
)
4547

4648
do_entity_test(
47-
rocrate_path=ValidROC().five_safes_crate_request,
49+
rocrate_path=ValidROC().five_safes_crate_result,
4850
requirement_severity=Severity.RECOMMENDED,
4951
expected_validation_result=False,
50-
expected_triggered_requirements=None,
51-
expected_triggered_issues=None,
52+
expected_triggered_requirements=["CreateAction"],
53+
expected_triggered_issues=[
54+
"`CreateAction` with CompletedActionStatus SHOULD have the `schema:result` property."
55+
],
5256
profile_identifier="five-safes-crate",
5357
rocrate_entity_mod_sparql=sparql,
5458
)
@@ -77,11 +81,13 @@ def test_result_output_does_not_have_allowed_type():
7781
)
7882

7983
do_entity_test(
80-
rocrate_path=ValidROC().five_safes_crate_request,
84+
rocrate_path=ValidROC().five_safes_crate_result,
8185
requirement_severity=Severity.RECOMMENDED,
8286
expected_validation_result=False,
83-
expected_triggered_requirements=None,
84-
expected_triggered_issues=None,
87+
expected_triggered_requirements=["Output"],
88+
expected_triggered_issues=[
89+
"Result SHOULD have a `@type` among an allowed set of values."
90+
],
8591
profile_identifier="five-safes-crate",
8692
rocrate_entity_mod_sparql=sparql,
8793
)

0 commit comments

Comments
 (0)