From e3fdba18559d9e0f17bf100f91d6cd87f514f559 Mon Sep 17 00:00:00 2001 From: ehennestad Date: Wed, 13 Nov 2024 11:16:34 +0100 Subject: [PATCH] Fix property name extraction --- .gitignore | 2 ++ pipeline/translator.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1a84fe8e..ec888099 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ downloads/ target/ _sources/ +docs/reports/ + # Autosave files *.asv *.m~ diff --git a/pipeline/translator.py b/pipeline/translator.py index d64bed3b..bc4affbc 100644 --- a/pipeline/translator.py +++ b/pipeline/translator.py @@ -290,7 +290,7 @@ def _build_mixed_type_class(self, schema, prop): def _create_matlab_name(json_name): """Remove the openMINDS prefix from a name""" - return json_name.replace(OPENMINDS_VOCAB_URI, '') + return json_name.split('/')[-1] def _generate_class_name(iri): """ @@ -528,6 +528,7 @@ def _create_property_validator_functions(name, property_info): def _expand_type_namespace( type_specifier ): if type_specifier.startswith('https://'): + # For versions 3 and below, the type specifier is already fully expanded in the schema return type_specifier else: schema_type_name = type_specifier.split(':')[-1]