Skip to content

Commit 767e47f

Browse files
committed
Fixed failing tests (due to unsaved files, not to the tests themselves).
1 parent f53a8f2 commit 767e47f

File tree

1 file changed

+182
-0
lines changed

1 file changed

+182
-0
lines changed

rocrate_validator/profiles/five-safes-crate/13_validation_phase.ttl

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
2424

2525

26+
#=== MUST shapes ===#
27+
2628
five-safes-crate:ValidationCheckObjectHasDescriptiveNameAndIsAssessAction
2729
a sh:NodeShape ;
2830
sh:name "ValidationCheck" ;
@@ -124,3 +126,183 @@ five-safes-crate:ValidationCheckActionStatusMustHaveAllowedValue
124126
sh:severity sh:Violation ;
125127
sh:message "actionStatus MUST be either PotentialActionStatus, ActiveActionStatus, CompletedActionStatus, or FailedActionStatus." ;
126128
] .
129+
130+
131+
#=== SHOULD shapes ===#
132+
133+
five-safes-crate:RootDataEntityShouldMentionValidationCheckObject
134+
a sh:NodeShape ;
135+
sh:name "RootDataEntity" ;
136+
sh:targetClass ro-crate:RootDataEntity ;
137+
sh:description "" ;
138+
139+
sh:sparql [
140+
a sh:SPARQLConstraint ;
141+
sh:name "mentions" ;
142+
sh:description "RootDataEntity SHOULD mention a ValidationCheck object." ;
143+
sh:select """
144+
PREFIX schema: <http://schema.org/>
145+
PREFIX shp: <https://w3id.org/shp#>
146+
SELECT $this
147+
WHERE {
148+
FILTER NOT EXISTS{
149+
$this schema:mentions ?action .
150+
?action schema:additionalType shp:ValidationCheck .
151+
}
152+
}
153+
""" ;
154+
sh:severity sh:Warning ;
155+
sh:message "RootDataEntity SHOULD mention a ValidationCheck object." ;
156+
] .
157+
158+
159+
five-safes-crate:ValidationCheckObjectShouldPointToRootDataEntity
160+
a sh:NodeShape ;
161+
sh:name "ValidationCheck" ;
162+
sh:description "" ;
163+
sh:target [
164+
a sh:SPARQLTarget ;
165+
sh:select """
166+
PREFIX schema: <http://schema.org/>
167+
PREFIX shp: <https://w3id.org/shp#>
168+
SELECT ?this
169+
WHERE {
170+
?this schema:additionalType shp:ValidationCheck .
171+
}
172+
""" ;
173+
] ;
174+
175+
sh:property [
176+
a sh:PropertyShape ;
177+
sh:name "object" ;
178+
sh:path schema:object ;
179+
sh:minCount 1 ;
180+
sh:class ro-crate:RootDataEntity ;
181+
sh:severity sh:Warning ;
182+
sh:message "`ValidationCheck` --> `object` SHOULD point to the root of the RO-Crate" ;
183+
] .
184+
185+
five-safes-crate:ValidationCheckInstrumentShouldPointToEntityWithSpecificId
186+
a sh:NodeShape ;
187+
sh:name "ValidationCheck" ;
188+
sh:description "" ;
189+
sh:target [
190+
a sh:SPARQLTarget ;
191+
sh:select """
192+
PREFIX schema: <http://schema.org/>
193+
PREFIX shp: <https://w3id.org/shp#>
194+
SELECT ?this
195+
WHERE {
196+
?this schema:additionalType shp:ValidationCheck .
197+
}
198+
""" ;
199+
] ;
200+
201+
sh:property [
202+
a sh:PropertyShape ;
203+
sh:name "instrument" ;
204+
sh:description "" ;
205+
sh:path schema:instrument ;
206+
sh:minCount 1 ;
207+
sh:nodeKind sh:IRI ;
208+
sh:hasValue <https://w3id.org/5s-crate/0.4> ;
209+
sh:severity sh:Warning ;
210+
sh:message "`ValidationCheck` --> `instrument` SHOULD point to an entity with @id https://w3id.org/5s-crate/0.4" ;
211+
] .
212+
213+
214+
five-safes-crate:ValidationCheckShouldHaveActionStatus
215+
a sh:NodeShape ;
216+
sh:name "ValidationCheck" ;
217+
sh:description "" ;
218+
219+
sh:target [
220+
a sh:SPARQLTarget ;
221+
sh:select """
222+
PREFIX schema: <http://schema.org/>
223+
PREFIX shp: <https://w3id.org/shp#>
224+
225+
SELECT ?this
226+
WHERE {
227+
?this schema:additionalType shp:ValidationCheck .
228+
}
229+
""" ;
230+
] ;
231+
232+
sh:property [
233+
a sh:PropertyShape ;
234+
sh:name "ActionStatus" ;
235+
sh:path schema:actionStatus ;
236+
sh:minCount 1 ;
237+
sh:severity sh:Warning ;
238+
sh:message "ValidationCheck SHOULD have actionStatus property." ;
239+
] .
240+
241+
242+
five-safes-crate:DownloadActionShouldHaveEndTimeIfBegun
243+
a sh:NodeShape ;
244+
sh:name "ValidationCheck" ;
245+
sh:description "" ;
246+
sh:target [
247+
a sh:SPARQLTarget ;
248+
sh:select """
249+
PREFIX schema: <http://schema.org/>
250+
PREFIX shp: <https://w3id.org/shp#>
251+
SELECT ?this
252+
WHERE {
253+
?this schema:additionalType shp:ValidationCheck ;
254+
schema:actionStatus ?status .
255+
FILTER(?status IN (
256+
"http://schema.org/CompletedActionStatus",
257+
"http://schema.org/FailedActionStatus"
258+
))
259+
}
260+
""" ;
261+
] ;
262+
263+
sh:property [
264+
a sh:PropertyShape ;
265+
sh:name "EndTime" ;
266+
sh:path schema:endTime ;
267+
sh:minCount 1 ;
268+
sh:maxCount 1 ;
269+
sh:severity sh:Warning ;
270+
sh:description "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ;
271+
sh:message "ValidationCheck SHOULD have the `endTime` property if `actionStatus` is either CompletedActionStatus or FailedActionStatus." ;
272+
] .
273+
274+
275+
#=== MAY shapes ===#
276+
277+
five-safes-crate:DownloadActionMayHaveStartTimeIfBegun
278+
a sh:NodeShape ;
279+
sh:name "ValidationCheck" ;
280+
sh:description "" ;
281+
sh:target [
282+
a sh:SPARQLTarget ;
283+
sh:select """
284+
PREFIX schema: <http://schema.org/>
285+
PREFIX shp: <https://w3id.org/shp#>
286+
SELECT ?this
287+
WHERE {
288+
?this schema:additionalType shp:ValidationCheck ;
289+
schema:actionStatus ?status .
290+
FILTER(?status IN (
291+
"http://schema.org/CompletedActionStatus",
292+
"http://schema.org/FailedActionStatus",
293+
"http://schema.org/ActiveActionStatus"
294+
))
295+
}
296+
""" ;
297+
] ;
298+
299+
sh:property [
300+
a sh:PropertyShape ;
301+
sh:name "StartTime" ;
302+
sh:path schema:startTime ;
303+
sh:minCount 1 ;
304+
sh:maxCount 1 ;
305+
sh:severity sh:Info ;
306+
sh:description "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
307+
sh:message "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
308+
] .

0 commit comments

Comments
 (0)