From 39c5f1b6ae7364a2d1c495967da96cb3de9bcfc8 Mon Sep 17 00:00:00 2001 From: shirazos7 Date: Sun, 4 May 2025 14:45:03 +0200 Subject: [PATCH 1/4] add an inner function to extract tags --- src/zbmath_rest2oai/getAsXml.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/zbmath_rest2oai/getAsXml.py b/src/zbmath_rest2oai/getAsXml.py index 93739053..13780b7a 100644 --- a/src/zbmath_rest2oai/getAsXml.py +++ b/src/zbmath_rest2oai/getAsXml.py @@ -80,6 +80,12 @@ def extract_tags(result): elif db == 'Zbl': tags.append('openaire') + def add_software(): + zbmath_url = result.get("result", {}).get("zbmath_url","") + return zbmath_url.startswith("https://zbmath.org/software/") + if add_software(): + tags.append('openaire') + return tags From 8565a6181ed28d785a946f1abec64af48b591774 Mon Sep 17 00:00:00 2001 From: shirazos7 Date: Sun, 4 May 2025 14:50:30 +0200 Subject: [PATCH 2/4] add a whitespace --- src/zbmath_rest2oai/getAsXml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zbmath_rest2oai/getAsXml.py b/src/zbmath_rest2oai/getAsXml.py index 13780b7a..0d26cbee 100644 --- a/src/zbmath_rest2oai/getAsXml.py +++ b/src/zbmath_rest2oai/getAsXml.py @@ -81,7 +81,7 @@ def extract_tags(result): tags.append('openaire') def add_software(): - zbmath_url = result.get("result", {}).get("zbmath_url","") + zbmath_url = result.get("result", {}).get("zbmath_url", "") return zbmath_url.startswith("https://zbmath.org/software/") if add_software(): tags.append('openaire') From dc7290919aa32594541f241e2b5125578743b127 Mon Sep 17 00:00:00 2001 From: shirazos7 Date: Mon, 5 May 2025 18:16:16 +0200 Subject: [PATCH 3/4] moving add_software function outside extract tags --- src/zbmath_rest2oai/getAsXml.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/zbmath_rest2oai/getAsXml.py b/src/zbmath_rest2oai/getAsXml.py index 0d26cbee..8e5ebedc 100644 --- a/src/zbmath_rest2oai/getAsXml.py +++ b/src/zbmath_rest2oai/getAsXml.py @@ -63,6 +63,9 @@ def apply_zbmath_api_fixes(result, prefix_get_as_xml): states[k] = v result['states'] = states +def add_software(result): + zbmath_url = result.get("result", {}).get("zbmath_url", "") + return zbmath_url.startswith("https://zbmath.org/software/") def extract_tags(result): tags = [] @@ -80,10 +83,7 @@ def extract_tags(result): elif db == 'Zbl': tags.append('openaire') - def add_software(): - zbmath_url = result.get("result", {}).get("zbmath_url", "") - return zbmath_url.startswith("https://zbmath.org/software/") - if add_software(): + if add_software(result): tags.append('openaire') return tags From 6dbbf59c3263096abc58ce446041979aa95537d2 Mon Sep 17 00:00:00 2001 From: shirazos7 Date: Mon, 5 May 2025 18:18:46 +0200 Subject: [PATCH 4/4] adjusting the whitespaces and blank spaces --- src/zbmath_rest2oai/getAsXml.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/zbmath_rest2oai/getAsXml.py b/src/zbmath_rest2oai/getAsXml.py index 8e5ebedc..5dfc7388 100644 --- a/src/zbmath_rest2oai/getAsXml.py +++ b/src/zbmath_rest2oai/getAsXml.py @@ -63,9 +63,11 @@ def apply_zbmath_api_fixes(result, prefix_get_as_xml): states[k] = v result['states'] = states + def add_software(result): - zbmath_url = result.get("result", {}).get("zbmath_url", "") - return zbmath_url.startswith("https://zbmath.org/software/") + zbmath_url = result.get("result", {}).get("zbmath_url", "") + return zbmath_url.startswith("https://zbmath.org/software/") + def extract_tags(result): tags = []