uc3-dmp-id 0.0.21 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa1a63e00e317587dc9bba2ce165b400a4f2ea4cb72f9af62db6703ba83ebe88
4
- data.tar.gz: 778c12434dc38726d18260912b4d46f488f865afad4ab000fc76d97b689a7cfd
3
+ metadata.gz: 4f782828a3f7f2d734f02ae97e1fded41787e62cbf17d814a7e5a2e32752374b
4
+ data.tar.gz: b696b7097b38f97a28912567258ecf2a8b7285cfee2bef64878cb6dc89a105ac
5
5
  SHA512:
6
- metadata.gz: 65e1c3f23cd91b366f59c67f85d210736dcdf54c63d5c5e3a727300ecaf7479c88af91c5ed91e08662f972050e83fa44bf3d411a43f3463fd97539b73cd1415a
7
- data.tar.gz: d996426a6899f7ce753256818af9b68ad8552756711b4da755d465f42f3d0312c4e6b302802d833bb1262890c8537fd9bf482156b2bf582123dae2dee7de79be
6
+ metadata.gz: 99f808a87e791b3c6ce5368c4a1dd830548c65ebc6f4b6c99c13d05a2167f35d07cff32871c60fd0b3cd475f9c6c8d624e4a7130d08256b77aa8069e6538e1d5
7
+ data.tar.gz: ad11e40faf5ceb18359b3b035d625e6b7600321f71e1877e59731e2fa26369e433d22ab98253b75a618160b3bd2b6c87709078b5f5eb0f8afa237643773a0636
@@ -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