uc3-dmp-id 0.0.21 → 0.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-id/helper.rb +0 -3
- data/lib/uc3-dmp-id/schemas/amend.rb +343 -0
- data/lib/uc3-dmp-id/schemas/author.rb +1388 -0
- data/lib/uc3-dmp-id/validator.rb +3 -13
- data/lib/uc3-dmp-id/version.rb +1 -1
- metadata +3 -3
- data/lib/schemas/amend.json +0 -330
- data/lib/schemas/author.json +0 -1375
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86a7aa81a5a55d488eb5cb0db508c787d781e68fc050f61acc7913c86b38fd06
|
4
|
+
data.tar.gz: 1d19d4ce33a472ac9a7125a51141330c5a14c039701ccc3f23ff584ad35d42cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29ed2efd8e952c0a94874b2a1da368b483e519d4b8a1dfbf35a91d389362de5ebc19ecd091f5aaf8fa0d1b2b2fef00fa8110559f42cfcdbc4453cdfb52c1c665
|
7
|
+
data.tar.gz: b198854582d27299fc09e49a66a1bc06c69bfd0a1aac21d2a67c68e25433e2c09c18fb4ba532b75f4384f0751e9bfb980aeeaaef094bc817fce8397824f676b0
|
data/lib/uc3-dmp-id/helper.rb
CHANGED
@@ -116,9 +116,6 @@ module Uc3DmpId
|
|
116
116
|
def cleanse_dmp_json(json:)
|
117
117
|
return json unless json.is_a?(Hash) || json.is_a?(Array)
|
118
118
|
|
119
|
-
puts "CLEANSING"
|
120
|
-
puts json
|
121
|
-
|
122
119
|
# If it's an array clean each of the objects individually
|
123
120
|
return json.map { |obj| cleanse_dmp_json(json: obj) }.compact if json.is_a?(Array)
|
124
121
|
|
@@ -0,0 +1,343 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Uc3DmpId
|
4
|
+
module Schemas
|
5
|
+
# The JSON schema for creating a new DMP ID
|
6
|
+
class Amend
|
7
|
+
class << self
|
8
|
+
def load
|
9
|
+
JSON.parse({
|
10
|
+
"$id": "https://github.com/CDLUC3/dmp-hub-sam/layer/ruby/config/schemas/amend.json",
|
11
|
+
"title": "RDA DMP Common Standard Schema",
|
12
|
+
"description": "JSON Schema for the RDA DMP Common Standard",
|
13
|
+
"type": "object",
|
14
|
+
"properties": {
|
15
|
+
"dmp": {
|
16
|
+
"$id": "#/properties/dmp",
|
17
|
+
"type": "object",
|
18
|
+
"title": "The DMP Schema",
|
19
|
+
"properties": {
|
20
|
+
"dmp_id": {
|
21
|
+
"$id": "#/properties/dmp/properties/dmp_id",
|
22
|
+
"type": "object",
|
23
|
+
"title": "The DMP Identifier Schema",
|
24
|
+
"description": "Identifier for the DMP itself",
|
25
|
+
"properties": {
|
26
|
+
"identifier": {
|
27
|
+
"$id": "#/properties/dmp/properties/dmp_id/properties/identifier",
|
28
|
+
"type": "string",
|
29
|
+
"title": "The DMP Identifier Value Schema",
|
30
|
+
"description": "Identifier for a DMP",
|
31
|
+
"examples": ["https://doi.org/10.1371/journal.pcbi.1006750"]
|
32
|
+
},
|
33
|
+
"type": {
|
34
|
+
"$id": "#/properties/dmp/properties/dmp_id/properties/type",
|
35
|
+
"type": "string",
|
36
|
+
"enum": [
|
37
|
+
"handle",
|
38
|
+
"doi",
|
39
|
+
"ark",
|
40
|
+
"url",
|
41
|
+
"other"
|
42
|
+
],
|
43
|
+
"title": "The DMP Identifier Type Schema",
|
44
|
+
"description": "The DMP Identifier Type. Allowed values: handle, doi, ark, url, other",
|
45
|
+
"examples": ["doi"]
|
46
|
+
}
|
47
|
+
},
|
48
|
+
"required": [
|
49
|
+
"identifier",
|
50
|
+
"type"
|
51
|
+
]
|
52
|
+
},
|
53
|
+
"modified": {
|
54
|
+
"$id": "#/properties/dmp/properties/modified",
|
55
|
+
"type": "string",
|
56
|
+
"format": "date-time",
|
57
|
+
"title": "The DMP Modification Schema",
|
58
|
+
"description": "Must be set each time DMP is modified. Indicates DMP version. Encoded using the relevant ISO 8601 Date and Time compliant string.",
|
59
|
+
"examples": ["2020-03-14T10:53:49"]
|
60
|
+
},
|
61
|
+
"title": {
|
62
|
+
"$id": "#/properties/dmp/properties/title",
|
63
|
+
"type": "string",
|
64
|
+
"title": "The DMP Title Schema",
|
65
|
+
"description": "Title of a DMP",
|
66
|
+
"examples": ["DMP for our new project"]
|
67
|
+
},
|
68
|
+
"anyOf": [
|
69
|
+
{
|
70
|
+
"dmproadmap_related_identifiers": {
|
71
|
+
"$id": "#/properties/dmp/properties/dmproadmap_related_identifiers",
|
72
|
+
"type": "array",
|
73
|
+
"title": "Related identifiers for the DMP",
|
74
|
+
"description": "Identifiers for objects related to the DMP (e.g. datasets, publications, etc.)",
|
75
|
+
"items": {
|
76
|
+
"$id": "#/properties/dmp/properties/dmproadmap_related_identifiers/items",
|
77
|
+
"type": "object",
|
78
|
+
"title": "A related identifier",
|
79
|
+
"properties": {
|
80
|
+
"descriptor": {
|
81
|
+
"$id": "#/properties/dmp/properties/dmproadmap_related_identifiers/items/properties/descriptor",
|
82
|
+
"type": "string",
|
83
|
+
"enum": [
|
84
|
+
"is_cited_by",
|
85
|
+
"cites",
|
86
|
+
"is_supplement_to",
|
87
|
+
"is_supplemented_by",
|
88
|
+
"is_described_by",
|
89
|
+
"describes",
|
90
|
+
"has_metadata",
|
91
|
+
"is_metadata_for",
|
92
|
+
"is_part_of",
|
93
|
+
"has_part",
|
94
|
+
"is_referenced_by",
|
95
|
+
"references",
|
96
|
+
"is_documented_by",
|
97
|
+
"documents",
|
98
|
+
"is_new_version_of",
|
99
|
+
"is_previous_version_of"
|
100
|
+
]
|
101
|
+
},
|
102
|
+
"identifier": {
|
103
|
+
"$id": "#/properties/dmp/properties/dmproadmap_related_identifiers/items/properties/identifier",
|
104
|
+
"type": "string",
|
105
|
+
"title": "A unique identifier for the item",
|
106
|
+
"description": "Identifier for a DMP",
|
107
|
+
"examples": ["https://doi.org/10.1371/journal.pcbi.1006750"]
|
108
|
+
},
|
109
|
+
"type": {
|
110
|
+
"$id": "#/properties/dmp/properties/dmproadmap_related_identifiers/items/properties/type",
|
111
|
+
"type": "string",
|
112
|
+
"enum": [
|
113
|
+
"handle",
|
114
|
+
"doi",
|
115
|
+
"ark",
|
116
|
+
"url",
|
117
|
+
"other"
|
118
|
+
]
|
119
|
+
},
|
120
|
+
"work_type": {
|
121
|
+
"$id": "#/properties/dmp/properties/dmproadmap_related_identifiers/items/properties/work_type",
|
122
|
+
"type": "string",
|
123
|
+
"enum": [
|
124
|
+
"article",
|
125
|
+
"book",
|
126
|
+
"dataset",
|
127
|
+
"metadata_template",
|
128
|
+
"other",
|
129
|
+
"output_management_plan",
|
130
|
+
"paper",
|
131
|
+
"preprint",
|
132
|
+
"preregistration",
|
133
|
+
"protocol",
|
134
|
+
"software",
|
135
|
+
"supplemental_information"
|
136
|
+
]
|
137
|
+
}
|
138
|
+
},
|
139
|
+
"required": [
|
140
|
+
"descriptor",
|
141
|
+
"identifier",
|
142
|
+
"type",
|
143
|
+
"work_type"
|
144
|
+
]
|
145
|
+
}
|
146
|
+
}
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"project": {
|
150
|
+
"$id": "#/properties/dmp/properties/project",
|
151
|
+
"type": "array",
|
152
|
+
"title": "The DMP Project Schema",
|
153
|
+
"description": "Project related to a DMP",
|
154
|
+
"items": {
|
155
|
+
"$id": "#/properties/dmp/properties/project/items",
|
156
|
+
"type": "object",
|
157
|
+
"title": "The DMP Project Items Schema",
|
158
|
+
"properties": {
|
159
|
+
"funding": {
|
160
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding",
|
161
|
+
"type": "array",
|
162
|
+
"title": "The DMP Project Funding Schema",
|
163
|
+
"description": "Funding related with a project",
|
164
|
+
"items": {
|
165
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/items",
|
166
|
+
"type": "object",
|
167
|
+
"title": "The DMP Project Funding Items Schema",
|
168
|
+
"properties": {
|
169
|
+
"dmproadmap_funded_affiliations": {
|
170
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding//items/properties/dmproadmap_funded_affiliations",
|
171
|
+
"type": "array",
|
172
|
+
"title": "Institutions named on the grant",
|
173
|
+
"description": "The institutions who received the funding",
|
174
|
+
"items": {
|
175
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/items/properties/dmproadmap_funded_affiliations/items",
|
176
|
+
"type": "object",
|
177
|
+
"title": "An institution that received funding",
|
178
|
+
"properties": {
|
179
|
+
"affiliation_id": {
|
180
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/items/properties/dmproadmap_funded_affiliations/items/properties/affiliation_id",
|
181
|
+
"type": "object",
|
182
|
+
"title": "The funded affiliation's ID",
|
183
|
+
"description": "Affiliation ID of the associated project",
|
184
|
+
"properties": {
|
185
|
+
"identifier": {
|
186
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/items/properties/dmproadmap_funded_affiliations/items/properties/affiliation_id/properties/identifier",
|
187
|
+
"type": "string",
|
188
|
+
"title": "The affiliation ID",
|
189
|
+
"description": "ROR ID or URL. Recommended to use Research Organization Registry (ROR). See: https://ror.org",
|
190
|
+
"examples": ["https://ror.org/00pjdza24", "https://cdlib.org"]
|
191
|
+
},
|
192
|
+
"type": {
|
193
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/items/properties/dmproadmap_funded_affiliations/items/properties/affiliation_id/properties/type",
|
194
|
+
"type": "string",
|
195
|
+
"enum": [
|
196
|
+
"doi",
|
197
|
+
"ror",
|
198
|
+
"url"
|
199
|
+
],
|
200
|
+
"title": "The affiliation ID Type Schema",
|
201
|
+
"description": "Identifier type. Allowed values: doi, ror, url",
|
202
|
+
"examples": ["ror"]
|
203
|
+
}
|
204
|
+
},
|
205
|
+
"required": [
|
206
|
+
"identifier",
|
207
|
+
"type"
|
208
|
+
]
|
209
|
+
},
|
210
|
+
"name": {
|
211
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/items/properties/dmproadmap_funded_affiliations/items/properties/name",
|
212
|
+
"type": "string",
|
213
|
+
"title": "The name of the instituion / organization",
|
214
|
+
"description": "Project title",
|
215
|
+
"examples": ["Our New Project"]
|
216
|
+
}
|
217
|
+
}
|
218
|
+
}
|
219
|
+
},
|
220
|
+
"dmproadmap_opportunity_number": {
|
221
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/properties/dmproadmap_opportunity_number",
|
222
|
+
"type": "string",
|
223
|
+
"title": "The funder's opportunity / award number",
|
224
|
+
"description": "The funder's number used to identify the award or call for submissions",
|
225
|
+
"examples": ["Award-123"]
|
226
|
+
},
|
227
|
+
"dmproadmap_project_number": {
|
228
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/properties/dmproadmap_project_number",
|
229
|
+
"type": "string",
|
230
|
+
"title": "The funder's identifier for the research project",
|
231
|
+
"description": "The funder's identifier used to identify the research project",
|
232
|
+
"examples": ["prj-XYZ987-UCB"]
|
233
|
+
},
|
234
|
+
"funder_id": {
|
235
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/properties/funder_id",
|
236
|
+
"type": "object",
|
237
|
+
"title": "The Funder ID Schema",
|
238
|
+
"description": "Funder ID of the associated project",
|
239
|
+
"properties": {
|
240
|
+
"identifier": {
|
241
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/properties/funder_id/properties/identifier",
|
242
|
+
"type": "string",
|
243
|
+
"title": "The Funder ID Value Schema",
|
244
|
+
"description": "Funder ID, recommended to use CrossRef Funder Registry. See: https://www.crossref.org/services/funder-registry/",
|
245
|
+
"examples": ["501100002428"]
|
246
|
+
},
|
247
|
+
"type": {
|
248
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/properties/funder_id/properties/type",
|
249
|
+
"type": "string",
|
250
|
+
"enum": [
|
251
|
+
"fundref",
|
252
|
+
"ror",
|
253
|
+
"url",
|
254
|
+
"other"
|
255
|
+
],
|
256
|
+
"title": "The Funder ID Type Schema",
|
257
|
+
"description": "Identifier type. Allowed values: fundref, url, other",
|
258
|
+
"examples": ["fundref"]
|
259
|
+
}
|
260
|
+
},
|
261
|
+
"required": [
|
262
|
+
"identifier",
|
263
|
+
"type"
|
264
|
+
]
|
265
|
+
},
|
266
|
+
"funding_status": {
|
267
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/properties/funding_status",
|
268
|
+
"type": "string",
|
269
|
+
"enum": [
|
270
|
+
"planned",
|
271
|
+
"applied",
|
272
|
+
"granted",
|
273
|
+
"rejected"
|
274
|
+
],
|
275
|
+
"title": "The Funding Status Schema",
|
276
|
+
"description": "To express different phases of project lifecycle. Allowed values: planned, applied, granted, rejected",
|
277
|
+
"examples": ["granted"]
|
278
|
+
},
|
279
|
+
"grant_id": {
|
280
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/properties/grant_id",
|
281
|
+
"type": "object",
|
282
|
+
"title": "The Funding Grant ID Schema",
|
283
|
+
"description": "Grant ID of the associated project",
|
284
|
+
"properties": {
|
285
|
+
"identifier": {
|
286
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/properties/grant_id/properties/identifier",
|
287
|
+
"type": "string",
|
288
|
+
"title": "The Funding Grant ID Value Schema",
|
289
|
+
"description": "Grant ID",
|
290
|
+
"examples": ["776242"]
|
291
|
+
},
|
292
|
+
"type": {
|
293
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/properties/grant_id/properties/type",
|
294
|
+
"type": "string",
|
295
|
+
"title": "The Funding Grant ID Type Schema",
|
296
|
+
"enum": [
|
297
|
+
"url",
|
298
|
+
"other"
|
299
|
+
],
|
300
|
+
"description": "Identifier type. Allowed values: url, other",
|
301
|
+
"examples": ["other"]
|
302
|
+
}
|
303
|
+
},
|
304
|
+
"required": [
|
305
|
+
"identifier",
|
306
|
+
"type"
|
307
|
+
]
|
308
|
+
},
|
309
|
+
"name": {
|
310
|
+
"$id": "#/properties/dmp/properties/project/items/properties/funding/properties/name",
|
311
|
+
"type": "string",
|
312
|
+
"title": "The name of the funding instituion / organization",
|
313
|
+
"description": "Name",
|
314
|
+
"examples": ["National Science Foundation"]
|
315
|
+
}
|
316
|
+
},
|
317
|
+
"required": [
|
318
|
+
"funding_status",
|
319
|
+
"name"
|
320
|
+
]
|
321
|
+
}
|
322
|
+
}
|
323
|
+
}
|
324
|
+
}
|
325
|
+
}
|
326
|
+
}
|
327
|
+
]
|
328
|
+
},
|
329
|
+
"required": [
|
330
|
+
"dmp_id",
|
331
|
+
"modified",
|
332
|
+
"title"
|
333
|
+
]
|
334
|
+
}
|
335
|
+
},
|
336
|
+
"additionalProperties": false,
|
337
|
+
"required": ["dmp"]
|
338
|
+
}.to_json)
|
339
|
+
end
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
end
|