2222@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
2323
2424
25- five-safes-crate:RootDataEntityMentionsCreateAction
25+ ro-crate:FindWorkflowRunAction a sh:NodeShape, validator:HiddenShape;
26+ sh:name " Identify the CreateAction Entity that corresponds to the Workflow run" ;
27+ sh:description """ The Workflow Run is the CreateAction entity that refers to Workflow run.
28+ This is identified by checking that the CreateAction entity has an `instrument` property
29+ that references the same entity as the `mainEntity` property of the Root Data Entity.""" ;
30+ sh:target [
31+ a sh:SPARQLTarget ;
32+ sh:prefixes ro-crate:sparqlPrefixes ;
33+ sh:select """
34+ SELECT ?this
35+ WHERE {
36+ ?this a schema:CreateAction ;
37+ schema:instrument ?instrument .
38+ ?root schema:mainEntity ?instrument ;
39+ a schema:Dataset .
40+ ?metadatafile schema:about ?root .
41+ FILTER(contains(str(?metadatafile), "ro-crate-metadata.json"))
42+ }
43+ """
44+ ] ;
45+
46+ # Expand data graph with triples from the file data entity
47+ sh:rule [
48+ a sh:TripleRule ;
49+ sh:subject sh:this ;
50+ sh:predicate rdf:type ;
51+ sh:object ro-crate:WorkflowRun ;
52+ ] .
53+
54+
55+ five-safes-crate:RootDataEntityMentionsWorkflowRun
2656 a sh:NodeShape ;
2757 sh:name " RootDataEntity" ;
2858 sh:targetClass ro-crate:RootDataEntity ;
@@ -33,42 +63,43 @@ five-safes-crate:RootDataEntityMentionsCreateAction
3363 sh:name " mentions" ;
3464 sh:path schema:mentions;
3565 sh:qualifiedValueShape [
36- sh:class schema:CreateAction ;
66+ sh:class ro-crate:WorkflowRun ;
3767 ] ;
3868 sh:qualifiedMinCount 1 ;
3969 sh:severity sh:Violation ;
40- sh:message " `RootDataEntity` MUST reference at least one `CreateAction ` through `mentions`" ;
70+ sh:message " `RootDataEntity` MUST reference at least one `WorkflowRun ` through `mentions`" ;
4171 ] .
4272
4373
44- five-safes-crate:CreateActionInstrumentAndStatus
74+ five-safes-crate:WorkflowRunExistence
4575 a sh:NodeShape ;
46- sh:name " CreateAction" ;
47- sh:targetClass schema:CreateAction ;
48- sh:description " " ;
49- sh:severity sh:Violation ; # Apply to all property shapes / constraints below
76+ sh:name " RootDataEntity" ;
77+ sh:targetClass ro-crate:RootDataEntity ;
78+ sh:description " " ;
5079
51- sh:property [
52- a sh:PropertyShape ;
53- sh:name " instrument" ;
54- sh:path schema:instrument;
55- sh:minCount 1 ;
56- sh:message " `CreateAction` MUST have the `instrument` property" ;
57- ] ;
5880 sh:sparql [
5981 a sh:SPARQLConstraint ;
60- sh:name " instrument " ;
82+ sh:name " WorkflowRun " ;
6183 sh:prefixes ro-crate:sparqlPrefixes ;
6284 sh:select """
63- SELECT $this ?main ?instrument
64- WHERE {
65- ?root schema:mainEntity ?main .
66- $this schema:instrument ?instrument .
67- FILTER (?instrument != ?main)
68- }
85+ SELECT $this
86+ WHERE {
87+ FILTER NOT EXISTS {
88+ ?workflowRun a ro-crate:WorkflowRun .
89+ }
90+ }
6991 """ ;
70- sh:message " `CreateAction` --> `instrument` MUST reference the same entity as `Root Data Entity` --> `mainEntity`" ;
71- ] ;
92+ sh:message " The crate MUST contain at least one `WorkflowRun` entity" ;
93+ ] .
94+
95+
96+ five-safes-crate:WorkflowRunObject
97+ a sh:NodeShape ;
98+ sh:name " WorkflowRun" ;
99+ sh:targetClass ro-crate:WorkflowRun ;
100+ sh:description " " ;
101+ sh:severity sh:Violation ; # Apply to all property shapes / constraints below
102+
72103 sh:sparql [
73104 a sh:SPARQLConstraint ;
74105 sh:prefixes ro-crate:sparqlPrefixes ;
@@ -80,5 +111,5 @@ five-safes-crate:CreateActionInstrumentAndStatus
80111 FILTER NOT EXISTS { ?object a ?type . }
81112 }
82113 """ ;
83- sh:message " Each `object` in `CreateAction ` MUST reference an existing entity." ;
84- ] .
114+ sh:message " Each `object` in `WorkflowRun ` MUST reference an existing entity." ;
115+ ] .
0 commit comments