pyegeria 5.3.9.9.3__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 (272) hide show
  1. commands/__init__.py +24 -0
  2. commands/cat/Dr-Egeria_md-orig.py +2 -2
  3. commands/cat/__init__.py +1 -17
  4. commands/cat/collection_actions.py +197 -0
  5. commands/cat/dr_egeria_command_help.py +372 -0
  6. commands/cat/dr_egeria_jupyter.py +7 -7
  7. commands/cat/dr_egeria_md.py +27 -182
  8. commands/cat/exp_list_glossaries.py +11 -14
  9. commands/cat/get_asset_graph.py +37 -267
  10. commands/cat/{get_collection.py → get_collection_tree.py} +10 -18
  11. commands/cat/get_project_dependencies.py +14 -14
  12. commands/cat/get_project_structure.py +15 -14
  13. commands/cat/get_tech_type_elements.py +16 -116
  14. commands/cat/glossary_actions.py +145 -298
  15. commands/cat/list_assets.py +3 -11
  16. commands/cat/list_cert_types.py +17 -63
  17. commands/cat/list_collections.py +46 -138
  18. commands/cat/list_deployed_catalogs.py +15 -27
  19. commands/cat/list_deployed_database_schemas.py +27 -43
  20. commands/cat/list_deployed_databases.py +16 -31
  21. commands/cat/list_deployed_servers.py +35 -54
  22. commands/cat/list_glossaries.py +18 -17
  23. commands/cat/list_projects.py +10 -12
  24. commands/cat/list_tech_type_elements.py +21 -37
  25. commands/cat/list_tech_types.py +13 -25
  26. commands/cat/list_terms.py +38 -79
  27. commands/cat/list_todos.py +4 -11
  28. commands/cat/list_user_ids.py +3 -10
  29. commands/cat/my_reports.py +559 -0
  30. commands/cat/run_report.py +394 -0
  31. commands/cat/run_report_orig.py +528 -0
  32. commands/cli/egeria.py +222 -247
  33. commands/cli/egeria_cat.py +68 -81
  34. commands/cli/egeria_my.py +13 -0
  35. commands/cli/egeria_ops.py +69 -74
  36. commands/cli/egeria_tech.py +17 -93
  37. commands/cli/ops_config.py +3 -6
  38. commands/{cat/list_categories.py → deprecated/list_data_designer.py} +53 -64
  39. commands/{cat/list_data_structures.py → deprecated/list_data_structures_full.py} +3 -6
  40. commands/deprecated/old_get_asset_graph.py +315 -0
  41. commands/my/__init__.py +0 -2
  42. commands/my/list_my_profile.py +27 -34
  43. commands/my/list_my_roles.py +1 -7
  44. commands/my/monitor_my_todos.py +1 -7
  45. commands/my/monitor_open_todos.py +6 -7
  46. commands/my/todo_actions.py +4 -5
  47. commands/ops/__init__.py +0 -2
  48. commands/ops/gov_server_actions.py +17 -21
  49. commands/ops/list_archives.py +17 -38
  50. commands/ops/list_catalog_targets.py +33 -40
  51. commands/ops/load_archive.py +35 -26
  52. commands/ops/{monitor_engine_activity_c.py → monitor_active_engine_activity.py} +51 -82
  53. commands/ops/{monitor_integ_daemon_status.py → monitor_daemon_status.py} +35 -55
  54. commands/ops/monitor_engine_activity.py +79 -77
  55. commands/ops/{monitor_gov_eng_status.py → monitor_engine_status.py} +10 -7
  56. commands/ops/monitor_platform_status.py +38 -50
  57. commands/ops/monitor_server_startup.py +6 -11
  58. commands/ops/monitor_server_status.py +7 -11
  59. commands/ops/orig_monitor_server_list.py +8 -8
  60. commands/ops/orig_monitor_server_status.py +1 -5
  61. commands/ops/refresh_integration_daemon.py +5 -5
  62. commands/ops/restart_integration_daemon.py +5 -5
  63. commands/ops/table_integ_daemon_status.py +6 -6
  64. commands/ops/x_engine_actions.py +7 -7
  65. commands/tech/__init__.py +0 -2
  66. commands/tech/{generic_actions.py → element_actions.py} +6 -11
  67. commands/tech/get_element_info.py +20 -29
  68. commands/tech/get_guid_info.py +23 -42
  69. commands/tech/get_tech_details.py +20 -35
  70. commands/tech/get_tech_type_template.py +28 -39
  71. commands/tech/list_all_om_type_elements.py +24 -30
  72. commands/tech/list_all_om_type_elements_x.py +22 -28
  73. commands/tech/list_all_related_elements.py +19 -28
  74. commands/tech/list_anchored_elements.py +22 -30
  75. commands/tech/list_asset_types.py +19 -24
  76. commands/tech/list_elements_by_classification_by_property_value.py +26 -32
  77. commands/tech/list_elements_by_property_value.py +19 -25
  78. commands/tech/list_elements_by_property_value_x.py +20 -28
  79. commands/tech/list_elements_for_classification.py +28 -41
  80. commands/tech/list_gov_action_processes.py +16 -27
  81. commands/tech/list_information_supply_chains.py +22 -30
  82. commands/tech/list_registered_services.py +14 -26
  83. commands/tech/list_related_elements_with_prop_value.py +15 -25
  84. commands/tech/list_related_specification.py +1 -4
  85. commands/tech/list_relationship_types.py +15 -25
  86. commands/tech/list_relationships.py +20 -36
  87. commands/tech/list_solution_blueprints.py +28 -33
  88. commands/tech/list_solution_components.py +23 -29
  89. commands/tech/list_solution_roles.py +21 -32
  90. commands/tech/list_tech_templates.py +51 -54
  91. commands/tech/list_valid_metadata_values.py +5 -9
  92. commands/tech/table_tech_templates.py +2 -6
  93. commands/tech/x_list_related_elements.py +1 -4
  94. examples/GeoSpatial Products Example.py +524 -0
  95. examples/Jupyter Notebooks/P-egeria-server-config.ipynb +2137 -0
  96. examples/Jupyter Notebooks/README.md +2 -0
  97. examples/Jupyter Notebooks/common/P-environment-check.ipynb +115 -0
  98. examples/Jupyter Notebooks/common/__init__.py +14 -0
  99. examples/Jupyter Notebooks/common/common-functions.ipynb +4694 -0
  100. examples/Jupyter Notebooks/common/environment-check.ipynb +52 -0
  101. examples/Jupyter Notebooks/common/globals.ipynb +184 -0
  102. examples/Jupyter Notebooks/common/globals.py +154 -0
  103. examples/Jupyter Notebooks/common/orig_globals.py +152 -0
  104. examples/format_sets/all_format_sets.json +910 -0
  105. examples/format_sets/custom_format_sets.json +268 -0
  106. examples/format_sets/subset_format_sets.json +187 -0
  107. examples/format_sets_save_load_example.py +291 -0
  108. examples/jacquard_data_sets.py +129 -0
  109. examples/output_formats_example.py +193 -0
  110. examples/test_jacquard_data_sets.py +54 -0
  111. examples/test_jacquard_data_sets_scenarios.py +94 -0
  112. md_processing/__init__.py +90 -0
  113. md_processing/command_dispatcher.py +33 -0
  114. md_processing/command_mapping.py +221 -0
  115. md_processing/data/commands/commands_data_designer.json +537 -0
  116. md_processing/data/commands/commands_external_reference.json +733 -0
  117. md_processing/data/commands/commands_feedback.json +155 -0
  118. md_processing/data/commands/commands_general.json +204 -0
  119. md_processing/data/commands/commands_glossary.json +218 -0
  120. md_processing/data/commands/commands_governance.json +3678 -0
  121. md_processing/data/commands/commands_product_manager.json +865 -0
  122. md_processing/data/commands/commands_project.json +642 -0
  123. md_processing/data/commands/commands_solution_architect.json +366 -0
  124. md_processing/data/commands.json +17568 -0
  125. md_processing/data/commands_working.json +30641 -0
  126. md_processing/data/gened_report_specs.py +6584 -0
  127. md_processing/data/generated_format_sets.json +6533 -0
  128. md_processing/data/generated_format_sets_old.json +4137 -0
  129. md_processing/data/generated_format_sets_old.py +45 -0
  130. md_processing/dr_egeria.py +182 -0
  131. md_processing/md_commands/__init__.py +3 -0
  132. md_processing/md_commands/data_designer_commands.py +1276 -0
  133. md_processing/md_commands/ext_ref_commands.py +530 -0
  134. md_processing/md_commands/feedback_commands.py +726 -0
  135. md_processing/md_commands/glossary_commands.py +684 -0
  136. md_processing/md_commands/governance_officer_commands.py +600 -0
  137. md_processing/md_commands/product_manager_commands.py +1266 -0
  138. md_processing/md_commands/project_commands.py +383 -0
  139. md_processing/md_commands/solution_architect_commands.py +1184 -0
  140. md_processing/md_commands/view_commands.py +295 -0
  141. md_processing/md_processing_utils/__init__.py +4 -0
  142. md_processing/md_processing_utils/common_md_proc_utils.py +1249 -0
  143. md_processing/md_processing_utils/common_md_utils.py +578 -0
  144. md_processing/md_processing_utils/determine_width.py +103 -0
  145. md_processing/md_processing_utils/extraction_utils.py +547 -0
  146. md_processing/md_processing_utils/gen_report_specs.py +643 -0
  147. md_processing/md_processing_utils/generate_dr_help.py +193 -0
  148. md_processing/md_processing_utils/generate_md_cmd_templates.py +144 -0
  149. md_processing/md_processing_utils/generate_md_templates.py +83 -0
  150. md_processing/md_processing_utils/md_processing_constants.py +1228 -0
  151. md_processing/md_processing_utils/message_constants.py +19 -0
  152. pyegeria/__init__.py +201 -443
  153. pyegeria/core/__init__.py +40 -0
  154. pyegeria/core/_base_platform_client.py +574 -0
  155. pyegeria/core/_base_server_client.py +573 -0
  156. pyegeria/core/_exceptions.py +457 -0
  157. pyegeria/core/_globals.py +60 -0
  158. pyegeria/core/_server_client.py +6073 -0
  159. pyegeria/core/_validators.py +257 -0
  160. pyegeria/core/config.py +654 -0
  161. pyegeria/{create_tech_guid_lists.py → core/create_tech_guid_lists.py} +0 -1
  162. pyegeria/core/load_config.py +37 -0
  163. pyegeria/core/logging_configuration.py +207 -0
  164. pyegeria/core/mcp_adapter.py +144 -0
  165. pyegeria/core/mcp_server.py +212 -0
  166. pyegeria/core/utils.py +405 -0
  167. pyegeria/deprecated/__init__.py +0 -0
  168. pyegeria/{_client.py → deprecated/_client.py} +62 -24
  169. pyegeria/{_deprecated_gov_engine.py → deprecated/_deprecated_gov_engine.py} +16 -16
  170. pyegeria/{classification_manager_omvs.py → deprecated/classification_manager_omvs.py} +1988 -1878
  171. pyegeria/deprecated/output_formatter_with_machine_keys.py +1127 -0
  172. pyegeria/{runtime_manager_omvs.py → deprecated/runtime_manager_omvs.py} +216 -229
  173. pyegeria/{valid_metadata_omvs.py → deprecated/valid_metadata_omvs.py} +93 -93
  174. pyegeria/{x_action_author_omvs.py → deprecated/x_action_author_omvs.py} +2 -3
  175. pyegeria/egeria_cat_client.py +25 -51
  176. pyegeria/egeria_client.py +140 -98
  177. pyegeria/egeria_config_client.py +48 -24
  178. pyegeria/egeria_tech_client.py +170 -83
  179. pyegeria/models/__init__.py +150 -0
  180. pyegeria/models/collection_models.py +168 -0
  181. pyegeria/models/models.py +654 -0
  182. pyegeria/omvs/__init__.py +84 -0
  183. pyegeria/omvs/action_author.py +342 -0
  184. pyegeria/omvs/actor_manager.py +5980 -0
  185. pyegeria/omvs/asset_catalog.py +842 -0
  186. pyegeria/omvs/asset_maker.py +2736 -0
  187. pyegeria/omvs/automated_curation.py +4403 -0
  188. pyegeria/omvs/classification_manager.py +11213 -0
  189. pyegeria/omvs/collection_manager.py +5780 -0
  190. pyegeria/omvs/community_matters_omvs.py +468 -0
  191. pyegeria/{core_omag_server_config.py → omvs/core_omag_server_config.py} +157 -157
  192. pyegeria/{data_designer_omvs.py → omvs/data_designer.py} +1991 -1691
  193. pyegeria/omvs/data_discovery.py +869 -0
  194. pyegeria/omvs/data_engineer.py +372 -0
  195. pyegeria/omvs/digital_business.py +1133 -0
  196. pyegeria/omvs/external_links.py +1752 -0
  197. pyegeria/omvs/feedback_manager.py +834 -0
  198. pyegeria/{full_omag_server_config.py → omvs/full_omag_server_config.py} +73 -69
  199. pyegeria/omvs/glossary_manager.py +3231 -0
  200. pyegeria/omvs/governance_officer.py +3009 -0
  201. pyegeria/omvs/lineage_linker.py +314 -0
  202. pyegeria/omvs/location_arena.py +1525 -0
  203. pyegeria/omvs/metadata_expert.py +668 -0
  204. pyegeria/omvs/metadata_explorer_omvs.py +2943 -0
  205. pyegeria/omvs/my_profile.py +1042 -0
  206. pyegeria/omvs/notification_manager.py +358 -0
  207. pyegeria/omvs/people_organizer.py +394 -0
  208. pyegeria/{platform_services.py → omvs/platform_services.py} +113 -193
  209. pyegeria/omvs/product_manager.py +1825 -0
  210. pyegeria/omvs/project_manager.py +1907 -0
  211. pyegeria/omvs/reference_data.py +1140 -0
  212. pyegeria/omvs/registered_info.py +334 -0
  213. pyegeria/omvs/runtime_manager.py +2817 -0
  214. pyegeria/omvs/schema_maker.py +446 -0
  215. pyegeria/{server_operations.py → omvs/server_operations.py} +27 -26
  216. pyegeria/omvs/solution_architect.py +6490 -0
  217. pyegeria/omvs/specification_properties.py +37 -0
  218. pyegeria/omvs/subject_area.py +1042 -0
  219. pyegeria/omvs/template_manager_omvs.py +236 -0
  220. pyegeria/omvs/time_keeper.py +1761 -0
  221. pyegeria/omvs/valid_metadata.py +3221 -0
  222. pyegeria/omvs/valid_metadata_lists.py +37 -0
  223. pyegeria/omvs/valid_type_lists.py +37 -0
  224. pyegeria/view/__init__.py +28 -0
  225. pyegeria/view/_output_format_models.py +514 -0
  226. pyegeria/view/_output_formats.py +14 -0
  227. pyegeria/view/base_report_formats.py +2719 -0
  228. pyegeria/view/dr_egeria_reports.py +56 -0
  229. pyegeria/view/format_set_executor.py +397 -0
  230. pyegeria/{md_processing_utils.py → view/md_processing_utils.py} +5 -5
  231. pyegeria/{mermaid_utilities.py → view/mermaid_utilities.py} +2 -154
  232. pyegeria/view/output_formatter.py +1297 -0
  233. pyegeria-5.5.3.3.dist-info/METADATA +218 -0
  234. pyegeria-5.5.3.3.dist-info/RECORD +241 -0
  235. {pyegeria-5.3.9.9.3.dist-info → pyegeria-5.5.3.3.dist-info}/WHEEL +2 -1
  236. pyegeria-5.5.3.3.dist-info/entry_points.txt +103 -0
  237. pyegeria-5.5.3.3.dist-info/top_level.txt +4 -0
  238. commands/cat/.DS_Store +0 -0
  239. commands/cat/README.md +0 -16
  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/monitor_asset_events.py +0 -108
  244. commands/tech/README.md +0 -24
  245. pyegeria/.DS_Store +0 -0
  246. pyegeria/README.md +0 -35
  247. pyegeria/_globals.py +0 -47
  248. pyegeria/_validators.py +0 -385
  249. pyegeria/asset_catalog_omvs.py +0 -864
  250. pyegeria/automated_curation_omvs.py +0 -3765
  251. pyegeria/collection_manager_omvs.py +0 -2744
  252. pyegeria/dr.egeria spec.md +0 -9
  253. pyegeria/egeria_my_client.py +0 -56
  254. pyegeria/feedback_manager_omvs.py +0 -4573
  255. pyegeria/glossary_browser_omvs.py +0 -3728
  256. pyegeria/glossary_manager_omvs.py +0 -2440
  257. pyegeria/m_test.py +0 -118
  258. pyegeria/md_processing_helpers.py +0 -58
  259. pyegeria/md_processing_utils_orig.py +0 -1103
  260. pyegeria/metadata_explorer_omvs.py +0 -2326
  261. pyegeria/my_profile_omvs.py +0 -1022
  262. pyegeria/output_formatter.py +0 -389
  263. pyegeria/project_manager_omvs.py +0 -1933
  264. pyegeria/registered_info.py +0 -167
  265. pyegeria/solution_architect_omvs.py +0 -2156
  266. pyegeria/template_manager_omvs.py +0 -1414
  267. pyegeria/utils.py +0 -197
  268. pyegeria-5.3.9.9.3.dist-info/METADATA +0 -72
  269. pyegeria-5.3.9.9.3.dist-info/RECORD +0 -143
  270. pyegeria-5.3.9.9.3.dist-info/entry_points.txt +0 -99
  271. /pyegeria/{_exceptions.py → deprecated/_exceptions.py} +0 -0
  272. {pyegeria-5.3.9.9.3.dist-info → pyegeria-5.5.3.3.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,1228 @@
1
+ """
2
+ This file contains display-related constants and formatting functions for Egeria Markdown processing
3
+ """
4
+ import importlib.resources
5
+ import json
6
+ import os
7
+
8
+ import inflect
9
+ from loguru import logger
10
+ from rich.markdown import Markdown
11
+
12
+ from pyegeria.core._globals import DEBUG_LEVEL
13
+ from pyegeria.core.logging_configuration import config_logging
14
+
15
+ inflect_engine = inflect.engine()
16
+
17
+ EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", "/home/jovyan")
18
+ EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "loading-bay/dr_egeria_inbox")
19
+
20
+ # Constants for element labels
21
+ GLOSSARY_NAME_LABELS = ["Glossary Name", "Glossary", "Glossaries", "Owning Glossary", "In Glossary"]
22
+
23
+ TERM_NAME_LABELS = ["Glossary Term Name", "Glossary Term", "Glossary Terms", "Term Name", "Term", "Terms", "Term Names"]
24
+ PROJECT_NAME_LABELS = ["Project Name", "Project", "Project Names", "Projects"]
25
+ BLUEPRINT_NAME_LABELS = ["Solution Blueprint Name", "Solution Blueprint", "Solution Blueprints", "Blueprint Name",
26
+ "Blueprint", "Blueprints"]
27
+ COMPONENT_NAME_LABELS = ["Solution Component Name", "Solution Component", "Solution Components", "Component Name",
28
+ "Component", "Components", "Parent Components", "Parent Component"]
29
+ SOLUTION_ROLE_LABELS = ["Solution Role Name", "Solution Role", "Solution Roles", "Role Name", "Role", "Roles"]
30
+ SOLUTION_ACTOR_ROLE_LABELS = ["Solution Actor Role Name", "Solution Actor Role Names", "Solution Actor Role",
31
+ "Solution Actor Roles", "Actor Role Name", "Actor Role", "Actor Roles",
32
+ "Actor Role Names"]
33
+ SOLUTION_LINKING_ROLE_LABELS = ["Solution Linking Role Name", "Solution Linking Role Names", "Solution Linking Role",
34
+ "Solution Linking Roles", "Linking Role Name", "Linking Role", "Linking Roles",
35
+ "Linking Role Names"]
36
+ OUTPUT_LABELS = ["Output", "Output Format"]
37
+ SEARCH_LABELS = ['Search String', 'Filter']
38
+ GUID_LABELS = ['GUID', 'guid']
39
+
40
+ # Constants for output formats
41
+ ELEMENT_OUTPUT_FORMATS = ["LIST", "DICT", "MD", "FORM", "REPORT"]
42
+
43
+ # Constants for term relationships
44
+ TERM_RELATIONSHPS = ["Synonym", "Translation", "PreferredTerm", "TermISATYPEOFRelationship", "TermTYPEDBYRelationship",
45
+ "Antonym", "ReplacementTerm", "ValidValue", "TermHASARelationship", "RelatedTerm",
46
+ "ISARelationship"]
47
+
48
+ # List of supported md_commands
49
+ GOV_LINK_LIST = ["Link Governance Drivers", "Link Drivers", "Detach Governance Drivers", "Detach Drivers",
50
+ "Link Governance Policies", "Link Policies", "Detach Governance Policies", "Detach Policies",
51
+ "Link Governance Controls", "Link Controls", "Detach Governance Controls", "Detach Controls",
52
+ ]
53
+
54
+ GOV_COM_LIST = ["Create Business Imperative", "Update Business Imperative",
55
+ "Create Regulation Article Definition", "Update Regulation Article Definition",
56
+ "Create Threat Definition", "Update Threat Definition",
57
+ "Create Governance Principle", "Update Governance Principle",
58
+ "Create Governance Obligation", "Update Governance Obligation",
59
+ "Create Governance Approach", "Update Governance Approach",
60
+ "Create Governance Strategy", "Update Governance Strategy",
61
+ "Create Regulation", "Create Regulation Definition", "Update Regulation",
62
+ "Update Regulation Definition",
63
+ "Create Governance Control:", "Update Governance Control",
64
+ "Create Governance Rule:", "Update Governance Rule",
65
+ "Create Service Level Objective", "Update Service Level Objective",
66
+ "Create Governance Process", "Update Governance Process",
67
+ "Create Governance Responsibility", "Update Governance Responsibility",
68
+ "Create Governance Procedure", "Update Governance Procedure",
69
+ "Create Security Access Control", "Update Security Access Control",
70
+ "Create Security Group", "Update Security Group",
71
+ "Create Naming Standard Rule", "Update Naming Standard Rule",
72
+ "Create Certification Type", "Update Certification Type",
73
+ "Create License Type", "Update License Type",
74
+
75
+ ]
76
+
77
+ SIMPLE_BASE_COLLECTIONS: set = {"Collection", "Home Collection", "Digital Product", "Result Set", "Recent Access",
78
+ "Reference List", "Work Item List", "Data Sharing Agreement", "Namespace", "Agreement",
79
+ "Digital Subscription", "Data Product", "Subscription",
80
+ "Root Collection", "Folder", "Context Event Collection", "Name Space Collection",
81
+ # "Data Specifications", "Data Specifications", "Data Specs", "Data Specs",
82
+ # "Data Dictionaries", "Data Dictionaries",
83
+ "Event Set Collection", "Naming Standard Ruleset", "Digital Product Catalog"
84
+ }
85
+ LIST_COMMANDS = {"List Collections", "View Collections", "List Agreements", "View Agreements",
86
+ "List Digital Products", "View Digital Products", "List Products", "View Products",
87
+ "List Subscriptions", "View Subscriptions", "List Folders", "View Folders",
88
+ "List Data Specifications", "View Data Specifications", "List Data Specs", "View Data Specs",
89
+ "List Data Dictionaries", "View Data Dictionaries",
90
+ "List Governance Definitions", "View Governance Definitions", "List Governance Drivers",
91
+ "View Governance Drivers",
92
+ "List Governance Policies", "View Governance Policies", "List Governance Controls",
93
+ "View Governance Controls",
94
+ "List Governance Rules", "View Governance Rules", "List Governance Principles",
95
+ "View Governance Principles",
96
+ "List Governance Obligations", "View Governance Obligations", "List Governance Approaches",
97
+ "View Governance Approaches",
98
+ "List Governance Strategies", "View Governance Strategies", "List Regulations", "View Regulations",
99
+ "List Regulation Definitions", "View Regulation Definitions",
100
+ "List Naming Standard Rulesets", "View Naming Standard Rulesets", "List Governance Drivers",
101
+ "List Governance Strategies", "List Business Imperatives" "List Regulations",
102
+ "List Regulation Articles", "List Threats",
103
+ "List Governance Metrics", "View Governance Metrics", "List Service Level Objectives",
104
+ "View Service Level Objectives",
105
+ "List Governance Rules", "View Governance Rules", "List Notification Types", "View Notification Types",
106
+ "List Security Access Controls", "View Security Access Controls", "List Security Groups",
107
+ "View Security Groups",
108
+ "List Governance Procedures", "View Governance Procedures", "List Methodologies", "View Methodologies",
109
+ "List Governance Responsibilities", "View Governance Responsibilities", "List Terms and Conditions",
110
+ "View Terms and Conditions", "List License Types", "View License Types", "List Certification Types",
111
+ "View Certification Types",
112
+ "List Subject Area Definitions", "View Subject Area Definitions", "List Data Processing Purposes",
113
+ "View Data Processing Purposes",
114
+ "List Projects", "View Projects",
115
+
116
+ }
117
+
118
+ SIMPLE_COLLECTIONS: set = set()
119
+ for element in SIMPLE_BASE_COLLECTIONS:
120
+ SIMPLE_COLLECTIONS.add(f"Create {element}")
121
+ SIMPLE_COLLECTIONS.add(f"Update {element}")
122
+ plural = inflect_engine.plural_noun(element)
123
+ SIMPLE_COLLECTIONS.add(f"Create {plural}")
124
+ SIMPLE_COLLECTIONS.add(f"Update {plural}")
125
+
126
+ COLLECTIONS_LIST = ["List Collections", "View Collections", "List Digital Products", "View Digital Products",
127
+ "List Data Products", "View Data Products",
128
+ "List Data Sharing Agreements", "View Data Sharing Agreements",
129
+ "List Agreements", "View Agreements",
130
+ "List Digital Subscriptions", "View Digital Subscriptions",
131
+ "List Subscriptions", "View Subscriptions",
132
+ "List Root Collections", "View Root Collections",
133
+ "List Data Specifications", "View Data Specifications", "List Data Specs", "View Data Specs",
134
+ "List Data Dictionaries", "View Data Dictionaries",
135
+ "List Folders", "View Folders",
136
+ "List Context Event Collections", "View Context Event Collections",
137
+ "List Name Space Collections", "View Name Space Collections",
138
+ "List Event Set Collections", "View Event Set Collections",
139
+ "List Naming Standard Rulesets", "View Naming Standard Rulesets", "List External Reference",
140
+ "List Related Media", "List Cited Document", "List External Data Source",
141
+ "List External Model Source",
142
+ "List Digital Product Catalogs", "View Digital Product Catalogs", ]
143
+
144
+ PROJECT_COMMANDS = ["Create Project", "Update Project", "Create Campaign", "Update Campaign",
145
+ "Create Task", "Update Task", "Create Study Project", "Update Study Project",
146
+ "Create Personal Project", "Update Personal Project"]
147
+
148
+ LINK_EXT_REF = ["Link External Reference", "Link Referenceable->External Reference", "Attach External Reference",
149
+ "Detach External Reference", "Detach External Reference Link", "Link External Data Source",
150
+ "Link External Model Source", "Detach External Data Source", "Detach External Model Source", ]
151
+
152
+ LINK_MEDIA = ["Link Related Media", "Link Referenceable->Related Media", "Attach Related Media",
153
+ "Attach Media Reference Link",
154
+ "Detach Related Media", "Detach Related Media Link", "Detach Media Reference Link"]
155
+
156
+ LINK_CITED_DOC = ["Link Cited Document", "Link Referenceable->Cited Document", "Attach Cited Document",
157
+ "Attach Cited Document Link",
158
+ "Detach Cited Document", "Detach Cited Document Link", ]
159
+
160
+ EXT_REF_UPSERT = ["Create External Reference", "Update External Reference",
161
+ "Create Related Media", "Update Related Media",
162
+ "Create Cited Document", "Update Cited Document",
163
+ "Create External Data Source", "Update External Data Source", "Create External Model Source",
164
+ "Update External Model Source", ]
165
+ EXT_REF_COMMANDS = EXT_REF_UPSERT + LINK_EXT_REF + LINK_MEDIA + LINK_CITED_DOC
166
+
167
+ COLLECTION_CREATE = ["Create Collection", "Update Collection", "Create Digital Product Catalog",
168
+ "Update Digital Product Catalog",
169
+ "Create Root Collection", "Update Root Collection", "Create Folder", "Update Folder",
170
+ ]
171
+ FEEDBACK_COMMANDS = ["Create Comment", "Update Comment", "Create Journal Entry",
172
+ "Create Informal Tag", "Update Informal Tag", "Link Tag->Element", "Link Tag", "Detach Tag"]
173
+
174
+ command_list = ["Provenance", "Create Glossary", "Update Glossary", "Create Term", "Update Term", "List Terms",
175
+ "List Term Details", "List Glossary Terms", "List Term History", "List Term Revision History",
176
+ "List Term Update History", "List Glossary Structure", "List Glossaries", "List Categories",
177
+ "List Glossary Categories", "Link Project Dependency", "Attach Project Dependency",
178
+ "Detach Project Dependency", "Link Parent Project", "Attach Parent Project", "Detach Parent Project",
179
+ "Detach Parent Project",
180
+ "Create Solution Blueprint", "Update Solution Blueprint", "View Solution Blueprint",
181
+ "View Solution Blueprints", "View Blueprints",
182
+ "View Information Supply Chain", "View Information Supply Chains", "View Supply Chains",
183
+ "View Supply Chain",
184
+ "View Solution Components", "View Solution Component", "View Solution Roles", "View Solution Role",
185
+ "Create Information Supply Chain", "Update Information Supply Chain",
186
+ "Link Information Supply Chain Peers", "Link Supply Chains", "Link Information Supply Chains",
187
+ "Unlink Information Supply Chain Peers", "Unlink Information Supply Chains", "Unlink Supply Chains",
188
+ "Create Solution Component", "Update Solution Component", "Link Solution Components",
189
+ "Wire Solution Components",
190
+ "Detach Solution Components", "Unlink Solution Components", "Link Term-Term Relationship", "Link Terms",
191
+ "Detach Terms",
192
+ "Detach Term-Term Relationship", "Create Data Spec", "Create Data Specification", "Update Data Spec",
193
+ "Update Data Specification", "Create Data Field", "Update Data Field", "Create Data Structure",
194
+ "Update Data Structure", "Create Data Dictionary", "Update Data Dictionary", "Create Data Dict",
195
+ "Update Data Dict",
196
+ "View Data Structures", "View Data Structure", "View Data Fields", "View Data Field",
197
+ "View Data Classes", "View Data Class", "Create Data Class", "Update Data Class",
198
+
199
+ "Create Data Specifications", "Update Data Specifications", "Create Data Specs", "Update Data Specs",
200
+ "Create Data Dictionaries", "Update Data Dictionaries", "Create Data Dicts", "Update Data Dicts",
201
+ "View Data Specifications", "View Data Specification", "View Data Specs", "View Data Specification",
202
+ "View Data Dictionaries", "View Data Dictionary", "View Data Dicts", "View Data Dictionary",
203
+ "Link Collection->Root Collection", "Link Collection->Folder",
204
+ "Link Collection->Context Event Collection", "Link Collection->Name Space Collection",
205
+ "Link Collection->Event Set Collection", "Link Collection->Naming Standard Ruleset",
206
+ "Create Digital Product", "Create Data Product", "Update Digital Product", "Update Data Product",
207
+ "Create Agreement", "Update Agreement",
208
+ "Link Digital Products", "Link Product-Product", "Detach Digital Products", "Detach Product-Product",
209
+ "Create Data Sharing Agreement", "Update Data Sharing Agreement",
210
+ "Create Digital Subscription", "Create Product Subscription", "Update Digital Subscription",
211
+ "Update Product Subscription",
212
+ "Link Agreement->Item", "Detach Agreement->Item",
213
+ "Attach Contract", "Detach Contract",
214
+ "Link Subscriber->Subscription", "Detach Subscriber->Subscription",
215
+ "Link Collection->Resource", "Attach Collection->Resource",
216
+ "Unlink Collection->Resource", "Detach Collection->Resource",
217
+ "Add Member to Collection", "Add Member", "Add Member->Collection", 'Add Member', 'Add to Folder',
218
+ "Remove Member from Collection", "Remove Member->Collection", ' Remove Member', 'Remove from Folder',
219
+ "View Governance Definitions", "View Gov Definitions",
220
+ "List Governance Definitions", "List Gov Definitions",
221
+ "View Governance Definition Context", "List Governance Definition Context",
222
+ "View Governance Def Context", "List Governance Def Context",
223
+ "View Report",
224
+ "Create Business Imperative", "Update Business Imperative",
225
+ "Create Regulation Article Definition", "Update Regulation Article Definition",
226
+ "Create Threat Definition", "Update Threat Definition",
227
+ "Create Governance Principle", "Update Governance Principle",
228
+ "Create Governance Obligation", "Update Governance Obligation",
229
+ "Create Governance Approach", "Update Governance Approach",
230
+ "Create Governance Strategy", "Update Governance Strategy",
231
+ "Create Regulation", "Create Regulation Definition", "Update Regulation",
232
+ "Update Regulation Definition",
233
+ "Create Governance Control:", "Update Governance Control",
234
+ "Create Governance Rule:", "Update Governance Rule",
235
+ "Create Service Level Objective", "Update Service Level Objective",
236
+ "Create Governance Process", "Update Governance Process",
237
+ "Create Governance Responsibility", "Update Governance Responsibility",
238
+ "Create Governance Procedure", "Update Governance Procedure",
239
+ "Create Security Access Control", "Update Security Access Control",
240
+ "Create Security Group", "Update Security Group",
241
+ "Create Naming Standard Rule", "Update Naming Standard Rule",
242
+ "Create Certification Type", "Update Certification Type",
243
+ "Create License Type", "Update License Type",
244
+ "Link Governance Drivers", "Detach Governance Drivers",
245
+ "Link Governance Policies", "Detach Governance Policies",
246
+ "Link Governance Controls", "Detach Governance Controls",
247
+ "Link Governed By", "Attach Governed By", "Detach Governed By",
248
+ "Create CSV File"
249
+
250
+ ]
251
+ command_list.extend(LIST_COMMANDS)
252
+ command_list.extend(GOV_COM_LIST)
253
+ command_list.extend(GOV_LINK_LIST)
254
+ command_list.extend(COLLECTIONS_LIST)
255
+ command_list.extend(COLLECTION_CREATE)
256
+ command_list.extend(SIMPLE_COLLECTIONS)
257
+ command_list.extend(PROJECT_COMMANDS)
258
+ command_list.extend(EXT_REF_COMMANDS)
259
+ command_list.extend(["Link Governance Response", "Detach Governance Response",
260
+ "Link Governance Mechanism", "Detach Governance Mechanism"])
261
+ command_list.extend(FEEDBACK_COMMANDS)
262
+ pre_command = "\n---\n==> Processing object_action:"
263
+ command_seperator = Markdown("\n---\n")
264
+ EXISTS_REQUIRED = "Exists Required"
265
+ COMMAND_DEFINITIONS = {}
266
+
267
+ generic_bodies = {
268
+
269
+ }
270
+
271
+ config_logging()
272
+ logger.enable("pyegeria")
273
+ debug_level = DEBUG_LEVEL
274
+
275
+
276
+ # def load_commands(filename: str) -> None:
277
+ # global COMMAND_DEFINITIONS
278
+ #
279
+ # try:
280
+ # config_path = importlib.resources.files("md_processing") / "data" / filename
281
+ # config_str = config_path.read_text(encoding="utf-8")
282
+ # COMMAND_DEFINITIONS = json.loads(config_str)
283
+ #
284
+ # except FileNotFoundError:
285
+ # msg = f"ERROR: File {filename} not found."
286
+ # print(ERROR, msg, debug_level)
287
+
288
+ def load_commands(filename: str) -> None:
289
+ global COMMAND_DEFINITIONS
290
+
291
+ try:
292
+ config_path = importlib.resources.files("md_processing") / "data" / filename
293
+ config_str = config_path.read_text(encoding="utf-8")
294
+
295
+ # Validate JSON before attempting to load
296
+ try:
297
+ COMMAND_DEFINITIONS = json.loads(config_str)
298
+ msg = f"Successfully loaded {filename}"
299
+ logger.debug(msg)
300
+ except json.JSONDecodeError as json_err:
301
+ # Provide detailed error information
302
+ error_line = json_err.lineno
303
+ error_col = json_err.colno
304
+ error_pos = json_err.pos
305
+
306
+ # Extract context around the error
307
+ lines = config_str.split('\n')
308
+ start_line = max(0, error_line - 3)
309
+ end_line = min(len(lines), error_line + 2)
310
+
311
+ context = '\n'.join([
312
+ f"Line {i + 1}: {lines[i]}"
313
+ for i in range(start_line, end_line)
314
+ ])
315
+
316
+ error_msg = (
317
+ f"\n{'=' * 80}\n"
318
+ f"ERROR: Invalid JSON in {filename}\n"
319
+ f"{'=' * 80}\n"
320
+ f"Location: Line {error_line}, Column {error_col} (char position {error_pos})\n"
321
+ f"Error: {json_err.msg}\n"
322
+ f"\nContext around error:\n{context}\n"
323
+ f"{'=' * 80}\n"
324
+ f"\nPlease fix the JSON syntax error in {filename} at line {error_line}.\n"
325
+ f"Common issues:\n"
326
+ f" - Missing comma between elements\n"
327
+ f" - Trailing comma before closing bracket/brace\n"
328
+ f" - Unescaped quotes in strings\n"
329
+ f" - Missing closing bracket/brace\n"
330
+ f"{'=' * 80}\n"
331
+ )
332
+
333
+ print(error_msg)
334
+
335
+ # Initialize with empty dict to allow application to continue
336
+ # (though functionality will be limited)
337
+ COMMAND_DEFINITIONS = {}
338
+
339
+ # Re-raise with more context
340
+ raise json.JSONDecodeError(
341
+ f"Invalid JSON in {filename}: {json_err.msg}",
342
+ json_err.doc,
343
+ json_err.pos
344
+ ) from json_err
345
+
346
+ except FileNotFoundError:
347
+ msg = f"ERROR: File {filename} not found."
348
+ print(msg)
349
+ COMMAND_DEFINITIONS = {}
350
+ raise FileNotFoundError(msg)
351
+ except Exception as e:
352
+ msg = f"ERROR: Unexpected error loading {filename}: {str(e)}"
353
+ print(msg)
354
+ COMMAND_DEFINITIONS = {}
355
+ raise
356
+
357
+
358
+ def validate_json_file(filename: str) -> tuple[bool, str]:
359
+ """
360
+ Validate a JSON file and return status with error details.
361
+
362
+ Returns:
363
+ tuple: (is_valid: bool, message: str)
364
+ """
365
+ try:
366
+ config_path = importlib.resources.files("md_processing") / "data" / filename
367
+ config_str = config_path.read_text(encoding="utf-8")
368
+ json.loads(config_str)
369
+ return True, f"JSON file {filename} is valid"
370
+ except json.JSONDecodeError as e:
371
+ error_msg = (
372
+ f"Invalid JSON at line {e.lineno}, column {e.colno}: {e.msg}\n"
373
+ f"Character position: {e.pos}"
374
+ )
375
+ return False, error_msg
376
+ except Exception as e:
377
+ return False, f"Error reading file: {str(e)}"
378
+
379
+
380
+ def find_json_errors(filename: str, max_errors: int = 10) -> list[str]:
381
+ """
382
+ Attempt to find multiple JSON errors in a file.
383
+
384
+ This function tries to parse the JSON and collect error information.
385
+ """
386
+ errors = []
387
+ try:
388
+ config_path = importlib.resources.files("md_processing") / "data" / filename
389
+ config_str = config_path.read_text(encoding="utf-8")
390
+
391
+ # Try to parse
392
+ json.loads(config_str)
393
+ return ["No errors found - JSON is valid"]
394
+
395
+ except json.JSONDecodeError as e:
396
+ lines = config_str.split('\n')
397
+ error_line = e.lineno - 1 # Convert to 0-indexed
398
+
399
+ # Get context
400
+ start = max(0, error_line - 2)
401
+ end = min(len(lines), error_line + 3)
402
+
403
+ error_context = []
404
+ for i in range(start, end):
405
+ prefix = ">>> " if i == error_line else " "
406
+ error_context.append(f"{prefix}Line {i + 1}: {lines[i]}")
407
+
408
+ error_msg = (
409
+ f"Error at line {e.lineno}, column {e.colno}: {e.msg}\n" +
410
+ "\n".join(error_context)
411
+ )
412
+ errors.append(error_msg)
413
+
414
+ except Exception as e:
415
+ errors.append(f"Unexpected error: {str(e)}")
416
+
417
+ return errors
418
+
419
+
420
+ def get_command_spec(command: str, body_type: str = None) -> dict | None:
421
+ global COMMAND_DEFINITIONS
422
+
423
+ com = COMMAND_DEFINITIONS.get('Command Specifications', {}).get(command, None)
424
+ if com:
425
+ return com
426
+ else:
427
+ obj = find_alternate_names(command)
428
+ if obj:
429
+ return COMMAND_DEFINITIONS.get('Command Specifications', {}).get(obj, None)
430
+
431
+
432
+ def does_command_match(command: str, alt_names: list[str]) -> bool:
433
+ # Define verb synonyms
434
+ verbs_synonyms = {
435
+ "Link": ["Link", "Attach", "Detach", "Unlink"],
436
+ "Create": ["Create", "Update"],
437
+ "View": ["List", "View"],
438
+ }
439
+
440
+ # Extract the verb from the command
441
+ command_parts = command.split(maxsplit=1)
442
+ if len(command_parts) < 2:
443
+ return False # Invalid command structure
444
+ verb, terms = command_parts
445
+
446
+ # Generate all possible combinations and check for a match
447
+ for primary_verb, synonyms in verbs_synonyms.items():
448
+ for synonym in synonyms:
449
+ for alt_name in alt_names:
450
+ alt_name = alt_name.strip()
451
+ tst = f"{synonym} {alt_name}"
452
+ if tst == command:
453
+ return True
454
+ return False
455
+
456
+
457
+ def find_alternate_names(command: str) -> str | None:
458
+ global COMMAND_DEFINITIONS
459
+
460
+ comm_spec = COMMAND_DEFINITIONS.get('Command Specifications', {})
461
+ for key, value in comm_spec.items():
462
+ if isinstance(value, dict):
463
+ v = value.get('alternate_names', "")
464
+ v = v.split(';') if v else ""
465
+ verb = command.split()[0] if command else ""
466
+ normalized_command = " ".join(command.split())
467
+ # normalized_alternates = (" ".join(s.split()) for s in v)
468
+ if (normalized_command in v):
469
+ return key
470
+ elif does_command_match(normalized_command, v):
471
+ return key
472
+ return None
473
+
474
+
475
+ def get_alternate_names(command: str) -> list | None:
476
+ global COMMAND_DEFINITIONS
477
+ return get_command_spec(command).get('alternate_names', None)
478
+
479
+
480
+ def get_attribute(command: str, attrib_name: str) -> dict | None:
481
+ attr = get_command_spec(command)['Attributes']
482
+ if attr:
483
+ for attribute_dict in attr:
484
+ if "Display Name" in attribute_dict:
485
+ return attribute_dict["Display Name"]
486
+ else:
487
+ print("Key not found in the dictionary.")
488
+
489
+
490
+ def get_attribute_labels(command: str, attrib_name: str) -> list | None:
491
+ label_str = get_attribute(command, attrib_name).get('attr_labels', None)
492
+ if label_str:
493
+ return label_str.split(';')
494
+ else:
495
+ print("Key not found in the dictionary.")
496
+ return None
497
+
498
+
499
+ def add_default_upsert_attributes(attributes: list[dict]) -> list[dict]:
500
+ new_attributes = attributes
501
+ default_upsert_attributes = [
502
+ {
503
+ "Status": {
504
+ "variable_name": "element_status",
505
+ "inUpdate": True,
506
+ "attr_labels": "",
507
+ "examples": "APPROVED",
508
+ "default_value": "ACTIVE",
509
+ "valid_values": "DRAFT; PREPARED; PROPOSED; APPROVED; REJECTED; APPROVED_CONCEPT; UNDER_DEVELOPMENT; DEVELOPMENT_COMPLETE; APPROVED_FOR_DEPLOYMENT; ACTIVE; DISABLED; DEPRECATED; OTHER",
510
+ "existing_element": "",
511
+ "description": "The status of the digital product. There is a list of valid values that this conforms to.",
512
+
513
+ "generated": False,
514
+ "style": "Valid Value",
515
+ "user_specified": True,
516
+ "unique": False,
517
+ "input_required": False,
518
+
519
+ "min_cardinality": 1,
520
+ "max_cardinality": 1,
521
+ "level": "INVISIBLE",
522
+
523
+ }
524
+ },
525
+ {
526
+ "User Defined Status": {
527
+ "variable_name": "user_defined_status",
528
+ "inUpdate": True,
529
+ "attr_labels": "",
530
+ "examples": "Pink",
531
+ "default_value": "",
532
+ "valid_values": "",
533
+ "existing_element": "",
534
+ "description": "Only valid if Product Status is set to OTHER. User defined & managed status values.",
535
+ "generated": False,
536
+ "style": "Simple",
537
+ "user_specified": True,
538
+ "unique": False,
539
+ "input_required": False,
540
+ "min_cardinality": 0,
541
+ "max_cardinality": 1,
542
+ "level": "Basic",
543
+ }
544
+ },
545
+
546
+ {
547
+ "Category": {
548
+ "variable_name": "category",
549
+ "inUpdate": True,
550
+ "attr_labels": "Category Name",
551
+ "examples": "",
552
+ "default_value": "",
553
+ "valid_values": "",
554
+ "existing_element": "",
555
+ "description": "A user specified category name that can be used for example, to define product types or agreement types.",
556
+
557
+ "generated": False,
558
+ "style": "Simple",
559
+ "user_specified": True,
560
+ "unique": False,
561
+ "input_required": False,
562
+
563
+ "min_cardinality": 0,
564
+ "max_cardinality": 1,
565
+ "level": "Basic",
566
+
567
+ }
568
+ },
569
+ {
570
+ "Version Identifier": {
571
+ "variable_name": "current_version",
572
+ "inUpdate": True,
573
+ "attr_labels": "",
574
+ "examples": "V1.01",
575
+ "default_value": "1.0",
576
+ "valid_values": "",
577
+ "existing_element": "",
578
+ "description": "Published product version identifier.",
579
+
580
+ "generated": False,
581
+ "style": "Simple",
582
+ "user_specified": True,
583
+ "unique": False,
584
+ "input_required": False,
585
+
586
+ "min_cardinality": 0,
587
+ "max_cardinality": 1,
588
+ "level": "Basic",
589
+
590
+ }
591
+ },
592
+ {
593
+ "URL": {
594
+ "variable_name": "url",
595
+ "inUpdate": True,
596
+ "attr_labels": "",
597
+ "examples": "",
598
+ "default_value": "",
599
+ "valid_values": "",
600
+ "existing_element": "",
601
+ "description": "Link to supporting information",
602
+
603
+ "generated": False,
604
+ "style": "Simple",
605
+ "user_specified": True,
606
+ "unique": False,
607
+ "input_required": False,
608
+
609
+ "min_cardinality": 0,
610
+ "max_cardinality": 1,
611
+ "level": "Basic",
612
+
613
+ }
614
+ },
615
+ {
616
+ "Identifier": {
617
+ "variable_name": "identifier",
618
+ "inUpdate": True,
619
+ "attr_labels": "",
620
+ "examples": "",
621
+ "default_value": "",
622
+ "valid_values": "",
623
+ "existing_element": "",
624
+ "description": "role identifier",
625
+
626
+ "generated": False,
627
+ "style": "Simple",
628
+ "user_specified": True,
629
+ "unique": False,
630
+ "input_required": False,
631
+
632
+ "min_cardinality": 1,
633
+ "max_cardinality": 1,
634
+ "level": "Basic",
635
+
636
+ }
637
+ },
638
+ {
639
+ "Classifications": {
640
+ "variable_name": "classifications",
641
+ "inUpdate": True,
642
+ "attr_labels": "classification",
643
+ "examples": "Folder; RootCollection; ReferenceList; HomeCollection; ResultSet; RecentAccess; WorkItemList; NameSpace ",
644
+ "default_value": "",
645
+ "valid_values": "",
646
+ "existing_element": "",
647
+ "description": "Optionally specify the initial classifications for a collection. Multiple classifications can be specified. ",
648
+
649
+ "generated": False,
650
+ "style": "Named DICT",
651
+ "min_cardinality": 0,
652
+ "max_cardinality": 1,
653
+ "level": "Advanced"
654
+ }
655
+ },
656
+ {
657
+ "Is Own Anchor": {
658
+ "variable_name": "is_own_anchor",
659
+ "inUpdate": True,
660
+ "attr_labels": "Own Anchor",
661
+ "examples": "",
662
+ "default_value": "True",
663
+ "valid_values": "",
664
+ "existing_element": "",
665
+ "description": "Generally True. ",
666
+
667
+ "generated": False,
668
+ "style": "Bool",
669
+ "user_specified": True,
670
+ "unique": False,
671
+ "input_required": False,
672
+
673
+ "min_cardinality": 1,
674
+ "max_cardinality": 1,
675
+ "level": "Advanced",
676
+
677
+ }
678
+ },
679
+ {
680
+ "Anchor ID": {
681
+ "variable_name": "anchor_id",
682
+ "inUpdate": True,
683
+ "attr_labels": "",
684
+ "examples": "",
685
+ "default_value": "",
686
+ "valid_values": "",
687
+ "existing_element": "",
688
+ "description": "Anchor identity for the collection. Typically a qualified name but if display name is unique then it could be used (not recommended)",
689
+
690
+ "generated": False,
691
+ "style": "Reference Name",
692
+ "user_specified": True,
693
+ "unique": True,
694
+ "input_required": False,
695
+
696
+ "min_cardinality": 0,
697
+ "max_cardinality": 1,
698
+ "level": "Advanced",
699
+
700
+ }
701
+ },
702
+ {
703
+ "Parent ID": {
704
+ "variable_name": "parent_id",
705
+ "inUpdate": True,
706
+ "attr_labels": "Parent;",
707
+ "examples": "DataDict::MyParent",
708
+ "default_value": "",
709
+ "valid_values": "",
710
+ "existing_element": "DataDicti",
711
+ "description": "Unique name of the parent element.",
712
+
713
+ "generated": False,
714
+ "style": "Reference Name",
715
+ "user_specified": True,
716
+ "unique": False,
717
+ "input_required": False,
718
+
719
+ "min_cardinality": 0,
720
+ "max_cardinality": 1,
721
+ "level": "Advanced",
722
+ "Journal Entry": "Should the parent be anything or just a collection?"
723
+ }
724
+ },
725
+ {
726
+ "Parent Relationship Type Name": {
727
+ "variable_name": "parent_rel_type_name",
728
+ "inUpdate": True,
729
+ "attr_labels": "",
730
+ "examples": "",
731
+ "default_value": "",
732
+ "valid_values": "",
733
+ "existing_element": "",
734
+ "description": "The kind of the relationship to the parent element.",
735
+
736
+ "generated": False,
737
+ "style": "Simple",
738
+ "user_specified": True,
739
+ "unique": False,
740
+ "input_required": False,
741
+
742
+ "min_cardinality": 0,
743
+ "max_cardinality": 1,
744
+ "level": "Advanced",
745
+ "Journal Entry": "Any restrictions?"
746
+ }
747
+ },
748
+ {
749
+ "Anchor Scope Name": {
750
+ "variable_name": "anchor_scope_guid",
751
+ "inUpdate": True,
752
+ "attr_labels": "",
753
+ "examples": "",
754
+ "default_value": "",
755
+ "valid_values": "",
756
+ "existing_element": "DataDict",
757
+ "description": "Optional qualified name of an anchor scope.",
758
+
759
+ "generated": False,
760
+ "style": "Reference Name",
761
+ "user_specified": True,
762
+ "unique": False,
763
+ "input_required": False,
764
+
765
+ "min_cardinality": 0,
766
+ "max_cardinality": 1,
767
+ "level": "Advanced",
768
+
769
+ }
770
+ },
771
+ {
772
+ "Parent at End1": {
773
+ "variable_name": "parent_end1",
774
+ "inUpdate": True,
775
+ "attr_labels": "",
776
+ "examples": "",
777
+ "default_value": "True",
778
+ "valid_values": "",
779
+ "existing_element": "",
780
+ "description": "Is the parent at end1 of the relationship?",
781
+
782
+ "generated": False,
783
+ "style": "Bool",
784
+ "user_specified": True,
785
+ "unique": False,
786
+ "input_required": False,
787
+
788
+ "min_cardinality": 0,
789
+ "max_cardinality": 1,
790
+ "level": "Advanced",
791
+
792
+ }
793
+ },
794
+ {
795
+ "Qualified Name": {
796
+ "variable_name": "qualified_name",
797
+ "inUpdate": True,
798
+ "attr_labels": "",
799
+ "examples": "dataField::a data field",
800
+ "default_value": "",
801
+ "valid_values": "",
802
+ "existing_element": "",
803
+ "description": "A unique qualified name for the element. Generated using the qualified name pattern if not user specified.",
804
+ "qualified_name_pattern": "local_qualifier::namespace::DataDictionary:display_name::version_id",
805
+ "generated": True,
806
+ "style": "QN",
807
+ "user_specified": True,
808
+ "unique": True,
809
+ "input_required": False,
810
+
811
+ "min_cardinality": 1,
812
+ "max_cardinality": 1,
813
+ "level": "Basic",
814
+
815
+ }
816
+ },
817
+ {
818
+ "GUID": {
819
+ "variable_name": "guid",
820
+ "inUpdate": True,
821
+ "attr_labels": "Guid; guid",
822
+ "examples": "00585a82-0f7d-45ef-9b87-7078665917a9",
823
+ "default_value": "",
824
+ "valid_values": "",
825
+ "existing_element": "",
826
+ "description": "A system generated unique identifier.",
827
+
828
+ "generated": True,
829
+ "style": "GUID",
830
+ "user_specified": False,
831
+ "unique": True,
832
+ "input_required": False,
833
+
834
+ "min_cardinality": 1,
835
+ "max_cardinality": 1,
836
+ "level": "Basic",
837
+
838
+ }
839
+ },
840
+ {
841
+ "Effective Time": {
842
+ "variable_name": "effective_time",
843
+ "inUpdate": True,
844
+ "attr_labels": "",
845
+ "examples": "",
846
+ "default_value": "",
847
+ "valid_values": "",
848
+ "existing_element": "",
849
+ "description": "An ISO-8601 string representing the time to use for evaluating effectivity of the elements related to this one.",
850
+
851
+ "generated": False,
852
+ "style": "Simple",
853
+ "user_specified": True,
854
+ "unique": False,
855
+ "input_required": False,
856
+
857
+ "min_cardinality": 1,
858
+ "max_cardinality": 1,
859
+ "level": "Advanced",
860
+
861
+ }
862
+ },
863
+ {
864
+ "Effective From": {
865
+ "variable_name": "effective_from",
866
+ "inUpdate": True,
867
+ "attr_labels": "",
868
+ "examples": "",
869
+ "default_value": "",
870
+ "valid_values": "",
871
+ "existing_element": "",
872
+ "description": "A string in ISO-8601 format that defines the when an element becomes effective (visible).",
873
+ "generated": False,
874
+ "style": "Simple",
875
+ "user_specified": True,
876
+ "unique": False,
877
+ "input_required": False,
878
+ "min_cardinality": 0,
879
+ "max_cardinality": 1,
880
+ "level": "Advanced",
881
+
882
+ }
883
+ },
884
+ {
885
+ "Effective To": {
886
+ "variable_name": "effective_to",
887
+ "inUpdate": True,
888
+ "attr_labels": "",
889
+ "examples": "",
890
+ "default_value": "",
891
+ "valid_values": "",
892
+ "existing_element": "",
893
+ "description": "A string in ISO-8601 format that defines the when an element is no longer effective (visible).",
894
+
895
+ "generated": False,
896
+ "style": "Simple",
897
+ "user_specified": True,
898
+ "unique": False,
899
+ "input_required": False,
900
+
901
+ "min_cardinality": 1,
902
+ "max_cardinality": 1,
903
+ "level": "Advanced",
904
+
905
+ }
906
+ },
907
+ {
908
+ "Merge Update": {
909
+ "variable_name": "merge_update",
910
+ "inUpdate": True,
911
+ "attr_labels": "Merge",
912
+ "examples": "",
913
+ "default_value": "True",
914
+ "valid_values": "",
915
+ "existing_element": "",
916
+ "description": "If True, only those attributes specified in the update will be updated; If False, any attributes not provided during the update will be set to None.",
917
+
918
+ "generated": False,
919
+ "style": "Bool",
920
+ "user_specified": True,
921
+ "unique": False,
922
+ "input_required": False,
923
+
924
+ "min_cardinality": 0,
925
+ "max_cardinality": 1,
926
+ "level": "Advanced",
927
+
928
+ }
929
+ },
930
+ {
931
+ "Additional Properties": {
932
+ "variable_name": "additional_properties",
933
+ "inUpdate": True,
934
+ "attr_labels": "",
935
+ "examples": "",
936
+ "default_value": "",
937
+ "valid_values": "",
938
+ "existing_element": "",
939
+ "description": "Additional user defined values organized as name value pairs in a dictionary.",
940
+
941
+ "generated": False,
942
+ "style": "Dictionary",
943
+ "user_specified": True,
944
+ "unique": False,
945
+ "input_required": False,
946
+
947
+ "min_cardinality": 0,
948
+ "max_cardinality": -1,
949
+ "level": "Advanced",
950
+
951
+ }
952
+ },
953
+ {
954
+ "Extended Properties": {
955
+ "variable_name": "additional_properties",
956
+ "inUpdate": True,
957
+ "attr_labels": "",
958
+ "examples": "",
959
+ "default_value": "",
960
+ "valid_values": "",
961
+ "existing_element": "",
962
+ "description": "Additional user defined values organized as name value pairs in a dictionary.",
963
+ "generated": False,
964
+ "style": "Named DICT",
965
+ "user_specified": True,
966
+ "unique": False,
967
+ "input_required": False,
968
+ "min_cardinality": 0,
969
+ "max_cardinality": -1,
970
+ "level": "Invisible",
971
+ }
972
+ },
973
+ {
974
+ "External Source GUID": {
975
+ "variable_name": "external_source_guid",
976
+ "inUpdate": True,
977
+ "attr_labels": "",
978
+ "examples": "",
979
+ "default_value": "",
980
+ "valid_values": "",
981
+ "existing_element": "",
982
+ "description": "Identifier of an external source that is associated with this element.",
983
+
984
+ "generated": False,
985
+ "style": "Simple",
986
+ "user_specified": True,
987
+ "unique": False,
988
+ "input_required": False,
989
+
990
+ "min_cardinality": 0,
991
+ "max_cardinality": 1,
992
+ "level": "Advanced",
993
+
994
+ }
995
+ },
996
+ {
997
+ "External Source Name": {
998
+ "variable_name": "external_source_name",
999
+ "inUpdate": True,
1000
+ "attr_labels": "",
1001
+ "examples": "",
1002
+ "default_value": "",
1003
+ "valid_values": "",
1004
+ "existing_element": "",
1005
+ "description": "Name of an external element that is associated with this element.",
1006
+ "generated": False,
1007
+ "style": "Simple",
1008
+ "user_specified": True,
1009
+ "unique": False,
1010
+ "input_required": False,
1011
+ "min_cardinality": 0,
1012
+ "max_cardinality": 1,
1013
+ "level": "Advanced",
1014
+
1015
+ }
1016
+ },
1017
+ {
1018
+ "Journal Entry": {
1019
+ "variable_name": "journal_entry",
1020
+ "inUpdate": True,
1021
+ "attr_labels": "",
1022
+ "examples": "",
1023
+ "default_value": "",
1024
+ "valid_values": "",
1025
+ "existing_element": "",
1026
+ "description": "",
1027
+ "generated": False,
1028
+ "style": "Simple",
1029
+ "user_specified": True,
1030
+ "unique": False,
1031
+ "input_required": False,
1032
+
1033
+ "min_cardinality": 0,
1034
+ "max_cardinality": 1,
1035
+ "level": "Basic",
1036
+
1037
+ }
1038
+ },
1039
+ {
1040
+ "URL": {
1041
+ "variable_name": "url",
1042
+ "inUpdate": True,
1043
+ "attr_labels": "",
1044
+ "examples": "",
1045
+ "default_value": "",
1046
+ "valid_values": "",
1047
+ "existing_element": "",
1048
+ "description": "Link to supporting information",
1049
+
1050
+ "generated": False,
1051
+ "style": "Simple",
1052
+ "user_specified": True,
1053
+ "unique": False,
1054
+ "input_required": False,
1055
+
1056
+ "min_cardinality": 0,
1057
+ "max_cardinality": 1,
1058
+ "level": "Basic",
1059
+
1060
+ }
1061
+ },
1062
+ {
1063
+ "Search Keywords": {
1064
+ "variable_name": "search_keywords",
1065
+ "inUpdate": True,
1066
+ "attr_labels": "",
1067
+ "examples": "",
1068
+ "default_value": "",
1069
+ "valid_values": "",
1070
+ "existing_element": "",
1071
+ "description": "Keywords to facilitate finding the element",
1072
+
1073
+ "generated": False,
1074
+ "style": "Simple List",
1075
+ "user_specified": True,
1076
+ "unique": False,
1077
+ "input_required": False,
1078
+
1079
+ "min_cardinality": 0,
1080
+ "max_cardinality": 20,
1081
+ "level": "Basic",
1082
+
1083
+ }
1084
+ },
1085
+ {
1086
+ "Translation Details": {
1087
+ "variable_name": "translation_details",
1088
+ "inUpdate": True,
1089
+ "attr_labels": "",
1090
+ "examples": "",
1091
+ "default_value": "",
1092
+ "valid_values": "",
1093
+ "existing_element": "",
1094
+ "description": "Allow translation information for the element to be provided.",
1095
+ "generated": False,
1096
+ "style": "Named DICT",
1097
+ "user_specified": True,
1098
+ "unique": False,
1099
+ "input_required": False,
1100
+ "min_cardinality": 0,
1101
+ "max_cardinality": -1,
1102
+ "level": "Invisible",
1103
+ }
1104
+ },
1105
+ {
1106
+ "Supplementary Properties": {
1107
+ "variable_name": "supplementary_properties",
1108
+ "inUpdate": True,
1109
+ "attr_labels": "",
1110
+ "examples": "",
1111
+ "default_value": "",
1112
+ "valid_values": "",
1113
+ "existing_element": "",
1114
+ "description": "Provide supplementary information to the element using the structure of a glossary term",
1115
+ "generated": False,
1116
+ "style": "Named DICT",
1117
+ "user_specified": True,
1118
+ "unique": False,
1119
+ "input_required": False,
1120
+ "min_cardinality": 0,
1121
+ "max_cardinality": -1,
1122
+ "level": "Advanced",
1123
+ }
1124
+ },
1125
+ ]
1126
+ new_attributes.extend(default_upsert_attributes)
1127
+ return new_attributes
1128
+
1129
+
1130
+ def add_default_link_attributes(attributes: list[dict]) -> list[dict]:
1131
+ new_attributes = attributes
1132
+ default_link_attributes = [
1133
+ {
1134
+ "Effective Time": {
1135
+ "variable_name": "effective_time",
1136
+ "inUpdate": True,
1137
+ "attr_labels": "",
1138
+ "examples": "",
1139
+ "default_value": "",
1140
+ "valid_values": "",
1141
+ "existing_element": "",
1142
+ "description": "An ISO-8601 string representing the time to use for evaluating effectivity of the elements related to this one.",
1143
+
1144
+ "generated": False,
1145
+ "style": "Simple",
1146
+ "user_specified": True,
1147
+ "unique": False,
1148
+ "input_required": False,
1149
+
1150
+ "min_cardinality": 1,
1151
+ "max_cardinality": 1,
1152
+ "level": "Advanced",
1153
+
1154
+ }
1155
+ },
1156
+ {
1157
+ "Effective From": {
1158
+ "variable_name": "effective_from",
1159
+ "inUpdate": True,
1160
+ "attr_labels": "",
1161
+ "examples": "",
1162
+ "default_value": "",
1163
+ "valid_values": "",
1164
+ "existing_element": "",
1165
+ "description": "A string in ISO-8601 format that defines the when an element becomes effective (visible).",
1166
+
1167
+ "generated": False,
1168
+ "style": "Simple",
1169
+ "user_specified": True,
1170
+ "unique": False,
1171
+ "input_required": False,
1172
+
1173
+ "min_cardinality": 0,
1174
+ "max_cardinality": 1,
1175
+ "level": "Advanced",
1176
+
1177
+ }
1178
+ },
1179
+ {
1180
+ "Effective To": {
1181
+ "variable_name": "effective_to",
1182
+ "inUpdate": True,
1183
+ "attr_labels": "",
1184
+ "examples": "",
1185
+ "default_value": "",
1186
+ "valid_values": "",
1187
+ "existing_element": "",
1188
+ "description": "A string in ISO-8601 format that defines the when an element is no longer effective (visible).",
1189
+
1190
+ "generated": False,
1191
+ "style": "Simple",
1192
+ "user_specified": True,
1193
+ "unique": False,
1194
+ "input_required": False,
1195
+
1196
+ "min_cardinality": 1,
1197
+ "max_cardinality": 1,
1198
+ "level": "Advanced",
1199
+
1200
+ }
1201
+ },
1202
+ {
1203
+ "Extended Properties": {
1204
+ "variable_name": "additional_properties",
1205
+ "inUpdate": True,
1206
+ "attr_labels": "",
1207
+ "examples": "",
1208
+ "default_value": "",
1209
+ "valid_values": "",
1210
+ "existing_element": "",
1211
+ "description": "Additional user defined values organized as name value pairs in a dictionary.",
1212
+
1213
+ "generated": False,
1214
+ "style": "Dictionary",
1215
+ "user_specified": True,
1216
+ "unique": False,
1217
+ "input_required": False,
1218
+
1219
+ "min_cardinality": 0,
1220
+ "max_cardinality": -1,
1221
+ "level": "Invisible",
1222
+
1223
+ }
1224
+ }
1225
+
1226
+ ]
1227
+ new_attributes.extend(default_link_attributes)
1228
+ return new_attributes