File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,8 @@ def customize_schema_rdm(json_record):
373
373
if "community" in json_record :
374
374
com = json_record .pop ("community" )
375
375
parent ["communities" ] = {"ids" : [com ], "default" : com }
376
- final ["parent" ] = parent
376
+ if parent != {}:
377
+ final ["parent" ] = parent
377
378
# Not technically datacite, but transfer pids information
378
379
if "pids" in json_record :
379
380
final ["pids" ] = json_record .pop ("pids" )
Original file line number Diff line number Diff line change @@ -147,7 +147,10 @@ def full_rdm_record():
147
147
{"scheme" : "orcid" , "identifier" : "0000-0001-8135-3489" }
148
148
],
149
149
},
150
- "affiliations" : [{"name" : "free-text" }, {"id" : "01ggx4157" }],
150
+ "affiliations" : [
151
+ {"name" : "free-text" },
152
+ {"name" : "CERN" , "id" : "01ggx4157" },
153
+ ],
151
154
}
152
155
],
153
156
"title" : "InvenioRDM" ,
@@ -176,7 +179,7 @@ def full_rdm_record():
176
179
],
177
180
},
178
181
"role" : {"id" : "other" },
179
- "affiliations" : [{"id" : "01ggx4157" }],
182
+ "affiliations" : [{"name" : "CERN" , " id" : "01ggx4157" }],
180
183
}
181
184
],
182
185
"dates" : [
@@ -227,7 +230,9 @@ def full_rdm_record():
227
230
"funding" : [
228
231
{
229
232
"funder" : {
230
- "name" : "European Commission" ,
233
+ "title" : {
234
+ "en" : "OpenAIRE" ,
235
+ },
231
236
"identifier" : "00k4n6c32" ,
232
237
"scheme" : "ror" ,
233
238
},
Original file line number Diff line number Diff line change 9
9
10
10
11
11
def test_datacite_rdm_conversion (full_datacite43_record , full_rdm_record ):
12
+
13
+ # Remove DOI from full_datacite43_record
14
+ # since it's prcessed by caltechdata_write or caltechdata_edit
15
+ identifiers = []
16
+ for identifier in full_datacite43_record ["identifiers" ]:
17
+ if identifier ["identifierType" ] != "DOI" :
18
+ identifiers .append (identifier )
19
+ full_datacite43_record ["identifiers" ] = identifiers
20
+
12
21
converted = customize_schema (full_datacite43_record , schema = "43" )
13
22
14
23
assert converted == full_rdm_record
You can’t perform that action at this time.
0 commit comments