Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("********************************************************")
Expand Down Expand Up @@ -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
),
]
Expand Down
4 changes: 3 additions & 1 deletion pipeline/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down