diff --git a/rocrate_validator/profiles/five-safes-crate/should/10_outputs.ttl b/rocrate_validator/profiles/five-safes-crate/10_outputs.ttl similarity index 96% rename from rocrate_validator/profiles/five-safes-crate/should/10_outputs.ttl rename to rocrate_validator/profiles/five-safes-crate/10_outputs.ttl index f3d56ed56..6002fc2b3 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/10_outputs.ttl +++ b/rocrate_validator/profiles/five-safes-crate/10_outputs.ttl @@ -22,6 +22,11 @@ @prefix xsd: . +#=== MUST shapes ===# +# (none) + + +#=== SHOULD shapes ===# five-safes-crate:CreateActionHasResultIfActionCompleted a sh:NodeShape ; @@ -87,3 +92,6 @@ five-safes-crate:CreateActionResultOutputsHaveAllowedTypes ] ) . + +#=== MAY shapes ===# +# (none) diff --git a/rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl b/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl similarity index 51% rename from rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl rename to rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl index 0c1523102..849ec83d3 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/11_workflow_execution_phase.ttl +++ b/rocrate_validator/profiles/five-safes-crate/11_workflow_execution_phase.ttl @@ -23,6 +23,48 @@ @prefix xsd: . +#=== MUST shapes ===# + +five-safes-crate:WorkflowMustHaveDescriptiveName + a sh:NodeShape ; + sh:name "WorkflowExecution" ; + sh:targetClass schema:CreateAction ; + + sh:property [ + a sh:PropertyShape ; + sh:name "name" ; + sh:minCount 1 ; + sh:description "Workflow (CreateAction) MUST have a name string of at least 10 characters." ; + sh:path schema:name ; + sh:datatype xsd:string ; + sh:minLength 10 ; + sh:severity sh:Violation ; + sh:message "Workflow (CreateAction) MUST have a name string of at least 10 characters." ; + ] . + + +five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues + a sh:NodeShape ; + sh:name "WorkflowExecution" ; + sh:targetClass schema:CreateAction ; + sh:property [ + a sh:PropertyShape ; + sh:minCount 1 ; + sh:name "actionStatus" ; + sh:description "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; + sh:path schema:actionStatus ; + sh:in ( + "http://schema.org/PotentialActionStatus" + "http://schema.org/ActiveActionStatus" + "http://schema.org/CompletedActionStatus" + "http://schema.org/FailedActionStatus" + ) ; + sh:severity sh:Violation ; + sh:message "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; + ] . + + +#=== SHOULD shapes ===# five-safes-crate:RootDataEntityShouldMentionWorkflow a sh:NodeShape ; @@ -82,4 +124,48 @@ five-safes-crate:WorkflowexecutionObjectHasEndTimeIfEnded sh:severity sh:Warning ; sh:description "The workflow execution object SHOULD have an endTime property if it has ended." ; sh:message "The workflow execution object SHOULD have an endTime property if it has ended." ; - ] . \ No newline at end of file + ] . + + +#=== MAY shapes ===# + +five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun + a sh:NodeShape ; + sh:name "WorkflowExecution" ; + sh:description ( + "The workflow execution object MAY have a startTime if actionStatus is " + "either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." + ) ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX rdf: + + SELECT ?this + WHERE { + ?this rdf:type schema:CreateAction ; + schema:actionStatus ?status . + FILTER(?status IN ( + "http://schema.org/CompletedActionStatus", + "http://schema.org/FailedActionStatus", + "http://schema.org/ActiveActionStatus" + )) + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "StartTime" ; + sh:path schema:startTime ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:severity sh:Info ; + sh:description ( + "The workflow execution object MAY have a startTime if actionStatus is " + "either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." + ) ; + sh:message "The workflow execution object MAY have a startTime if actionStatus is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; + ] . diff --git a/rocrate_validator/profiles/five-safes-crate/should/12_check_phase.ttl b/rocrate_validator/profiles/five-safes-crate/12_check_phase.ttl similarity index 62% rename from rocrate_validator/profiles/five-safes-crate/should/12_check_phase.ttl rename to rocrate_validator/profiles/five-safes-crate/12_check_phase.ttl index faf744594..4c358511d 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/12_check_phase.ttl +++ b/rocrate_validator/profiles/five-safes-crate/12_check_phase.ttl @@ -19,31 +19,103 @@ @prefix schema: . @prefix purl: . @prefix sh: . +@prefix shp: . @prefix validator: . @prefix xsd: . -five-safes-crate:RootDataEntityShouldMentionCheckValueObject +#=== MUST shapes ===# + +five-safes-crate:CheckValueObjectHasDescriptiveNameAndIsAssessAction a sh:NodeShape ; - sh:name "RootDataEntity" ; - sh:targetClass ro-crate:RootDataEntity ; + sh:name "CheckValue" ; + sh:description "" ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + + SELECT ?this + WHERE { + ?this schema:additionalType shp:CheckValue . + } + """ ; + ] ; + + sh:property [ + sh:path rdf:type ; + sh:minCount 1 ; + sh:hasValue schema:AssessAction; + sh:severity sh:Violation ; + sh:message "CheckValue MUST be a `AssessAction`." ; + ] ; + + sh:property [ + sh:a sh:PropertyShape ; + sh:name "name" ; + sh:description "CheckValue MUST have a human readable name string." ; + sh:path schema:name ; + sh:datatype xsd:string ; + sh:severity sh:Violation ; + sh:message "CheckValue MUST have a human readable name string." ; + ] . + +five-safes-crate:CheckValueActionStatusMustHaveAllowedValues + a sh:NodeShape ; + sh:name "CheckValue" ; sh:description "" ; - sh:sparql [ - a sh:SPARQLConstraint ; - sh:name "mentions" ; - sh:description "RootDataEntity SHOULD mention a check value object." ; + sh:target [ + a sh:SPARQLTarget ; sh:select """ PREFIX schema: - PREFIX shp: - SELECT $this + PREFIX shp: + + SELECT ?this WHERE { - FILTER NOT EXISTS{ - $this schema:mentions ?action . - ?action schema:additionalType shp:CheckValue . - } + ?this schema:additionalType shp:CheckValue ; + schema:actionStatus ?status . } """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "ActionStatus" ; + sh:path schema:actionStatus ; + sh:in ( + "http://schema.org/PotentialActionStatus" + "http://schema.org/ActiveActionStatus" + "http://schema.org/CompletedActionStatus" + "http://schema.org/FailedActionStatus" + ) ; + sh:severity sh:Violation ; + sh:message "`CheckValue` --> `actionStatus` MUST have one of the allowed values." ; + ] . + + +#=== SHOULD shapes ===# + +five-safes-crate:RootDataEntityShouldMentionCheckValueObject + a sh:NodeShape ; + sh:name "RootDataEntity" ; + sh:targetClass ro-crate:RootDataEntity ; + sh:description "" ; + + sh:property [ + sh:path schema:mentions ; + + # Among the mentioned nodes, require at least one that matches this shape: + sh:qualifiedValueShape [ + sh:property [ + sh:path schema:additionalType ; + sh:hasValue shp:CheckValue ; + ] ; + ] ; + sh:qualifiedMinCount 1 ; + sh:severity sh:Warning ; sh:message "RootDataEntity SHOULD mention a check value object." ; ] . @@ -188,3 +260,38 @@ five-safes-crate:CheckValueShouldHaveActionStatus sh:severity sh:Warning ; sh:message "CheckValue SHOULD have actionStatus property." ; ] . + + +#=== MAY shapes ===# + +five-safes-crate:CheckValueMayHaveStartTime + a sh:NodeShape ; + sh:name "CheckValue" ; + sh:description "" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + SELECT ?this + WHERE { + ?this schema:additionalType shp:CheckValue ; + schema:actionStatus ?status . + FILTER(?status IN ( + "http://schema.org/CompletedActionStatus", + "http://schema.org/FailedActionStatus", + "http://schema.org/ActiveActionStatus" + )) + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "StartTime" ; + sh:path schema:startTime ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:severity sh:Info ; + sh:message "`CheckValue` MAY have the `startTime` property." ; + ] . diff --git a/rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl b/rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl similarity index 50% rename from rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl rename to rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl index cb2b18137..7cf032dc5 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/13_validation_phase.ttl +++ b/rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl @@ -19,31 +19,136 @@ @prefix schema: . @prefix purl: . @prefix sh: . +@prefix shp: . @prefix validator: . @prefix xsd: . -five-safes-crate:RootDataEntityShouldMentionValidationCheckObject +#=== MUST shapes ===# + +five-safes-crate:ValidationCheckObjectHasDescriptiveNameAndIsAssessAction a sh:NodeShape ; - sh:name "RootDataEntity" ; - sh:targetClass ro-crate:RootDataEntity ; + sh:name "ValidationCheck" ; sh:description "" ; - sh:sparql [ - a sh:SPARQLConstraint ; - sh:name "mentions" ; - sh:description "RootDataEntity SHOULD mention a ValidationCheck object." ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + + SELECT ?this + WHERE { + ?this schema:additionalType shp:ValidationCheck . + } + """ ; + ] ; + + sh:property [ + sh:path rdf:type ; + sh:minCount 1 ; + sh:hasValue schema:AssessAction; + sh:severity sh:Violation ; + sh:message "ValidationCheck MUST be a `AssessAction`." ; + ] ; + + sh:property [ + sh:a sh:PropertyShape ; + sh:name "name" ; + sh:description "ValidationCheck MUST have a human readable name string." ; + sh:path schema:name ; + sh:datatype xsd:string ; + sh:severity sh:Violation ; + sh:message "ValidationCheck MUST have a human readable name string." ; + ] . + + +five-safes-crate:ValidationCheckActionStatusMustHaveAllowedValue + a sh:NodeShape ; + sh:name "ValidationCheck" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + + SELECT ?this + WHERE { + ?this schema:additionalType shp:ValidationCheck ; + schema:actionStatus ?status . + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "actionStatus" ; + sh:description "The `actionStatus` of ValidationCheck MUST have an allowed value (see https://schema.org/ActionStatusType)." ; + sh:path schema:actionStatus ; + sh:in ( + "http://schema.org/PotentialActionStatus" + "http://schema.org/ActiveActionStatus" + "http://schema.org/CompletedActionStatus" + "http://schema.org/FailedActionStatus" + ) ; + sh:severity sh:Violation ; + sh:message "The `actionStatus` of ValidationCheck MUST have an allowed value (see https://schema.org/ActionStatusType)." ; + ] . + + +five-safes-crate:ValidationCheckActionStatusMustHaveAllowedValue + a sh:NodeShape ; + sh:name "ValidationCheck" ; + sh:target [ + a sh:SPARQLTarget ; sh:select """ PREFIX schema: - PREFIX shp: - SELECT $this + PREFIX shp: + + SELECT ?this WHERE { - FILTER NOT EXISTS{ - $this schema:mentions ?action . - ?action schema:additionalType shp:ValidationCheck . - } + ?this schema:additionalType shp:ValidationCheck . } """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:minCount 1 ; + sh:name "actionStatus" ; + sh:description "actionStatus MUST be either PotentialActionStatus, ActiveActionStatus, CompletedActionStatus, or FailedActionStatus." ; + sh:path schema:actionStatus ; + sh:in ( + "http://schema.org/PotentialActionStatus" + "http://schema.org/ActiveActionStatus" + "http://schema.org/CompletedActionStatus" + "http://schema.org/FailedActionStatus" + ) ; + sh:severity sh:Violation ; + sh:message "actionStatus MUST be either PotentialActionStatus, ActiveActionStatus, CompletedActionStatus, or FailedActionStatus." ; + ] . + + +#=== SHOULD shapes ===# + +five-safes-crate:RootDataEntityShouldMentionValidationCheckObject + a sh:NodeShape ; + sh:name "RootDataEntity" ; + sh:targetClass ro-crate:RootDataEntity ; + sh:description "" ; + + sh:property [ + sh:path schema:mentions ; + + # Require at least one mentioned node that is a ValidationCheck (via additionalType) + sh:qualifiedValueShape [ + sh:property [ + sh:path schema:additionalType ; + sh:hasValue shp:ValidationCheck ; + ] ; + ] ; + sh:qualifiedMinCount 1 ; + sh:severity sh:Warning ; sh:message "RootDataEntity SHOULD mention a ValidationCheck object." ; ] . @@ -163,3 +268,39 @@ five-safes-crate:DownloadActionShouldHaveEndTimeIfBegun sh:description "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; sh:message "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ; ] . + + +#=== MAY shapes ===# + +five-safes-crate:DownloadActionMayHaveStartTimeIfBegun + a sh:NodeShape ; + sh:name "ValidationCheck" ; + sh:description "" ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX schema: + PREFIX shp: + SELECT ?this + WHERE { + ?this schema:additionalType shp:ValidationCheck ; + schema:actionStatus ?status . + FILTER(?status IN ( + "http://schema.org/CompletedActionStatus", + "http://schema.org/FailedActionStatus", + "http://schema.org/ActiveActionStatus" + )) + } + """ ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "StartTime" ; + sh:path schema:startTime ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:severity sh:Info ; + sh:description "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; + sh:message "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; + ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/1_requesting_agent.ttl b/rocrate_validator/profiles/five-safes-crate/1_requesting_agent.ttl similarity index 81% rename from rocrate_validator/profiles/five-safes-crate/must/1_requesting_agent.ttl rename to rocrate_validator/profiles/five-safes-crate/1_requesting_agent.ttl index 2cc0d434d..7b480db04 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/1_requesting_agent.ttl +++ b/rocrate_validator/profiles/five-safes-crate/1_requesting_agent.ttl @@ -22,6 +22,8 @@ @prefix xsd: . +#=== MUST shapes ===# + five-safes-crate:AgentIsMemberOf a sh:NodeShape ; sh:name "Requesting Agent" ; @@ -79,4 +81,34 @@ five-safes-crate:AgentProjectIntersection """ ; sh:severity sh:Violation ; sh:message """At least one Project referenced by Agent -> memberOf MUST be included in the set of Projects referenced by RootDataEntity -> sourceOrganization.""" ; - ] . \ No newline at end of file + ] . + + +#=== SHOULD shapes ===# + +five-safes-crate:AgentIsMemberOf + a sh:NodeShape ; + sh:name "Requesting Agent" ; + sh:target [ + a sh:SPARQLTarget ; + sh:prefixes ro-crate:sparqlPrefixes ; + sh:select """ + SELECT DISTINCT ?this WHERE { + ?action a schema:CreateAction ; + schema:agent ?this . + } + """ + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "memberOf" ; + sh:path schema:memberOf; + sh:minCount 1 ; + sh:severity sh:Warning ; + sh:message """The Requesting Agent SHOULD have a `memberOf` property.""" ; + ] . + + +#=== MAY shapes ===# +# (none) diff --git a/rocrate_validator/profiles/five-safes-crate/should/1_responsible_project.ttl b/rocrate_validator/profiles/five-safes-crate/1_responsible_project.ttl similarity index 56% rename from rocrate_validator/profiles/five-safes-crate/should/1_responsible_project.ttl rename to rocrate_validator/profiles/five-safes-crate/1_responsible_project.ttl index 28d1c1eef..75f0b13f4 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/1_responsible_project.ttl +++ b/rocrate_validator/profiles/five-safes-crate/1_responsible_project.ttl @@ -22,6 +22,47 @@ @prefix xsd: . +#=== MUST shapes ===# + +five-safes-crate:ResponsibleProject + a sh:NodeShape ; + sh:name "Responsible Project" ; + sh:target [ + a sh:SPARQLTarget ; + sh:prefixes ro-crate:sparqlPrefixes ; + sh:select """ + SELECT DISTINCT ?this WHERE { + ?action a schema:CreateAction ; + schema:agent ?agent . + ?agent schema:memberOf ?this . + } + """ + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "funding" ; + sh:path schema:funding; + sh:class schema:Grant ; + sh:severity sh:Violation ; + sh:message """The property 'funding' of the Responsible Project MUST be of type Grant.""" ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "member" ; + sh:path schema:member; + sh:or ( + [ sh:class schema:Organization ] + [ sh:class schema:Person ] + ) ; + sh:severity sh:Violation ; + sh:message """The property 'member' of the Responsible Project MUST be of type schema:Organization or Person.""" ; + ] . + + +#=== SHOULD shapes ===# + five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection a sh:NodeShape ; sh:name "Organizations (members of Responsible Project)" ; @@ -57,4 +98,40 @@ five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection """ ; sh:severity sh:Warning ; sh:message """At least one of the organisations that are members of the responsible project SHOULD be included in the Requesting Agent's affiliations, if such properties exist.""" ; - ] . \ No newline at end of file + ] . + + +#=== MAY shapes ===# + +five-safes-crate:ResponsibleProject + a sh:NodeShape ; + sh:name "Responsible Project" ; + sh:target [ + a sh:SPARQLTarget ; + sh:prefixes ro-crate:sparqlPrefixes ; + sh:select """ + SELECT DISTINCT ?this WHERE { + ?action a schema:CreateAction ; + schema:agent ?agent . + ?agent schema:memberOf ?this . + } + """ + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "funding" ; + sh:path schema:funding; + sh:minCount 1 ; + sh:severity sh:Info ; + sh:message """The Responsible Project does not have the property `funding`.""" ; + ] ; + + sh:property [ + a sh:PropertyShape ; + sh:name "member" ; + sh:path schema:member; + sh:minCount 1 ; + sh:severity sh:Info ; + sh:message """The Responsible Project does not have the property `member`.""" ; + ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/1_root_data_entity.ttl b/rocrate_validator/profiles/five-safes-crate/1_root_data_entity.ttl similarity index 95% rename from rocrate_validator/profiles/five-safes-crate/must/1_root_data_entity.ttl rename to rocrate_validator/profiles/five-safes-crate/1_root_data_entity.ttl index bb9a51471..fe0516b4f 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/1_root_data_entity.ttl +++ b/rocrate_validator/profiles/five-safes-crate/1_root_data_entity.ttl @@ -22,6 +22,8 @@ @prefix xsd: . +#=== MUST shapes ===# + five-safes-crate:RootDataEntityRequiredProperties a sh:NodeShape ; sh:name "RootDataEntity" ; @@ -44,3 +46,11 @@ five-safes-crate:RootDataEntityRequiredProperties sh:severity sh:Violation ; sh:message """The `sourceOrganization` property of the RootDataEntity MUST point to a Project entity.""" ; ] . + + +#=== SHOULD shapes ===# +# (none) + + +#=== MAY shapes ===# +# (none) diff --git a/rocrate_validator/profiles/five-safes-crate/must/2_requesting_agent.ttl b/rocrate_validator/profiles/five-safes-crate/2_requesting_agent.ttl similarity index 73% rename from rocrate_validator/profiles/five-safes-crate/must/2_requesting_agent.ttl rename to rocrate_validator/profiles/five-safes-crate/2_requesting_agent.ttl index 4f3a4d898..f275fa59e 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/2_requesting_agent.ttl +++ b/rocrate_validator/profiles/five-safes-crate/2_requesting_agent.ttl @@ -22,6 +22,7 @@ @prefix xsd: . +#=== MUST shapes ===# five-safes-crate:CreateActionHasAgent a sh:NodeShape ; @@ -60,4 +61,37 @@ five-safes-crate:CreateActionHasAgent sh:nodeKind sh:IRI ; sh:severity sh:Violation ; sh:message "The affiliation of a CreateAction's agent MUST be a contextual entity with type Organization." ; - ] . \ No newline at end of file + ] . + + +#=== SHOULD shapes ===# + +# Person who is the agent of a CreateAction SHOULD have an affiliation +five-safes-crate:PersonAgentHasAffiliation + a sh:NodeShape ; + sh:name "Agent of CreateAction" ; + sh:description "The agent of a CreateAction entity" ; + sh:target [ + a sh:SPARQLTarget ; + sh:prefixes ro-crate:sparqlPrefixes ; + sh:select """ + SELECT DISTINCT ?this WHERE { + ?action a schema:CreateAction ; + schema:agent ?this . + } + """ + ] ; + + # The agent of a CreateAction entity SHOULD have an affiliation + sh:property [ + a sh:PropertyShape ; + sh:name "Presence of affiliations" ; + sh:path schema:affiliation ; + sh:minCount 1 ; + sh:severity sh:Warning ; + sh:message "The agent of a CreateAction entity SHOULD have an affiliation" ; + ] . + + +#=== MAY shapes ===# +# (none) \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/must/3_timestamp_format.ttl b/rocrate_validator/profiles/five-safes-crate/3_timestamp_format.ttl similarity index 100% rename from rocrate_validator/profiles/five-safes-crate/must/3_timestamp_format.ttl rename to rocrate_validator/profiles/five-safes-crate/3_timestamp_format.ttl diff --git a/rocrate_validator/profiles/five-safes-crate/must/6_workflow_reference.ttl b/rocrate_validator/profiles/five-safes-crate/6_workflow_reference.ttl similarity index 73% rename from rocrate_validator/profiles/five-safes-crate/must/6_workflow_reference.ttl rename to rocrate_validator/profiles/five-safes-crate/6_workflow_reference.ttl index 34dd73d62..446a64eac 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/6_workflow_reference.ttl +++ b/rocrate_validator/profiles/five-safes-crate/6_workflow_reference.ttl @@ -23,6 +23,7 @@ @prefix xsd: . +#=== MUST shapes ===# five-safes-crate:ReferenceToWorkflowCrate a sh:NodeShape ; @@ -78,3 +79,35 @@ five-safes-crate:mainEntityHasProperConformsTo } """ ; ] . + + +#=== SHOULD shapes ===# + +five-safes-crate:DatasetMustHaveDistributionIfURI + a sh:NodeShape ; + sh:name "mainEntity" ; + sh:targetObjectsOf schema:mainEntity ; + sh:description "If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ; + + sh:sparql [ + a sh:SPARQLConstraint ; + sh:name "distribution" ; + sh:description "If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ; + sh:prefixes ro-crate:sparqlPrefixes ; + sh:select """ + SELECT $this + WHERE { + FILTER (STRSTARTS(STR($this), "http://") || STRSTARTS(STR($this), "https://")) . + FILTER NOT EXISTS { + $this schema:distribution ?dist . + FILTER (STRSTARTS(STR(?dist), "http://") || STRSTARTS(STR(?dist), "https://")) . + } + } + """ ; + sh:severity sh:Warning ; + sh:message "If mainEntity has an HTTP(S) @id SHOULD have at least one distribution with an HTTP(S) URL." ; + ] . + + +#=== MAY shapes ===# +# (none) \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/must/7_requested_workflow_run.ttl b/rocrate_validator/profiles/five-safes-crate/7_requested_workflow_run.ttl similarity index 84% rename from rocrate_validator/profiles/five-safes-crate/must/7_requested_workflow_run.ttl rename to rocrate_validator/profiles/five-safes-crate/7_requested_workflow_run.ttl index d1a9ff6d3..495548060 100644 --- a/rocrate_validator/profiles/five-safes-crate/must/7_requested_workflow_run.ttl +++ b/rocrate_validator/profiles/five-safes-crate/7_requested_workflow_run.ttl @@ -22,6 +22,8 @@ @prefix xsd: . +#=== MUST shapes ===# + five-safes-crate:RootDataEntityMentionsCreateAction a sh:NodeShape ; sh:name "RootDataEntity" ; @@ -83,4 +85,24 @@ five-safes-crate:CreateActionInstrumentAndStatus """ ; sh:severity sh:Violation ; sh:message "Each `object` in `CreateAction` MUST reference an existing entity." ; - ] . \ No newline at end of file + ] . + + +#=== SHOULD shapes ===# + +# CreateAction SHOULD have object property with minimum cardinality 1 +five-safes-crate:CreateActionShouldHaveObjectProperty + a sh:NodeShape ; + sh:targetClass schema:CreateAction ; + sh:name "CreateAction" ; + sh:property [ + sh:path schema:object ; + sh:minCount 1 ; + sh:nodeKind sh:IRI ; + sh:severity sh:Warning ; + sh:message "`CreateAction` SHOULD have the property `object` with IRI values." ; + ] . + + +#=== MAY shapes ===# +# (none) diff --git a/rocrate_validator/profiles/five-safes-crate/should/9_inputs.ttl b/rocrate_validator/profiles/five-safes-crate/9_inputs.ttl similarity index 95% rename from rocrate_validator/profiles/five-safes-crate/should/9_inputs.ttl rename to rocrate_validator/profiles/five-safes-crate/9_inputs.ttl index 572610962..0c922ba5c 100644 --- a/rocrate_validator/profiles/five-safes-crate/should/9_inputs.ttl +++ b/rocrate_validator/profiles/five-safes-crate/9_inputs.ttl @@ -24,6 +24,11 @@ @prefix xsd: . +#=== MUST shapes ===# +# (none) + + +#=== SHOULD shapes ===# five-safes-crate:InputEntityReferencesFormalParameterViaExampleOfWork a sh:NodeShape ; @@ -55,4 +60,8 @@ five-safes-crate:InputEntityReferencesFormalParameterViaExampleOfWork """ ; sh:severity sh:Warning ; sh:message "Input SHOULD reference a FormalParameter using exampleOfWork" ; - ] . \ No newline at end of file + ] . + + +#=== MAY shapes ===# +# (none) diff --git a/rocrate_validator/profiles/five-safes-crate/may/11_workflow_execution_phase.ttl b/rocrate_validator/profiles/five-safes-crate/may/11_workflow_execution_phase.ttl deleted file mode 100644 index 6c331913b..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/11_workflow_execution_phase.ttl +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun - a sh:NodeShape ; - sh:name "WorkflowExecution" ; - sh:description ( - "The workflow execution object MAY have a startTime if actionStatus is " - "either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." - ) ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX rdf: - - SELECT ?this - WHERE { - ?this rdf:type schema:CreateAction ; - schema:actionStatus ?status . - FILTER(?status IN ( - "http://schema.org/CompletedActionStatus", - "http://schema.org/FailedActionStatus", - "http://schema.org/ActiveActionStatus" - )) - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "StartTime" ; - sh:path schema:startTime ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:severity sh:Info ; - sh:description ( - "The workflow execution object MAY have a startTime if actionStatus is " - "either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." - ) ; - sh:message "The workflow execution object MAY have a startTime if actionStatus is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/may/12_check_phase.ttl b/rocrate_validator/profiles/five-safes-crate/may/12_check_phase.ttl deleted file mode 100644 index 0e741f6ca..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/12_check_phase.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix purl: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:CheckValueMayHaveStartTime - a sh:NodeShape ; - sh:name "CheckValue" ; - sh:description "" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - SELECT ?this - WHERE { - ?this schema:additionalType shp:CheckValue ; - schema:actionStatus ?status . - FILTER(?status IN ( - "http://schema.org/CompletedActionStatus", - "http://schema.org/FailedActionStatus", - "http://schema.org/ActiveActionStatus" - )) - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "StartTime" ; - sh:path schema:startTime ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:severity sh:Info ; - sh:message "`CheckValue` MAY have the `startTime` property." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/may/13_validation_phase.ttl b/rocrate_validator/profiles/five-safes-crate/may/13_validation_phase.ttl deleted file mode 100644 index b7adcb3bc..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/13_validation_phase.ttl +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix purl: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:DownloadActionMayHaveStartTimeIfBegun - a sh:NodeShape ; - sh:name "ValidationCheck" ; - sh:description "" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - SELECT ?this - WHERE { - ?this schema:additionalType shp:ValidationCheck ; - schema:actionStatus ?status . - FILTER(?status IN ( - "http://schema.org/CompletedActionStatus", - "http://schema.org/FailedActionStatus", - "http://schema.org/ActiveActionStatus" - )) - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "StartTime" ; - sh:path schema:startTime ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:severity sh:Info ; - sh:description "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; - sh:message "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/may/1_responsible_project.ttl b/rocrate_validator/profiles/five-safes-crate/may/1_responsible_project.ttl deleted file mode 100644 index 5dd46fd27..000000000 --- a/rocrate_validator/profiles/five-safes-crate/may/1_responsible_project.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:ResponsibleProject - a sh:NodeShape ; - sh:name "Responsible Project" ; - sh:target [ - a sh:SPARQLTarget ; - sh:prefixes ro-crate:sparqlPrefixes ; - sh:select """ - SELECT DISTINCT ?this WHERE { - ?action a schema:CreateAction ; - schema:agent ?agent . - ?agent schema:memberOf ?this . - } - """ - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "funding" ; - sh:path schema:funding; - sh:minCount 1 ; - sh:severity sh:Info ; - sh:message """The Responsible Project does not have the property `funding`.""" ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "member" ; - sh:path schema:member; - sh:minCount 1 ; - sh:severity sh:Info ; - sh:message """The Responsible Project does not have the property `member`.""" ; - ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl b/rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl deleted file mode 100644 index 2f723c938..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix purl: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:WorkflowMustHaveDescriptiveName - a sh:NodeShape ; - sh:name "WorkflowExecution" ; - sh:targetClass schema:CreateAction ; - - sh:property [ - a sh:PropertyShape ; - sh:name "name" ; - sh:minCount 1 ; - sh:description "Workflow (CreateAction) MUST have a name string of at least 10 characters." ; - sh:path schema:name ; - sh:datatype xsd:string ; - sh:minLength 10 ; - sh:severity sh:Violation ; - sh:message "Workflow (CreateAction) MUST have a name string of at least 10 characters." ; - ] . - - - - -five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues - a sh:NodeShape ; - sh:name "WorkflowExecution" ; - sh:targetClass schema:CreateAction ; - sh:property [ - a sh:PropertyShape ; - sh:minCount 1 ; - sh:name "actionStatus" ; - sh:description "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; - sh:path schema:actionStatus ; - sh:in ( - "http://schema.org/PotentialActionStatus" - "http://schema.org/ActiveActionStatus" - "http://schema.org/CompletedActionStatus" - "http://schema.org/FailedActionStatus" - ) ; - sh:severity sh:Violation ; - sh:message "WorkflowExecution MUST have an actionStatus with an allowed value (see https://schema.org/ActionStatusType)." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/12_check_phase.ttl b/rocrate_validator/profiles/five-safes-crate/must/12_check_phase.ttl deleted file mode 100644 index caecb1651..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/12_check_phase.ttl +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix purl: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:CheckValueObjectHasDescriptiveNameAndIsAssessAction - a sh:NodeShape ; - sh:name "CheckValue" ; - sh:description "" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:CheckValue . - } - """ ; - ] ; - - sh:property [ - sh:path rdf:type ; - sh:minCount 1 ; - sh:hasValue schema:AssessAction; - sh:severity sh:Violation ; - sh:message "CheckValue MUST be a `AssessAction`." ; - ] ; - - sh:property [ - sh:a sh:PropertyShape ; - sh:name "name" ; - sh:description "CheckValue MUST have a human readable name string." ; - sh:path schema:name ; - sh:datatype xsd:string ; - sh:severity sh:Violation ; - sh:message "CheckValue MUST have a human readable name string." ; - ] . - -five-safes-crate:CheckValueActionStatusMustHaveAllowedValues - a sh:NodeShape ; - sh:name "CheckValue" ; - sh:description "" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:CheckValue ; - schema:actionStatus ?status . - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "ActionStatus" ; - sh:path schema:actionStatus ; - sh:in ( - "http://schema.org/PotentialActionStatus" - "http://schema.org/ActiveActionStatus" - "http://schema.org/CompletedActionStatus" - "http://schema.org/FailedActionStatus" - ) ; - sh:severity sh:Violation ; - sh:message "`CheckValue` --> `actionStatus` MUST have one of the allowed values." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/13_validation_phase.ttl b/rocrate_validator/profiles/five-safes-crate/must/13_validation_phase.ttl deleted file mode 100644 index 735ba27b8..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/13_validation_phase.ttl +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix purl: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:ValidationCheckObjectHasDescriptiveNameAndIsAssessAction - a sh:NodeShape ; - sh:name "ValidationCheck" ; - sh:description "" ; - - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:ValidationCheck . - } - """ ; - ] ; - - sh:property [ - sh:path rdf:type ; - sh:minCount 1 ; - sh:hasValue schema:AssessAction; - sh:severity sh:Violation ; - sh:message "ValidationCheck MUST be a `AssessAction`." ; - ] ; - - sh:property [ - sh:a sh:PropertyShape ; - sh:name "name" ; - sh:description "ValidationCheck MUST have a human readable name string." ; - sh:path schema:name ; - sh:datatype xsd:string ; - sh:severity sh:Violation ; - sh:message "ValidationCheck MUST have a human readable name string." ; - ] . - - -five-safes-crate:ValidationCheckActionStatusMustHaveAllowedValue - a sh:NodeShape ; - sh:name "ValidationCheck" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:ValidationCheck ; - schema:actionStatus ?status . - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "actionStatus" ; - sh:description "The `actionStatus` of ValidationCheck MUST have an allowed value (see https://schema.org/ActionStatusType)." ; - sh:path schema:actionStatus ; - sh:in ( - "http://schema.org/PotentialActionStatus" - "http://schema.org/ActiveActionStatus" - "http://schema.org/CompletedActionStatus" - "http://schema.org/FailedActionStatus" - ) ; - sh:severity sh:Violation ; - sh:message "The `actionStatus` of ValidationCheck MUST have an allowed value (see https://schema.org/ActionStatusType)." ; - ] . - - -five-safes-crate:ValidationCheckActionStatusMustHaveAllowedValue - a sh:NodeShape ; - sh:name "ValidationCheck" ; - sh:target [ - a sh:SPARQLTarget ; - sh:select """ - PREFIX schema: - PREFIX shp: - - SELECT ?this - WHERE { - ?this schema:additionalType shp:ValidationCheck . - } - """ ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:minCount 1 ; - sh:name "actionStatus" ; - sh:description "actionStatus MUST be either PotentialActionStatus, ActiveActionStatus, CompletedActionStatus, or FailedActionStatus." ; - sh:path schema:actionStatus ; - sh:in ( - "http://schema.org/PotentialActionStatus" - "http://schema.org/ActiveActionStatus" - "http://schema.org/CompletedActionStatus" - "http://schema.org/FailedActionStatus" - ) ; - sh:severity sh:Violation ; - sh:message "actionStatus MUST be either PotentialActionStatus, ActiveActionStatus, CompletedActionStatus, or FailedActionStatus." ; - ] . diff --git a/rocrate_validator/profiles/five-safes-crate/must/1_responsible_project.ttl b/rocrate_validator/profiles/five-safes-crate/must/1_responsible_project.ttl deleted file mode 100644 index 4748655ea..000000000 --- a/rocrate_validator/profiles/five-safes-crate/must/1_responsible_project.ttl +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:ResponsibleProject - a sh:NodeShape ; - sh:name "Responsible Project" ; - sh:target [ - a sh:SPARQLTarget ; - sh:prefixes ro-crate:sparqlPrefixes ; - sh:select """ - SELECT DISTINCT ?this WHERE { - ?action a schema:CreateAction ; - schema:agent ?agent . - ?agent schema:memberOf ?this . - } - """ - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "funding" ; - sh:path schema:funding; - sh:class schema:Grant ; - sh:severity sh:Violation ; - sh:message """The property 'funding' of the Responsible Project MUST be of type Grant.""" ; - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "member" ; - sh:path schema:member; - sh:or ( - [ sh:class schema:Organization ] - [ sh:class schema:Person ] - ) ; - sh:severity sh:Violation ; - sh:message """The property 'member' of the Responsible Project MUST be of type schema:Organization or Person.""" ; - ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/1_requesting_agent.ttl b/rocrate_validator/profiles/five-safes-crate/should/1_requesting_agent.ttl deleted file mode 100644 index 332c67d3d..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/1_requesting_agent.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:AgentIsMemberOf - a sh:NodeShape ; - sh:name "Requesting Agent" ; - sh:target [ - a sh:SPARQLTarget ; - sh:prefixes ro-crate:sparqlPrefixes ; - sh:select """ - SELECT DISTINCT ?this WHERE { - ?action a schema:CreateAction ; - schema:agent ?this . - } - """ - ] ; - - sh:property [ - a sh:PropertyShape ; - sh:name "memberOf" ; - sh:path schema:memberOf; - sh:minCount 1 ; - sh:severity sh:Warning ; - sh:message """The Requesting Agent SHOULD have a `memberOf` property.""" ; - ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/2_requesting_agent.ttl b/rocrate_validator/profiles/five-safes-crate/should/2_requesting_agent.ttl deleted file mode 100644 index c21b3f977..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/2_requesting_agent.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -# Person who is the agent of a CreateAction SHOULD have an affiliation -five-safes-crate:PersonAgentHasAffiliation - a sh:NodeShape ; - sh:name "Agent of CreateAction" ; - sh:description "The agent of a CreateAction entity" ; - sh:target [ - a sh:SPARQLTarget ; - sh:prefixes ro-crate:sparqlPrefixes ; - sh:select """ - SELECT DISTINCT ?this WHERE { - ?action a schema:CreateAction ; - schema:agent ?this . - } - """ - ] ; - - # The agent of a CreateAction entity SHOULD have an affiliation - sh:property [ - a sh:PropertyShape ; - sh:name "Presence of affiliations" ; - sh:path schema:affiliation ; - sh:minCount 1 ; - sh:severity sh:Warning ; - sh:message "The agent of a CreateAction entity SHOULD have an affiliation" ; - ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/6_workflow_reference.ttl b/rocrate_validator/profiles/five-safes-crate/should/6_workflow_reference.ttl deleted file mode 100644 index 98c285652..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/6_workflow_reference.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix purl: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -five-safes-crate:DatasetMustHaveDistributionIfURI - a sh:NodeShape ; - sh:name "mainEntity" ; - sh:targetObjectsOf schema:mainEntity ; - sh:description "If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ; - - sh:sparql [ - a sh:SPARQLConstraint ; - sh:name "distribution" ; - sh:description "If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ; - sh:prefixes ro-crate:sparqlPrefixes ; - sh:select """ - SELECT $this - WHERE { - FILTER (STRSTARTS(STR($this), "http://") || STRSTARTS(STR($this), "https://")) . - FILTER NOT EXISTS { - $this schema:distribution ?dist . - FILTER (STRSTARTS(STR(?dist), "http://") || STRSTARTS(STR(?dist), "https://")) . - } - } - """ ; - sh:severity sh:Warning ; - sh:message "If mainEntity has an HTTP(S) @id SHOULD have at least one distribution with an HTTP(S) URL." ; - ] . \ No newline at end of file diff --git a/rocrate_validator/profiles/five-safes-crate/should/7_requested_workflow_run.ttl b/rocrate_validator/profiles/five-safes-crate/should/7_requested_workflow_run.ttl deleted file mode 100644 index 41af739c0..000000000 --- a/rocrate_validator/profiles/five-safes-crate/should/7_requested_workflow_run.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2025 eScience Lab, The University of Manchester -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -@prefix ro: <./> . -@prefix ro-crate: . -@prefix five-safes-crate: . -@prefix rdf: . -@prefix schema: . -@prefix sh: . -@prefix validator: . -@prefix xsd: . - - -# CreateAction SHOULD have object property with minimum cardinality 1 -five-safes-crate:CreateActionShouldHaveObjectProperty - a sh:NodeShape ; - sh:targetClass schema:CreateAction ; - sh:name "CreateAction" ; - sh:property [ - sh:path schema:object ; - sh:minCount 1 ; - sh:nodeKind sh:IRI ; - sh:severity sh:Warning ; - sh:message "`CreateAction` SHOULD have the property `object` with IRI values." ; - ] . \ No newline at end of file diff --git a/tests/integration/profiles/five-safes-crate/test_5src_12_check_phase.py b/tests/integration/profiles/five-safes-crate/test_5src_12_check_phase.py index 53171a4c0..6e0d8919f 100644 --- a/tests/integration/profiles/five-safes-crate/test_5src_12_check_phase.py +++ b/tests/integration/profiles/five-safes-crate/test_5src_12_check_phase.py @@ -198,6 +198,7 @@ def test_5src_root_data_entity_does_not_mention_check_value_entity(): <./> schema:mentions ?o . } WHERE { + <./> schema:mentions ?o . ?o schema:additionalType shp:CheckValue ; } """