@@ -119,7 +119,39 @@ def test_5src_root_data_entity_has_publisher_but_not_date_published():
119119 expected_validation_result = False ,
120120 expected_triggered_requirements = ["datePublished present on published crates" ],
121121 expected_triggered_issues = [
122- "Published crates SHOULD include schema:datePublished."
122+ "A crate SHOULD have a publishedDate if and only if it has a publisher."
123+ ],
124+ profile_identifier = "five-safes-crate" ,
125+ rocrate_entity_mod_sparql = sparql ,
126+ )
127+
128+
129+ def test_5src_root_data_entity_has_date_published_but_not_publisher ():
130+ """
131+ Test a Five Safes Crate where the RootDataEntity has published but not date published.
132+ """
133+ sparql = (
134+ SPARQL_PREFIXES
135+ + """
136+ DELETE {
137+ ?rootdataentity schema:datePublished ?datePublished .
138+ }
139+ WHERE {
140+ ?metadatafile a schema:CreativeWork ;
141+ schema:about ?rootdataentity .
142+ ?rootdataentity schema:publisher ?publisher ;
143+ schema:datePublished ?datePublished .
144+ }
145+ """
146+ )
147+
148+ do_entity_test (
149+ rocrate_path = ValidROC ().five_safes_crate_result ,
150+ requirement_severity = Severity .RECOMMENDED ,
151+ expected_validation_result = False ,
152+ expected_triggered_requirements = ["datePublished present on published crates" ],
153+ expected_triggered_issues = [
154+ "A crate SHOULD have a publishedDate if and only if it has a publisher."
123155 ],
124156 profile_identifier = "five-safes-crate" ,
125157 rocrate_entity_mod_sparql = sparql ,
0 commit comments