Skip to content

Commit d4d090f

Browse files
committed
simplifying reference
1 parent 0e0bf8d commit d4d090f

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

script/oca_to_linkml.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -295,33 +295,37 @@ def writeEnums():
295295
# the structure:
296296
# "type": [string absolute/relative URI],
297297
# "capture_base": hash, # Ignore
298+
# ALSO, it is assumed that language variant objects all have the "default"
299+
# and consistent primary language as first entry.
300+
301+
oca_overlays = oca_obj["bundle"]["overlays"];
298302

299303
# Contains {schema.name,.description,.language} in array
300304
# Optional?
301-
oca_metas = oca_obj["bundle"]["overlays"]["meta"][0];
305+
oca_metas = oca_overlays["meta"][0];
302306

303307
# oca_attributes contains slot.name and slot.datatype
304308
oca_attributes = oca_obj["bundle"]["capture_base"]["attributes"];
305309

306310
# Contains slot.name and slot.pattern
307-
oca_formats = oca_obj["bundle"]["overlays"]["format"]["attribute_formats"];
311+
oca_formats = oca_overlays["format"]["attribute_formats"];
308312

309313
# Contains {slot.title,.language} in array
310-
oca_labels = oca_obj["bundle"]["overlays"]["label"][0]["attribute_labels"];
314+
oca_labels = oca_overlays["label"][0]["attribute_labels"];
311315

312316
# Contains {slot.name,.description,.language} in array
313317
# Optional?
314-
oca_informations = oca_obj["bundle"]["overlays"]["information"][0]["attribute_information"];
318+
oca_informations = oca_overlays["information"][0]["attribute_information"];
315319

316320
# Contains {"d": "M", "i": "M", "passed": "M"} # "M" ?
317-
oca_conformance = oca_obj["bundle"]["overlays"]["conformance"]["attribute_conformance"];
321+
oca_conformance = oca_overlays["conformance"]["attribute_conformance"];
318322

319323
# Contains [enumeration name]:[code,...]
320-
oca_entry_codes = oca_obj["bundle"]["overlays"]["entry_code"]["attribute_entry_codes"];
324+
oca_entry_codes = oca_overlays["entry_code"]["attribute_entry_codes"];
321325

322326
# Contains array of {enumeration.language,.attribute_entries} where
323327
# attribute_entries is dictionary of [enumeration name]: {code, label}
324-
oca_entry_labels = oca_obj["bundle"]["overlays"]["entry"][0]["attribute_entries"];
328+
oca_entry_labels = oca_overlays["entry"][0]["attribute_entries"];
325329

326330
SCHEMA = writeSchemaCore();
327331
writeSlots();

0 commit comments

Comments
 (0)