uc3-dmp-id 0.0.140 → 0.1.0

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