Skip to content

Commit 7743a34

Browse files
committed
Merged 6_workflow_reference.tll files.
1 parent fcd6ff1 commit 7743a34

2 files changed

Lines changed: 34 additions & 49 deletions

File tree

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

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

2525

26+
#=== MUST shapes ===#
2627

2728
five-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)

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

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)