Skip to content

Commit

Permalink
collecting alternative identifiers for software in final software xml
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazztok45 committed Dec 18, 2024
1 parent ca5f56c commit 7bb5a4e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/zbmath_rest2oai/getAsXml.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def extract_tags(result):

def add_references_to_software(api_uri, dict_res):
list_articles_ids_to_soft = []
list_articles_ids_and_alter_ids_to_soft = []
if "software" in api_uri:
if api_uri.startswith("https://api.zbmath.org/v1/software/_all?start_after=")==False:
soft_id=api_uri.split("/")[-1]
Expand All @@ -88,16 +89,21 @@ def api_doc_endpoint(page):
break

list_ids=[]
list_ids_and_alter = []
for entry in data["result"]:
list_ids.append(entry["id"])
list_links = []
for alt_dic in entry["link"]:
for alt_dic in entry["links"]:
if alt_dic["type"] == "doi":
list_links.append(alt_dic["identifier"])
elif alt_dic["type"] == "arxiv":
list_links.append(alt_dic["identifier"])

list_ids_and_alter.append(";".join([str(entry["id"])]+list_links))

list_articles_ids_to_soft.extend(list_ids)
list_articles_ids_and_alter_ids_to_soft.extend(list_ids_and_alter)

page+=1

if isinstance(dict_res, dict):
Expand Down

0 comments on commit 7bb5a4e

Please sign in to comment.