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):
373373 if "community" in json_record :
374374 com = json_record .pop ("community" )
375375 parent ["communities" ] = {"ids" : [com ], "default" : com }
376- final ["parent" ] = parent
376+ if parent != {}:
377+ final ["parent" ] = parent
377378 # Not technically datacite, but transfer pids information
378379 if "pids" in json_record :
379380 final ["pids" ] = json_record .pop ("pids" )
Original file line number Diff line number Diff line change @@ -147,7 +147,10 @@ def full_rdm_record():
147147 {"scheme" : "orcid" , "identifier" : "0000-0001-8135-3489" }
148148 ],
149149 },
150- "affiliations" : [{"name" : "free-text" }, {"id" : "01ggx4157" }],
150+ "affiliations" : [
151+ {"name" : "free-text" },
152+ {"name" : "CERN" , "id" : "01ggx4157" },
153+ ],
151154 }
152155 ],
153156 "title" : "InvenioRDM" ,
@@ -176,7 +179,7 @@ def full_rdm_record():
176179 ],
177180 },
178181 "role" : {"id" : "other" },
179- "affiliations" : [{"id" : "01ggx4157" }],
182+ "affiliations" : [{"name" : "CERN" , " id" : "01ggx4157" }],
180183 }
181184 ],
182185 "dates" : [
@@ -227,7 +230,9 @@ def full_rdm_record():
227230 "funding" : [
228231 {
229232 "funder" : {
230- "name" : "European Commission" ,
233+ "title" : {
234+ "en" : "OpenAIRE" ,
235+ },
231236 "identifier" : "00k4n6c32" ,
232237 "scheme" : "ror" ,
233238 },
Original file line number Diff line number Diff line change 99
1010
1111def 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+
1221 converted = customize_schema (full_datacite43_record , schema = "43" )
1322
1423 assert converted == full_rdm_record
You can’t perform that action at this time.
0 commit comments