File tree Expand file tree Collapse file tree
rocrate_validator/profiles/five-safes-crate Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
2424
2525
26+ # === MUST shapes ===#
2627
2728five-safes-crate:ReferenceToWorkflowCrate
2829 a sh:NodeShape ;
@@ -55,6 +56,7 @@ five-safes-crate:mainEntityHasProperConformsTo
5556 a sh:NodeShape ;
5657 sh:name " mainEntity" ;
5758 sh:description " The mainEntity of the RootDataEntity MUST have a conformsTo property with an IRI starting with https://w3id.org/workflowhub/workflow-ro-crate" ;
59+ sh:severity sh:Violation ;
5860 sh:targetObjectsOf schema:mainEntity ;
5961 sh:property [
6062 a sh:PropertyShape ;
@@ -78,3 +80,35 @@ five-safes-crate:mainEntityHasProperConformsTo
7880 }
7981 """ ;
8082 ] .
83+
84+
85+ # === SHOULD shapes ===#
86+
87+ five-safes-crate:DatasetMustHaveDistributionIfURI
88+ a sh:NodeShape ;
89+ sh:name " mainEntity" ;
90+ sh:targetObjectsOf schema:mainEntity ;
91+ sh:description " If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ;
92+ sh:severity sh:Warning ;
93+
94+ sh:sparql [
95+ a sh:SPARQLConstraint ;
96+ sh:name " distribution" ;
97+ sh:description " If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ;
98+ sh:prefixes ro-crate:sparqlPrefixes ;
99+ sh:select """
100+ SELECT $this
101+ WHERE {
102+ FILTER (STRSTARTS(STR($this), "http://") || STRSTARTS(STR($this), "https://")) .
103+ FILTER NOT EXISTS {
104+ $this schema:distribution ?dist .
105+ FILTER (STRSTARTS(STR(?dist), "http://") || STRSTARTS(STR(?dist), "https://")) .
106+ }
107+ }
108+ """ ;
109+ sh:message " If mainEntity has an HTTP(S) @id SHOULD have at least one distribution with an HTTP(S) URL." ;
110+ ] .
111+
112+
113+ # === MAY shapes ===#
114+ # (none)
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments