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.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-id/asserter.rb +162 -78
- data/lib/uc3-dmp-id/creator.rb +20 -16
- data/lib/uc3-dmp-id/deleter.rb +17 -18
- data/lib/uc3-dmp-id/finder.rb +49 -31
- data/lib/uc3-dmp-id/helper.rb +37 -21
- data/lib/uc3-dmp-id/schemas/amend.rb +269 -267
- data/lib/uc3-dmp-id/schemas/author.rb +1363 -1361
- data/lib/uc3-dmp-id/updater.rb +74 -39
- data/lib/uc3-dmp-id/validator.rb +10 -4
- data/lib/uc3-dmp-id/version.rb +1 -1
- data/lib/uc3-dmp-id/versioner.rb +16 -7
- data/lib/uc3-dmp-id.rb +1 -11
- metadata +2 -58
@@ -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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
-
|
44
|
-
|
45
|
-
|
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
|
-
|
49
|
-
|
50
|
-
|
49
|
+
required: %w[
|
50
|
+
identifier
|
51
|
+
type
|
51
52
|
]
|
52
53
|
},
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
-
|
69
|
+
anyOf: [
|
69
70
|
{
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
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
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
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
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
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
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
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
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
140
|
+
required: %w[
|
141
|
+
descriptor
|
142
|
+
identifier
|
143
|
+
type
|
144
|
+
work_type
|
144
145
|
]
|
145
146
|
}
|
146
147
|
}
|
147
148
|
},
|
148
149
|
{
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
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
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
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
|
-
|
201
|
-
|
202
|
-
|
201
|
+
title: 'The affiliation ID Type Schema',
|
202
|
+
description: 'Identifier type. Allowed values: doi, ror, url',
|
203
|
+
examples: ['ror']
|
203
204
|
}
|
204
205
|
},
|
205
|
-
|
206
|
-
|
207
|
-
|
206
|
+
required: %w[
|
207
|
+
identifier
|
208
|
+
type
|
208
209
|
]
|
209
210
|
},
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
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
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
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
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
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
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
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
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
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
|
-
|
257
|
-
|
258
|
-
|
257
|
+
title: 'The Funder ID Type Schema',
|
258
|
+
description: 'Identifier type. Allowed values: fundref, url, other',
|
259
|
+
examples: ['fundref']
|
259
260
|
}
|
260
261
|
},
|
261
|
-
|
262
|
-
|
263
|
-
|
262
|
+
required: %w[
|
263
|
+
identifier
|
264
|
+
type
|
264
265
|
]
|
265
266
|
},
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
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
|
-
|
276
|
-
|
277
|
-
|
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
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
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
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
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
|
-
|
302
|
-
|
302
|
+
description: 'Identifier type. Allowed values: url, other',
|
303
|
+
examples: ['other']
|
303
304
|
}
|
304
305
|
},
|
305
|
-
|
306
|
-
|
307
|
-
|
306
|
+
required: %w[
|
307
|
+
identifier
|
308
|
+
type
|
308
309
|
]
|
309
310
|
},
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
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
|
-
|
319
|
-
|
320
|
-
|
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
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
331
|
+
required: %w[
|
332
|
+
dmp_id
|
333
|
+
modified
|
334
|
+
title
|
334
335
|
]
|
335
336
|
}
|
336
337
|
},
|
337
|
-
|
338
|
-
|
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
|