From 81f3225fcbf26b70c7bf7ed53cc40d899151d063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20M=C3=BCller?= Date: Wed, 6 Nov 2024 16:50:42 +0100 Subject: [PATCH] added error check if key is not present --- .github/workflows/profile_generation_script.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/profile_generation_script.py b/.github/workflows/profile_generation_script.py index 3ba8ff9..8184764 100644 --- a/.github/workflows/profile_generation_script.py +++ b/.github/workflows/profile_generation_script.py @@ -358,9 +358,10 @@ def generate_property( # Replace property definitions with their type for g in data["@graph"]: - if req_label == g["rdfs:label"]: - if not "bioschemas" in g["@id"].split(":")[0]: - req_label = g["@id"] + if g.get("rdfs:label", -1) != -1: + if req_label == g["rdfs:label"]: + if not "bioschemas" in g["@id"].split(":")[0]: + req_label = g["@id"] new_p["property"] = req_label print(Fore.GREEN + Style.BRIGHT + f"Property : {req_label}" + Style.RESET_ALL)