Skip to content

Commit 452ade3

Browse files
committed
add conformsTo checks
1 parent 2241c68 commit 452ade3

File tree

1 file changed

+52
-5
lines changed

1 file changed

+52
-5
lines changed

rocrate_validator/profiles/workflow-ro-crate-linkml/workflow-ro-crate.yaml

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ prefixes:
88
roterms: http://purl.org/ro/roterms#
99
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
1010
sh: http://www.w3.org/ns/shacl#
11+
ro: ./
1112
ro-crate: https://github.com/crs4/rocrate-validator/profiles/ro-crate/
1213
workflow-ro-crate: https://github.com/crs4/rocrate-validator/profiles/workflow-ro-crate/
1314
imports:
@@ -16,6 +17,25 @@ default_range: string
1617

1718
classes:
1819
# validation classes
20+
WorkflowROCrateMetadataDescriptor:
21+
title: WROC Metadata File Descriptor properties
22+
description: Properties of the WROC Metadata File Descriptor
23+
class_uri: ro:ro-crate-metadata.json
24+
slots:
25+
- conforms_to
26+
slot_usage:
27+
conforms_to:
28+
title: Metadata File Descriptor conformsTo
29+
description: "The Metadata File Descriptor conformsTo SHOULD contain https://w3id.org/ro/crate/1.1 and <https://w3id.org/workflowhub/workflow-ro-crate/1.0>"
30+
minimum_cardinality: 2
31+
has_member:
32+
equals_string: https://w3id.org/workflowhub/workflow-ro-crate/1.0
33+
annotations:
34+
#sh:message: The Metadata File Descriptor conformsTo SHOULD contain https://w3id.org/ro/crate/1.1 and https://w3id.org/workflowhub/workflow-ro-crate/1.0
35+
sh:message: "The Metadata File Descriptor conformsTo SHOULD contain the Workflow RO-Crate profile"
36+
sh:severity: sh:Warning
37+
38+
1939
WorkflowROCrateRootDataEntity:
2040
title: WROC Root Data Entity Required Properties
2141
description: Root Data Entity properties defined as MUST
@@ -34,7 +54,18 @@ classes:
3454
# - ComputationalWorkflow
3555
slots:
3656
- programming_language
57+
- conforms_to
3758
# - main_workflow_types
59+
slot_usage:
60+
conforms_to:
61+
title: Main Workflow Bioschemas compliance
62+
description: The Main Workflow SHOULD comply with Bioschemas ComputationalWorkflow profile version 1.0 or later ;
63+
#has_member:
64+
pattern: "https://bioschemas.org/profiles/ComputationalWorkflow/[1-9].*"
65+
required: true
66+
annotations:
67+
sh:message: The Main Workflow SHOULD comply with Bioschemas ComputationalWorkflow profile version 1.0 or later
68+
sh:severity: sh:Warning
3869

3970
# classes representing schema.org types
4071
File:
@@ -51,6 +82,7 @@ classes:
5182

5283
# individual property requirements
5384
slots:
85+
# MUST
5486
main_entity:
5587
required: true
5688
slot_uri: schema:mainEntity
@@ -59,13 +91,15 @@ slots:
5991
description: Check if the Main Workflow is specified through a `mainEntity` property in the root data entity
6092
annotations:
6193
sh:message: The Main Workflow must be specified through a `mainEntity` property in the root data entity
94+
sh:severity: sh:Violation
6295
license:
6396
required: true
6497
slot_uri: schema:license
6598
title: Crate license
6699
description: The Crate must specify a license
67100
annotations:
68101
sh:message: The Crate (Root Data Entity) must specify a license, which should be a URL but can also be a string
102+
sh:severity: sh:Violation
69103
any_of:
70104
- range: CreativeWork # TODO: make this map to just sh:IRI, via objectidentifier or similar?
71105
- range: string
@@ -78,16 +112,29 @@ slots:
78112
description: The Main Workflow must refer to its language via programmingLanguage
79113
annotations:
80114
sh:message: The Main Workflow must refer to its language via programmingLanguage
115+
sh:severity: sh:Violation
81116
main_workflow_types:
82117
# slot doesn't work - awaiting help in Slack
83118
# (1) unclear how to test for multiple types
84-
# (2) min_cardinality doesn't work https://github.com/linkml/linkml/issues/2429
85-
required: true
86-
slot_uri: rdf:type
87-
range: uriorcurie
119+
# (2) minimum_cardinality doesn't work https://github.com/linkml/linkml/issues/2429
120+
# required: true
121+
# slot_uri: rdf:type
122+
# range: uriorcurie
123+
# type_mappings:
124+
# - framework_key: shacl
125+
# mapped_type: bioschemas:ComputationalWorkflow
88126
title: Main Workflow type
89127
description: The Main Workflow must have types File, SoftwareSourceCode, ComputationalWorkflow
90128
multivalued: true
91-
minimum_cardinality: 3
92129
annotations:
93130
sh:message: The Main Workflow must have types File, SoftwareSourceCode, ComputationalWorkflow
131+
sh:severity: sh:Violation
132+
# SHOULD
133+
# generic conformsTo slot - would be on base profile if we had one in LinkML
134+
conforms_to:
135+
slot_uri: schema:conformsTo
136+
title: conformsTo
137+
multivalued: true
138+
# any_of:
139+
# - range: uriorcurie
140+
range: CreativeWork

0 commit comments

Comments
 (0)