From 11e764ff02a273fafba18064ba3272bebe0d3f84 Mon Sep 17 00:00:00 2001 From: shirazos7 Date: Thu, 8 May 2025 14:19:03 +0200 Subject: [PATCH 1/6] adding a new set for software heritage --- src/zbmath_rest2oai/get_sets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/zbmath_rest2oai/get_sets.py b/src/zbmath_rest2oai/get_sets.py index 9121ccf0..841cad1e 100644 --- a/src/zbmath_rest2oai/get_sets.py +++ b/src/zbmath_rest2oai/get_sets.py @@ -15,7 +15,10 @@ def get_sets(): 'datacite': ( 'Datacite: for metadata supported with Doi and ' 'arXiv identifiers' - ) + ), + 'software heritage': ( + 'Software heritage required set' + 'to store all softwares that have source code') } for result in results: From 186c79ff504112281f5cee43c7314b34378ff379 Mon Sep 17 00:00:00 2001 From: shirazos7 Date: Thu, 8 May 2025 14:21:45 +0200 Subject: [PATCH 2/6] update the numbers of sets in the unittest --- test/test_get_sets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_get_sets.py b/test/test_get_sets.py index 3140293d..2554b971 100644 --- a/test/test_get_sets.py +++ b/test/test_get_sets.py @@ -7,5 +7,5 @@ class PlainXmlTest(unittest.TestCase): @staticmethod def test_getSets(): real_sets = get_sets() - assert len(real_sets) == 66 + assert len(real_sets) == 67 assert real_sets['14'] == '14-XX:Algebraic geometry' From 6778c1ce5b29f47c3184573c6e5b967b85052958 Mon Sep 17 00:00:00 2001 From: shirazos7 Date: Thu, 8 May 2025 14:28:07 +0200 Subject: [PATCH 3/6] rename the set --- src/zbmath_rest2oai/get_sets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zbmath_rest2oai/get_sets.py b/src/zbmath_rest2oai/get_sets.py index 841cad1e..f50f1450 100644 --- a/src/zbmath_rest2oai/get_sets.py +++ b/src/zbmath_rest2oai/get_sets.py @@ -16,7 +16,7 @@ def get_sets(): 'Datacite: for metadata supported with Doi and ' 'arXiv identifiers' ), - 'software heritage': ( + 'SWH': ( 'Software heritage required set' 'to store all softwares that have source code') } From 787fcbc10cf79010eef8ba0ac737204604fa838e Mon Sep 17 00:00:00 2001 From: shirazos7 Date: Thu, 8 May 2025 14:31:08 +0200 Subject: [PATCH 4/6] adjust the description --- src/zbmath_rest2oai/get_sets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zbmath_rest2oai/get_sets.py b/src/zbmath_rest2oai/get_sets.py index f50f1450..97e2e439 100644 --- a/src/zbmath_rest2oai/get_sets.py +++ b/src/zbmath_rest2oai/get_sets.py @@ -17,8 +17,9 @@ def get_sets(): 'arXiv identifiers' ), 'SWH': ( - 'Software heritage required set' - 'to store all softwares that have source code') + 'Required set for Software Heritage: includes all entries that provide ' + 'software artifacts with accessible source code.' + ) } for result in results: From 287ae8ae46a3d8479ab761b76931ef2949a484c4 Mon Sep 17 00:00:00 2001 From: shirazos7 Date: Thu, 8 May 2025 15:00:06 +0200 Subject: [PATCH 5/6] write a function for software codemeta to filter the results and append them in SWH set --- src/zbmath_rest2oai/getAsXml.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/zbmath_rest2oai/getAsXml.py b/src/zbmath_rest2oai/getAsXml.py index 948939c0..e19c88fc 100644 --- a/src/zbmath_rest2oai/getAsXml.py +++ b/src/zbmath_rest2oai/getAsXml.py @@ -77,6 +77,11 @@ def datacite_records(result: dict) -> bool: return False +def software_codemeta(result: dict) -> bool: + src= result.get("source_code", {}) + return bool(src) + + def extract_tags(result): tags = [] for msc in result.get('msc', []): @@ -96,6 +101,9 @@ def extract_tags(result): if add_software(result): tags.append('openaire') + if software_codemeta(result): + tags.append('SWH') + if datacite_records(result): tags.append('datacite') From d99da8900b37b52570d7f5224aabbd2eb97dc107 Mon Sep 17 00:00:00 2001 From: shirazos7 Date: Thu, 8 May 2025 15:05:11 +0200 Subject: [PATCH 6/6] adding a needed 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 e19c88fc..d7e7c5b5 100644 --- a/src/zbmath_rest2oai/getAsXml.py +++ b/src/zbmath_rest2oai/getAsXml.py @@ -78,7 +78,7 @@ def datacite_records(result: dict) -> bool: def software_codemeta(result: dict) -> bool: - src= result.get("source_code", {}) + src = result.get("source_code", {}) return bool(src)