Skip to content

Commit 6ac555e

Browse files
committed
add test profiles
1 parent 00708df commit 6ac555e

58 files changed

Lines changed: 5020 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright (c) 2025 eScience Lab, The University of Manchester
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
@prefix ro: <./> .
16+
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
17+
@prefix alpha-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/alpha-crate/> .
18+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
19+
@prefix schema: <http://schema.org/> .
20+
@prefix sh: <http://www.w3.org/ns/shacl#> .
21+
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
22+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
23+
24+
25+
alpha-crate:RootDataEntityRequiredProperties
26+
a sh:NodeShape ;
27+
sh:name "RootDataEntity" ;
28+
sh:targetClass ro-crate:RootDataEntity ;
29+
30+
sh:property [
31+
a sh:PropertyShape ;
32+
sh:name "sourceOrganization" ;
33+
sh:path schema:sourceOrganization;
34+
sh:minCount 1 ;
35+
sh:severity sh:Violation ;
36+
sh:message """The Root Data Entity MUST have a `sourceOrganization` property.""" ;
37+
] ;
38+
39+
sh:property [
40+
a sh:PropertyShape ;
41+
sh:name "sourceOrganization" ;
42+
sh:path schema:sourceOrganization ;
43+
sh:class schema:Project ;
44+
sh:severity sh:Violation ;
45+
sh:message """The `sourceOrganization` property of the RootDataEntity MUST point to a Project entity.""" ;
46+
] .
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright (c) 2024-2025 CRS4, University of Manchester
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
@prefix dct: <http://purl.org/dc/terms/> .
16+
@prefix prof: <http://www.w3.org/ns/dx/prof/> .
17+
@prefix role: <http://www.w3.org/ns/dx/prof/role/> .
18+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
19+
20+
<https://w3id.org/alpha-crate/0.1>
21+
a prof:Profile ;
22+
23+
# the Profile's label
24+
rdfs:label "Alpha RO-Crate 0.1" ;
25+
26+
# regular metadata, a basic description of the Profile
27+
rdfs:comment """Alpha RO-Crate Metadata Specification 0.1"""@en ;
28+
29+
# URI of the publisher of the Metadata Specification
30+
dct:publisher <https://w3id.org/alpha-crate> ;
31+
32+
# This profile is a transitive profile of the RO-Crate Metadata Specification
33+
prof:isTransitiveProfileOf <https://w3id.org/ro/crate/1.1> ;
34+
35+
# this profile has a JSON-LD context resource
36+
prof:hasResource [
37+
a prof:ResourceDescriptor ;
38+
39+
# it's in JSON-LD format
40+
dct:format <https://w3id.org/mediatype/application/ld+json> ;
41+
42+
# it conforms to JSON-LD, here referred to by its namespace URI as a Profile
43+
dct:conformsTo <https://www.w3.org/TR/json-ld11/> ;
44+
45+
# this profile resource plays the role of "Vocabulary"
46+
# described in this ontology's accompanying Roles vocabulary
47+
prof:hasRole role:Vocabulary ;
48+
49+
# this profile resource's actual file
50+
prof:hasArtifact <https://w3id.org/ro/terms/workflow-run/context> ;
51+
] ;
52+
53+
# a short code to refer to the Profile with when a URI can't be used
54+
prof:hasToken "alpha-crate" ;
55+
.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright (c) 2025 eScience Lab, The University of Manchester
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
@prefix ro: <./> .
16+
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
17+
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
18+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
19+
@prefix schema: <http://schema.org/> .
20+
@prefix sh: <http://www.w3.org/ns/shacl#> .
21+
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
22+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
23+
24+
25+
five-safes-crate:WorkflowexecutionObjectHasStartTimeIfBegun
26+
a sh:NodeShape ;
27+
sh:name "WorkflowExecution" ;
28+
sh:description (
29+
"The workflow execution object MAY have a startTime if actionStatus is "
30+
"either ActiveActionStatus, CompletedActionStatus or FailedActionStatus."
31+
) ;
32+
33+
sh:target [
34+
a sh:SPARQLTarget ;
35+
sh:select """
36+
PREFIX schema: <http://schema.org/>
37+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
38+
39+
SELECT ?this
40+
WHERE {
41+
?this rdf:type schema:CreateAction ;
42+
schema:actionStatus ?status .
43+
FILTER(?status IN (
44+
"http://schema.org/CompletedActionStatus",
45+
"http://schema.org/FailedActionStatus",
46+
"http://schema.org/ActiveActionStatus"
47+
))
48+
}
49+
""" ;
50+
] ;
51+
52+
sh:property [
53+
a sh:PropertyShape ;
54+
sh:name "StartTime" ;
55+
sh:path schema:startTime ;
56+
sh:minCount 1 ;
57+
sh:maxCount 1 ;
58+
sh:severity sh:Info ;
59+
sh:description (
60+
"The workflow execution object MAY have a startTime if actionStatus is "
61+
"either ActiveActionStatus, CompletedActionStatus or FailedActionStatus."
62+
) ;
63+
sh:message "The workflow execution object MAY have a startTime if actionStatus is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
64+
] .
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright (c) 2025 eScience Lab, The University of Manchester
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
@prefix ro: <./> .
16+
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
17+
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
18+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
19+
@prefix schema: <http://schema.org/> .
20+
@prefix purl: <http://purl.org/dc/terms/> .
21+
@prefix sh: <http://www.w3.org/ns/shacl#> .
22+
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
23+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
24+
25+
26+
five-safes-crate:CheckValueMayHaveStartTime
27+
a sh:NodeShape ;
28+
sh:name "CheckValue" ;
29+
sh:description "" ;
30+
sh:target [
31+
a sh:SPARQLTarget ;
32+
sh:select """
33+
PREFIX schema: <http://schema.org/>
34+
PREFIX shp: <https://w3id.org/shp#>
35+
SELECT ?this
36+
WHERE {
37+
?this schema:additionalType shp:CheckValue ;
38+
schema:actionStatus ?status .
39+
FILTER(?status IN (
40+
"http://schema.org/CompletedActionStatus",
41+
"http://schema.org/FailedActionStatus",
42+
"http://schema.org/ActiveActionStatus"
43+
))
44+
}
45+
""" ;
46+
] ;
47+
48+
sh:property [
49+
a sh:PropertyShape ;
50+
sh:name "StartTime" ;
51+
sh:path schema:startTime ;
52+
sh:minCount 1 ;
53+
sh:maxCount 1 ;
54+
sh:severity sh:Info ;
55+
sh:message "`CheckValue` MAY have the `startTime` property." ;
56+
] .
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright (c) 2025 eScience Lab, The University of Manchester
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
@prefix ro: <./> .
16+
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
17+
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
18+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
19+
@prefix schema: <http://schema.org/> .
20+
@prefix purl: <http://purl.org/dc/terms/> .
21+
@prefix sh: <http://www.w3.org/ns/shacl#> .
22+
@prefix validator: <https://github.com/crs4/rocrate-validator/> .
23+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
24+
25+
26+
five-safes-crate:DownloadActionMayHaveStartTimeIfBegun
27+
a sh:NodeShape ;
28+
sh:name "ValidationCheck" ;
29+
sh:description "" ;
30+
sh:target [
31+
a sh:SPARQLTarget ;
32+
sh:select """
33+
PREFIX schema: <http://schema.org/>
34+
PREFIX shp: <https://w3id.org/shp#>
35+
SELECT ?this
36+
WHERE {
37+
?this schema:additionalType shp:ValidationCheck ;
38+
schema:actionStatus ?status .
39+
FILTER(?status IN (
40+
"http://schema.org/CompletedActionStatus",
41+
"http://schema.org/FailedActionStatus",
42+
"http://schema.org/ActiveActionStatus"
43+
))
44+
}
45+
""" ;
46+
] ;
47+
48+
sh:property [
49+
a sh:PropertyShape ;
50+
sh:name "StartTime" ;
51+
sh:path schema:startTime ;
52+
sh:minCount 1 ;
53+
sh:maxCount 1 ;
54+
sh:severity sh:Info ;
55+
sh:description "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
56+
sh:message "ValidationCheck MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
57+
] .
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Copyright (c) 2025 eScience Lab, The University of Manchester
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
@prefix ro: <./> .
17+
@prefix ro-crate: <https://github.com/crs4/rocrate-validator/profiles/ro-crate/> .
18+
@prefix five-safes-crate: <https://github.com/eScienceLab/rocrate-validator/profiles/five-safes-crate/> .
19+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
20+
@prefix schema: <http://schema.org/> .
21+
@prefix purl: <http://purl.org/dc/terms/> .
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+
27+
five-safes-crate:DownloadedWorkflowSHOULDExistAndBeReferencedByDownloadActionResult
28+
a sh:NodeShape ;
29+
sh:name "DownloadAction" ;
30+
sh:description "Validates that DownloadAction result references an existing entity" ;
31+
sh:targetClass schema:DownloadAction ;
32+
33+
sh:property [
34+
a sh:PropertyShape ;
35+
sh:name "Result" ;
36+
sh:description "The result property must reference an existing entity in the RO-Crate" ;
37+
sh:path schema:result ;
38+
sh:minCount 1 ;
39+
sh:nodeKind sh:IRI ;
40+
41+
sh:sparql [
42+
a sh:SPARQLConstraint ;
43+
sh:select """
44+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
45+
PREFIX schema: <http://schema.org/>
46+
47+
SELECT $this $value
48+
WHERE {
49+
$this schema:result $value .
50+
51+
# Entity must have BOTH type AND name (proper definition)
52+
FILTER NOT EXISTS {
53+
$value rdf:type schema:Dataset .
54+
}
55+
}
56+
""" ;
57+
sh:severity sh:Info ;
58+
sh:message "The entity representing the downloaded workflow is not defined, OR is not referenced by `DownloadAction` --> `result`, OR is not of type `schema:Dataset`." ;
59+
] ;
60+
] .
61+
62+
63+
five-safes-crate:DownloadActionMayHaveStartTimeIfBegun
64+
a sh:NodeShape ;
65+
sh:name "DownloadAction" ;
66+
sh:description (
67+
"`DownloadAction` MAY have the `startTime` property if `actionStatus` "
68+
"is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus."
69+
);
70+
71+
sh:target [
72+
a sh:SPARQLTarget ;
73+
sh:select """
74+
PREFIX schema: <http://schema.org/>
75+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
76+
77+
SELECT ?this
78+
WHERE {
79+
?this rdf:type schema:DownloadAction ;
80+
schema:actionStatus ?status .
81+
FILTER(?status IN (
82+
"http://schema.org/CompletedActionStatus",
83+
"http://schema.org/FailedActionStatus",
84+
"http://schema.org/ActiveActionStatus"
85+
))
86+
}
87+
""" ;
88+
] ;
89+
90+
sh:property [
91+
a sh:PropertyShape ;
92+
sh:name "StartTime" ;
93+
sh:path schema:startTime ;
94+
sh:minCount 1 ;
95+
sh:maxCount 1 ;
96+
sh:severity sh:Info ;
97+
sh:description (
98+
"`DownloadAction` MAY have the `startTime` property if `actionStatus` "
99+
"is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus."
100+
);
101+
sh:message "`DownloadAction` MAY have the `startTime` property if `actionStatus` is either ActiveActionStatus, CompletedActionStatus or FailedActionStatus." ;
102+
] .

0 commit comments

Comments
 (0)