From 787272e8d80d1218d02ff29b56ad53ae5a23a6f9 Mon Sep 17 00:00:00 2001 From: Johannes Nussbaum Date: Thu, 11 Apr 2024 17:20:00 +0200 Subject: [PATCH] fix filename to serialize --- dsp_permissions_scripts/oap/oap_serialize.py | 1 + 1 file changed, 1 insertion(+) diff --git a/dsp_permissions_scripts/oap/oap_serialize.py b/dsp_permissions_scripts/oap/oap_serialize.py index 7a08b25c..c66cb193 100644 --- a/dsp_permissions_scripts/oap/oap_serialize.py +++ b/dsp_permissions_scripts/oap/oap_serialize.py @@ -26,6 +26,7 @@ def serialize_resource_oaps( logger.info(f"Writing {len(resource_oaps)} OAPs into {str(folder)}") for res_oap in resource_oaps: filename = re.sub(r"http://rdfh\.ch/[^/]+/", "resource_", res_oap.object_iri) + filename = re.sub(r"/", "_", filename) with open(folder / f"{filename}.json", mode="w", encoding="utf-8") as f: f.write(res_oap.model_dump_json(indent=2)) logger.info(f"Successfully wrote {len(resource_oaps)} OAPs into {str(folder)}")