diff --git a/build.py b/build.py index e5e89b9d..3333f474 100644 --- a/build.py +++ b/build.py @@ -17,6 +17,7 @@ terms_as_enums = True licenses_as_enums = True content_types_as_enums = True +accessibilities_as_enums = True graph_structures_as_enums = True print("********************************************************") @@ -78,9 +79,11 @@ terms_as_enums and "controlled" in schema_file_path, licenses_as_enums and "license" in schema_file_path, content_types_as_enums and "contentType" in schema_file_path, + accessibilities_as_enums and "accessibility" in schema_file_path, graph_structures_as_enums and ( "parcellationEntity" in schema_file_path + or "commonCoordinateFramework" in schema_file_path or "commonCoordinateSpace" in schema_file_path ), ] diff --git a/pipeline/translator.py b/pipeline/translator.py index 2d4935d9..f24bfa0f 100644 --- a/pipeline/translator.py +++ b/pipeline/translator.py @@ -280,7 +280,9 @@ def build_enum(instance): return enum def get_instance_name(instance): - return instance.get("name", instance.get("shortName")) + # Final fallback for special cases (e.g. the "Accessibility" library) + # where neither "name" nor "shortName" is available. + return instance.get("name", instance.get("shortName") or instance.get("@id").split("/")[-1]) instances_payload = self.instances[self._schema_payload["_type"]] self._translated_schema = {