File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,10 +111,13 @@ def extract_software_info_from_somef(somef_data: Dict) -> Dict:
111111 for entry in somef_data ["identifier" ]:
112112 if "result" in entry and "value" in entry ["result" ]:
113113 identifier_value = entry ["result" ]["value" ]
114- if identifier_value .startswith ("https://doi.org/" ):
115- software_info ["schema:identifier" ] = {"@id" : identifier_value }
116- elif identifier_value .startswith ("10." ):
117- software_info ["schema:identifier" ] = {"@id" : f"https://doi.org/{ identifier_value } " }
114+ if isinstance (identifier_value , list ) and len (identifier_value ) > 0 :
115+ identifier_value = identifier_value [0 ]
116+ if isinstance (identifier_value , str ):
117+ if identifier_value .startswith ("https://doi.org/" ):
118+ software_info ["schema:identifier" ] = {"@id" : identifier_value }
119+ elif identifier_value .startswith ("10." ):
120+ software_info ["schema:identifier" ] = {"@id" : f"https://doi.org/{ identifier_value } " }
118121 break
119122
120123 # Add commit ID
You can’t perform that action at this time.
0 commit comments