From 7bb5a4eb140aa9bd430ed9f217d1f4bd982fed00 Mon Sep 17 00:00:00 2001 From: Mazztok45 Date: Wed, 18 Dec 2024 17:11:26 +0100 Subject: [PATCH] collecting alternative identifiers for software in final software xml --- src/zbmath_rest2oai/getAsXml.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/zbmath_rest2oai/getAsXml.py b/src/zbmath_rest2oai/getAsXml.py index 01ad48b..2f1f77f 100644 --- a/src/zbmath_rest2oai/getAsXml.py +++ b/src/zbmath_rest2oai/getAsXml.py @@ -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] @@ -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):