Skip to content

Commit 9942e52

Browse files
authored
Merge pull request #100 from eScienceLab/98-add-shape-names-and-move-severity-level-in-shacl-ttl-files
Added `sh:name` and moved around `sh:severity` when necessary.
2 parents 8fc209e + 300d9fb commit 9942e52

File tree

9 files changed

+38
-32
lines changed

9 files changed

+38
-32
lines changed

rocrate_validator/profiles/five-safes-crate/may/14_workflow_retrieval_phase.ttl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ five-safes-crate:DownloadedWorkflowSHOULDExistAndBeReferencedByDownloadActionRes
3737
sh:path schema:result ;
3838
sh:minCount 1 ;
3939
sh:nodeKind sh:IRI ;
40-
4140
sh:sparql [
4241
a sh:SPARQLConstraint ;
4342
sh:select """
@@ -54,9 +53,9 @@ five-safes-crate:DownloadedWorkflowSHOULDExistAndBeReferencedByDownloadActionRes
5453
}
5554
}
5655
""" ;
57-
sh:severity sh:Info ;
58-
sh:message "The entity representing the downloaded workflow is not defined, OR is not referenced by `DownloadAction` --> `result`, OR is not of type `Dataset`." ;
5956
] ;
57+
sh:severity sh:Info ;
58+
sh:message "The entity representing the downloaded workflow is not defined, OR is not referenced by `DownloadAction` --> `result`, OR is not of type `Dataset`." ;
6059
] .
6160

6261

@@ -93,10 +92,10 @@ five-safes-crate:DownloadActionMayHaveStartTimeIfBegun
9392
sh:path schema:startTime ;
9493
sh:minCount 1 ;
9594
sh:maxCount 1 ;
96-
sh:severity sh:Info ;
9795
sh:description (
9896
"`DownloadAction` MAY have the `startTime` property if `actionStatus` "
9997
"is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus."
10098
);
99+
sh:severity sh:Info ;
101100
sh:message "`DownloadAction` MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
102101
] .

rocrate_validator/profiles/five-safes-crate/must/11_workflow_execution_phase.ttl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ five-safes-crate:WorkflowMustHaveDescriptiveName
4141
] .
4242

4343

44-
45-
4644
five-safes-crate:WorkflowMustHaveActionStatusWithAllowedValues
4745
a sh:NodeShape ;
4846
sh:name "WorkflowExecution" ;

rocrate_validator/profiles/five-safes-crate/must/14_workflow_retrieval_phase.ttl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ five-safes-crate:WorkflowSameAsAndRootDataEntityMainEntityMUSTBeTheSame
4747
a sh:NodeShape ;
4848
sh:name "Downloaded Workflow" ;
4949
sh:description "" ;
50+
sh:severity sh:Violation ;
51+
5052
sh:target [
5153
a sh:SPARQLTarget ;
5254
sh:select """
@@ -77,7 +79,7 @@ five-safes-crate:WorkflowSameAsAndRootDataEntityMainEntityMUSTBeTheSame
7779
}
7880
}
7981
""" ;
80-
sh:severity sh:Violation ;
82+
8183
sh:description "The property `sameAs` of the entity representing the downloaded workflow MUST point to the same entity as `RootDataEntity` --> `mainEntity`." ;
8284
sh:message "The property `sameAs` of the entity representing the downloaded workflow MUST point to the same entity as `RootDataEntity` --> `mainEntity`." ;
8385
] .
@@ -87,6 +89,8 @@ five-safes-crate:DownloadedWorkflowDistributionAndDownloadActionObjectMUSTBeTheS
8789
a sh:NodeShape ;
8890
sh:name "Downloaded Workflow" ;
8991
sh:description "" ;
92+
sh:severity sh:Violation ;
93+
9094
sh:target [
9195
a sh:SPARQLTarget ;
9296
sh:select """
@@ -118,7 +122,6 @@ five-safes-crate:DownloadedWorkflowDistributionAndDownloadActionObjectMUSTBeTheS
118122
}
119123
}
120124
""" ;
121-
sh:severity sh:Violation ;
122125
sh:message "DownloadedWorkflow --> `distribution` MUST reference the same entity as `DownloadAction` --> `object`." ;
123126
] .
124127

rocrate_validator/profiles/five-safes-crate/must/1_requesting_agent.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ five-safes-crate:AgentProjectIntersection
7777
}
7878
}
7979
""" ;
80-
sh:severity sh:Violation ;
81-
sh:message """At least one Project referenced by Agent -> memberOf MUST be included in the set of Projects referenced by RootDataEntity -> sourceOrganization.""" ;
82-
] .
80+
] ;
81+
sh:severity sh:Violation ;
82+
sh:message """At least one Project referenced by Agent -> memberOf MUST be included in the set of Projects referenced by RootDataEntity -> sourceOrganization.""" .

rocrate_validator/profiles/five-safes-crate/must/3_timestamp_format.ttl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ five-safes-crate:TimeStampFormat
3535
sh:property [
3636
a sh:PropertyShape ;
3737
sh:name "End TimeStamp" ;
38+
sh:description "End timestamps MUST follow the RFC 3339 standard." ;
3839
sh:path schema:endTime ;
3940
sh:minCount 0 ;
4041
sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}[Tt][0-9]{2}:[0-9]{2}:[0-9]{2}([.|,][0-9]+)?(Z|z|[+-][0-9]{2}:[0-9]{2})$" ;
4142
sh:severity sh:Violation ;
4243
sh:message "All `startTime` and `endTime` values MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
43-
sh:description "End timestamps MUST follow the RFC 3339 standard." ;
4444
] ;
4545
sh:property [
4646
a sh:PropertyShape ;
4747
sh:name "Start TimeStamp" ;
48+
sh:description "Start timestamps MUST follow the RFC 3339 standard." ;
4849
sh:path schema:startTime ;
4950
sh:minCount 0 ;
5051
sh:pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}[Tt][0-9]{2}:[0-9]{2}:[0-9]{2}([.|,][0-9]+)?(Z|z|[+-][0-9]{2}:[0-9]{2})$" ;
5152
sh:severity sh:Violation ;
5253
sh:message "All `startTime` and `endTime` values MUST follow the RFC 3339 standard (YYYY-MM-DD'T'hh:mm:ss[.fraction](Z | ±hh:mm))." ;
53-
sh:description "Start timestamps MUST follow the RFC 3339 standard." ;
5454
] .

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ 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 [
59+
sh:property [
6060
a sh:PropertyShape ;
6161
sh:name "conformsTo" ;
6262
sh:path purl:conformsTo ;
@@ -65,16 +65,12 @@ five-safes-crate:mainEntityHasProperConformsTo
6565
sh:severity sh:Violation ;
6666
sh:message "mainEntity MUST have one and only one `conformsTo` property." ;
6767
] ;
68-
sh:sparql [
69-
a sh:SPARQLConstraint ;
68+
sh:property [
69+
a sh:PropertyShape ;
7070
sh:name "conformsTo" ;
71+
sh:path purl:conformsTo ;
72+
sh:nodeKind sh:IRI ;
73+
sh:pattern "^https://w3id\\.org/workflowhub/workflow-ro-crate" ;
74+
sh:severity sh:Violation ;
7175
sh:message "conformsTo IRI must start with https://w3id.org/workflowhub/workflow-ro-crate" ;
72-
sh:select """
73-
PREFIX schema: <http://schema.org/>
74-
PREFIX purl: <http://purl.org/dc/terms/>
75-
SELECT $this WHERE {
76-
$this purl:conformsTo ?iri .
77-
FILTER(!STRSTARTS(STR(?iri), "https://w3id.org/workflowhub/workflow-ro-crate"))
78-
}
79-
""" ;
8076
] .

rocrate_validator/profiles/five-safes-crate/must/7_requested_workflow_run.ttl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ five-safes-crate:CreateActionInstrumentAndStatus
4646
sh:name "CreateAction" ;
4747
sh:targetClass schema:CreateAction ;
4848
sh:description "" ;
49+
sh:severity sh:Violation ; # Apply to all property shapes / constraints below
4950

5051
sh:property [
5152
a sh:PropertyShape ;
5253
sh:name "instrument" ;
5354
sh:path schema:instrument;
5455
sh:minCount 1 ;
55-
sh:severity sh:Violation ;
5656
sh:message "`CreateAction` MUST have the `instrument` property" ;
5757
] ;
5858
sh:sparql [
@@ -67,7 +67,6 @@ five-safes-crate:CreateActionInstrumentAndStatus
6767
FILTER (?instrument != ?main)
6868
}
6969
""" ;
70-
sh:severity sh:Violation ;
7170
sh:message "`CreateAction` --> `instrument` MUST reference the same entity as `Root Data Entity` --> `mainEntity`" ;
7271
] ;
7372
sh:sparql [
@@ -81,6 +80,5 @@ five-safes-crate:CreateActionInstrumentAndStatus
8180
FILTER NOT EXISTS { ?object a ?type . }
8281
}
8382
""" ;
84-
sh:severity sh:Violation ;
8583
sh:message "Each `object` in `CreateAction` MUST reference an existing entity." ;
8684
] .

rocrate_validator/profiles/five-safes-crate/should/1_responsible_project.ttl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection
2626
a sh:NodeShape ;
2727
sh:name "Organizations (members of Responsible Project)" ;
2828
sh:description """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.""" ;
29+
sh:severity sh:Warning ;
30+
2931
sh:target [
3032
a sh:SPARQLTarget ;
3133
sh:prefixes ro-crate:sparqlPrefixes ;
@@ -40,6 +42,7 @@ five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection
4042
}
4143
"""
4244
] ;
45+
4346
sh:sparql [
4447
a sh:SPARQLConstraint ;
4548
sh:name "Intersection with agent affiliations" ;
@@ -55,6 +58,5 @@ five-safes-crate:ResponsibleProjectMemberAndSourceOrganizationIntersection
5558
}
5659
}
5760
""" ;
58-
sh:severity sh:Warning ;
5961
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.""" ;
6062
] .

rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
# There SHOULD be a Sign-Off Phase
2727
five-safes-crate:SignOffPhase
2828
a sh:NodeShape ;
29+
sh:name "SignOffPhase" ;
2930
sh:targetClass ro-crate:RootDataEntity ;
3031
sh:description "Check the Sign-Off Phase" ;
32+
sh:severity sh:Warning ;
33+
3134
sh:sparql [
3235
sh:select """
3336
PREFIX schema: <http://schema.org/>
@@ -39,9 +42,9 @@ five-safes-crate:SignOffPhase
3942
}
4043
}
4144
""" ;
42-
sh:severity sh:Warning ;
4345
sh:message "There SHOULD be a Sign-Off Phase in the Final RO-Crate" ;
4446
] ;
47+
4548
sh:sparql [
4649
sh:select """
4750
PREFIX schema: <http://schema.org/>
@@ -54,14 +57,16 @@ five-safes-crate:SignOffPhase
5457
}
5558
}
5659
""" ;
57-
sh:severity sh:Warning ;
5860
sh:message "The Root Data Entity SHOULD mention a Sign-Off Phase Object" ;
5961
] .
6062

6163

6264
five-safes-crate:SignOffPhaseProperties
6365
a sh:NodeShape ;
66+
sh:name "SignOffPhaseProperties" ;
6467
sh:description "Check Sign-Off Phase Properties" ;
68+
sh:severity sh:Warning ;
69+
6570
sh:target [
6671
a sh:SPARQLTarget ;
6772
sh:select """
@@ -73,20 +78,23 @@ five-safes-crate:SignOffPhaseProperties
7378
}
7479
"""
7580
] ;
81+
7682
sh:property [
7783
sh:description "Check if the Sign Off phase has an actionStatus" ;
7884
sh:path schema:actionStatus ;
7985
sh:minCount 1 ;
8086
sh:severity sh:Warning ;
8187
sh:message "The Sign-Off Phase SHOULD have an actionStatus" ;
8288
] ;
89+
8390
sh:property [
8491
sh:description "Check if the Sign Off phase has an agent" ;
8592
sh:path schema:agent ;
8693
sh:minCount 1 ;
8794
sh:severity sh:Warning ;
8895
sh:message "The Sign-Off Phase SHOULD have an agent" ;
8996
] ;
97+
9098
sh:property [
9199
sh:description "Check if the Sign Off phase has an instrument (TRE Policy)" ;
92100
sh:path schema:instrument ;
@@ -96,6 +104,7 @@ five-safes-crate:SignOffPhaseProperties
96104
sh:severity sh:Warning ;
97105
sh:message "The Sign-Off Phase SHOULD have an TRE policy (instrument) with type CreativeWork" ;
98106
] ;
107+
99108
sh:property [
100109
sh:description "Check if the Sign Off phase has an instrument (TRE Policy)" ;
101110
sh:path ( schema:instrument schema:name ) ;
@@ -104,6 +113,7 @@ five-safes-crate:SignOffPhaseProperties
104113
sh:severity sh:Warning ;
105114
sh:message "The Sign-Off Phase SHOULD have an TRE policy (instrument) with a human-readable name" ;
106115
] ;
116+
107117
sh:sparql [
108118
a sh:SPARQLConstraint ;
109119
sh:description "Check if the Sign Off phase lists the workflow as an object" ;
@@ -120,9 +130,9 @@ five-safes-crate:SignOffPhaseProperties
120130
}
121131
}
122132
""" ;
123-
sh:severity sh:Warning ;
124133
sh:message "The Sign-Off Phase SHOULD list the workflow (mainEntity) as an object" ;
125134
];
135+
126136
sh:sparql [
127137
a sh:SPARQLConstraint ;
128138
sh:description "Check if the Sign Off phase lists the Responsible Project as an object" ;
@@ -139,13 +149,13 @@ five-safes-crate:SignOffPhaseProperties
139149
}
140150
}
141151
""" ;
142-
sh:severity sh:Warning ;
143152
sh:message "The Sign-Off Phase SHOULD list the Responsible Project (sourceOrganization) as an object" ;
144153
].
145154

146155

147156
five-safes-crate:SignOffPhaseEndTime
148157
a sh:NodeShape ;
158+
sh:name "SignOffPhaseEndTime" ;
149159
sh:description "Sign Off end time check" ;
150160

151161
sh:target [

0 commit comments

Comments
 (0)