Skip to content

Commit fd7046d

Browse files
committed
add extra crates to check context
1 parent ec02130 commit fd7046d

4 files changed

Lines changed: 350 additions & 13 deletions

File tree

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
{
2+
"@context": ["https://w3id.org/ro/crate/1.1/context", "http://schema.org", {"test": "http://schema.org/test"}],
3+
"@graph": [
4+
{
5+
"@type": "CreativeWork",
6+
"@id": "ro-crate-metadata.json",
7+
"about": {
8+
"@id": "./"
9+
},
10+
"conformsTo": {
11+
"@id": "https://w3id.org/ro/crate/1.2"
12+
}
13+
},
14+
{
15+
"@id": "./",
16+
"@type": "Dataset",
17+
"name": "5-Safe RO-Crate Request",
18+
"description": "example 5-Safe RO-Crate request metadata for testing",
19+
"license": "Apache-2.0",
20+
"datePublished": "2025-09-20T14:38:00+00:00",
21+
"conformsTo": {
22+
"@id": "https://w3id.org/5s-crate/0.4"
23+
},
24+
"hasPart": [
25+
{
26+
"@id": "https://workflowhub.eu/workflows/289?version=1"
27+
},
28+
{
29+
"@id": "input1.txt"
30+
}
31+
],
32+
"mainEntity": {
33+
"@id": "https://workflowhub.eu/workflows/289?version=1"
34+
},
35+
"mentions": {
36+
"@id": "#query-37252371-c937-43bd-a0a7-3680b48c0538"
37+
},
38+
"sourceOrganization": {
39+
"@id": "#project-be6ffb55-4f5a-4c14-b60e-47e0951090c70"
40+
}
41+
},
42+
{
43+
"@id": "https://w3id.org/5s-crate/0.4",
44+
"@type": "Profile",
45+
"name": "Five Safes RO-Crate profile"
46+
},
47+
{
48+
"@id": "https://workflowhub.eu/workflows/289?version=1",
49+
"@type": "Dataset",
50+
"name": "CWL Protein MD Setup tutorial with mutations",
51+
"conformsTo": {
52+
"@id": "https://w3id.org/workflowhub/workflow-ro-crate/1.0"
53+
},
54+
"distribution": {
55+
"@id": "https://workflowhub.eu/workflows/289/ro_crate?version=1"
56+
}
57+
},
58+
{
59+
"@id": "https://workflowhub.eu/workflows/289/ro_crate?version=1",
60+
"@type": "DataDownload",
61+
"conformsTo": {
62+
"@id": "https://w3id.org/ro/crate"
63+
},
64+
"encodingFormat": "application/zip"
65+
},
66+
{
67+
"@id": "#query-37252371-c937-43bd-a0a7-3680b48c0538",
68+
"@type": "CreateAction",
69+
"actionStatus": "http://schema.org/PotentialActionStatus",
70+
"agent": {
71+
"@id": "https://orcid.org/0000-0001-9842-9718"
72+
},
73+
"instrument": {
74+
"@id": "https://workflowhub.eu/workflows/289?version=1"
75+
},
76+
"name": "Execute query 12389 on workflow ",
77+
"object": [
78+
{
79+
"@id": "input1.txt"
80+
},
81+
{
82+
"@id": "#enableFastMode"
83+
}
84+
]
85+
},
86+
{
87+
"@id": "https://orcid.org/0000-0001-9842-9718",
88+
"@type": "Person",
89+
"name": "Stian Soiland-Reyes",
90+
"affiliation": {
91+
"@id": "https://ror.org/027m9bs27"
92+
},
93+
"memberOf": [
94+
{
95+
"@id": "#project-be6ffb55-4f5a-4c14-b60e-47e0951090c70"
96+
}
97+
]
98+
},
99+
{
100+
"@id": "https://ror.org/027m9bs27",
101+
"@type": "Organization",
102+
"name": "The University of Manchester"
103+
},
104+
{
105+
"@id": "https://ror.org/01ee9ar58",
106+
"@type": "Organization",
107+
"name": "University of Nottingham"
108+
},
109+
{
110+
"@id": "#project-be6ffb55-4f5a-4c14-b60e-47e0951090c70",
111+
"@type": "Project",
112+
"name": "Investigation of cancer (TRE72 project 81)",
113+
"identifier": [
114+
{
115+
"@id": "_:localid:tre72:project81"
116+
}
117+
],
118+
"funding": {
119+
"@id": "https://gtr.ukri.org/projects?ref=10038961"
120+
},
121+
"member": [
122+
{
123+
"@id": "https://ror.org/027m9bs27"
124+
},
125+
{
126+
"@id": "https://ror.org/01ee9ar58"
127+
}
128+
]
129+
},
130+
{
131+
"@id": "_:localid:tre72:project81",
132+
"@type": "PropertyValue",
133+
"name": "tre72",
134+
"value": "project81"
135+
},
136+
{
137+
"@id": "https://gtr.ukri.org/projects?ref=10038961",
138+
"@type": "Grant",
139+
"name": "EOSC4Cancer"
140+
},
141+
{
142+
"@id": "input1.txt",
143+
"@type": "File",
144+
"name": "input1",
145+
"exampleOfWork": {
146+
"@id": "#sequence"
147+
}
148+
},
149+
{
150+
"@id": "#enableFastMode",
151+
"@type": "PropertyValue",
152+
"name": "--fast-mode",
153+
"value": "True",
154+
"exampleOfWork": {
155+
"@id": "#fast"
156+
}
157+
},
158+
{
159+
"@id": "#sequence",
160+
"@type": "FormalParameter",
161+
"name": "input-sequence"
162+
},
163+
{
164+
"@id": "#fast",
165+
"@type": "FormalParameter",
166+
"name": "fast-mode"
167+
}
168+
]
169+
}
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
{
2+
"@context": "https://w3id.org/ro/crate/1.1/context",
3+
"@graph": [
4+
{
5+
"@type": "CreativeWork",
6+
"@id": "ro-crate-metadata.json",
7+
"about": {
8+
"@id": "./"
9+
},
10+
"conformsTo": {
11+
"@id": "https://w3id.org/ro/crate/1.2"
12+
}
13+
},
14+
{
15+
"@id": "./",
16+
"@type": "Dataset",
17+
"name": "5-Safe RO-Crate Request",
18+
"description": "example 5-Safe RO-Crate request metadata for testing",
19+
"license": "Apache-2.0",
20+
"datePublished": "2025-09-20T14:38:00+00:00",
21+
"conformsTo": {
22+
"@id": "https://w3id.org/5s-crate/0.4"
23+
},
24+
"hasPart": [
25+
{
26+
"@id": "https://workflowhub.eu/workflows/289?version=1"
27+
},
28+
{
29+
"@id": "input1.txt"
30+
}
31+
],
32+
"mainEntity": {
33+
"@id": "https://workflowhub.eu/workflows/289?version=1"
34+
},
35+
"mentions": {
36+
"@id": "#query-37252371-c937-43bd-a0a7-3680b48c0538"
37+
},
38+
"sourceOrganization": {
39+
"@id": "#project-be6ffb55-4f5a-4c14-b60e-47e0951090c70"
40+
}
41+
},
42+
{
43+
"@id": "https://w3id.org/5s-crate/0.4",
44+
"@type": "Profile",
45+
"name": "Five Safes RO-Crate profile"
46+
},
47+
{
48+
"@id": "https://workflowhub.eu/workflows/289?version=1",
49+
"@type": "Dataset",
50+
"name": "CWL Protein MD Setup tutorial with mutations",
51+
"conformsTo": {
52+
"@id": "https://w3id.org/workflowhub/workflow-ro-crate/1.0"
53+
},
54+
"distribution": {
55+
"@id": "https://workflowhub.eu/workflows/289/ro_crate?version=1"
56+
}
57+
},
58+
{
59+
"@id": "https://workflowhub.eu/workflows/289/ro_crate?version=1",
60+
"@type": "DataDownload",
61+
"conformsTo": {
62+
"@id": "https://w3id.org/ro/crate"
63+
},
64+
"encodingFormat": "application/zip"
65+
},
66+
{
67+
"@id": "#query-37252371-c937-43bd-a0a7-3680b48c0538",
68+
"@type": "CreateAction",
69+
"actionStatus": "http://schema.org/PotentialActionStatus",
70+
"agent": {
71+
"@id": "https://orcid.org/0000-0001-9842-9718"
72+
},
73+
"instrument": {
74+
"@id": "https://workflowhub.eu/workflows/289?version=1"
75+
},
76+
"name": "Execute query 12389 on workflow ",
77+
"object": [
78+
{
79+
"@id": "input1.txt"
80+
},
81+
{
82+
"@id": "#enableFastMode"
83+
}
84+
]
85+
},
86+
{
87+
"@id": "https://orcid.org/0000-0001-9842-9718",
88+
"@type": "Person",
89+
"name": "Stian Soiland-Reyes",
90+
"affiliation": {
91+
"@id": "https://ror.org/027m9bs27"
92+
},
93+
"memberOf": [
94+
{
95+
"@id": "#project-be6ffb55-4f5a-4c14-b60e-47e0951090c70"
96+
}
97+
]
98+
},
99+
{
100+
"@id": "https://ror.org/027m9bs27",
101+
"@type": "Organization",
102+
"name": "The University of Manchester"
103+
},
104+
{
105+
"@id": "https://ror.org/01ee9ar58",
106+
"@type": "Organization",
107+
"name": "University of Nottingham"
108+
},
109+
{
110+
"@id": "#project-be6ffb55-4f5a-4c14-b60e-47e0951090c70",
111+
"@type": "Project",
112+
"name": "Investigation of cancer (TRE72 project 81)",
113+
"identifier": [
114+
{
115+
"@id": "_:localid:tre72:project81"
116+
}
117+
],
118+
"funding": {
119+
"@id": "https://gtr.ukri.org/projects?ref=10038961"
120+
},
121+
"member": [
122+
{
123+
"@id": "https://ror.org/027m9bs27"
124+
},
125+
{
126+
"@id": "https://ror.org/01ee9ar58"
127+
}
128+
]
129+
},
130+
{
131+
"@id": "_:localid:tre72:project81",
132+
"@type": "PropertyValue",
133+
"name": "tre72",
134+
"value": "project81"
135+
},
136+
{
137+
"@id": "https://gtr.ukri.org/projects?ref=10038961",
138+
"@type": "Grant",
139+
"name": "EOSC4Cancer"
140+
},
141+
{
142+
"@id": "input1.txt",
143+
"@type": "File",
144+
"name": "input1",
145+
"exampleOfWork": {
146+
"@id": "#sequence"
147+
}
148+
},
149+
{
150+
"@id": "#enableFastMode",
151+
"@type": "PropertyValue",
152+
"name": "--fast-mode",
153+
"value": "True",
154+
"exampleOfWork": {
155+
"@id": "#fast"
156+
}
157+
},
158+
{
159+
"@id": "#sequence",
160+
"@type": "FormalParameter",
161+
"name": "input-sequence"
162+
},
163+
{
164+
"@id": "#fast",
165+
"@type": "FormalParameter",
166+
"name": "fast-mode"
167+
}
168+
]
169+
}

tests/data/crates/valid/five-safes-crate-result/ro-crate-metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"@context": "https://w3id.org/ro/crate/1.1/context",
2+
"@context": "https://w3id.org/ro/crate/1.2/context",
33
"@graph": [
44
{
55
"@type": "CreativeWork",
@@ -8,7 +8,7 @@
88
"@id": "./"
99
},
1010
"conformsTo": {
11-
"@id": "https://w3id.org/ro/crate/1.1"
11+
"@id": "https://w3id.org/ro/crate/1.2"
1212
}
1313
},
1414
{
@@ -404,4 +404,4 @@
404404
"name": "sha-512 algorithm"
405405
}
406406
]
407-
}
407+
}

tests/ro_crates.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def five_safes_crate_request(self) -> Path:
9898
@property
9999
def five_safes_crate_result(self) -> Path:
100100
return VALID_CRATES_DATA_PATH / "five-safes-crate-result"
101+
102+
@property
103+
def five_safes_crate_multiple_context(self) -> Path:
104+
return VALID_CRATES_DATA_PATH / "five-safes-crate-multiple-context"
101105

102106

103107
class InvalidFileDescriptor:
@@ -980,20 +984,15 @@ def propertyvalue_no_unitcode(self) -> Path:
980984

981985
class Invalid5sROC:
982986

983-
base_path = INVALID_CRATES_DATA_PATH / "6_five_safes_crate/"
984-
985-
@property
986-
def funding_project_no_name(self) -> Path:
987-
return self.base_path / "funding_project_no_name"
987+
base_path = INVALID_CRATES_DATA_PATH / "five_safes_crate/"
988988

989989
@property
990-
def root_data_entity_no_source_organization(self) -> Path:
991-
return self.base_path / "root_data_entity_no_source_organization"
990+
def context_multiple_wrong_version(self) -> Path:
991+
return self.base_path / "context_multiple_wrong_version"
992992

993993
@property
994-
def root_data_entity_source_organization_not_entity(self) -> Path:
995-
return self.base_path / "root_data_entity_source_organization_not_entity"
996-
994+
def context_single_wrong_version(self) -> Path:
995+
return self.base_path / "context_single_wrong_version"
997996

998997
class InvalidMultiProfileROC:
999998

0 commit comments

Comments
 (0)