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 ;
@@ -74,3 +76,35 @@ five-safes-crate:mainEntityHasProperConformsTo
7476 sh:severity sh:Violation ;
7577 sh:message " conformsTo IRI must start with https://w3id.org/workflowhub/workflow-ro-crate" ;
7678 ] .
79+
80+
81+ # === SHOULD shapes ===#
82+
83+ five-safes-crate:DatasetMustHaveDistributionIfURI
84+ a sh:NodeShape ;
85+ sh:name " mainEntity" ;
86+ sh:targetObjectsOf schema:mainEntity ;
87+ sh:description " If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ;
88+ sh:severity sh:Warning ;
89+
90+ sh:sparql [
91+ a sh:SPARQLConstraint ;
92+ sh:name " distribution" ;
93+ sh:description " If mainEntity has an HTTP(S) @id, it SHOULD have a distribution that is an HTTP(S) URL." ;
94+ sh:prefixes ro-crate:sparqlPrefixes ;
95+ sh:select """
96+ SELECT $this
97+ WHERE {
98+ FILTER (STRSTARTS(STR($this), "http://") || STRSTARTS(STR($this), "https://")) .
99+ FILTER NOT EXISTS {
100+ $this schema:distribution ?dist .
101+ FILTER (STRSTARTS(STR(?dist), "http://") || STRSTARTS(STR(?dist), "https://")) .
102+ }
103+ }
104+ """ ;
105+ sh:message " If mainEntity has an HTTP(S) @id SHOULD have at least one distribution with an HTTP(S) URL." ;
106+ ] .
107+
108+
109+ # === MAY shapes ===#
110+ # (none)
0 commit comments