Skip to content

Commit e012cae

Browse files
committed
Addressed Alex' comments.
1 parent 06303a4 commit e012cae

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

rocrate_validator/profiles/five-safes-crate/must/6_workflow_reference.ttl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ five-safes-crate:mainEntityHasProperConformsTo
5656
sh:name "mainEntity" ;
5757
sh:description "The mainEntity of the RootDataEntity MUST have a conformsTo property with an IRI starting with https://w3id.org/workflowhub/workflow-ro-crate" ;
5858
sh:targetObjectsOf schema:mainEntity ;
59+
sh:property [
60+
a sh:PropertyShape ;
61+
sh:name "conformsTo" ;
62+
sh:path purl:conformsTo ;
63+
sh:minCount 1 ;
64+
sh:maxCount 1 ;
65+
sh:severity sh:Violation ;
66+
sh:message "mainEntity MUST have a conform property." ;
67+
] ;
5968
sh:sparql [
6069
a sh:SPARQLConstraint ;
6170
sh:name "conformsTo" ;

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,36 @@ def test_5src_root_data_entity_main_entity_not_dataset_iri():
8989
)
9090

9191

92+
def test_5src_main_entity_conformsTo_absent():
93+
"""
94+
Test a Five Safes Crate where the mainEntity does not have the purl:conformsTo property
95+
(we remove from the fraph the triplet mainEntity conformsTo ?o).
96+
"""
97+
sparql = (
98+
SPARQL_PREFIXES
99+
+ """
100+
PREFIX purl: <http://purl.org/dc/terms/>
101+
DELETE {
102+
?dataset purl:conformsTo ?o .
103+
}
104+
WHERE {
105+
<./> schema:mainEntity ?dataset .
106+
?dataset purl:conformsTo ?o .
107+
}
108+
"""
109+
)
110+
111+
do_entity_test(
112+
rocrate_path=ValidROC().five_safes_crate_request,
113+
requirement_severity=Severity.REQUIRED,
114+
expected_validation_result=False,
115+
expected_triggered_requirements=["mainEntity"],
116+
expected_triggered_issues=["mainEntity MUST have a conform property."],
117+
profile_identifier="five-safes-crate",
118+
rocrate_entity_mod_sparql=sparql,
119+
)
120+
121+
92122
def test_5src_main_entity_conformsTo_invalid():
93123
"""
94124
Test a Five Safes Crate where the mainEntity's purl:conformsTo IRI does NOT start with

0 commit comments

Comments
 (0)