pyegeria 5.4.0.28__py3-none-any.whl → 5.5.3.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyegeria might be problematic. Click here for more details.

Files changed (433) hide show
  1. commands/__init__.py +24 -0
  2. commands/cat/Dr-Egeria_md-orig.py +2 -2
  3. commands/cat/collection_actions.py +197 -0
  4. commands/cat/dr_egeria_command_help.py +137 -38
  5. commands/cat/dr_egeria_jupyter.py +7 -7
  6. commands/cat/dr_egeria_md.py +10 -267
  7. commands/cat/exp_list_glossaries.py +11 -14
  8. commands/cat/get_asset_graph.py +37 -267
  9. commands/cat/{get_collection.py → get_collection_tree.py} +10 -18
  10. commands/cat/get_project_dependencies.py +14 -14
  11. commands/cat/get_project_structure.py +15 -14
  12. commands/cat/get_tech_type_elements.py +16 -116
  13. commands/cat/glossary_actions.py +145 -298
  14. commands/cat/list_assets.py +3 -11
  15. commands/cat/list_cert_types.py +17 -63
  16. commands/cat/list_collections.py +17 -139
  17. commands/cat/list_deployed_catalogs.py +15 -27
  18. commands/cat/list_deployed_database_schemas.py +27 -43
  19. commands/cat/list_deployed_databases.py +16 -31
  20. commands/cat/list_deployed_servers.py +35 -54
  21. commands/cat/list_glossaries.py +18 -17
  22. commands/cat/list_projects.py +10 -12
  23. commands/cat/list_tech_type_elements.py +21 -37
  24. commands/cat/list_tech_types.py +13 -25
  25. commands/cat/list_terms.py +38 -79
  26. commands/cat/list_todos.py +4 -11
  27. commands/cat/list_user_ids.py +3 -10
  28. commands/cat/my_reports.py +559 -0
  29. commands/cat/run_report.py +394 -0
  30. commands/cat/{list_format_set.py → run_report_orig.py} +136 -44
  31. commands/cli/egeria.py +182 -219
  32. commands/cli/egeria_cat.py +32 -59
  33. commands/cli/egeria_my.py +13 -0
  34. commands/cli/egeria_ops.py +69 -74
  35. commands/cli/egeria_tech.py +17 -93
  36. commands/{cat → deprecated}/list_data_designer.py +2 -4
  37. commands/{cat → deprecated}/list_data_structures_full.py +3 -6
  38. commands/deprecated/old_get_asset_graph.py +315 -0
  39. commands/my/__init__.py +0 -2
  40. commands/my/list_my_profile.py +27 -34
  41. commands/my/list_my_roles.py +1 -7
  42. commands/my/monitor_my_todos.py +1 -7
  43. commands/my/monitor_open_todos.py +6 -7
  44. commands/my/todo_actions.py +4 -5
  45. commands/ops/__init__.py +0 -2
  46. commands/ops/gov_server_actions.py +17 -21
  47. commands/ops/list_archives.py +17 -38
  48. commands/ops/list_catalog_targets.py +33 -40
  49. commands/ops/load_archive.py +14 -11
  50. commands/ops/{monitor_engine_activity_c.py → monitor_active_engine_activity.py} +51 -82
  51. commands/ops/{monitor_integ_daemon_status.py → monitor_daemon_status.py} +35 -55
  52. commands/ops/monitor_engine_activity.py +79 -77
  53. commands/ops/{monitor_gov_eng_status.py → monitor_engine_status.py} +10 -7
  54. commands/ops/monitor_platform_status.py +38 -50
  55. commands/ops/monitor_server_startup.py +6 -11
  56. commands/ops/monitor_server_status.py +7 -11
  57. commands/ops/orig_monitor_server_list.py +8 -8
  58. commands/ops/orig_monitor_server_status.py +1 -5
  59. commands/ops/refresh_integration_daemon.py +5 -5
  60. commands/ops/restart_integration_daemon.py +5 -5
  61. commands/ops/table_integ_daemon_status.py +6 -6
  62. commands/ops/x_engine_actions.py +7 -7
  63. commands/tech/__init__.py +0 -2
  64. commands/tech/{generic_actions.py → element_actions.py} +6 -11
  65. commands/tech/get_element_info.py +20 -29
  66. commands/tech/get_guid_info.py +23 -42
  67. commands/tech/get_tech_details.py +20 -35
  68. commands/tech/get_tech_type_template.py +28 -39
  69. commands/tech/list_all_om_type_elements.py +24 -30
  70. commands/tech/list_all_om_type_elements_x.py +22 -28
  71. commands/tech/list_all_related_elements.py +19 -28
  72. commands/tech/list_anchored_elements.py +22 -30
  73. commands/tech/list_asset_types.py +19 -24
  74. commands/tech/list_elements_by_classification_by_property_value.py +26 -32
  75. commands/tech/list_elements_by_property_value.py +19 -25
  76. commands/tech/list_elements_by_property_value_x.py +20 -28
  77. commands/tech/list_elements_for_classification.py +28 -41
  78. commands/tech/list_gov_action_processes.py +16 -27
  79. commands/tech/list_information_supply_chains.py +22 -30
  80. commands/tech/list_registered_services.py +14 -26
  81. commands/tech/list_related_elements_with_prop_value.py +15 -25
  82. commands/tech/list_related_specification.py +1 -4
  83. commands/tech/list_relationship_types.py +15 -25
  84. commands/tech/list_relationships.py +20 -36
  85. commands/tech/list_solution_blueprints.py +28 -33
  86. commands/tech/list_solution_components.py +23 -29
  87. commands/tech/list_solution_roles.py +21 -32
  88. commands/tech/list_tech_templates.py +51 -54
  89. commands/tech/list_valid_metadata_values.py +5 -9
  90. commands/tech/table_tech_templates.py +2 -6
  91. commands/tech/x_list_related_elements.py +1 -4
  92. examples/GeoSpatial Products Example.py +524 -0
  93. examples/Jupyter Notebooks/P-egeria-server-config.ipynb +2137 -0
  94. examples/Jupyter Notebooks/README.md +2 -0
  95. examples/Jupyter Notebooks/common/P-environment-check.ipynb +115 -0
  96. examples/Jupyter Notebooks/common/__init__.py +14 -0
  97. examples/Jupyter Notebooks/common/common-functions.ipynb +4694 -0
  98. examples/Jupyter Notebooks/common/environment-check.ipynb +52 -0
  99. examples/Jupyter Notebooks/common/globals.ipynb +184 -0
  100. examples/Jupyter Notebooks/common/globals.py +154 -0
  101. examples/Jupyter Notebooks/common/orig_globals.py +152 -0
  102. examples/format_sets/all_format_sets.json +910 -0
  103. examples/format_sets/custom_format_sets.json +268 -0
  104. examples/format_sets/subset_format_sets.json +187 -0
  105. examples/format_sets_save_load_example.py +291 -0
  106. examples/jacquard_data_sets.py +129 -0
  107. examples/output_formats_example.py +193 -0
  108. examples/test_jacquard_data_sets.py +54 -0
  109. examples/test_jacquard_data_sets_scenarios.py +94 -0
  110. md_processing/__init__.py +33 -24
  111. md_processing/command_dispatcher.py +33 -0
  112. md_processing/command_mapping.py +221 -0
  113. md_processing/data/commands/commands_data_designer.json +537 -0
  114. md_processing/data/commands/commands_external_reference.json +733 -0
  115. md_processing/data/commands/commands_feedback.json +155 -0
  116. md_processing/data/commands/commands_general.json +204 -0
  117. md_processing/data/commands/commands_glossary.json +218 -0
  118. md_processing/data/commands/commands_governance.json +3678 -0
  119. md_processing/data/commands/commands_product_manager.json +865 -0
  120. md_processing/data/commands/commands_project.json +642 -0
  121. md_processing/data/commands/commands_solution_architect.json +366 -0
  122. md_processing/data/commands.json +6489 -30060
  123. md_processing/data/{commands-working.json → commands_working.json} +9304 -13513
  124. md_processing/data/gened_report_specs.py +6584 -0
  125. md_processing/data/generated_format_sets.json +6533 -0
  126. md_processing/data/generated_format_sets_old.json +4137 -0
  127. md_processing/data/generated_format_sets_old.py +45 -0
  128. md_processing/dr_egeria.py +182 -0
  129. md_processing/md_commands/data_designer_commands.py +195 -583
  130. md_processing/md_commands/ext_ref_commands.py +530 -0
  131. md_processing/md_commands/feedback_commands.py +726 -0
  132. md_processing/md_commands/glossary_commands.py +106 -490
  133. md_processing/md_commands/governance_officer_commands.py +129 -18
  134. md_processing/md_commands/product_manager_commands.py +362 -115
  135. md_processing/md_commands/project_commands.py +351 -134
  136. md_processing/md_commands/solution_architect_commands.py +276 -232
  137. md_processing/md_commands/view_commands.py +295 -0
  138. md_processing/md_processing_utils/common_md_proc_utils.py +258 -166
  139. md_processing/md_processing_utils/common_md_utils.py +138 -43
  140. md_processing/md_processing_utils/determine_width.py +103 -0
  141. md_processing/md_processing_utils/extraction_utils.py +100 -39
  142. md_processing/md_processing_utils/gen_report_specs.py +643 -0
  143. md_processing/md_processing_utils/generate_dr_help.py +61 -33
  144. md_processing/md_processing_utils/generate_md_cmd_templates.py +20 -19
  145. md_processing/md_processing_utils/generate_md_templates.py +3 -12
  146. md_processing/md_processing_utils/md_processing_constants.py +1053 -72
  147. pyegeria/__init__.py +203 -158
  148. pyegeria/core/__init__.py +40 -0
  149. pyegeria/core/_base_platform_client.py +574 -0
  150. pyegeria/core/_base_server_client.py +573 -0
  151. pyegeria/{_exceptions_new.py → core/_exceptions.py} +62 -30
  152. pyegeria/{_globals.py → core/_globals.py} +14 -3
  153. pyegeria/core/_server_client.py +6073 -0
  154. pyegeria/{_validators.py → core/_validators.py} +7 -8
  155. pyegeria/core/config.py +654 -0
  156. pyegeria/{create_tech_guid_lists.py → core/create_tech_guid_lists.py} +0 -1
  157. pyegeria/core/load_config.py +37 -0
  158. pyegeria/{logging_configuration.py → core/logging_configuration.py} +1 -1
  159. pyegeria/core/mcp_adapter.py +144 -0
  160. pyegeria/core/mcp_server.py +212 -0
  161. pyegeria/core/utils.py +405 -0
  162. pyegeria/{_client.py → deprecated/_client.py} +24 -25
  163. pyegeria/{_deprecated_gov_engine.py → deprecated/_deprecated_gov_engine.py} +16 -16
  164. pyegeria/{classification_manager_omvs.py → deprecated/classification_manager_omvs.py} +1987 -1877
  165. pyegeria/{output_formatter.py → deprecated/output_formatter_with_machine_keys.py} +298 -45
  166. pyegeria/{runtime_manager_omvs.py → deprecated/runtime_manager_omvs.py} +155 -171
  167. pyegeria/{valid_metadata_omvs.py → deprecated/valid_metadata_omvs.py} +93 -93
  168. pyegeria/{x_action_author_omvs.py → deprecated/x_action_author_omvs.py} +2 -3
  169. pyegeria/egeria_cat_client.py +26 -70
  170. pyegeria/egeria_client.py +130 -93
  171. pyegeria/egeria_config_client.py +40 -46
  172. pyegeria/egeria_tech_client.py +141 -54
  173. pyegeria/models/__init__.py +150 -0
  174. pyegeria/{models.py → models/models.py} +156 -20
  175. pyegeria/omvs/__init__.py +84 -0
  176. pyegeria/omvs/action_author.py +342 -0
  177. pyegeria/omvs/actor_manager.py +5980 -0
  178. pyegeria/omvs/asset_catalog.py +842 -0
  179. pyegeria/omvs/asset_maker.py +2736 -0
  180. pyegeria/omvs/automated_curation.py +4403 -0
  181. pyegeria/omvs/classification_manager.py +11213 -0
  182. pyegeria/{collection_manager.py → omvs/collection_manager.py} +1334 -1160
  183. pyegeria/omvs/community_matters_omvs.py +468 -0
  184. pyegeria/{core_omag_server_config.py → omvs/core_omag_server_config.py} +157 -157
  185. pyegeria/{data_designer.py → omvs/data_designer.py} +1115 -660
  186. pyegeria/omvs/data_discovery.py +869 -0
  187. pyegeria/omvs/data_engineer.py +372 -0
  188. pyegeria/omvs/digital_business.py +1133 -0
  189. pyegeria/omvs/external_links.py +1752 -0
  190. pyegeria/omvs/feedback_manager.py +834 -0
  191. pyegeria/{full_omag_server_config.py → omvs/full_omag_server_config.py} +73 -69
  192. pyegeria/{glossary_manager.py → omvs/glossary_manager.py} +857 -519
  193. pyegeria/{governance_officer.py → omvs/governance_officer.py} +964 -468
  194. pyegeria/omvs/lineage_linker.py +314 -0
  195. pyegeria/omvs/location_arena.py +1525 -0
  196. pyegeria/omvs/metadata_expert.py +668 -0
  197. pyegeria/omvs/metadata_explorer_omvs.py +2943 -0
  198. pyegeria/omvs/my_profile.py +1042 -0
  199. pyegeria/omvs/notification_manager.py +358 -0
  200. pyegeria/omvs/people_organizer.py +394 -0
  201. pyegeria/{platform_services.py → omvs/platform_services.py} +113 -193
  202. pyegeria/omvs/product_manager.py +1825 -0
  203. pyegeria/omvs/project_manager.py +1907 -0
  204. pyegeria/omvs/reference_data.py +1140 -0
  205. pyegeria/omvs/registered_info.py +334 -0
  206. pyegeria/omvs/runtime_manager.py +2817 -0
  207. pyegeria/omvs/schema_maker.py +446 -0
  208. pyegeria/{server_operations.py → omvs/server_operations.py} +27 -26
  209. pyegeria/{solution_architect_omvs.py → omvs/solution_architect.py} +1886 -1505
  210. pyegeria/omvs/specification_properties.py +37 -0
  211. pyegeria/omvs/subject_area.py +1042 -0
  212. pyegeria/omvs/template_manager_omvs.py +236 -0
  213. pyegeria/omvs/time_keeper.py +1761 -0
  214. pyegeria/omvs/valid_metadata.py +3221 -0
  215. pyegeria/omvs/valid_metadata_lists.py +37 -0
  216. pyegeria/omvs/valid_type_lists.py +37 -0
  217. pyegeria/view/__init__.py +28 -0
  218. pyegeria/{_output_format_models.py → view/_output_format_models.py} +160 -24
  219. pyegeria/view/_output_formats.py +14 -0
  220. pyegeria/view/base_report_formats.py +2719 -0
  221. pyegeria/view/dr_egeria_reports.py +56 -0
  222. pyegeria/view/format_set_executor.py +397 -0
  223. pyegeria/{md_processing_utils.py → view/md_processing_utils.py} +5 -5
  224. pyegeria/{mermaid_utilities.py → view/mermaid_utilities.py} +2 -154
  225. pyegeria/view/output_formatter.py +1297 -0
  226. pyegeria-5.5.3.3.dist-info/METADATA +218 -0
  227. pyegeria-5.5.3.3.dist-info/RECORD +241 -0
  228. {pyegeria-5.4.0.28.dist-info → pyegeria-5.5.3.3.dist-info}/WHEEL +2 -1
  229. pyegeria-5.5.3.3.dist-info/entry_points.txt +103 -0
  230. pyegeria-5.5.3.3.dist-info/top_level.txt +4 -0
  231. commands/cat/.DS_Store +0 -0
  232. commands/cat/.env +0 -8
  233. commands/cat/README.md +0 -16
  234. commands/cat/debug_log +0 -1126
  235. commands/cat/debug_log.2025-08-18_11-34-38_088636.zip +0 -0
  236. commands/cat/list_categories.py +0 -192
  237. commands/cat/logs/pyegeria.log +0 -4
  238. commands/cli/debug_log +0 -0
  239. commands/cli/debug_log.log +0 -0
  240. commands/cli/txt_custom_v2.tcss +0 -19
  241. commands/my/README.md +0 -17
  242. commands/ops/README.md +0 -24
  243. commands/ops/logs/pyegeria.log +0 -0
  244. commands/ops/monitor_asset_events.py +0 -108
  245. commands/tech/README.md +0 -24
  246. md_processing/.DS_Store +0 -0
  247. md_processing/dr-egeria-outbox/Collections-2025-08-12-13-30-37.md +0 -163
  248. md_processing/dr-egeria-outbox/Collections-2025-08-12-13-35-58.md +0 -474
  249. md_processing/dr_egeria_inbox/Derive-Dr-Gov-Defs.md +0 -8
  250. md_processing/dr_egeria_inbox/Dr.Egeria Templates.md +0 -873
  251. md_processing/dr_egeria_inbox/arch_test.md +0 -57
  252. md_processing/dr_egeria_inbox/archive/dr_egeria_intro.md +0 -254
  253. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_more_terms.md +0 -696
  254. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part1.md +0 -254
  255. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part2.md +0 -298
  256. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part3.md +0 -608
  257. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part4.md +0 -94
  258. md_processing/dr_egeria_inbox/archive/freddie_intro.md +0 -284
  259. md_processing/dr_egeria_inbox/archive/freddie_intro_orig.md +0 -275
  260. md_processing/dr_egeria_inbox/archive/test-term.md +0 -110
  261. md_processing/dr_egeria_inbox/cat_test.md +0 -100
  262. md_processing/dr_egeria_inbox/collections.md +0 -39
  263. md_processing/dr_egeria_inbox/data_designer_debug.log +0 -6
  264. md_processing/dr_egeria_inbox/data_designer_out.md +0 -60
  265. md_processing/dr_egeria_inbox/data_designer_search_test.md +0 -11
  266. md_processing/dr_egeria_inbox/data_field.md +0 -54
  267. md_processing/dr_egeria_inbox/data_spec.md +0 -77
  268. md_processing/dr_egeria_inbox/data_spec_test.md +0 -2406
  269. md_processing/dr_egeria_inbox/data_test.md +0 -179
  270. md_processing/dr_egeria_inbox/data_test2.md +0 -429
  271. md_processing/dr_egeria_inbox/data_test3.md +0 -462
  272. md_processing/dr_egeria_inbox/dr_egeria_data_designer_1.md +0 -124
  273. md_processing/dr_egeria_inbox/dr_egeria_intro_categories.md +0 -168
  274. md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +0 -280
  275. md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +0 -318
  276. md_processing/dr_egeria_inbox/dr_egeria_intro_part3.md +0 -1073
  277. md_processing/dr_egeria_inbox/dr_egeria_isc1.md +0 -44
  278. md_processing/dr_egeria_inbox/generated_help_report.md +0 -9
  279. md_processing/dr_egeria_inbox/glossary_creation_experiment.ipynb +0 -341
  280. md_processing/dr_egeria_inbox/glossary_list.md +0 -5
  281. md_processing/dr_egeria_inbox/glossary_search_test.md +0 -40
  282. md_processing/dr_egeria_inbox/glossary_test1.md +0 -324
  283. md_processing/dr_egeria_inbox/gov_def.md +0 -482
  284. md_processing/dr_egeria_inbox/gov_def2.md +0 -447
  285. md_processing/dr_egeria_inbox/img.png +0 -0
  286. md_processing/dr_egeria_inbox/product.md +0 -211
  287. md_processing/dr_egeria_inbox/rel.md +0 -8
  288. md_processing/dr_egeria_inbox/sb.md +0 -119
  289. md_processing/dr_egeria_inbox/solution-components.md +0 -136
  290. md_processing/dr_egeria_inbox/solution_blueprints.md +0 -118
  291. md_processing/dr_egeria_inbox/synonym_test.md +0 -42
  292. md_processing/dr_egeria_inbox/t2.md +0 -268
  293. md_processing/dr_egeria_outbox/.obsidian/app.json +0 -1
  294. md_processing/dr_egeria_outbox/.obsidian/appearance.json +0 -1
  295. md_processing/dr_egeria_outbox/.obsidian/community-plugins.json +0 -6
  296. md_processing/dr_egeria_outbox/.obsidian/core-plugins.json +0 -31
  297. md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/data.json +0 -10
  298. md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/main.js +0 -4459
  299. md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/manifest.json +0 -10
  300. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/data.json +0 -3
  301. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/main.js +0 -153
  302. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/manifest.json +0 -11
  303. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/styles.css +0 -1
  304. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/main.js +0 -500
  305. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +0 -12
  306. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/styles.css +0 -1
  307. md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/main.js +0 -37
  308. md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/manifest.json +0 -11
  309. md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/styles.css +0 -220
  310. md_processing/dr_egeria_outbox/.obsidian/types.json +0 -28
  311. md_processing/dr_egeria_outbox/.obsidian/workspace.json +0 -220
  312. md_processing/dr_egeria_outbox/Untitled.canvas +0 -1
  313. md_processing/dr_egeria_outbox/friday/processed-2025-08-22 21:22-dr_egeria_intro_part1.md +0 -312
  314. md_processing/dr_egeria_outbox/friday/processed-2025-08-22 21:23-dr_egeria_intro_part1.md +0 -265
  315. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:06-dr_egeria_intro_part1.md +0 -230
  316. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:30-dr_egeria_intro_part1.md +0 -296
  317. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:31-dr_egeria_intro_part1.md +0 -253
  318. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 16:08-dr_egeria_intro_part2.md +0 -343
  319. md_processing/dr_egeria_outbox/friday/processed-2025-08-23 16:12-dr_egeria_intro_part2.md +0 -343
  320. md_processing/dr_egeria_outbox/monday/processed-2025-08-19 07:05-product.md +0 -426
  321. md_processing/dr_egeria_outbox/monday/processed-2025-08-19 07:56-product.md +0 -212
  322. md_processing/dr_egeria_outbox/monday/processed-2025-08-19 09:43-product.md +0 -201
  323. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 14:55-product.md +0 -77
  324. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 15:05-product.md +0 -75
  325. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 15:11-product.md +0 -74
  326. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 20:40-collections.md +0 -49
  327. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 15:00-Derive-Dr-Gov-Defs.md +0 -719
  328. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:13-Derive-Dr-Gov-Defs.md +0 -41
  329. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:14-Derive-Dr-Gov-Defs.md +0 -33
  330. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:50-Derive-Dr-Gov-Defs.md +0 -192
  331. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 22:08-gov_def2.md +0 -486
  332. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 22:10-gov_def2.md +0 -486
  333. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 08:53-gov_def2.md +0 -486
  334. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 08:54-gov_def2.md +0 -486
  335. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:03-gov_def2.md +0 -486
  336. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:06-gov_def2.md +0 -486
  337. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:10-gov_def2.md +0 -486
  338. md_processing/dr_egeria_outbox/tuesday/processed-2025-07-16 19:15-gov_def2.md +0 -527
  339. md_processing/dr_egeria_outbox/tuesday/processed-2025-07-17 12:08-gov_def2.md +0 -527
  340. md_processing/dr_egeria_outbox/tuesday/processed-2025-07-17 14:27-gov_def2.md +0 -485
  341. md_processing/dr_egeria_outbox/tuesday/processed-2025-08-19 10:55-product.md +0 -209
  342. md_processing/family_docs/Data Designer/Create_Data_Class.md +0 -164
  343. md_processing/family_docs/Data Designer/Create_Data_Dictionary.md +0 -30
  344. md_processing/family_docs/Data Designer/Create_Data_Field.md +0 -162
  345. md_processing/family_docs/Data Designer/Create_Data_Specification.md +0 -36
  346. md_processing/family_docs/Data Designer/Create_Data_Structure.md +0 -38
  347. md_processing/family_docs/Data Designer/View_Data_Classes.md +0 -78
  348. md_processing/family_docs/Data Designer/View_Data_Dictionaries.md +0 -78
  349. md_processing/family_docs/Data Designer/View_Data_Fields.md +0 -78
  350. md_processing/family_docs/Data Designer/View_Data_Specifications.md +0 -78
  351. md_processing/family_docs/Data Designer/View_Data_Structures.md +0 -78
  352. md_processing/family_docs/Data Designer.md +0 -842
  353. md_processing/family_docs/Digital Product Manager/Add_Member->Collection.md +0 -42
  354. md_processing/family_docs/Digital Product Manager/Attach_Collection->Resource.md +0 -36
  355. md_processing/family_docs/Digital Product Manager/Create_Agreement.md +0 -96
  356. md_processing/family_docs/Digital Product Manager/Create_Data_Sharing_Agreement.md +0 -72
  357. md_processing/family_docs/Digital Product Manager/Create_DigitalSubscription.md +0 -102
  358. md_processing/family_docs/Digital Product Manager/Create_Digital_Product.md +0 -134
  359. md_processing/family_docs/Digital Product Manager/Link_Agreement_Items.md +0 -60
  360. md_processing/family_docs/Digital Product Manager/Link_Contracts.md +0 -26
  361. md_processing/family_docs/Digital Product Manager/Link_Digital_Product_-_Digital_Product.md +0 -30
  362. md_processing/family_docs/Digital Product Manager/Link_Subscribers.md +0 -48
  363. md_processing/family_docs/Digital Product Manager.md +0 -668
  364. md_processing/family_docs/Glossary/Attach_Category_Parent.md +0 -18
  365. md_processing/family_docs/Glossary/Attach_Term-Term_Relationship.md +0 -26
  366. md_processing/family_docs/Glossary/Create_Category.md +0 -38
  367. md_processing/family_docs/Glossary/Create_Glossary.md +0 -42
  368. md_processing/family_docs/Glossary/Create_Term.md +0 -70
  369. md_processing/family_docs/Glossary.md +0 -206
  370. md_processing/family_docs/Governance Officer/Create_Business_Imperative.md +0 -106
  371. md_processing/family_docs/Governance Officer/Create_Certification_Type.md +0 -112
  372. md_processing/family_docs/Governance Officer/Create_Governance_Approach.md +0 -114
  373. md_processing/family_docs/Governance Officer/Create_Governance_Obligation.md +0 -114
  374. md_processing/family_docs/Governance Officer/Create_Governance_Principle.md +0 -114
  375. md_processing/family_docs/Governance Officer/Create_Governance_Procedure.md +0 -128
  376. md_processing/family_docs/Governance Officer/Create_Governance_Process.md +0 -122
  377. md_processing/family_docs/Governance Officer/Create_Governance_Processing_Purpose.md +0 -106
  378. md_processing/family_docs/Governance Officer/Create_Governance_Responsibility.md +0 -122
  379. md_processing/family_docs/Governance Officer/Create_Governance_Rule.md +0 -122
  380. md_processing/family_docs/Governance Officer/Create_Governance_Strategy.md +0 -106
  381. md_processing/family_docs/Governance Officer/Create_License_Type.md +0 -112
  382. md_processing/family_docs/Governance Officer/Create_Naming_Standard_Rule.md +0 -122
  383. md_processing/family_docs/Governance Officer/Create_Regulation_Article.md +0 -106
  384. md_processing/family_docs/Governance Officer/Create_Regulation_Definition.md +0 -118
  385. md_processing/family_docs/Governance Officer/Create_Security_Access_Control.md +0 -114
  386. md_processing/family_docs/Governance Officer/Create_Security_Group.md +0 -120
  387. md_processing/family_docs/Governance Officer/Create_Service_Level_Objectives.md +0 -122
  388. md_processing/family_docs/Governance Officer/Create_Threat_Definition.md +0 -106
  389. md_processing/family_docs/Governance Officer/Link_Governance_Controls.md +0 -32
  390. md_processing/family_docs/Governance Officer/Link_Governance_Drivers.md +0 -32
  391. md_processing/family_docs/Governance Officer/Link_Governance_Policies.md +0 -32
  392. md_processing/family_docs/Governance Officer/View_Governance_Definitions.md +0 -82
  393. md_processing/family_docs/Governance Officer.md +0 -2412
  394. md_processing/family_docs/Solution Architect/Create_Information_Supply_Chain.md +0 -70
  395. md_processing/family_docs/Solution Architect/Create_Solution_Blueprint.md +0 -44
  396. md_processing/family_docs/Solution Architect/Create_Solution_Component.md +0 -96
  397. md_processing/family_docs/Solution Architect/Create_Solution_Role.md +0 -66
  398. md_processing/family_docs/Solution Architect/Link_Information_Supply_Chain_Peers.md +0 -32
  399. md_processing/family_docs/Solution Architect/Link_Solution_Component_Peers.md +0 -32
  400. md_processing/family_docs/Solution Architect/View_Information_Supply_Chains.md +0 -32
  401. md_processing/family_docs/Solution Architect/View_Solution_Blueprints.md +0 -32
  402. md_processing/family_docs/Solution Architect/View_Solution_Components.md +0 -32
  403. md_processing/family_docs/Solution Architect/View_Solution_Roles.md +0 -32
  404. md_processing/family_docs/Solution Architect.md +0 -490
  405. md_processing/md_processing_utils/debug_log +0 -574
  406. md_processing/md_processing_utils/debug_log.log +0 -0
  407. md_processing/md_processing_utils/dr-egeria-help-2025-07-17T17:22:09.md +0 -2065
  408. md_processing/md_processing_utils/generated_help_terms.md +0 -842
  409. pyegeria/.DS_Store +0 -0
  410. pyegeria/README.md +0 -35
  411. pyegeria/_client_new.py +0 -1102
  412. pyegeria/_output_formats.py +0 -730
  413. pyegeria/asset_catalog_omvs.py +0 -864
  414. pyegeria/automated_curation_omvs.py +0 -3765
  415. pyegeria/config.py +0 -523
  416. pyegeria/egeria_my_client.py +0 -91
  417. pyegeria/feedback_manager_omvs.py +0 -4573
  418. pyegeria/load_config_orig.py +0 -218
  419. pyegeria/md_processing_helpers.py +0 -58
  420. pyegeria/md_processing_utils_orig.py +0 -1103
  421. pyegeria/metadata_explorer_omvs.py +0 -2326
  422. pyegeria/my_profile_omvs.py +0 -1022
  423. pyegeria/project_manager.py +0 -1591
  424. pyegeria/registered_info.py +0 -167
  425. pyegeria/template_manager_omvs.py +0 -1414
  426. pyegeria/utils.py +0 -256
  427. pyegeria-5.4.0.28.dist-info/METADATA +0 -77
  428. pyegeria-5.4.0.28.dist-info/RECORD +0 -343
  429. pyegeria-5.4.0.28.dist-info/entry_points.txt +0 -105
  430. /commands/cat/debug_log.log → /pyegeria/deprecated/__init__.py +0 -0
  431. /pyegeria/{_exceptions.py → deprecated/_exceptions.py} +0 -0
  432. /pyegeria/{collection_models.py → models/collection_models.py} +0 -0
  433. {pyegeria-5.4.0.28.dist-info → pyegeria-5.5.3.3.dist-info/licenses}/LICENSE +0 -0
@@ -1,9 +1,13 @@
1
- """
1
+ """PDX-License-Identifier: Apache-2.0
2
+ Copyright Contributors to the ODPi Egeria project.
3
+
2
4
  This file contains term-related object_action functions for processing Egeria Markdown
5
+
6
+
3
7
  """
8
+
4
9
  import json
5
10
  import os
6
- import sys
7
11
  from typing import Optional
8
12
 
9
13
  from loguru import logger
@@ -11,12 +15,25 @@ from rich import print
11
15
  from rich.console import Console
12
16
  from rich.markdown import Markdown
13
17
 
14
- from md_processing.md_processing_utils.common_md_proc_utils import (parse_upsert_command, parse_view_command)
15
- from md_processing.md_processing_utils.common_md_utils import update_element_dictionary, setup_log
18
+ from md_processing.md_processing_utils.common_md_proc_utils import (parse_upsert_command)
19
+ from md_processing.md_processing_utils.common_md_utils import (
20
+ update_element_dictionary,
21
+ set_create_body,
22
+ set_element_prop_body,
23
+ set_update_body,
24
+ set_rel_request_body,
25
+ set_rel_prop_body,
26
+ set_data_field_body,
27
+ )
28
+ # Developer note: Request bodies follow a two-layer pattern:
29
+ # - Outer: action wrapper (NewElementRequestBody/UpdateElementRequestBody/...)
30
+ # - Inner: element-specific Properties dict placed under the outer["properties"] key
31
+ # Always build inner bodies via helpers (set_element_prop_body, set_data_field_body, etc.) and assign to the outer
16
32
  from md_processing.md_processing_utils.extraction_utils import (extract_command_plus, update_a_command)
17
- from md_processing.md_processing_utils.md_processing_constants import (load_commands, ERROR)
33
+ from md_processing.md_processing_utils.md_processing_constants import (load_commands)
18
34
  from pyegeria import DEBUG_LEVEL, body_slimmer
19
35
  from pyegeria.egeria_tech_client import EgeriaTech
36
+ from pyegeria.core.utils import make_format_set_name_from_type
20
37
 
21
38
  GERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
22
39
  EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
@@ -41,7 +58,6 @@ load_commands('commands.json')
41
58
  debug_level = DEBUG_LEVEL
42
59
 
43
60
  console = Console(width=int(200))
44
- setup_log()
45
61
 
46
62
 
47
63
  #
@@ -54,7 +70,7 @@ def add_member_to_data_collections(egeria_client: EgeriaTech, collection_list: l
54
70
  Add member to data dictionaries and data specifications.
55
71
  """
56
72
  body = {
57
- "class": "RelationshipRequestBody", "properties": {
73
+ "class": "NewRelationshipRequestBody", "properties": {
58
74
  "class": "CollectionMembershipProperties", "membershipRationale": "User Specified",
59
75
  "notes": "Added by Dr.Egeria"
60
76
  }
@@ -93,8 +109,8 @@ def update_data_collection_memberships(egeria_client: EgeriaTech, entity_type: s
93
109
  replace_all_props: bool = True) -> None:
94
110
  """ update the collection membership of the element
95
111
 
96
- If replace_all_props is set to True, all existing memberships are removed and new memberships are added.
97
- If replace_all_props is set to False, only the new memberships are added.
112
+ If merge_update is set to True, all existing memberships are removed and new memberships are added.
113
+ If merge_update is set to False, only the new memberships are added.
98
114
  """
99
115
 
100
116
  if replace_all_props:
@@ -418,6 +434,7 @@ def process_data_spec_upsert_command(egeria_client: EgeriaTech, txt: str, direct
418
434
  """
419
435
 
420
436
  command, object_type, object_action = extract_command_plus(txt)
437
+ print(Markdown(f"# {command}\n"))
421
438
 
422
439
  parsed_output = parse_upsert_command(egeria_client, object_type, object_action, txt, directive)
423
440
 
@@ -427,37 +444,19 @@ def process_data_spec_upsert_command(egeria_client: EgeriaTech, txt: str, direct
427
444
  qualified_name = parsed_output.get('qualified_name', None)
428
445
  guid = parsed_output.get('guid', None)
429
446
 
430
- print(Markdown(parsed_output['display']))
431
-
432
447
  logger.debug(json.dumps(parsed_output, indent=4))
433
448
 
434
449
  attributes = parsed_output['attributes']
435
- description = attributes['Description'].get('value', None)
436
- display_name = attributes['Display Name'].get('value', None)
437
- anchor_guid = attributes.get('Anchor ID', {}).get('guid', None)
438
- parent_guid = attributes.get('Parent ID', {}).get('guid', None)
439
- parent_relationship_type_name = attributes.get('Parent Relationship Type Name', {}).get('value',
440
- "CollectionMembership")
441
- parent_at_end1 = attributes.get('Parent at End1', {}).get('value', True)
442
-
443
- anchor_scope_guid = attributes.get('Anchor Scope GUID', {}).get('value', None)
444
- is_own_anchor = attributes.get('Is Own Anchor', {}).get('value', True)
445
- if parent_guid is None:
446
- is_own_anchor = True
447
-
448
- collection_type = attributes.get('Collection Type', {}).get('value', None)
449
-
450
- replace_all_props = not attributes.get('Merge Update', {}).get('value', True)
451
-
452
- additional_prop = attributes.get('Additional Properties', {}).get('value', None)
453
- additional_properties = json.loads(additional_prop) if additional_prop is not None else None
454
- extended_prop = attributes.get('Extended Properties', {}).get('value', None)
455
- extended_properties = json.loads(extended_prop) if extended_prop is not None else None
450
+ display_name = attributes.get('Display Name', {}).get('value', "None Found")
451
+ status = attributes.get('Status', {}).get('value', None)
452
+ print(Markdown(parsed_output['display']))
456
453
 
457
- replace_all_props = not attributes.get('Merge Update', {}).get('value', True)
458
454
  in_data_spec_list = attributes.get('In Data Specification', {}).get('value', None)
459
455
  in_data_spec_valid = attributes.get('In Data Specification', {}).get('valid', None)
460
456
  in_data_spec_exists = attributes.get('In Data Specification', {}).get('exists', None)
457
+ output_set = make_format_set_name_from_type(object_type)
458
+ object_type = "DataSpec"
459
+ print(Markdown(parsed_output['display']))
461
460
 
462
461
  if directive == "display":
463
462
 
@@ -470,6 +469,7 @@ def process_data_spec_upsert_command(egeria_client: EgeriaTech, txt: str, direct
470
469
  return valid
471
470
 
472
471
  elif directive == "process":
472
+
473
473
  try:
474
474
  if object_action == "Update":
475
475
  if not exists:
@@ -483,16 +483,19 @@ def process_data_spec_upsert_command(egeria_client: EgeriaTech, txt: str, direct
483
483
  print(Markdown(
484
484
  f"==> Validation of {command} completed successfully! Proceeding to apply the changes.\n"))
485
485
 
486
- egeria_client.update_collection(guid, qualified_name, display_name, description, collection_type,
487
- additional_properties,
488
- extended_properties, replace_all_props)
486
+ body = set_update_body(object_type, attributes)
487
+ body['properties'] = set_element_prop_body(object_type, qualified_name, attributes)
488
+
489
+ egeria_client.update_collection(guid, body)
490
+ if status:
491
+ egeria_client.update_collection_status(guid, status)
492
+
489
493
  logger.success(f"Updated {object_type} `{display_name}` with GUID {guid}\n\n___")
490
494
  update_element_dictionary(qualified_name, {
491
495
  'guid': guid, 'display_name': display_name
492
- })
493
- return egeria_client.get_collection_by_guid(guid, collection_type='Data Specification',
494
- output_format='MD')
495
-
496
+ })
497
+ return egeria_client.get_collection_by_guid(guid, element_type='Data-Specification-DrE',
498
+ output_format='MD', report_spec=output_set)
496
499
 
497
500
  elif object_action == "Create":
498
501
  if valid is False and exists:
@@ -506,24 +509,27 @@ def process_data_spec_upsert_command(egeria_client: EgeriaTech, txt: str, direct
506
509
  logger.error(msg)
507
510
  return None
508
511
  else:
509
- guid = egeria_client.create_data_spec_collection(display_name, description, qualified_name,
510
- is_own_anchor, anchor_guid, parent_guid,
511
- parent_relationship_type_name, parent_at_end1,
512
- collection_type, anchor_scope_guid,
513
- additional_properties, extended_properties)
512
+ body = set_create_body(object_type, attributes)
513
+ body["properties"] = set_element_prop_body(object_type, qualified_name, attributes)
514
+ parent_guid = body.get('parentGuid', None)
515
+ if parent_guid:
516
+ body['parentRelationshipTypeName'] = "CollectionMembership"
517
+ body['parentAtEnd1'] = True
518
+
519
+ guid = egeria_client.create_collection(body=body)
514
520
  if guid:
515
521
  update_element_dictionary(qualified_name, {
516
522
  'guid': guid, 'display_name': display_name
517
- })
523
+ })
518
524
  msg = f"Created Element `{display_name}` with GUID {guid}\n\n___"
519
525
  logger.success(msg)
520
- return egeria_client.get_collection_by_guid(guid, collection_type='Data Specification',
521
- output_format='MD')
526
+ return egeria_client.get_collection_by_guid(guid, object_type, output_format='MD', report_spec=output_set)
522
527
  else:
523
528
  msg = f"Failed to create element `{display_name}` with GUID {guid}\n\n___"
524
529
  logger.error(msg)
525
530
  return None
526
531
 
532
+
527
533
  except Exception as e:
528
534
  logger.error(f"Error performing {command}: {e}")
529
535
  return None
@@ -543,7 +549,9 @@ def process_data_dict_upsert_command(egeria_client: EgeriaTech, txt: str, direct
543
549
  :return: A string summarizing the outcome of the processing.
544
550
  """
545
551
 
552
+
546
553
  command, object_type, object_action = extract_command_plus(txt)
554
+ print(Markdown(f"# {command}\n"))
547
555
 
548
556
  parsed_output = parse_upsert_command(egeria_client, object_type, object_action, txt, directive)
549
557
 
@@ -554,31 +562,16 @@ def process_data_dict_upsert_command(egeria_client: EgeriaTech, txt: str, direct
554
562
  guid = parsed_output.get('guid', None)
555
563
 
556
564
  print(Markdown(parsed_output['display']))
565
+
557
566
  logger.debug(json.dumps(parsed_output, indent=4))
558
567
 
559
568
  attributes = parsed_output['attributes']
560
- description = attributes['Description'].get('value', None)
561
569
  display_name = attributes.get('Display Name', {}).get('value', "None Found")
562
- display_name = display_name if display_name is not None else "None Found"
563
- anchor_guid = attributes.get('Anchor ID', {}).get('guid', None)
564
- parent_guid = attributes.get('Parent ID', {}).get('guid', None)
565
- parent_relationship_type_name = attributes.get('Parent Relationship Type Name', {}).get('value',
566
- "CollectionMembership")
567
- parent_at_end1 = attributes.get('Parent at End1', {}).get('value', True)
568
-
569
- anchor_scope_guid = attributes.get('Anchor Scope GUID', {}).get('value', None)
570
- is_own_anchor = attributes.get('Is Own Anchor', {}).get('value', True)
571
- if parent_guid is None:
572
- is_own_anchor = True
573
- collection_type = attributes.get('Collection Type', {}).get('value', None)
574
- replace_all_props = not attributes.get('Merge Update', {}).get('value', True)
575
-
576
- additional_prop = attributes.get('Additional Properties', {}).get('value', None)
577
- additional_properties = json.loads(additional_prop) if additional_prop is not None else None
578
- extended_prop = attributes.get('Extended Properties', {}).get('value', None)
579
- extended_properties = json.loads(extended_prop) if extended_prop is not None else None
570
+ status = attributes.get('Status', {}).get('value', None)
571
+ output_set = make_format_set_name_from_type(object_type)
580
572
 
581
573
  if directive == "display":
574
+
582
575
  return None
583
576
  elif directive == "validate":
584
577
  if valid:
@@ -591,62 +584,73 @@ def process_data_dict_upsert_command(egeria_client: EgeriaTech, txt: str, direct
591
584
 
592
585
  try:
593
586
  if object_action == "Update":
594
-
595
587
  if not exists:
596
- logger.error(f"Element `{display_name}` does not exist! Updating result document with Create "
597
- f"object_action\n\n___")
588
+ msg = (f" Element `{display_name}` does not exist! Updating result document with Create "
589
+ f"object_action\n")
590
+ logger.error(msg)
598
591
  return update_a_command(txt, object_action, object_type, qualified_name, guid)
599
592
  elif not valid:
600
- logger.error(f"Element `{display_name}` does not have a valid specification? Review..\n\n___ ")
601
593
  return None
602
594
  else:
603
595
  print(Markdown(
604
- f"==> Validation of {command} completed successfully! Proceeding to apply the changes."))
596
+ f"==> Validation of {command} completed successfully! Proceeding to apply the changes.\n"))
597
+
598
+ body = set_update_body(object_type, attributes)
599
+ body['properties'] = set_element_prop_body("Data Spec", qualified_name, attributes)
600
+
601
+ egeria_client.update_collection(guid, body)
602
+ if status:
603
+ egeria_client.update_collection_status(guid, status)
605
604
 
606
- egeria_client.update_collection(guid, qualified_name, display_name, description, collection_type,
607
- additional_properties,
608
- extended_properties, replace_all_props)
609
605
  logger.success(f"Updated {object_type} `{display_name}` with GUID {guid}\n\n___")
610
606
  update_element_dictionary(qualified_name, {
611
607
  'guid': guid, 'display_name': display_name
612
- })
613
- return egeria_client.get_collection_by_guid(guid, collection_type='Data Dictionary', output_format='MD')
608
+ })
609
+ return egeria_client.get_collection_by_guid(guid, element_type='Data Specification',
610
+ output_format='MD', report_spec=output_set)
614
611
 
615
612
  elif object_action == "Create":
616
613
  if valid is False and exists:
617
- logger.error(f"\nElement `{display_name}` already exists and result document updated changing "
618
- f"`Create` to `Update` in processed output\n\n___")
614
+ msg = (f" Data Specification `{display_name}` already exists and result document updated changing "
615
+ f"`Create` to `Update` in processed output\n\n___")
616
+ logger.error(msg)
619
617
  return update_a_command(txt, object_action, object_type, qualified_name, guid)
618
+ elif valid is False :
619
+ msg = f" invalid data? - Correct and try again\n\n___"
620
+ logger.error(msg)
621
+ return None
620
622
  else:
621
- guid = egeria_client.create_data_dictionary_collection(display_name, description, qualified_name,
622
- is_own_anchor, anchor_guid, parent_guid,
623
- parent_relationship_type_name,
624
- parent_at_end1, collection_type,
625
- anchor_scope_guid, additional_properties,
626
- extended_properties)
623
+ body = set_create_body(object_type, attributes)
624
+ body["properties"] = set_element_prop_body(object_type, qualified_name, attributes)
625
+ parent_guid = body.get('parentGuid', None)
626
+ if parent_guid:
627
+ body['parentRelationshipTypeName'] = "CollectionMembership"
628
+ body['parentAtEnd1'] = True
629
+
630
+ guid = egeria_client.create_collection(body=body)
627
631
  if guid:
628
632
  update_element_dictionary(qualified_name, {
629
633
  'guid': guid, 'display_name': display_name
630
- })
631
- logger.success(f"Created Element `{display_name}` with GUID {guid}\n\n___")
632
-
633
- return egeria_client.get_collection_by_guid(guid, collection_type='Data Dictionary',
634
- output_format='MD')
634
+ })
635
+ msg = f"Created Element `{display_name}` with GUID {guid}\n\n___"
636
+ logger.success(msg)
637
+ return egeria_client.get_collection_by_guid(guid, object_type, output_format='MD', report_spec=output_set)
635
638
  else:
636
- logger.error(f"Failed to create Term `{display_name}`\n\n___")
639
+ msg = f"Failed to create element `{display_name}` with GUID {guid}\n\n___"
640
+ logger.error(msg)
637
641
  return None
638
642
 
643
+
639
644
  except Exception as e:
640
- logger.error(f"{ERROR}Error performing {command}: {e}")
641
- Console().print_exception(show_locals=True)
645
+ logger.error(f"Error performing {command}: {e}")
642
646
  return None
643
647
  else:
644
648
  return None
645
649
 
646
650
 
647
651
  @logger.catch
648
- def process_data_structure_upsert_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[
649
- str]:
652
+ def process_data_structure_upsert_command(egeria_client: EgeriaTech, txt: str,
653
+ directive: str = "display") -> Optional[str]:
650
654
  """
651
655
  Processes a data structure create or update object_action by extracting key attributes such as
652
656
  spec name, parent_guid, parent_relationship_type, parent_at_end_1, category
@@ -656,9 +660,7 @@ def process_data_structure_upsert_command(egeria_client: EgeriaTech, txt: str, d
656
660
  :param directive: an optional string indicating the directive to be used - display, validate or execute
657
661
  :return: A string summarizing the outcome of the processing.
658
662
  """
659
- from md_processing.md_processing_utils.common_md_utils import set_debug_level
660
663
 
661
- set_debug_level(directive)
662
664
 
663
665
  command, object_type, object_action = extract_command_plus(txt)
664
666
  print(Markdown(f"# {command}\n"))
@@ -670,6 +672,7 @@ def process_data_structure_upsert_command(egeria_client: EgeriaTech, txt: str, d
670
672
 
671
673
  qualified_name = parsed_output.get('qualified_name', None)
672
674
  guid = parsed_output.get('guid', None)
675
+ output_set = make_format_set_name_from_type(object_type)
673
676
 
674
677
  print(Markdown(parsed_output['display']))
675
678
 
@@ -686,48 +689,16 @@ def process_data_structure_upsert_command(egeria_client: EgeriaTech, txt: str, d
686
689
  elif directive == "process":
687
690
  logger.debug(json.dumps(parsed_output, indent=4))
688
691
  attributes = parsed_output['attributes']
689
-
690
- external_source_guid = attributes.get('External Source Name', {}).get('guid', None)
691
- external_source_name = attributes.get('External Source Name', {}).get('value', None)
692
- effective_time = attributes.get('Effective Time', {}).get('value', None)
693
- for_lineage = attributes.get('For Lineage', {}).get('value', None)
694
- for_duplicate_processing = attributes.get('For Duplicate Processing', {}).get('value', None)
695
- anchor_guid = attributes.get('Anchor ID', {}).get('guid', None)
696
- is_own_anchor = attributes.get('Is Own Anchor', {}).get('value', None)
697
- parent_id = attributes.get('Parent ID', {}).get('value', None)
698
- parent_guid = attributes.get('Parent ID', {}).get('guid', None)
699
- parent_relationship_type_name = attributes.get('Parent Relationship Type Name', {}).get('value', None)
700
- parent_relationship_properties = attributes.get('Parent Relationship Properties', {}).get('value', None)
701
- parent_at_end1 = attributes.get('Parent at End1', {}).get('value', None)
702
-
703
- display_name = attributes['Display Name'].get('value', None)
704
-
705
- namespace = attributes.get('Namespace', {}).get('value', None)
706
- description = attributes.get('Description', {}).get('value', None)
707
- version_id = attributes.get('Version Identifier', {}).get('value', None)
708
- aliases = attributes.get('Aliases', {}).get('value', None)
709
- name_patterns = attributes.get('Name Patterns', {}).get('value', None)
710
- is_nullable = attributes.get('Is Nullable', {}).get('value', None)
711
- default_value = attributes.get('Default Value', {}).get('value', None)
712
- data_type = attributes.get('Data Type', {}).get('value', None)
713
- min_length = attributes.get('Minimum Length', {}).get('value', None)
714
- length = attributes.get('Length', {}).get('value', None)
715
- precision = attributes.get('Precision', {}).get('value', None)
716
- ordered_values = attributes.get('Ordered Values', {}).get('value', None)
717
- sort_order = attributes.get('Sort Order', {}).get('value', None)
718
- additional_properties = attributes.get('Additional Properties', {}).get('value', None)
719
- effective_from = attributes.get('Effective From', {}).get('value', None)
720
- effective_to = attributes.get('Effective To', {}).get('value', None)
721
-
722
- position = attributes.get('Position', {}).get('value', None)
723
- min_cardinality = attributes.get('Minimum Cardinality', {}).get('value', None)
724
- max_cardinality = attributes.get('Maximum Cardinality', {}).get('value', None)
725
- in_data_structure = attributes.get('In Data Structure', {}).get('value', None)
726
- data_class = attributes.get('Data Class', {}).get('value', None)
727
- glossary_term = attributes.get('Glossary Term', {}).get('value', None)
728
- glossary_term_guid = attributes.get('Glossary Term', {}).get('guid', None)
729
-
730
- # name_details_list = attributes.get("dict_list", None)
692
+ display_name = attributes.get('Display Name', {}).get('value', None)
693
+ qualified_name = attributes.get('Qualified Name',{}).get('value', None)
694
+ if qualified_name is None:
695
+ qualified_name = attributes.get('Display Name',{}).get('qualified_name', None)
696
+ if qualified_name is None:
697
+ logger.error(f"Element `{display_name}` does not have a valid specification? No qualified name..Review..\n\n___ ")
698
+ return None
699
+ prop_body = set_element_prop_body(object_type, qualified_name, attributes)
700
+ prop_body['namespace'] = attributes.get('Namespace', {}).get('value', None)
701
+ display_name = attributes.get('Display Name',{}).get('value', None)
731
702
 
732
703
  data_spec_name_list = attributes.get("In Data Specification", {}).get("name_list", "")
733
704
  data_spec_value = attributes.get("In Data Specification", {}).get("value", None)
@@ -737,95 +708,76 @@ def process_data_structure_upsert_command(egeria_client: EgeriaTech, txt: str, d
737
708
  data_dict_name_list = attributes.get('In Data Dictionary', {}).get('name_list', "")
738
709
  data_dict_value_list = attributes.get('In Data Dictionary', {}).get('value', None)
739
710
  data_dict_guid_list = attributes.get("In Data Dictionary", {}).get("guid_list", None)
740
-
741
- parent_data_field = attributes.get('Parent Data Field', {}).get('value', None)
742
- parent_data_field_guid = attributes.get('Parent Data Field', {}).get('guid', None)
743
-
744
- anchor_scope_guid = attributes.get('Anchor Scope GUID', {}).get('value', None)
745
-
746
- collection_type = object_type
747
- replace_all_props = True
748
- if not valid:
749
- if exists and object_action == "Create":
750
- msg = (f"Create failed because Element `{display_name}` exists - changing `Create` to `Update` in "
751
- f"processed output \n\n___")
752
- logger.error(msg)
753
- return update_a_command(txt, object_action, object_type, qualified_name, guid)
754
- else:
755
- return None
756
- elif object_action == "Update" and not exists:
757
- logger.error(f"Element `{display_name}` does not exist! Updating result document with Create "
758
- f"object_action\n\n___")
759
- return update_a_command(txt, object_action, object_type, qualified_name, guid)
760
-
761
- else:
762
- print(Markdown(f"==> Validation of {command} completed successfully! Proceeding to apply the changes.\n"))
711
+ merge_update = attributes.get('Merge Update', {}).get('value', True)
763
712
 
764
713
  try:
765
714
  if object_action == "Update":
766
- body = {
767
- "class": "UpdateElementRequestBody", "externalSourceGUID": external_source_guid,
768
- "externalSourceName": external_source_name, "effectiveTime": effective_time,
769
- "forLineage": for_lineage, "forDuplicateProcessing": for_duplicate_processing, "properties": {
770
- "class": "DataStructureProperties", "qualifiedName": qualified_name,
771
- "displayName": display_name, "description": description, "namespace": namespace,
772
- "versionIdentifier": version_id, "additionalProperties": additional_properties,
773
- "effectiveFrom": effective_from, "effectiveTo": effective_to
774
- }
775
- }
776
- egeria_client.update_data_structure_w_body(guid, body, replace_all_props)
777
- logger.info(f"Updated element `{display_name}` with GUID {guid}")
778
- core_props = egeria_client.get_data_structure_by_guid(guid, output_format='MD')
779
-
780
- update_element_dictionary(qualified_name, {
781
- 'guid': guid, 'display_name': display_name
715
+ if not exists:
716
+ logger.error(f"Element `{qualified_name}` does not exist! Updating result document with Create "
717
+ f"object_action\n\n___")
718
+ return update_a_command(txt, object_action, object_type, qualified_name, guid)
719
+ elif not valid:
720
+ logger.error(f"Element `{qualified_name}` does not have a valid specification? Review..\n\n___ ")
721
+ return None
722
+ else:
723
+ update_body = set_update_body(object_type,attributes)
724
+ update_body['properties'] = prop_body
725
+ egeria_client.update_data_structure(guid, update_body)
726
+ update_element_dictionary(qualified_name, {
727
+ 'guid': guid, 'display_name': display_name
728
+ })
729
+ logger.success(f"Updated {object_type} `{display_name}` with GUID {guid}\n\n___")
730
+
731
+ core_props = egeria_client.get_data_structure_by_guid(guid, output_format='MD', report_spec=output_set)
732
+
733
+ update_element_dictionary(qualified_name, {
734
+ 'guid': guid, 'display_name': display_name
782
735
  })
783
736
 
784
- update_data_collection_memberships(egeria_client, object_type, data_spec_guid_list, "DataSpec", guid,
785
- display_name, replace_all_props)
786
- core_props += f"## In Data Dictionary\n\n{data_dict_name_list}\n\n"
787
- core_props += f"## In Data Specification\n\n{data_spec_name_list}\n\n"
788
- logger.success(f"Updated {object_type} `{display_name}` with GUID {guid}\n\n___")
789
- return core_props
737
+ update_data_collection_memberships(egeria_client, object_type, data_spec_guid_list, "DataSpec", guid,
738
+ display_name, merge_update)
739
+ update_data_collection_memberships(egeria_client, object_type, data_dict_guid_list, "DataSpec",
740
+ guid,display_name, merge_update)
741
+ core_props += f"## In Data Dictionary\n\n{data_dict_name_list}\n\n"
742
+ core_props += f"## In Data Specification\n\n{data_spec_name_list}\n\n"
743
+ logger.success(f"Updated {object_type} `{display_name}` with GUID {guid}\n\n___")
744
+ return core_props
745
+
746
+
747
+ if not valid:
748
+ if exists and object_action == "Create":
749
+ msg = (f"Create failed because Element `{display_name}` exists - changing `Create` to `Update` in "
750
+ f"processed output \n\n___")
751
+ logger.error(msg)
752
+ return update_a_command(txt, object_action, object_type, qualified_name, guid)
753
+ else:
754
+ return None
755
+
790
756
 
791
757
  elif object_action == "Create":
792
758
  if exists:
793
759
  logger.warning(f"\nTerm `{display_name}` already exists and result document updated\n\n___")
794
760
  return update_a_command(txt, object_action, object_type, qualified_name, guid)
795
761
  else:
796
-
797
- body = {
798
- "class": "NewElementRequestBody", "externalSourceGUID": external_source_guid,
799
- "externalSourceName": external_source_name, "effectiveTime": effective_time,
800
- "forLineage": False, "forDuplicateProcessing": False, "anchorGUID": anchor_guid,
801
- "isOwnAnchor": is_own_anchor, "parentGUID": parent_guid,
802
- "parentRelationshipTypeName": parent_relationship_type_name,
803
- "parentRelationshipProperties": parent_relationship_properties, "parentAtEnd1": parent_at_end1,
804
- "properties": {
805
- "class": "DataStructureProperties", "qualifiedName": qualified_name,
806
- "displayName": display_name, "description": description, "namespace": namespace,
807
- "versionIdentifier": version_id, "additionalProperties": additional_properties,
808
- "effectiveFrom": effective_from, "effectiveTo": effective_to
809
- }
810
- }
811
-
812
- guid = egeria_client.create_data_structure_w_body(body_slimmer(body))
762
+ body = set_create_body(object_type, attributes)
763
+ body['properties'] = prop_body
764
+ guid = egeria_client.create_data_structure(body_slimmer(body))
813
765
  if guid:
814
766
  update_element_dictionary(qualified_name, {
815
767
  'guid': guid, 'display_name': display_name
816
768
  })
817
769
 
818
- core_props = egeria_client.get_data_structure_by_guid(guid, output_format='MD')
770
+ core_props = egeria_client.get_data_structure_by_guid(guid, output_format='MD', report_spec=output_set)
819
771
 
820
772
  if in_data_dictionary:
821
773
  logger.info(f"Will add to data dictionary(s) `{in_data_dictionary}`")
822
- result = add_member_to_data_collections(egeria_client, in_data_dictionary, display_name,
823
- guid)
774
+ add_member_to_data_collections(egeria_client, data_dict_guid_list,
775
+ display_name,guid)
824
776
  core_props += f"## In Data Dictionary\n\n{data_dict_name_list}\n\n"
825
777
 
826
778
  if data_spec_guid_list:
827
- result = add_member_to_data_collections(egeria_client, data_spec_guid_list, display_name,
828
- guid)
779
+ add_member_to_data_collections(egeria_client, data_spec_guid_list,
780
+ display_name, guid)
829
781
  core_props += f"## In Data Specifications\n\n`{data_spec_name_list}`\n\n"
830
782
 
831
783
  logger.info(f"Created Element `{display_name}` with GUID {guid}\n\n___")
@@ -835,12 +787,11 @@ def process_data_structure_upsert_command(egeria_client: EgeriaTech, txt: str, d
835
787
  logger.error(f"Failed to create Data Structure `{display_name}`\n\n___")
836
788
  return None
837
789
 
838
-
839
790
  except Exception as e:
840
791
  logger.error(f"Error performing {object_action}: {e}\n\n___")
841
792
  return None
842
- else:
843
- return None
793
+ else:
794
+ return None
844
795
 
845
796
 
846
797
  @logger.catch
@@ -868,6 +819,7 @@ def process_data_field_upsert_command(egeria_client: EgeriaTech, txt: str, direc
868
819
  guid = parsed_output.get('guid', None)
869
820
  valid = parsed_output['valid']
870
821
  exists = parsed_output['exists']
822
+ output_set = make_format_set_name_from_type(object_type)
871
823
 
872
824
  print(Markdown(parsed_output['display']))
873
825
 
@@ -885,38 +837,6 @@ def process_data_field_upsert_command(egeria_client: EgeriaTech, txt: str, direc
885
837
  elif directive == "process":
886
838
  logger.debug(json.dumps(parsed_output, indent=4))
887
839
 
888
- external_source_guid = attributes.get('External Source Name', {}).get('guid', None)
889
- external_source_name = attributes.get('External Source Name', {}).get('value', None)
890
- effective_time = attributes.get('Effective Time', {}).get('value', None)
891
- for_lineage = attributes.get('For Lineage', {}).get('value', None)
892
- for_duplicate_processing = attributes.get('For Duplicate Processing', {}).get('value', None)
893
- anchor_guid = attributes.get('Anchor ID', {}).get('guid', None)
894
- is_own_anchor = attributes.get('Is Own Anchor', {}).get('value', None)
895
- # parent_id = attributes.get('Parent ID', {}).get('value', None)
896
- # parent_guid = attributes['Parent ID'].get('guid', None)
897
- # parent_relationship_type_name = attributes.get('Parent Relationship Type Name', {}).get('value', None)
898
- # parent_relationship_properties = attributes.get('Parent Relationship Properties',{}).get('value', None)
899
- # parent_at_end1 = attributes.get('Parent at End1', {}).get('value', None)
900
-
901
- namespace = attributes.get('Namespace', {}).get('value', None)
902
- description = attributes.get('Description', {}).get('value', None)
903
- version_id = attributes.get('Version Identifier', {}).get('value', None)
904
- aliases = attributes.get('Aliases', {}).get('value', None)
905
- name_patterns = attributes.get('Name Patterns', {}).get('value', None)
906
- is_nullable = attributes.get('Is Nullable', {}).get('value', None)
907
- default_value = attributes.get('Default Value', {}).get('value', None)
908
- data_type = attributes.get('Data Type', {}).get('value', None)
909
- min_length = attributes.get('Minimum Length', {}).get('value', None)
910
- length = attributes.get('Length', {}).get('value', None)
911
- precision = attributes.get('Precision', {}).get('value', None)
912
- ordered_values = attributes.get('Ordered Values', {}).get('value', None)
913
- sort_order = attributes.get('Sort Order', {}).get('value', None)
914
- additional_properties = attributes.get('Additional Properties', {}).get('value', None)
915
- effective_from = attributes.get('Effective From', {}).get('value', None)
916
- effective_to = attributes.get('Effective To', {}).get('value', None)
917
-
918
- glossary_term = attributes['Glossary Term'].get('value', None)
919
- glossary_term_guid = attributes['Glossary Term'].get('guid', None)
920
840
 
921
841
  merge_update = attributes.get('Merge Update', {}).get('value', None)
922
842
 
@@ -930,13 +850,11 @@ def process_data_field_upsert_command(egeria_client: EgeriaTech, txt: str, direc
930
850
 
931
851
  data_class = attributes.get('Data Class', {}).get('value', None)
932
852
  data_class_guid = attributes.get('Data Class', {}).get('guid', None)
933
-
853
+ glossary_term = attributes.get('Glossary Term', {}).get('value', None)
934
854
  glossary_term_guid = attributes.get('Glossary Term', {}).get('guid', None)
935
855
  if glossary_term_guid:
936
856
  glossary_term_guid = [glossary_term_guid]
937
857
 
938
- glossary_term_guid = attributes.get('Glossary Term', {}).get('guid', None)
939
-
940
858
  # name_details_list = attributes.get("dict_list", None)
941
859
 
942
860
  in_data_spec = attributes.get("In Data Specification", {}).get("value", None) # this is a [dict]
@@ -968,6 +886,8 @@ def process_data_field_upsert_command(egeria_client: EgeriaTech, txt: str, direc
968
886
  else:
969
887
  print(Markdown(f"==> Validation of {command} completed successfully! Proceeding to apply the changes.\n"))
970
888
 
889
+ props_body = set_data_field_body(object_type, qualified_name, attributes)
890
+
971
891
  try:
972
892
  if object_action == "Update":
973
893
  if not exists:
@@ -976,29 +896,15 @@ def process_data_field_upsert_command(egeria_client: EgeriaTech, txt: str, direc
976
896
  return update_a_command(txt, object_action, object_type, qualified_name, guid)
977
897
 
978
898
  # first update the base data field
979
- body = {
980
- "class": "UpdateElementRequestBody", "externalSourceGUID": external_source_guid,
981
- "externalSourceName": external_source_name, "effectiveTime": effective_time,
982
- "forLineage": for_lineage, "forDuplicateProcessing": for_duplicate_processing, "properties": {
983
- "class": "DataFieldProperties", "qualifiedName": qualified_name, "displayName": display_name,
984
- "namespace": namespace, "description": description, "versionIdentifier": version_id,
985
- "aliases": aliases, "namePatterns": name_patterns, "isDeprecated": False,
986
- "isNullable": is_nullable, "defaultValue": default_value, "dataType": data_type,
987
- "minimumLength": min_length, "length": length, "precision": precision,
988
- "orderedValues": ordered_values, "sortOrder": sort_order,
989
- "additionalProperties": additional_properties, "effectiveFrom": effective_from,
990
- "effectiveTo": effective_to
991
- }
992
- }
993
-
994
- egeria_client.update_data_field(guid, body, not merge_update)
899
+ body = set_update_body(object_type, attributes)
900
+ body['properties'] = props_body
901
+ egeria_client.update_data_field(guid, body)
995
902
  logger.success(f"Updated {object_type} `{display_name}` with GUID {guid}")
996
903
  # Update data dictionary membership
997
904
  update_element_dictionary(qualified_name, {
998
905
  'guid': guid, 'display_name': display_name
999
906
  })
1000
- core_props = egeria_client.find_data_fields(qualified_name,
1001
- output_format='MD') ## update back to by_guid?
907
+ core_props = egeria_client.get_data_field_by_guid(guid, output_format='MD', report_spec=output_set) ## update back to by_guid?
1002
908
 
1003
909
  # existing_data_field = egeria_client.get_data_field_by_guid(guid, output_format='JSON')
1004
910
 
@@ -1029,17 +935,10 @@ def process_data_field_upsert_command(egeria_client: EgeriaTech, txt: str, direc
1029
935
  return update_a_command(txt, object_action, object_type, qualified_name, guid)
1030
936
  else:
1031
937
  # First lets create the data field
1032
- body = {
1033
- "class": "NewElementRequestBody", "properties": {
1034
- "class": "DataFieldProperties", "qualifiedName": qualified_name,
1035
- "displayName": display_name, "namespace": namespace, "description": description,
1036
- "versionIdentifier": version_id, "aliases": aliases, "namePatterns": name_patterns,
1037
- "isDeprecated": False, "isNullable": is_nullable, "defaultValue": default_value,
1038
- "dataType": data_type, "minimumLength": min_length, "length": length,
1039
- "precision": precision, "orderedValues": ordered_values, "sortOrder": sort_order,
1040
- "additionalProperties": additional_properties
1041
- }
1042
- }
938
+ body = set_create_body(object_type, attributes)
939
+ body['properties'] = props_body
940
+ parent_guid = body.get('parentGuid', None)
941
+
1043
942
  guid = egeria_client.create_data_field(body)
1044
943
  if guid:
1045
944
  # Now update our element dictionary with the new information
@@ -1047,7 +946,7 @@ def process_data_field_upsert_command(egeria_client: EgeriaTech, txt: str, direc
1047
946
  'guid': guid, 'display_name': display_name
1048
947
  })
1049
948
  # Start assembling the information we will present back out
1050
- core_props = egeria_client.get_data_field_by_guid(guid, None, 'MD')
949
+ core_props = egeria_client.get_data_field_by_guid(guid, 'MD', report_spec=output_set)
1051
950
 
1052
951
  # Add the field to any data dictionaries
1053
952
  if in_data_dictionary:
@@ -1060,27 +959,27 @@ def process_data_field_upsert_command(egeria_client: EgeriaTech, txt: str, direc
1060
959
  core_props += f"\n\n## In Data Structure\n\n{in_data_structure_names}\n\n"
1061
960
  for ds_guid in data_structure_guid_list:
1062
961
  # todo This is too naive? - need to better accommodate the relationship
1063
- df_body = {
1064
- "class": "RelationshipRequestBody", "properties": {
1065
- "class": "MemberDataFieldProperties", "dataFieldPosition": position,
1066
- "minCardinality": min_cardinality, "maxCardinality": max_cardinality,
1067
- }
1068
- }
962
+ prop_body = set_rel_prop_body("MemberDataFieldProperties", attributes)
963
+ prop_body["position"] = position
964
+ prop_body["minimumCardinality"] = min_cardinality
965
+ prop_body["maximumCardinality"] = max_cardinality
966
+
967
+ body = set_rel_request_body(object_type, attributes)
968
+ body['properties'] = prop_body
1069
969
 
1070
970
  msg = f"Adding field to structure {ds_guid}"
1071
971
  logger.info(msg)
1072
- egeria_client.link_member_data_field(ds_guid, guid, df_body)
972
+ egeria_client.link_member_data_field(ds_guid, guid, body)
1073
973
  core_props += f"\n\n## In Data Structure {in_data_structure_names}\n\n"
1074
974
 
1075
975
  if glossary_term:
1076
976
  if glossary_term_guid:
1077
- glossary_body = {
1078
- "class": "RelationshipRequestBody", "externalSourceGUID": external_source_guid,
1079
- "externalSourceName": external_source_name, "effectiveTime": effective_time,
1080
- "forLineage": for_lineage, "forDuplicateProcessing": for_duplicate_processing
1081
- }
977
+ term_body = set_rel_prop_body("GlossaryTermProperties", attributes)
978
+ body = set_rel_request_body(object_type, attributes)
979
+ body['properties'] = term_body
980
+
1082
981
  core_props += f"\n\n## Glossary Term \n\n{glossary_term}\n\n"
1083
- egeria_client.link_semantic_definition(guid, glossary_term_guid, glossary_body)
982
+ egeria_client.link_semantic_definition(guid, glossary_term_guid, term_body)
1084
983
 
1085
984
  if parent_data_field_guids:
1086
985
  # parent_df_body = {
@@ -1096,11 +995,11 @@ def process_data_field_upsert_command(egeria_client: EgeriaTech, txt: str, direc
1096
995
 
1097
996
  # Link data class
1098
997
  if data_class:
1099
- body = {
1100
- "class": "RelationshipRequestBody", "externalSourceGUID": external_source_guid,
1101
- "externalSourceName": external_source_name, "effectiveTime": effective_time,
1102
- "forLineage": for_lineage, "forDuplicateProcessing": for_duplicate_processing
1103
- }
998
+ prop_body = set_rel_prop_body("DataClassProperties", attributes)
999
+ body = set_rel_request_body(object_type, attributes)
1000
+ body['properties'] = prop_body
1001
+
1002
+ core_props += f"\n\n## Data Class\n\n{data_class}\n\n"
1104
1003
  egeria_client.link_data_class_definition(guid, data_class_guid, body)
1105
1004
  msg = f"Adding data class `{data_class}` to data field {display_name}"
1106
1005
  logger.info(msg)
@@ -1144,6 +1043,7 @@ def process_data_class_upsert_command(egeria_client: EgeriaTech, txt: str, direc
1144
1043
  guid = parsed_output.get('guid', None)
1145
1044
  valid = parsed_output['valid']
1146
1045
  exists = parsed_output['exists']
1046
+ output_set = make_format_set_name_from_type(object_type)
1147
1047
 
1148
1048
  print(Markdown(parsed_output['display']))
1149
1049
 
@@ -1194,6 +1094,7 @@ def process_data_class_upsert_command(egeria_client: EgeriaTech, txt: str, direc
1194
1094
  sample_values = attributes.get('Sample Values', {}).get('value', [])
1195
1095
  data_patterns = attributes.get('Data Patterns', {}).get('value', [])
1196
1096
  additional_properties = attributes.get('Additional Properties', {}).get('value', {})
1097
+ output_set = make_format_set_name_from_type(object_type)
1197
1098
 
1198
1099
  ###############
1199
1100
  aliases = attributes.get('Aliases', {}).get('value', None)
@@ -1283,7 +1184,7 @@ def process_data_class_upsert_command(egeria_client: EgeriaTech, txt: str, direc
1283
1184
  update_element_dictionary(qualified_name, {
1284
1185
  'guid': guid, 'display_name': display_name
1285
1186
  })
1286
- core_props = egeria_client.get_data_class_by_guid(guid, None, 'MD')
1187
+ core_props = egeria_client.get_data_class_by_guid(guid, None, 'MD', report_spec=output_set)
1287
1188
 
1288
1189
  # Sync membership in data dictionaries
1289
1190
  update_data_collection_memberships(egeria_client, object_type, data_dict_guid_list, "DataDictionary",
@@ -1331,7 +1232,7 @@ def process_data_class_upsert_command(egeria_client: EgeriaTech, txt: str, direc
1331
1232
  'guid': guid, 'display_name': display_name
1332
1233
  })
1333
1234
  # Start assembling the information we will present back out
1334
- core_props = egeria_client.get_data_class_by_guid(guid, None, 'MD')
1235
+ core_props = egeria_client.get_data_class_by_guid(guid, None, 'MD', report_spec=output_set)
1335
1236
 
1336
1237
  # Add the field to any data dictionaries
1337
1238
  if in_data_dictionary:
@@ -1373,292 +1274,3 @@ def process_data_class_upsert_command(egeria_client: EgeriaTech, txt: str, direc
1373
1274
  else:
1374
1275
  return None
1375
1276
 
1376
-
1377
- @logger.catch
1378
- def process_data_collection_list_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[
1379
- str]:
1380
- """
1381
- Processes a Data Dictionary list object_action by extracting key attributes such as
1382
- search string from the given text.
1383
-
1384
- :param txt: A string representing the input cell to be processed for
1385
- extracting term-related attributes.
1386
- :param directive: an optional string indicating the directive to be used - display, validate or execute
1387
- :return: A string summarizing the outcome of the processing.
1388
- """
1389
- command, object_type, object_action = extract_command_plus(txt)
1390
- print(Markdown(f"# {command}\n"))
1391
- if object_type in ["Data Dictionary", "Data Dictionaries", "DataDict", "DataDictionary"]:
1392
- col_type = "DataDictionary"
1393
- elif object_type in ["Data Specification", "Data Specifications", "Data Specs"]:
1394
- col_type = "DataSpec"
1395
- else:
1396
- col_type = "Collection"
1397
-
1398
- parsed_output = parse_view_command(egeria_client, object_type, object_action, txt, directive)
1399
-
1400
-
1401
-
1402
- valid = parsed_output['valid']
1403
- print(Markdown(f"Performing {command}"))
1404
- print(Markdown(parsed_output['display']))
1405
-
1406
- attr = parsed_output.get('attributes',{})
1407
- effective_time = attr.get('effectiveTime', {}).get('value', None)
1408
- as_of_time = attr.get('asOfTime', {}).get('value', None)
1409
- for_duplicate_processing = attr.get('forDuplicateProcessing', {}).get('value', False)
1410
- for_lineage = attr.get('forLineage',{}).get('value', False)
1411
- limit_result_by_status = attr.get('limitResultsByStatus',{}).get('value', ['ACTIVE'])
1412
- sequencing_property = attr.get('sequencingProperty',{}).get('value',"qualifiedName" )
1413
- sequencing_order = attr.get('sequencingOrder',{}).get('value', "PROPERTY_ASCENDING")
1414
- search_string = attr.get('Search String', {}).get('value', '*')
1415
- output_format = attr.get('Output Format', {}).get('value', 'LIST')
1416
- detailed = attr.get('Detailed', {}).get('value', False)
1417
-
1418
- if directive == "display":
1419
- return None
1420
- elif directive == "validate":
1421
- if valid:
1422
- print(Markdown(f"==> Validation of {command} completed successfully!\n"))
1423
- else:
1424
- msg = f"Validation failed for object_action `{command}`\n"
1425
- logger.error(msg)
1426
- return valid
1427
-
1428
- elif directive == "process":
1429
- try:
1430
- if not valid: # First validate the command before we process it
1431
- msg = f"Validation failed for {object_action} `{object_type}`\n"
1432
- logger.error(msg)
1433
- return None
1434
-
1435
- list_md = f"\n# `{col_type}` with filter: `{search_string}`\n\n"
1436
- body = {
1437
- "class": "FilterRequestBody",
1438
- "asOfTime": as_of_time,
1439
- "effectiveTime": effective_time,
1440
- "forLineage": for_lineage,
1441
- "forDuplicateProcessing": for_duplicate_processing,
1442
- "limitResultsByStatus": limit_result_by_status,
1443
- "sequencingOrder": sequencing_order,
1444
- "sequencingProperty": sequencing_property,
1445
- "filter": search_string,
1446
- }
1447
-
1448
- struct = egeria_client.find_collections_w_body(body, col_type, output_format=output_format)
1449
- if output_format == "DICT":
1450
- list_md += f"```\n{json.dumps(struct, indent=4)}\n```\n"
1451
- else:
1452
- list_md += struct
1453
- logger.info(f"Wrote `{col_type}` for search string: `{search_string}`")
1454
-
1455
- return list_md
1456
-
1457
- except Exception as e:
1458
- logger.error(f"Error performing {command}: {e}")
1459
- console.print_exception(show_locals=True)
1460
- return None
1461
- else:
1462
- return None
1463
-
1464
-
1465
- def process_data_structure_list_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[
1466
- str]:
1467
- """
1468
- Processes a Data Dictionary list object_action by extracting key attributes such as
1469
- search string from the given text.
1470
-
1471
- :param txt: A string representing the input cell to be processed for
1472
- extracting term-related attributes.
1473
- :param directive: an optional string indicating the directive to be used - display, validate or execute
1474
- :return: A string summarizing the outcome of the processing.
1475
- """
1476
- command, object_type, object_action = extract_command_plus(txt)
1477
- print(Markdown(f"# {command}\n"))
1478
-
1479
- parsed_output = parse_view_command(egeria_client, object_type, object_action, txt, directive)
1480
-
1481
- attributes = parsed_output['attributes']
1482
-
1483
- valid = parsed_output['valid']
1484
- print(Markdown(f"Performing {command}"))
1485
- print(Markdown(parsed_output['display']))
1486
-
1487
- if directive == "display":
1488
- return None
1489
- elif directive == "validate":
1490
- if valid:
1491
- print(Markdown(f"==> Validation of {command} completed successfully!\n"))
1492
- else:
1493
- msg = f"Validation failed for object_action `{command}`\n"
1494
- logger.error(msg)
1495
- return valid
1496
-
1497
- elif directive == "process":
1498
- attributes = parsed_output['attributes']
1499
- search_string = attributes.get('Search String', {}).get('value', '*')
1500
- output_format = attributes.get('Output Format', {}).get('value', 'LIST')
1501
- detailed = attributes.get('Detailed', {}).get('value', False)
1502
-
1503
- try:
1504
- if not valid: # First validate the command before we process it
1505
- msg = f"Validation failed for {object_action} `{object_type}`\n"
1506
- logger.error(msg)
1507
- return None
1508
-
1509
- list_md = f"\n# `{object_type}` with filter: `{search_string}`\n\n"
1510
- struct = egeria_client.find_data_structures(search_string, output_format=output_format)
1511
-
1512
- if output_format == "DICT":
1513
- list_md += f"```\n{json.dumps(struct, indent=4)}\n```\n"
1514
- else:
1515
- list_md += struct
1516
- logger.info(f"Wrote `{object_type}` for search string: `{search_string}`")
1517
-
1518
- return list_md
1519
-
1520
- except Exception as e:
1521
- logger.error(f"Error performing {command}: {e}")
1522
- console.print_exception(show_locals=True)
1523
- return None
1524
- else:
1525
- return None
1526
-
1527
-
1528
- def process_data_field_list_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[str]:
1529
- """
1530
- Processes a Data Dictionary list object_action by extracting key attributes such as
1531
- search string from the given text.
1532
-
1533
- :param txt: A string representing the input cell to be processed for
1534
- extracting term-related attributes.
1535
- :param directive: an optional string indicating the directive to be used - display, validate or execute
1536
- :return: A string summarizing the outcome of the processing.
1537
- """
1538
- command, object_type, object_action = extract_command_plus(txt)
1539
- print(Markdown(f"# {command}\n"))
1540
-
1541
- parsed_output = parse_view_command(egeria_client, object_type, object_action, txt, directive)
1542
-
1543
- attributes = parsed_output['attributes']
1544
-
1545
- valid = parsed_output['valid']
1546
- print(Markdown(f"Performing {command}"))
1547
- print(Markdown(parsed_output['display']))
1548
-
1549
- if directive == "display":
1550
- return None
1551
- elif directive == "validate":
1552
- if valid:
1553
- print(Markdown(f"==> Validation of {command} completed successfully!\n"))
1554
- else:
1555
- msg = f"Validation failed for object_action `{command}`\n"
1556
- logger.error(msg)
1557
- return valid
1558
-
1559
- elif directive == "process":
1560
- attributes = parsed_output['attributes']
1561
- search_string = attributes.get('Search String', {}).get('value', '*')
1562
- output_format = attributes.get('Output Format', {}).get('value', 'LIST')
1563
- detailed = attributes.get('Detailed', {}).get('value', False)
1564
- as_of_time = attributes.get('AsOfTime', {}).get('value', None)
1565
- effective_time = attributes.get('Effective Time', {}).get('value', None)
1566
- sort_order = attributes.get('Sort Order', {}).get('value', None)
1567
- order_property = attributes.get('Order Property', {}).get('value', None)
1568
- starts_with = attributes.get('Start With', {}).get('value', True)
1569
- ends_with = attributes.get('End With', {}).get('value', False)
1570
- ignore_case = attributes.get('Ignore Case', {}).get('value', False)
1571
- start_from = attributes.get('Start From', {}).get('value', 0)
1572
- page_size = attributes.get('Page Size', {}).get('value', None)
1573
-
1574
- try:
1575
- if not valid: # First validate the command before we process it
1576
- msg = f"Validation failed for {object_action} `{object_type}`\n"
1577
- logger.error(msg)
1578
- return None
1579
-
1580
- list_md = f"\n# `{object_type}` with filter: `{search_string}`\n\n"
1581
- body = {
1582
- "class": "FilterRequestBody", "asOfTime": as_of_time, "effectiveTime": effective_time,
1583
- "forLineage": False, "forDuplicateProcessing": False, "limitResultsByStatus": ["ACTIVE"],
1584
- "sequencingOrder": sort_order, "sequencingProperty": order_property, "filter": search_string,
1585
- }
1586
- struct = egeria_client.find_data_fields_w_body(body, start_from, page_size, starts_with, ends_with,
1587
- ignore_case, output_format)
1588
-
1589
- if output_format == "DICT":
1590
- list_md += f"```\n{json.dumps(struct, indent=4)}\n```\n"
1591
- else:
1592
- list_md += struct
1593
- logger.info(f"Wrote `{object_type}` for search string: `{search_string}`")
1594
-
1595
- return list_md
1596
-
1597
- except Exception as e:
1598
- logger.error(f"Error performing {command}: {e}")
1599
- console.print_exception(show_locals=True)
1600
- return None
1601
- else:
1602
- return None
1603
-
1604
-
1605
- def process_data_class_list_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[str]:
1606
- """
1607
- Processes a Data Dictionary list object_action by extracting key attributes such as
1608
- search string from the given text.
1609
-
1610
- :param txt: A string representing the input cell to be processed for
1611
- extracting term-related attributes.
1612
- :param directive: an optional string indicating the directive to be used - display, validate or execute
1613
- :return: A string summarizing the outcome of the processing.
1614
- """
1615
- command, object_type, object_action = extract_command_plus(txt)
1616
- print(Markdown(f"# {command}\n"))
1617
-
1618
- parsed_output = parse_view_command(egeria_client, object_type, object_action, txt, directive)
1619
-
1620
- attributes = parsed_output['attributes']
1621
-
1622
- valid = parsed_output['valid']
1623
- print(Markdown(f"Performing {command}"))
1624
- print(Markdown(parsed_output['display']))
1625
-
1626
- if directive == "display":
1627
- return None
1628
- elif directive == "validate":
1629
- if valid:
1630
- print(Markdown(f"==> Validation of {command} completed successfully!\n"))
1631
- else:
1632
- msg = f"Validation failed for object_action `{command}`\n"
1633
- logger.error(msg)
1634
- return valid
1635
-
1636
- elif directive == "process":
1637
- attributes = parsed_output['attributes']
1638
- search_string = attributes.get('Search String', {}).get('value', '*')
1639
- output_format = attributes.get('Output Format', {}).get('value', 'LIST')
1640
- detailed = attributes.get('Detailed', {}).get('value', False)
1641
-
1642
- try:
1643
- if not valid: # First validate the command before we process it
1644
- msg = f"Validation failed for {object_action} `{object_type}`\n"
1645
- logger.error(msg)
1646
- return None
1647
-
1648
- list_md = f"\n# `{object_type}` with filter: `{search_string}`\n\n"
1649
- struct = egeria_client.find_data_classes(search_string, output_format=output_format)
1650
-
1651
- if output_format == "DICT":
1652
- list_md += f"```\n{json.dumps(struct, indent=4)}\n```\n"
1653
- else:
1654
- list_md += struct
1655
- logger.info(f"Wrote `{object_type}` for search string: `{search_string}`")
1656
-
1657
- return list_md
1658
-
1659
- except Exception as e:
1660
- logger.error(f"Error performing {command}: {e}")
1661
- console.print_exception(show_locals=True)
1662
- return None
1663
- else:
1664
- return None