Skip to content

Commit

Permalink
fix filename to serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Apr 11, 2024
1 parent ac4827a commit 787272e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dsp_permissions_scripts/oap/oap_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}")
Expand Down

0 comments on commit 787272e

Please sign in to comment.