Skip to content

Commit

Permalink
fix case if type is not yet in types
Browse files Browse the repository at this point in the history
  • Loading branch information
olinux committed Sep 12, 2023
1 parent e43d319 commit a9bdbc4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions openMINDS_pipeline/vocab.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ def _extract_type(self, schema: SchemaStructure) -> str:
with open(schema.absolute_path, "r") as schema_file:
schema_payload = json.load(schema_file)
t = schema_payload[TEMPLATE_PROPERTY_TYPE]
for k in list(self._types[t].keys()):
if k not in ["label", "name", "description", "semanticEquivalent", "isPartOfVersion"]:
del self._types[t][k]
if t in self._types:
for k in list(self._types[t].keys()):
if k not in ["label", "name", "description", "semanticEquivalent", "isPartOfVersion"]:
del self._types[t][k]
simple_name = os.path.basename(t)
if t not in self._types:
self._types[t] = {}
Expand Down

0 comments on commit a9bdbc4

Please sign in to comment.