diff --git a/rocrate_validator/profiles/five-safes-crate/should/12_check_phase.ttl b/rocrate_validator/profiles/five-safes-crate/should/12_check_phase.ttl
index 3a8deea4..9944d8d1 100644
--- a/rocrate_validator/profiles/five-safes-crate/should/12_check_phase.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/should/12_check_phase.ttl
@@ -70,7 +70,7 @@ five-safes-crate:CheckValueObjectShouldPointToRootDataEntity
sh:name "object" ;
sh:path schema:object ;
sh:minCount 1 ;
- sh:hasValue ro-crate:RootDataEntity ;
+ sh:class ro-crate:RootDataEntity ;
sh:severity sh:Warning ;
sh:message "`CheckValue` --> `object` SHOULD point to the root of the RO-Crate" ;
] .
diff --git a/rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl b/rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl
index 6558715f..cb2b1813 100644
--- a/rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl
+++ b/rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl
@@ -65,24 +65,16 @@ five-safes-crate:ValidationCheckObjectShouldPointToRootDataEntity
""" ;
] ;
- sh:sparql [
- a sh:SPARQLConstraint ;
+ sh:property [
+ a sh:PropertyShape ;
sh:name "object" ;
- sh:select """
- PREFIX schema:
- PREFIX rocrate:
- SELECT $this
- WHERE {
- FILTER NOT EXISTS {
- $this schema:object rocrate:RootDataEntity .
- }
- }
- """ ;
+ sh:path schema:object ;
+ sh:minCount 1 ;
+ sh:class ro-crate:RootDataEntity ;
sh:severity sh:Warning ;
sh:message "`ValidationCheck` --> `object` SHOULD point to the root of the RO-Crate" ;
] .
-
five-safes-crate:ValidationCheckInstrumentShouldPointToEntityWithSpecificId
a sh:NodeShape ;
sh:name "ValidationCheck" ;
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 abbfc615..129c02df 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
@@ -26,7 +26,7 @@
# There SHOULD be a Sign-Off Phase
five-safes-crate:SignOffPhase
a sh:NodeShape ;
- sh:targetNode <./> ;
+ sh:targetClass ro-crate:RootDataEntity ;
sh:description "Check the Sign-Off Phase" ;
sh:sparql [
sh:select """
diff --git a/tests/integration/profiles/five-safes-crate/test_valid_5src.py b/tests/integration/profiles/five-safes-crate/test_valid_5src.py
index a8bbd992..994bb997 100644
--- a/tests/integration/profiles/five-safes-crate/test_valid_5src.py
+++ b/tests/integration/profiles/five-safes-crate/test_valid_5src.py
@@ -14,7 +14,9 @@
# limitations under the License.
import logging
+import pytest
+from rocrate_validator import services
from rocrate_validator.models import Severity
from tests.conftest import SKIP_LOCAL_DATA_ENTITY_EXISTENCE_CHECK_IDENTIFIER
from tests.ro_crates import ValidROC
@@ -23,6 +25,20 @@
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
+# Dynamically fetch the SKIP_WEB_RESOURCE_AVAILABILITY_IDENTIFIER
+# required as disable_inherited_profiles_reporting does not disable Python checks from
+# inherited profiles (https://github.com/crs4/rocrate-validator/issues/135)
+rocrate_profile = services.get_profile("ro-crate")
+if not rocrate_profile:
+ raise RuntimeError("Unable to load the RO-Crate profile")
+check_local_data_entity_existence = rocrate_profile.get_requirement_check(
+ "Web-based Data Entity: resource availability"
+)
+assert (
+ check_local_data_entity_existence
+), "Unable to find the requirement 'Web-based Data Entity: resource availability'"
+SKIP_WEB_RESOURCE_AVAILABILITY_IDENTIFIER = check_local_data_entity_existence.identifier
+
def test_valid_five_safes_crate_request_required():
"""Test a valid Five Safes Crate representing a request."""
@@ -37,6 +53,27 @@ def test_valid_five_safes_crate_request_required():
)
+@pytest.mark.xfail(
+ reason="""
+ Checks that ensure certain Five Safes actions are present currently fail for this crate,
+ as this crate represents an early stage of a process before those actions have happened.
+ """
+)
+def test_valid_five_safes_crate_request_recommended():
+ """Test a valid Five Safes Crate representing a request."""
+ do_entity_test(
+ ValidROC().five_safes_crate_request,
+ Severity.RECOMMENDED,
+ True,
+ profile_identifier="five-safes-crate",
+ skip_checks=[
+ SKIP_LOCAL_DATA_ENTITY_EXISTENCE_CHECK_IDENTIFIER,
+ SKIP_WEB_RESOURCE_AVAILABILITY_IDENTIFIER,
+ ],
+ disable_inherited_profiles_reporting=True,
+ )
+
+
def test_valid_five_safes_crate_result_required():
"""Test a valid Five Safes Crate representing a result."""
do_entity_test(
@@ -50,6 +87,21 @@ def test_valid_five_safes_crate_result_required():
)
+def test_valid_five_safes_crate_result_recommended():
+ """Test a valid Five Safes Crate representing a result."""
+ do_entity_test(
+ ValidROC().five_safes_crate_result,
+ Severity.RECOMMENDED,
+ True,
+ profile_identifier="five-safes-crate",
+ skip_checks=[
+ SKIP_LOCAL_DATA_ENTITY_EXISTENCE_CHECK_IDENTIFIER,
+ SKIP_WEB_RESOURCE_AVAILABILITY_IDENTIFIER,
+ ],
+ disable_inherited_profiles_reporting=True,
+ )
+
+
def test_valid_five_safes_crate_multiple_context():
"""Test a valid Five Safes Crate representing a result."""
do_entity_test(