1+ # Copyright (c) 2026 DataPLANT
2+ # Copyright (c) 2026 The University of Manchester
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+
16+ @prefix ro: <./> .
17+ @prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
18+ @prefix isa-ro-crate: <https://github.com/crs4/rocrate-validator/profiles/isa-ro-crate/> .
19+ @prefix bioschemas: <https://bioschemas.org/> .
20+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
21+ @prefix schema: <http://schema.org/> .
22+ @prefix sh: <http://www.w3.org/ns/shacl#> .
23+ @prefix validator: <https://github.com/crs4/rocrate-validator/> .
24+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
25+
26+ isa-ro-crate:RootDataEntityMustBeInvestigation a sh:NodeShape ;
27+ sh:name " Root Data Entity must be Investigation" ;
28+ sh:description " The root data entity must follow the investigation profile" ;
29+ sh:targetClass ro-crate:RootDataEntity ;
30+ sh:property [
31+ a sh:PropertyShape ;
32+ sh:path schema:additionalType ;
33+ sh:minCount 1 ;
34+ sh:hasValue " Investigation" ;
35+ sh:description " Check if the root data entity is specified as an investigation through additionalType" ;
36+ sh:message " The root data entity must have additionalType of `Investigation`" ;
37+ sh:severity sh:Violation ;
38+ ] ;
39+ sh:property [
40+ a sh:PropertyShape ;
41+ sh:path schema:identifier ;
42+ sh:minCount 1 ;
43+ sh:datatype xsd:string ;
44+ sh:not [
45+ sh:hasValue " "
46+ ] ;
47+ sh:description " Check if the root data entity (investigation) has an identifier" ;
48+ sh:message " The root data entity must have a non-empty identifier" ;
49+ sh:severity sh:Violation ;
50+ ] ;
51+ # sh:property [
52+ # a sh:PropertyShape ;
53+ # sh:path schema:name ;
54+ # sh:minCount 1 ;
55+ # sh:not [
56+ # sh:hasValue ""
57+ # ] ;
58+ # sh:description "Check if the root data entity (investigation) has a name" ;
59+ # sh:message "The root data entity must have a non-empty name" ;
60+ # sh:severity sh:Violation ;
61+ # ] ;
62+ # sh:property [
63+ # a sh:PropertyShape ;
64+ # sh:path schema:description ;
65+ # sh:minCount 1 ;
66+ # sh:not [
67+ # sh:hasValue ""
68+ # ] ;
69+ # sh:description "Check if the root data entity (investigation) has a description" ;
70+ # sh:message "The root data entity must have a non-empty description" ;
71+ # sh:severity sh:Violation ;
72+ # ] ;
73+ # sh:property [
74+ # a sh:PropertyShape ;
75+ # sh:path schema:license ;
76+ # sh:minCount 1 ;
77+ # sh:description "Check if the root data entity (investigation) specifies a license" ;
78+ # sh:message "The root data entity must specify a license" ;
79+ # sh:severity sh:Violation ;
80+ # ] ;
81+ # sh:property [
82+ # a sh:PropertyShape ;
83+ # sh:path schema:datePublished ;
84+ # sh:minCount 1 ;
85+ # sh:nodeKind sh:Literal ;
86+ # sh:pattern "^([\\+-]?\\d{4})((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))|W([0-4]\\d|5[0-2])(-?[1-7])|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)?[0-5]\\d)?|24:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)$" ;
87+ # sh:description "Check if the root data entity (investigation) has a datePublished" ;
88+ # sh:message "The root data entity must have a datePublished" ;
89+ # sh:severity sh:Violation ;
90+ # ] ;
91+ .
92+
93+ isa-ro-crate:InvestigationShouldHaveCreator a sh:NodeShape ;
94+ sh:name " Investigation SHOULD have creator" ;
95+ sh:description " An Investigation SHOULD have a creator" ;
96+ sh:targetClass ro-crate:RootDataEntity ;
97+ sh:property [
98+ a sh:PropertyShape ;
99+ sh:path schema:creator ;
100+ sh:minCount 1 ;
101+ sh:description " Check that investigation does have at least one creator" ;
102+ sh:message " Investigation entity SHOULD have a creator" ;
103+ sh:severity sh:Warning ;
104+ ] ;
105+ sh:property [
106+ a sh:PropertyShape ;
107+ sh:path schema:creator ;
108+ sh:class schema:Person ;
109+ sh:description " Check that if investigation does have at least one creator, it MUST be of type Person" ;
110+ sh:message " Investigation creator MUST be of type Person" ;
111+ sh:severity sh:Violation ;
112+ ]
113+ .
114+
115+ isa-ro-crate:InvestigationShouldHaveDateCreated a sh:NodeShape ;
116+ sh:name " Investigation SHOULD have dateCreated" ;
117+ sh:description " An Investigation SHOULD have a dateCreated" ;
118+ sh:targetClass ro-crate:RootDataEntity ;
119+ sh:property [
120+ a sh:PropertyShape ;
121+ sh:path schema:dateCreated ;
122+ sh:minCount 1 ;
123+ sh:description " Check that investigation does have at least one dateCreated" ;
124+ sh:message " Investigation entity SHOULD have a dateCreated" ;
125+ sh:severity sh:Warning ;
126+ ] ;
127+ sh:property [
128+ a sh:PropertyShape ;
129+ sh:path schema:dateCreated ;
130+ sh:nodeKind sh:Literal ;
131+ sh:pattern " ^([\\+-]?\\d{4})((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))|W([0-4]\\d|5[0-2])(-?[1-7])|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)?[0-5]\\d)?|24:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)$" ;
132+ sh:description " Check that if investigation does have at least one dateCreated, it MUST be a valid ISO 8601 date." ;
133+ sh:message " Investigation dateCreated MUST be a valid ISO 8601 date" ;
134+ sh:severity sh:Violation ;
135+ ]
136+ .
0 commit comments