pyegeria 5.2.1__py3-none-any.whl → 5.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.
Files changed (311) hide show
  1. commands/cat/.DS_Store +0 -0
  2. commands/cat/Dr-Egeria_md-orig.py +166 -0
  3. commands/cat/__init__.py +23 -0
  4. commands/cat/dr_egeria_jupyter.py +122 -0
  5. commands/cat/dr_egeria_md.py +247 -0
  6. {pyegeria/commands → commands}/cat/exp_list_glossaries.py +3 -4
  7. {pyegeria/commands → commands}/cat/get_asset_graph.py +4 -4
  8. {pyegeria/commands → commands}/cat/get_collection.py +8 -9
  9. {pyegeria/commands → commands}/cat/get_project_dependencies.py +6 -8
  10. {pyegeria/commands → commands}/cat/get_project_structure.py +6 -8
  11. {pyegeria/commands → commands}/cat/get_tech_type_elements.py +13 -15
  12. {pyegeria/commands → commands}/cat/glossary_actions.py +184 -34
  13. {pyegeria/commands → commands}/cat/list_assets.py +9 -6
  14. commands/cat/list_categories.py +192 -0
  15. {pyegeria/commands → commands}/cat/list_cert_types.py +6 -6
  16. {pyegeria/commands → commands}/cat/list_collections.py +62 -19
  17. commands/cat/list_data_structures.py +223 -0
  18. {pyegeria/commands → commands}/cat/list_deployed_catalogs.py +9 -8
  19. {pyegeria/commands → commands}/cat/list_deployed_database_schemas.py +10 -9
  20. {pyegeria/commands → commands}/cat/list_deployed_databases.py +9 -8
  21. pyegeria/commands/cat/list_servers_deployed_imp.py → commands/cat/list_deployed_servers.py +3 -3
  22. {pyegeria/commands → commands}/cat/list_glossaries.py +57 -15
  23. {pyegeria/commands → commands}/cat/list_projects.py +5 -5
  24. {pyegeria/commands → commands}/cat/list_tech_type_elements.py +3 -3
  25. {pyegeria/commands → commands}/cat/list_tech_types.py +4 -4
  26. {pyegeria/commands → commands}/cat/list_terms.py +93 -45
  27. {pyegeria/commands → commands}/cat/list_todos.py +3 -3
  28. {pyegeria/commands → commands}/cat/list_user_ids.py +9 -8
  29. {pyegeria/commands → commands}/cli/__init__.py +1 -1
  30. {pyegeria/commands → commands}/cli/egeria.py +513 -250
  31. {pyegeria/commands → commands}/cli/egeria_cat.py +128 -51
  32. {pyegeria/commands → commands}/cli/egeria_login_tui.py +15 -17
  33. {pyegeria/commands → commands}/cli/egeria_my.py +22 -15
  34. {pyegeria/commands → commands}/cli/egeria_ops.py +54 -55
  35. {pyegeria/commands → commands}/cli/egeria_tech.py +364 -152
  36. {pyegeria/commands → commands}/cli/ops_config.py +18 -11
  37. commands/my/__init__.py +22 -0
  38. {pyegeria/commands → commands}/my/list_my_profile.py +6 -8
  39. {pyegeria/commands → commands}/my/list_my_roles.py +4 -4
  40. {pyegeria/commands → commands}/my/monitor_my_todos.py +7 -7
  41. {pyegeria/commands → commands}/my/monitor_open_todos.py +7 -7
  42. {pyegeria/commands → commands}/my/todo_actions.py +3 -2
  43. commands/ops/__init__.py +23 -0
  44. {pyegeria/commands → commands}/ops/gov_server_actions.py +5 -4
  45. {pyegeria/commands → commands}/ops/list_archives.py +7 -6
  46. {pyegeria/commands → commands}/ops/list_catalog_targets.py +4 -4
  47. {pyegeria/commands → commands}/ops/load_archive.py +4 -2
  48. {pyegeria/commands → commands}/ops/monitor_asset_events.py +8 -7
  49. {pyegeria/commands → commands}/ops/monitor_engine_activity.py +5 -5
  50. {pyegeria/commands → commands}/ops/monitor_engine_activity_c.py +3 -3
  51. {pyegeria/commands → commands}/ops/monitor_gov_eng_status.py +3 -2
  52. {pyegeria/commands → commands}/ops/monitor_integ_daemon_status.py +23 -15
  53. {pyegeria/commands → commands}/ops/monitor_platform_status.py +5 -4
  54. {pyegeria/commands → commands}/ops/monitor_server_startup.py +7 -7
  55. {pyegeria/commands → commands}/ops/monitor_server_status.py +16 -11
  56. {pyegeria/commands → commands}/ops/orig_monitor_server_list.py +2 -2
  57. {pyegeria/commands → commands}/ops/orig_monitor_server_status.py +3 -3
  58. {pyegeria/commands → commands}/ops/refresh_integration_daemon.py +4 -4
  59. {pyegeria/commands → commands}/ops/restart_integration_daemon.py +3 -3
  60. {pyegeria/commands → commands}/ops/table_integ_daemon_status.py +3 -3
  61. commands/tech/__init__.py +22 -0
  62. commands/tech/generic_actions.py +74 -0
  63. {pyegeria/commands → commands}/tech/get_element_info.py +5 -7
  64. {pyegeria/commands → commands}/tech/get_guid_info.py +4 -5
  65. {pyegeria/commands → commands}/tech/get_tech_details.py +8 -9
  66. {pyegeria/commands → commands}/tech/get_tech_type_template.py +4 -4
  67. pyegeria/commands/tech/list_elements.py → commands/tech/list_all_om_type_elements.py +11 -10
  68. pyegeria/commands/tech/list_elements_x.py → commands/tech/list_all_om_type_elements_x.py +11 -12
  69. pyegeria/commands/tech/list_related_elements.py → commands/tech/list_all_related_elements.py +11 -9
  70. {pyegeria/commands → commands}/tech/list_anchored_elements.py +16 -16
  71. {pyegeria/commands → commands}/tech/list_asset_types.py +4 -4
  72. commands/tech/list_elements_by_classification_by_property_value.py +200 -0
  73. commands/tech/list_elements_by_property_value.py +180 -0
  74. commands/tech/list_elements_by_property_value_x.py +201 -0
  75. {pyegeria/commands → commands}/tech/list_elements_for_classification.py +11 -9
  76. {pyegeria/commands → commands}/tech/list_gov_action_processes.py +5 -6
  77. commands/tech/list_information_supply_chains.py +167 -0
  78. {pyegeria/commands → commands}/tech/list_registered_services.py +3 -3
  79. commands/tech/list_related_elements_with_prop_value.py +221 -0
  80. {pyegeria/commands → commands}/tech/list_related_specification.py +3 -3
  81. {pyegeria/commands → commands}/tech/list_relationship_types.py +4 -5
  82. {pyegeria/commands → commands}/tech/list_relationships.py +3 -3
  83. commands/tech/list_solution_blueprints.py +181 -0
  84. commands/tech/list_solution_components.py +185 -0
  85. commands/tech/list_solution_roles.py +184 -0
  86. {pyegeria/commands → commands}/tech/list_tech_templates.py +3 -3
  87. {pyegeria/commands → commands}/tech/list_valid_metadata_values.py +5 -6
  88. {pyegeria/commands → commands}/tech/table_tech_templates.py +16 -13
  89. {pyegeria/commands → commands}/tech/x_list_related_elements.py +6 -4
  90. md_processing/__init__.py +49 -0
  91. md_processing/data/commands.json +3252 -0
  92. md_processing/dr_egeria_inbox/archive/dr_egeria_intro.md +254 -0
  93. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_more_terms.md +696 -0
  94. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part1.md +254 -0
  95. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part2.md +298 -0
  96. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part3.md +608 -0
  97. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part4.md +94 -0
  98. md_processing/dr_egeria_inbox/archive/freddie_intro.md +284 -0
  99. md_processing/dr_egeria_inbox/archive/freddie_intro_orig.md +275 -0
  100. md_processing/dr_egeria_inbox/archive/test-term.md +110 -0
  101. md_processing/dr_egeria_inbox/cat_test.md +100 -0
  102. md_processing/dr_egeria_inbox/data_field.md +54 -0
  103. md_processing/dr_egeria_inbox/data_spec.md +77 -0
  104. md_processing/dr_egeria_inbox/data_spec_test.md +2406 -0
  105. md_processing/dr_egeria_inbox/data_test.md +86 -0
  106. md_processing/dr_egeria_inbox/dr_egeria_intro_categories.md +168 -0
  107. md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +280 -0
  108. md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +313 -0
  109. md_processing/dr_egeria_inbox/dr_egeria_intro_part3.md +1073 -0
  110. md_processing/dr_egeria_inbox/dr_egeria_isc1.md +44 -0
  111. md_processing/dr_egeria_inbox/glossary_creation_experiment.ipynb +341 -0
  112. md_processing/dr_egeria_inbox/glossary_test1.md +324 -0
  113. md_processing/dr_egeria_inbox/rel.md +8 -0
  114. md_processing/dr_egeria_inbox/sb.md +119 -0
  115. md_processing/dr_egeria_inbox/search_test.md +39 -0
  116. md_processing/dr_egeria_inbox/solution-components.md +154 -0
  117. md_processing/dr_egeria_inbox/solution_blueprints.md +118 -0
  118. md_processing/dr_egeria_inbox/synonym_test.md +42 -0
  119. md_processing/dr_egeria_inbox/t2.md +268 -0
  120. md_processing/dr_egeria_outbox/processed-2025-05-15 19:52-data_test.md +94 -0
  121. md_processing/dr_egeria_outbox/processed-2025-05-16 07:39-data_test.md +88 -0
  122. md_processing/dr_egeria_outbox/processed-2025-05-17 16:01-data_field.md +56 -0
  123. md_processing/dr_egeria_outbox/processed-2025-05-18 15:51-data_test.md +103 -0
  124. md_processing/dr_egeria_outbox/processed-2025-05-18 16:47-data_test.md +94 -0
  125. md_processing/dr_egeria_outbox/processed-2025-05-19 07:14-data_test.md +96 -0
  126. md_processing/dr_egeria_outbox/processed-2025-05-19 07:20-data_test.md +100 -0
  127. md_processing/dr_egeria_outbox/processed-2025-05-19 07:22-data_test.md +88 -0
  128. md_processing/dr_egeria_outbox/processed-2025-05-19 09:26-data_test.md +91 -0
  129. md_processing/dr_egeria_outbox/processed-2025-05-19 10:27-data_test.md +91 -0
  130. md_processing/dr_egeria_outbox/processed-2025-05-19 14:04-data_test.md +91 -0
  131. md_processing/md_commands/__init__.py +3 -0
  132. md_processing/md_commands/blueprint_commands.py +303 -0
  133. md_processing/md_commands/data_designer_commands.py +1182 -0
  134. md_processing/md_commands/glossary_commands.py +1144 -0
  135. md_processing/md_commands/project_commands.py +163 -0
  136. md_processing/md_processing_utils/__init__.py +4 -0
  137. md_processing/md_processing_utils/common_md_proc_utils.py +724 -0
  138. md_processing/md_processing_utils/common_md_utils.py +172 -0
  139. md_processing/md_processing_utils/extraction_utils.py +486 -0
  140. md_processing/md_processing_utils/md_processing_constants.py +128 -0
  141. md_processing/md_processing_utils/message_constants.py +19 -0
  142. pyegeria/.DS_Store +0 -0
  143. pyegeria/__init__.py +231 -146
  144. pyegeria/_client.py +36 -13
  145. pyegeria/_exceptions.py +55 -46
  146. pyegeria/_globals.py +11 -1
  147. pyegeria/_validators.py +5 -5
  148. pyegeria/asset_catalog_omvs.py +78 -21
  149. pyegeria/automated_curation_omvs.py +11 -6
  150. pyegeria/classification_manager_omvs.py +41 -37
  151. pyegeria/collection_manager_omvs.py +722 -705
  152. pyegeria/core_omag_server_config.py +1 -1
  153. pyegeria/create_tech_guid_lists.py +13 -13
  154. pyegeria/data_designer_omvs.py +5104 -0
  155. pyegeria/dr.egeria spec.md +9 -0
  156. pyegeria/egeria_cat_client.py +5 -8
  157. pyegeria/egeria_client.py +39 -24
  158. pyegeria/egeria_config_client.py +2 -1
  159. pyegeria/egeria_my_client.py +4 -4
  160. pyegeria/egeria_tech_client.py +40 -18
  161. pyegeria/feedback_manager_omvs.py +1 -1
  162. pyegeria/full_omag_server_config.py +5 -3
  163. pyegeria/glossary_browser_omvs.py +1915 -694
  164. pyegeria/glossary_manager_omvs.py +685 -1842
  165. pyegeria/m_test.py +118 -0
  166. pyegeria/md_processing_helpers.py +58 -0
  167. pyegeria/md_processing_utils.py +2147 -0
  168. pyegeria/md_processing_utils_orig.py +1103 -0
  169. pyegeria/mermaid_utilities.py +1194 -14
  170. pyegeria/metadata_explorer_omvs.py +5 -50
  171. pyegeria/my_profile_omvs.py +3 -2
  172. pyegeria/output_formatter.py +389 -0
  173. pyegeria/platform_services.py +5 -5
  174. pyegeria/project_manager_omvs.py +97 -18
  175. pyegeria/runtime_manager_omvs.py +8 -10
  176. pyegeria/server_operations.py +2 -2
  177. pyegeria/solution_architect_omvs.py +2156 -0
  178. pyegeria/template_manager_omvs.py +13 -13
  179. pyegeria/utils.py +3 -1
  180. pyegeria/valid_metadata_omvs.py +5 -4
  181. pyegeria/x_action_author_omvs.py +3 -6
  182. {pyegeria-5.2.1.dist-info → pyegeria-5.3.dist-info}/METADATA +9 -8
  183. pyegeria-5.3.dist-info/RECORD +196 -0
  184. {pyegeria-5.2.1.dist-info → pyegeria-5.3.dist-info}/WHEEL +1 -1
  185. pyegeria-5.3.dist-info/entry_points.txt +99 -0
  186. pyegeria/commands/README.md +0 -47
  187. pyegeria/commands/__init__.py +0 -22
  188. pyegeria/commands/cat/__init__.py +0 -1
  189. pyegeria/commands/doc/README.md +0 -145
  190. pyegeria/commands/doc/Visual Command Reference/README.md +0 -511
  191. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/asset-graph 2024-11-20 at 15.56.42.png +0 -0
  192. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/assets-in-domain 2024-11-20 at 15.49.55@2x.png +0 -0
  193. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/elements-of-type 2024-11-20 at 16.01.35.png +0 -0
  194. pyegeria/commands/doc/Visual Command Reference/cat/show/assets/tech-type-elements 2024-11-20 at 16.05.05.png +0 -0
  195. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png +0 -0
  196. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs-2024-11-20 at 16.17.43@2x.png +0 -0
  197. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-11-25 at 20.14.50@2x.png +0 -0
  198. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png +0 -0
  199. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-11-25 at 20.21.25@2x.png +0 -0
  200. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png +0 -0
  201. pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed_databases 2024-12-16 at 16.40.31@2x.png +0 -0
  202. pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-glossaries 2024-11-25 at 20.30.02.png +0 -0
  203. pyegeria/commands/doc/Visual Command Reference/cat/show/glossary/list-terms 2024-11-25 at 20.32.11.png +0 -0
  204. pyegeria/commands/doc/Visual Command Reference/cat/show/info/asset-types 2024-11-25 at 20.34.19@2x.png +0 -0
  205. pyegeria/commands/doc/Visual Command Reference/cat/show/info/certification-types 2024-11-25 at 20.37.07.png +0 -0
  206. pyegeria/commands/doc/Visual Command Reference/cat/show/info/collection-graph 2024-12-12 at 11.33.18@2x.png +0 -0
  207. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-collections 2024-12-10 at 14.25.51@2x.png +0 -0
  208. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-todos 2024-12-12 at 11.46.30@2x.png +0 -0
  209. pyegeria/commands/doc/Visual Command Reference/cat/show/info/list-user-ids 2024-12-12 at 11.51.09@2x.png +0 -0
  210. pyegeria/commands/doc/Visual Command Reference/cat/show/info/tech-types 2024-12-12 at 11.37.20@2x.png +0 -0
  211. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_dependencies 2024-12-14 at 16.24.39@2x.png +0 -0
  212. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/project_structure 2024-12-14 at 16.21.35@2x.png +0 -0
  213. pyegeria/commands/doc/Visual Command Reference/cat/show/projects/projects 2024-12-14 at 16.18.10@2x.png +0 -0
  214. pyegeria/commands/doc/Visual Command Reference/hey_egeria tui 2024-12-16 at 16.58.22@2x.png +0 -0
  215. pyegeria/commands/doc/Visual Command Reference/my/show/my_profile 2024-12-14 at 16.29.27@2x.png +0 -0
  216. pyegeria/commands/doc/Visual Command Reference/my/show/my_roles 2024-12-14 at 16.32.10@2x.png +0 -0
  217. pyegeria/commands/doc/Visual Command Reference/my/show/my_todos 2024-12-15 at 16.24.13@2x.png +0 -0
  218. pyegeria/commands/doc/Visual Command Reference/my/show/open_todos 2024-12-14 at 16.36.12@2x.png +0 -0
  219. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/list_engine_activity compressed 2024-12-15 at 16.48.48@2x.png +0 -0
  220. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity 2024-12-15 at 16.32.55@2x.png +0 -0
  221. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity compressed 2024-12-15 at 16.38.29@2x.png +0 -0
  222. pyegeria/commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_status 2024-12-15 at 16.51.26.jpeg +0 -0
  223. pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_daemon_status 2024-12-15 at 16.57.12@2x.png +0 -0
  224. pyegeria/commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_targets 2024-12-15 at 17.02.19@2x.png +0 -0
  225. pyegeria/commands/doc/Visual Command Reference/ops/show/platforms/monitor_platform_status 2024-12-15 at 19.53.18@2x.png +0 -0
  226. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status 2024-12-15 at 19.59.39@2x.png +0 -0
  227. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status full 2024-12-15 at 20.01.57@2x.png +0 -0
  228. pyegeria/commands/doc/Visual Command Reference/ops/show/servers/monitor_startup_servers 2024-12-15 at 19.56.07@2x.png +0 -0
  229. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_anchored_elements 2024-12-15 at 21.25.41@2x.png +0 -0
  230. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/get_elements_of_om_type 2024-12-16 at 14.39.59@2x.png +0 -0
  231. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/info_for_guid 2024-12-16 at 11.35.29@2x.png +0 -0
  232. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type 2024-12-16 at 14.24.18@2x.png +0 -0
  233. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type extended 2024-12-16 at 14.28.46@2x.png +0 -0
  234. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/list_elements_of_om_type_by_classification 2024-12-16 at 14.35.26@2x.png +0 -0
  235. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/related_elements 2024-12-16 at 14.55.01@2x.png +0 -0
  236. pyegeria/commands/doc/Visual Command Reference/tech/show/elements/show_related_specifications 2024-12-16 at 15.04.55@2x.png +0 -0
  237. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/asset_types 2024-12-16 at 15.10.16@2x.png +0 -0
  238. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/detailed_governance_action_processes 2024-12-16 at 15.16.26@2x.png +0 -0
  239. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/governance_action_processes 2024-12-16 at 15.13.01@2x.png +0 -0
  240. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/registered_services 2024-12-16 at 16.44.54@2x.png +0 -0
  241. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png +0 -0
  242. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png +0 -0
  243. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-info/valid_metadata_values 2024-12-16 at 15.31.56@2x.png +0 -0
  244. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_tech_type_template_specs 2024-12-16 at 16.03.22@2x.png +0 -0
  245. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/list_technology_types 2024-12-16 at 15.39.20@2x.png +0 -0
  246. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_details 2024-12-16 at 15.37.21@2x.png +0 -0
  247. pyegeria/commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_templates 2024-12-16 at 16.11.48@2x.png +0 -0
  248. pyegeria/commands/doc/glossary/basic-glossary-tui.md +0 -109
  249. pyegeria/commands/doc/glossary/images/delete-glossary-step1 2024-11-06 at 15.47.23@2x.png +0 -0
  250. pyegeria/commands/doc/glossary/images/delete-glossary-step2 2024-11-06 at 15.51.29@2x.png +0 -0
  251. pyegeria/commands/doc/glossary/images/delete-glossary-step3 2024-11-06 at 15.53.19@2x.png +0 -0
  252. pyegeria/commands/doc/glossary/images/delete-glossary-step4 2024-11-06 at 15.55.11@2x.png +0 -0
  253. pyegeria/commands/doc/glossary/images/out-create-glossary example 2024-11-05 at 20.38.04@2x.png +0 -0
  254. pyegeria/commands/doc/glossary/images/out-create-term 2024-11-06 at 20.48.29.png +0 -0
  255. pyegeria/commands/doc/glossary/images/out-delete-term 2024-11-07 at 03.57.25.png +0 -0
  256. pyegeria/commands/doc/glossary/images/out-display-terms-for-glossary-test 2024-11-06 at 20.51.28.png +0 -0
  257. pyegeria/commands/doc/glossary/images/out-export-example 2024-11-07 at 09.54.57.png +0 -0
  258. pyegeria/commands/doc/glossary/images/out-exported-terms 2024-11-06 at 21.06.32.png +0 -0
  259. pyegeria/commands/doc/glossary/images/out-glossary-list example 2024-11-05 at 20.41.02@2x.png +0 -0
  260. pyegeria/commands/doc/glossary/images/out-import-terms 2024-11-07 at 08.15.18.png +0 -0
  261. pyegeria/commands/doc/glossary/images/out-list-all-terms 2024-11-06 at 16.22.20@2x.png +0 -0
  262. pyegeria/commands/doc/glossary/images/out-list-terms-for-example 2024-11-06 at 16.40.12.png +0 -0
  263. pyegeria/commands/doc/glossary/images/out-list-terms-second 2024-11-06 at 16.45.13.png +0 -0
  264. pyegeria/commands/doc/glossary/images/out-pipx install pyegeria 2024-11-10 at 18.12.21.png +0 -0
  265. pyegeria/commands/doc/glossary/images/out-server-status-full 2024-11-10 at 18.25.14.png +0 -0
  266. pyegeria/commands/doc/glossary/images/out-servers-status 2024-11-10 at 18.15.42.png +0 -0
  267. pyegeria/commands/doc/glossary/images/out-upsert-import 2024-11-07 at 19.37.00.png +0 -0
  268. pyegeria/commands/doc/glossary/images/tui-2024-11-10 at 18.26.29.png +0 -0
  269. pyegeria/commands/doc/glossary/images/tui-create-glossary example 2024-11-05 at 20.34.24@2x.png +0 -0
  270. pyegeria/commands/doc/glossary/images/tui-create-term 2024-11-06 at 20.46.35.png +0 -0
  271. pyegeria/commands/doc/glossary/images/tui-delete-term 2024-11-07 at 03.51.57.png +0 -0
  272. pyegeria/commands/doc/glossary/images/tui-display-terms-for-example 2024-11-06 at 20.56.49.png +0 -0
  273. pyegeria/commands/doc/glossary/images/tui-export-example 2024-11-07 at 09.52.59.png +0 -0
  274. pyegeria/commands/doc/glossary/images/tui-hey-egeria 2024-11-10 at 18.31.01.png +0 -0
  275. pyegeria/commands/doc/glossary/images/tui-import-upsert-example 2024-11-07 at 10.08.37.png +0 -0
  276. pyegeria/commands/doc/glossary/images/tui-list-terms-second 2024-11-06 at 16.46.34.png +0 -0
  277. pyegeria/commands/doc/glossary/images/tui-load-archive.png +0 -0
  278. pyegeria/commands/doc/glossary/images/tui-server-status-full 2024-11-10 at 19.14.36.png +0 -0
  279. pyegeria/commands/doc/glossary/images/tui-show-glossaries 2024-11-07 at 20.00.05.png +0 -0
  280. pyegeria/commands/doc/glossary/images/tui-show-glossary-terms 2024-11-05 at 19.37.53@2x.png +0 -0
  281. pyegeria/commands/doc/glossary/images/tui-upsert 2024-11-07 at 11.49.04.png +0 -0
  282. pyegeria/commands/doc/glossary/images/upsert-example.om-terms 2024-11-07 at 11.44.05.png +0 -0
  283. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/README.md +0 -346
  284. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/CleanShot 2024-11-18 at 21.32.03@2x.png +0 -0
  285. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731421782704.png +0 -0
  286. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731422134920.png +0 -0
  287. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria 2024-11-12 at 20.38.43.png +0 -0
  288. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria cat 2024-11-12 at 21.41.43.png +0 -0
  289. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-integ-status-list 2024-11-12 at 16.45.26.png +0 -0
  290. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-integ-status-live 2024-11-12 at 16.44.12@2x.png +0 -0
  291. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-server-status 2024-11-10 at 18.15.42@2x.png +0 -0
  292. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/out-server-status-full 2024-11-10 at 18.25.14@2x.png +0 -0
  293. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/short-cut commands 2024-11-12 at 22.22.13.png +0 -0
  294. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-hey-egeria.png +0 -0
  295. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-integration-status-paging.png +0 -0
  296. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-load-archive 2024-11-10 at 19.19.09@2x.png +0 -0
  297. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-show-server-status 2024-11-10 at 18.52.01@2x.png +0 -0
  298. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-show-server-status-full 2024-11-10.png +0 -0
  299. pyegeria/commands/doc/hey_egeria: a pyegeria command line interface/images/tui-status-paging 2024-11-12 at 16.26.14@2x.png +0 -0
  300. pyegeria/commands/ops/__init__.py +0 -22
  301. pyegeria/commands/tech/__init__.py +0 -0
  302. pyegeria-5.2.1.dist-info/RECORD +0 -232
  303. pyegeria-5.2.1.dist-info/entry_points.txt +0 -81
  304. {pyegeria/commands → commands}/cat/README.md +0 -0
  305. {pyegeria/commands → commands}/cli/txt_custom_v2.tcss +0 -0
  306. {pyegeria/commands → commands}/my/README.md +0 -0
  307. {pyegeria/commands → commands}/ops/README.md +0 -0
  308. {pyegeria/commands → commands}/ops/x_engine_actions.py +0 -0
  309. {pyegeria/commands → commands}/tech/README.md +0 -0
  310. /pyegeria/commands/my/__init__.py → /md_processing/dr_egeria_inbox/t1.md +0 -0
  311. {pyegeria-5.2.1.dist-info → pyegeria-5.3.dist-info}/LICENSE +0 -0
@@ -6,25 +6,42 @@ This module contains an initial version of the glossary_manager omvs module. The
6
6
  added in subsequent versions of the glossary_omvs module.
7
7
 
8
8
  """
9
+
9
10
  import asyncio
11
+ import csv
10
12
  import os
11
13
  import time
12
- import csv
13
14
  from datetime import datetime
14
15
  from typing import List
15
16
 
16
- from pyegeria import InvalidParameterException
17
-
18
- # import json
19
17
  from pyegeria._client import Client
20
- from pyegeria._validators import (
21
- validate_name,
22
- validate_guid,
23
- validate_search_string,
24
- )
18
+ from pyegeria._exceptions import InvalidParameterException
19
+ from pyegeria._globals import NO_TERMS_FOUND
20
+ from pyegeria._validators import validate_guid, validate_name
25
21
  from pyegeria.glossary_browser_omvs import GlossaryBrowser
26
22
  from pyegeria.utils import body_slimmer
27
23
 
24
+ def query_seperator(current_string):
25
+ if current_string == "":
26
+ return "?"
27
+ else:
28
+ return "&"
29
+
30
+
31
+ "params are in the form of [(paramName, value), (param2Name, value)] if the value is not None, it will be added to the query string"
32
+
33
+
34
+ def query_string(params):
35
+ result = ""
36
+ for i in range(len(params)):
37
+ if params[i][1] is not None:
38
+ result = f"{result}{query_seperator(result)}{params[i][0]}={params[i][1]}"
39
+ return result
40
+
41
+
42
+ def base_path(client, view_server: str):
43
+ return f"{client.platform_url}/servers/{view_server}/api/open-metadata/classification-manager"
44
+
28
45
 
29
46
  class GlossaryManager(GlossaryBrowser):
30
47
  """
@@ -104,7 +121,7 @@ class GlossaryManager(GlossaryBrowser):
104
121
  "class": "ReferenceableRequestBody",
105
122
  "elementProperties": {
106
123
  "class": "GlossaryProperties",
107
- "qualifiedName": f"Glossary:{display_name}",
124
+ "qualifiedName": self.__create_qualified_name__("Glossary", display_name),
108
125
  "displayName": display_name,
109
126
  "description": description,
110
127
  "language": language,
@@ -147,36 +164,38 @@ class GlossaryManager(GlossaryBrowser):
147
164
  )
148
165
  return response
149
166
 
150
- async def _async_delete_glossary(self, glossary_guid: str) -> None:
167
+ async def _async_delete_glossary(self, glossary_guid: str, cascade:bool = False) -> None:
151
168
  """Delete glossary. Async version.
152
169
 
153
170
  Parameters
154
171
  ----------
155
172
  glossary_guid: str
156
173
  The ID of the glossary to delete.
157
-
174
+ cascade: bool, optional, default = False
175
+ If true, then delete all terms and categories in the glossary as well.
158
176
 
159
177
  Returns
160
178
  -------
161
179
  None
162
180
 
163
181
  """
164
-
182
+ cascade_str = str(cascade).lower()
165
183
  url = (
166
184
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
167
- f"{glossary_guid}/remove"
185
+ f"{glossary_guid}/remove?cascadedDelete={cascade_str}"
168
186
  )
169
187
 
170
188
  await self._async_make_request("POST", url)
171
- return
172
189
 
173
- def delete_glossary(self, glossary_guid: str) -> None:
174
- """Create a new glossary.
190
+ def delete_glossary(self, glossary_guid: str, cascade: bool = False) -> None:
191
+ """Delete a new glossary.
175
192
 
176
193
  Parameters
177
194
  ----------
178
195
  glossary_guid: str
179
196
  The ID of the glossary to delete.
197
+ cascade: bool, optional, default = False
198
+ If true, then delete all terms and categories in the glossary as well.
180
199
 
181
200
 
182
201
  Returns
@@ -185,8 +204,7 @@ class GlossaryManager(GlossaryBrowser):
185
204
 
186
205
  """
187
206
  loop = asyncio.get_event_loop()
188
- response = loop.run_until_complete(self._async_delete_glossary(glossary_guid))
189
- return response
207
+ loop.run_until_complete(self._async_delete_glossary(glossary_guid, cascade))
190
208
 
191
209
  async def _async_update_glossary(
192
210
  self,
@@ -243,7 +261,6 @@ class GlossaryManager(GlossaryBrowser):
243
261
  )
244
262
 
245
263
  await self._async_make_request("POST", url, body_slimmer(body))
246
- return
247
264
 
248
265
  def update_glossary(
249
266
  self,
@@ -300,210 +317,41 @@ class GlossaryManager(GlossaryBrowser):
300
317
  for_duplicate_processing,
301
318
  )
302
319
  )
303
- return
304
320
 
305
321
  #
306
322
  # Glossaries
307
323
  #
308
324
 
309
- async def _async_find_glossaries(
310
- self,
311
- search_string: str,
312
- effective_time: str = None,
313
- starts_with: bool = False,
314
- ends_with: bool = False,
315
- ignore_case: bool = False,
316
- for_lineage: bool = False,
317
- for_duplicate_processing: bool = False,
318
- type_name: str = None,
319
- start_from: int = 0,
320
- page_size: int = None,
321
- ) -> list | str:
322
- """Retrieve the list of glossary metadata elements that contain the search string. Async version.
323
- The search string is located in the request body and is interpreted as a plain string.
324
- The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
325
-
326
- Parameters
327
- ----------
328
- search_string: str,
329
- Search string to use to find matching glossaries. If the search string is '*' then all glossaries returned.
330
-
331
- effective_time: str, [default=None], optional
332
- Effective time of the query. If not specified will default to any time. Time format is
333
- "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
334
-
335
- starts_with : bool, [default=False], optional
336
- Starts with the supplied string.
337
- ends_with : bool, [default=False], optional
338
- Ends with the supplied string
339
- ignore_case : bool, [default=False], optional
340
- Ignore case when searching
341
- for_lineage : bool, [default=False], optional
342
-
343
- for_duplicate_processing : bool, [default=False], optional
344
- type_name: str, [default=None], optional
345
- An optional parameter indicating the subtype of the glossary to filter by.
346
- Values include 'ControlledGlossary', 'EditingGlossary', and 'StagingGlossary'
347
- start_from: int, [default=0], optional
348
- When multiple pages of results are available, the page number to start from.
349
- page_size: int, [default=None]
350
- The number of items to return in a single page. If not specified, the default will be taken from
351
- the class instance.
352
- Returns
353
- -------
354
- List | str
355
-
356
- A list of glossary definitions active in the server.
357
-
358
- Raises
359
- ------
360
-
361
- InvalidParameterException
362
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
363
- PropertyServerException
364
- Raised by the server when an issue arises in processing a valid request
365
- NotAuthorizedException
366
- The principle specified by the user_id does not have authorization for the requested action
367
-
368
- """
369
-
370
- if page_size is None:
371
- page_size = self.page_size
372
- starts_with_s = str(starts_with).lower()
373
- ends_with_s = str(ends_with).lower()
374
- ignore_case_s = str(ignore_case).lower()
375
- for_lineage_s = str(for_lineage).lower()
376
- for_duplicate_processing_s = str(for_duplicate_processing).lower()
377
-
378
- validate_search_string(search_string)
379
-
380
- if search_string == "*":
381
- search_string = None
382
-
383
- body = {
384
- "class": "SearchStringRequestBody",
385
- "searchString": search_string,
386
- "effectiveTime": effective_time,
387
- "typeName": type_name,
388
- }
389
- body = body_slimmer(body)
390
- # print(f"\n\nBody is: \n{body}")
391
-
392
- url = (
393
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
394
- f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
395
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}&forLineage={for_lineage_s}&"
396
- f"forDuplicateProcessing={for_duplicate_processing_s}"
397
- )
398
-
399
- response = await self._async_make_request("POST", url, body)
400
- return response.json().get("elementList", "No Glossaries found")
401
-
402
- def find_glossaries(
403
- self,
404
- search_string: str,
405
- effective_time: str = None,
406
- starts_with: bool = False,
407
- ends_with: bool = False,
408
- ignore_case: bool = False,
409
- for_lineage: bool = False,
410
- for_duplicate_processing: bool = False,
411
- type_name: str = None,
412
- start_from: int = 0,
413
- page_size: int = None,
414
- ) -> list | str:
415
- """Retrieve the list of glossary metadata elements that contain the search string.
416
- The search string is located in the request body and is interpreted as a plain string.
417
- The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
418
-
419
- Parameters
420
- ----------
421
- search_string: str,
422
- Search string to use to find matching glossaries. If the search string is '*' then all glossaries returned.
423
-
424
- effective_time: str, [default=None], optional
425
- Effective time of the query. If not specified will default to any time. Time format is
426
- "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
427
-
428
- starts_with : bool, [default=False], optional
429
- Starts with the supplied string.
430
- ends_with : bool, [default=False], optional
431
- Ends with the supplied string
432
- ignore_case : bool, [default=False], optional
433
- Ignore case when searching
434
- for_lineage : bool, [default=False], optional
435
- Indicates the search is for lineage.
436
- for_duplicate_processing : bool, [default=False], optional
437
- type_name: str, [default=None], optional
438
- An optional parameter indicating the subtype of the glossary to filter by.
439
- Values include 'ControlledGlossary', 'EditingGlossary', and 'StagingGlossary'
440
- start_from: int, [default=0], optional
441
- When multiple pages of results are available, the page number to start from.
442
- page_size: int, [default=None]
443
- The number of items to return in a single page. If not specified, the default will be taken from
444
- the class instance.
445
- Returns
446
- -------
447
- List | str
448
-
449
- A list of glossary definitions active in the server.
450
-
451
- Raises
452
- ------
453
-
454
- InvalidParameterException
455
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
456
- PropertyServerException
457
- Raised by the server when an issue arises in processing a valid request
458
- NotAuthorizedException
459
- The principle specified by the user_id does not have authorization for the requested action
460
325
 
461
- """
462
- loop = asyncio.get_event_loop()
463
- response = loop.run_until_complete(
464
- self._async_find_glossaries(
465
- search_string,
466
- effective_time,
467
- starts_with,
468
- ends_with,
469
- ignore_case,
470
- for_lineage,
471
- for_duplicate_processing,
472
- type_name,
473
- start_from,
474
- page_size,
475
- )
476
- )
477
326
 
478
- return response
479
327
 
480
- async def _async_get_glossaries_by_name(
328
+ #
329
+ # Glossary Categories
330
+ #
331
+ async def _async_create_category(
481
332
  self,
482
- glossary_name: str,
483
- effective_time: str = None,
484
- start_from: int = 0,
485
- page_size: int = None,
486
- ) -> dict | str:
487
- """Retrieve the list of glossary metadata elements with an exactly matching qualified or display name.
488
- There are no wildcards supported on this request.
333
+ glossary_guid: str,
334
+ display_name: str,
335
+ description: str,
336
+ is_root_category: bool = False,
337
+ ) -> str:
338
+ """Create a new category within the specified glossary. Async Version.
489
339
 
490
340
  Parameters
491
341
  ----------
492
- glossary_name: str,
493
- Name of the glossary to be retrieved
494
- effective_time: datetime, [default=None], optional
495
- Effective time of the query. If not specified will default to any effective time. Time format is
496
- "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
342
+ glossary_guid: str,
343
+ Unique identifier for the glossary.
344
+ display_name: str,
345
+ Display name for the glossary category. Will be used as the base for a constructed unique qualified name.
346
+ description: str,
347
+ Description for the category.
348
+ is_root_category: bool, [default=False], optional
349
+ Is this category a root category?
497
350
 
498
- start_from: int, [default=0], optional
499
- When multiple pages of results are available, the page number to start from.
500
- page_size: int, [default=None]
501
- The number of items to return in a single page. If not specified, the default will be taken from
502
- the class instance.
503
351
 
504
352
  Returns
505
353
  -------
506
- None
354
+ A string with the GUID of the new category..
507
355
 
508
356
  Raises
509
357
  ------
@@ -519,52 +367,49 @@ class GlossaryManager(GlossaryBrowser):
519
367
  invalid or make the new call invalid.
520
368
  """
521
369
 
522
- if page_size is None:
523
- page_size = self.page_size
524
- validate_name(glossary_name)
525
-
526
- if effective_time is None:
527
- body = {"name": glossary_name}
528
- else:
529
- body = {"name": glossary_name, "effectiveTime": effective_time}
530
-
531
370
  url = (
532
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
533
- f"by-name?startFrom={start_from}&pageSize={page_size}"
371
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
372
+ f"{glossary_guid}/categories?isRootCategory={is_root_category}"
534
373
  )
535
-
374
+ body = {
375
+ "class": "ReferenceableRequestBody",
376
+ "elementProperties": {
377
+ "class": "GlossaryCategoryProperties",
378
+ "qualifiedName": self.__create_qualified_name__("Category", display_name),
379
+ "displayName": display_name,
380
+ "description": description,
381
+ },
382
+ }
536
383
  response = await self._async_make_request("POST", url, body)
537
- return response.json().get("elementList", "No glossaries found")
384
+ return response.json().get("guid", None)
538
385
 
539
- def get_glossaries_by_name(
386
+ def create_category(
540
387
  self,
541
- glossary_name: str,
542
- effective_time: str = None,
543
- start_from: int = 0,
544
- page_size: int = None,
545
- ) -> dict | str:
546
- """Retrieve the list of glossary metadata elements with an exactly matching qualified or display name.
547
- There are no wildcards supported on this request.
388
+ glossary_guid: str,
389
+ display_name: str,
390
+ description: str,
391
+ is_root_category: bool = False,
392
+ ) -> str:
393
+ """Create a new category within the specified glossary.
548
394
 
549
395
  Parameters
550
396
  ----------
551
- glossary_name: str,
552
- Name of the glossary to be retrieved
553
- effective_time: datetime, [default=None], optional
554
- Effective time of the query. If not specified will default to any effective time.
555
-
556
- start_from: int, [default=0], optional
557
- When multiple pages of results are available, the page number to start from.
558
- page_size: int, [default=None]
559
- The number of items to return in a single page. If not specified, the default will be taken from
560
- he class instance.
397
+ glossary_guid: str,
398
+ Unique identifier for the glossary.
399
+ display_name: str,
400
+ Display name for the glossary category. Will be used as the base for a constructed unique qualified name.
401
+ description: str,
402
+ Description for the category.
403
+ is_root_category: bool, [default=False], optional
404
+ Is this category a root category?
561
405
 
562
406
  Returns
563
407
  -------
564
- None
408
+ A string with the GUID of the new category..
565
409
 
566
410
  Raises
567
411
  ------
412
+
568
413
  InvalidParameterException
569
414
  If the client passes incorrect parameters on the request - such as bad URLs or invalid values
570
415
  PropertyServerException
@@ -577,36 +422,43 @@ class GlossaryManager(GlossaryBrowser):
577
422
  """
578
423
  loop = asyncio.get_event_loop()
579
424
  response = loop.run_until_complete(
580
- self._async_get_glossaries_by_name(
581
- glossary_name, effective_time, start_from, page_size
582
- )
425
+ self._async_create_category(glossary_guid, display_name, description, is_root_category)
583
426
  )
584
427
  return response
585
428
 
586
- #
587
- # Glossary Categories
588
- #
589
- async def _async_create_category(
429
+ async def _async_update_category(
590
430
  self,
591
- glossary_guid: str,
431
+ category_guid: str,
592
432
  display_name: str,
593
433
  description: str,
594
- ) -> str:
434
+ qualified_name: str = None,
435
+ effective_time: str = None,
436
+ update_description: str = None,
437
+ is_merge_update: bool = True,
438
+ ) :
595
439
  """Create a new category within the specified glossary. Async Version.
596
440
 
597
441
  Parameters
598
442
  ----------
599
- glossary_guid: str,
443
+ category_guid: str,
600
444
  Unique identifier for the glossary.
601
445
  display_name: str,
602
446
  Display name for the glossary category. Will be used as the base for a constructed unique qualified name.
603
447
  description: str,
604
448
  Description for the category.
449
+ qualified_name: str, [default=None], optional
450
+ Unique identifier for the glossary category. Must be specified if not a merge update.
451
+ effective_time: datetime, [default=None], optional
452
+ Time when the category becomes effective.
453
+ update_description: str, [default=None], optional
454
+ Description of the update to the category.
455
+ is_merge_update: bool, [default=True], optional
456
+ Should this be a merge or a replace?
605
457
 
606
458
 
607
459
  Returns
608
460
  -------
609
- A string with the GUID of the new category..
461
+ None
610
462
 
611
463
  Raises
612
464
  ------
@@ -621,28 +473,35 @@ class GlossaryManager(GlossaryBrowser):
621
473
  Raised when configuration parameters passed on earlier calls turn out to be
622
474
  invalid or make the new call invalid.
623
475
  """
624
-
476
+ if (not is_merge_update and qualified_name is None):
477
+ raise ValueError('qualified_name must be specified for a replace update')
625
478
  url = (
626
479
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
627
- f"{glossary_guid}/categories"
480
+ f"categories/{category_guid}/update?isMergeUpdate={is_merge_update}"
628
481
  )
629
482
  body = {
630
- "class": "ReferenceableRequestBody",
483
+ "class": "ReferenceableUpdateRequestBody",
484
+ "effectiveTime": effective_time,
485
+ "updateDescription": update_description,
631
486
  "elementProperties": {
632
487
  "class": "GlossaryCategoryProperties",
633
- "qualifiedName": f"GlossaryCategory-{display_name}-{time.asctime()}",
488
+ "qualifiedName": qualified_name ,
634
489
  "displayName": display_name,
635
- "description": description,
490
+ "description": description
636
491
  },
637
492
  }
638
- response = await self._async_make_request("POST", url, body)
493
+ response = await self._async_make_request("POST", url, body_slimmer(body))
639
494
  return response.json().get("guid", None)
640
495
 
641
- def create_category(
496
+ def update_category(
642
497
  self,
643
498
  glossary_guid: str,
644
499
  display_name: str,
645
500
  description: str,
501
+ qualified_name: str = None,
502
+ effective_time: str = None,
503
+ update_description: str = None,
504
+ is_merge_update: bool = True,
646
505
  ) -> str:
647
506
  """Create a new category within the specified glossary.
648
507
 
@@ -654,11 +513,19 @@ class GlossaryManager(GlossaryBrowser):
654
513
  Display name for the glossary category. Will be used as the base for a constructed unique qualified name.
655
514
  description: str,
656
515
  Description for the category.
516
+ qualified_name: str, [default=None], optional
517
+ Unique identifier for the glossary category. Must be specified if not a merge update.
518
+ effective_time: datetime, [default=None], optional
519
+ Time when the category becomes effective.
520
+ update_description: str, [default=None], optional
521
+ Description of the update to the category.
522
+ is_merge_update: bool, [default=True], optional
523
+ Should this be a merge or a replace?
657
524
 
658
525
 
659
526
  Returns
660
527
  -------
661
- A string with the GUID of the new category..
528
+ None
662
529
 
663
530
  Raises
664
531
  ------
@@ -675,30 +542,26 @@ class GlossaryManager(GlossaryBrowser):
675
542
  """
676
543
  loop = asyncio.get_event_loop()
677
544
  response = loop.run_until_complete(
678
- self._async_create_category(glossary_guid, display_name, description)
545
+ self._async_update_category(glossary_guid, display_name, description,
546
+ qualified_name, effective_time, update_description, is_merge_update)
679
547
  )
680
548
  return response
681
549
 
682
- async def _async_get_glossary_for_category(
550
+
551
+ async def _async_delete_category(
683
552
  self,
684
- glossary_category_guid: str,
685
- effective_time: str = None,
686
- ) -> dict | str:
687
- """Retrieve the glossary metadata element for the requested category. The optional request body allows you to
688
- specify that the glossary element should only be returned if it was effective at a particular time.
553
+ category_guid: str,
554
+ ) -> None:
555
+ """Delete a category. Async Version.
689
556
 
690
557
  Parameters
691
558
  ----------
692
- glossary_category_guid: str,
693
- Unique identifier for the glossary category.
694
- effective_time: datetime, [default=None], optional
695
- Effective time of the query. If not specified will default to any effective time. Time format is
696
- "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
697
-
559
+ category_guid: str,
560
+ Unique identifier for the category.
698
561
 
699
562
  Returns
700
563
  -------
701
- A dict structure with the glossary metadata element for the requested category.
564
+ None
702
565
 
703
566
  Raises
704
567
  ------
@@ -714,39 +577,28 @@ class GlossaryManager(GlossaryBrowser):
714
577
  invalid or make the new call invalid.
715
578
  """
716
579
 
717
- body = {
718
- "class": "EffectiveTimeQueryRequestBody",
719
- "effectiveTime": effective_time,
720
- }
721
-
722
580
  url = (
723
581
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
724
- f"for-category/{glossary_category_guid}/retrieve"
582
+ f"categories/{category_guid}/remove"
725
583
  )
726
584
 
727
- response = await self._async_make_request("POST", url, body)
728
- return response.json()
585
+ await self._async_make_request("POST", url)
586
+
729
587
 
730
- def get_glossary_for_category(
588
+ def delete_category(
731
589
  self,
732
- glossary_category_guid: str,
733
- effective_time: str = None,
734
- ) -> dict | str:
735
- """Retrieve the glossary metadata element for the requested category. The optional request body allows you to
736
- specify that the glossary element should only be returned if it was effective at a particular time.
590
+ category_guid: str,
591
+ ) -> None:
592
+ """Delete a category.
737
593
 
738
594
  Parameters
739
595
  ----------
740
- glossary_category_guid: str,
741
- Unique identifier for the glossary category.
742
- effective_time: datetime, [default=None], optional
743
- Effective time of the query. If not specified will default to any effective time. Time format is
744
- "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
745
-
596
+ category_guid: str,
597
+ Unique identifier for the category.
746
598
 
747
599
  Returns
748
600
  -------
749
- A dict structure with the glossary metadata element for the requested category.
601
+ None
750
602
 
751
603
  Raises
752
604
  ------
@@ -762,53 +614,25 @@ class GlossaryManager(GlossaryBrowser):
762
614
  invalid or make the new call invalid.
763
615
  """
764
616
  loop = asyncio.get_event_loop()
765
- response = loop.run_until_complete(
766
- self._async_get_glossary_for_category(
767
- glossary_category_guid, effective_time
768
- )
617
+ loop.run_until_complete(
618
+ self._async_delete_category(category_guid)
769
619
  )
770
- return response
771
620
 
772
- async def _async_find_glossary_categories(
621
+ async def _async_set_parent_category(
773
622
  self,
774
- search_string: str,
775
- effective_time: str = None,
776
- starts_with: bool = False,
777
- ends_with: bool = False,
778
- ignore_case: bool = False,
779
- start_from: int = 0,
780
- page_size: int = None,
781
- ) -> list | str:
782
- """Retrieve the list of glossary category metadata elements that contain the search string.
783
- The search string is located in the request body and is interpreted as a plain string.
784
- The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
785
- Async version.
623
+ parent_category_guid: str, child_category_guid: str) -> None:
624
+ """Set parent category Async Version.
786
625
 
787
626
  Parameters
788
627
  ----------
789
- search_string: str,
790
- Search string to use to find matching glossaries. If the search string is '*' then all glossaries returned.
791
-
792
- effective_time: str, [default=None], optional
793
- Effective time of the query. If not specified will default to any time. Time format is
794
- "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
795
-
796
- starts_with : bool, [default=False], optional
797
- Starts with the supplied string.
798
- ends_with : bool, [default=False], optional
799
- Ends with the supplied string
800
- ignore_case : bool, [default=False], optional
801
- Ignore case when searching
802
- start_from: int, [default=0], optional
803
- When multiple pages of results are available, the page number to start from.
804
- page_size: int, [default=None]
805
- The number of items to return in a single page. If not specified, the default will be taken from
806
- the class instance.
628
+ parent_category_guid: str,
629
+ Unique identifier for the parent category.
630
+ child_category_guid: str,
631
+ Unique identifier for the child category.
632
+
807
633
  Returns
808
634
  -------
809
- List | str
810
-
811
- A list of glossary definitions active in the server.
635
+ None
812
636
 
813
637
  Raises
814
638
  ------
@@ -819,75 +643,31 @@ class GlossaryManager(GlossaryBrowser):
819
643
  Raised by the server when an issue arises in processing a valid request
820
644
  NotAuthorizedException
821
645
  The principle specified by the user_id does not have authorization for the requested action
822
-
646
+ ConfigurationErrorException
647
+ Raised when configuration parameters passed on earlier calls turn out to be
648
+ invalid or make the new call invalid.
823
649
  """
824
650
 
825
- if page_size is None:
826
- page_size = self.page_size
827
- starts_with_s = str(starts_with).lower()
828
- ends_with_s = str(ends_with).lower()
829
- ignore_case_s = str(ignore_case).lower()
830
-
831
- validate_search_string(search_string)
832
-
833
- if search_string == "*":
834
- search_string = None
835
-
836
- body = {
837
- "class": "SearchStringRequestBody",
838
- "searchString": search_string,
839
- "effectiveTime": effective_time,
840
- }
841
- body = body_slimmer(body)
842
-
843
651
  url = (
844
652
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
845
- f"categories/by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
846
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}"
653
+ f"categories/{parent_category_guid}/subcategories/{child_category_guid}"
847
654
  )
848
655
 
849
- response = await self._async_make_request("POST", url, body)
850
- return response.json().get("elementList", "No Categories found")
656
+ await self._async_make_request("POST", url)
851
657
 
852
- def find_glossary_categories(
853
- self,
854
- search_string: str,
855
- effective_time: str = None,
856
- starts_with: bool = False,
857
- ends_with: bool = False,
858
- ignore_case: bool = False,
859
- start_from: int = 0,
860
- page_size: int = None,
861
- ) -> list | str:
862
- """Retrieve the list of glossary category metadata elements that contain the search string.
863
- The search string is located in the request body and is interpreted as a plain string.
864
- The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
658
+ def set_parent_category(self, parent_category_guid: str, child_category_guid: str) -> None:
659
+ """Set parent category
865
660
 
866
661
  Parameters
867
662
  ----------
868
- search_string: str,
869
- Search string to use to find matching glossaries. If the search string is '*' then all glossaries returned.
870
-
871
- effective_time: str, [default=None], optional
872
- Effective time of the query. If not specified will default to any time. Time format is
873
- "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
874
-
875
- starts_with : bool, [default=False], optional
876
- Starts with the supplied string.
877
- ends_with : bool, [default=False], optional
878
- Ends with the supplied string
879
- ignore_case : bool, [default=False], optional
880
- Ignore case when searching
881
- start_from: int, [default=0], optional
882
- When multiple pages of results are available, the page number to start from.
883
- page_size: int, [default=None]
884
- The number of items to return in a single page. If not specified, the default will be taken from
885
- the class instance.
663
+ parent_category_guid: str,
664
+ Unique identifier for the parent category.
665
+ child_category_guid: str,
666
+ Unique identifier for the child category.
667
+
886
668
  Returns
887
669
  -------
888
- List | str
889
-
890
- A list of glossary definitions active in the server.
670
+ None
891
671
 
892
672
  Raises
893
673
  ------
@@ -898,47 +678,31 @@ class GlossaryManager(GlossaryBrowser):
898
678
  Raised by the server when an issue arises in processing a valid request
899
679
  NotAuthorizedException
900
680
  The principle specified by the user_id does not have authorization for the requested action
901
-
681
+ ConfigurationErrorException
682
+ Raised when configuration parameters passed on earlier calls turn out to be
683
+ invalid or make the new call invalid.
902
684
  """
685
+
903
686
  loop = asyncio.get_event_loop()
904
- response = loop.run_until_complete(
905
- self._async_find_glossary_categories(
906
- search_string,
907
- effective_time,
908
- starts_with,
909
- ends_with,
910
- ignore_case,
911
- start_from,
912
- page_size,
913
- )
687
+ loop.run_until_complete(
688
+ self._async_set_parent_category(parent_category_guid,child_category_guid)
914
689
  )
915
690
 
916
- return response
917
-
918
- async def _async_get_categories_for_glossary(
919
- self,
920
- glossary_guid: str,
921
- start_from: int = 0,
922
- page_size: int = None,
923
- ) -> list | str:
924
- """Return the list of categories associated with a glossary.
925
- Async version.
691
+ async def _async_remove_parent_category(
692
+ self,
693
+ parent_category_guid: str, child_category_guid: str) -> None:
694
+ """Remove parent category relationship. Async Version.
926
695
 
927
696
  Parameters
928
697
  ----------
929
- glossary_guid: str,
930
- Unique identity of the glossary
698
+ parent_category_guid: str,
699
+ Unique identifier for the parent category.
700
+ child_category_guid: str,
701
+ Unique identifier for the child category.
931
702
 
932
- start_from: int, [default=0], optional
933
- When multiple pages of results are available, the page number to start from.
934
- page_size: int, [default=None]
935
- The number of items to return in a single page. If not specified, the default will be taken from
936
- the class instance.
937
703
  Returns
938
704
  -------
939
- List | str
940
-
941
- A list of categories associated with a glossary.
705
+ None
942
706
 
943
707
  Raises
944
708
  ------
@@ -949,43 +713,31 @@ class GlossaryManager(GlossaryBrowser):
949
713
  Raised by the server when an issue arises in processing a valid request
950
714
  NotAuthorizedException
951
715
  The principle specified by the user_id does not have authorization for the requested action
952
-
716
+ ConfigurationErrorException
717
+ Raised when configuration parameters passed on earlier calls turn out to be
718
+ invalid or make the new call invalid.
953
719
  """
954
720
 
955
- if page_size is None:
956
- page_size = self.page_size
957
-
958
721
  url = (
959
722
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
960
- f"{glossary_guid}/categories/retrieve?startFrom={start_from}&pageSize={page_size}"
723
+ f"categories/{parent_category_guid}/subcategories/{child_category_guid}/remove"
961
724
  )
962
725
 
963
- response = await self._async_make_request("POST", url)
964
- return response.json().get("elementList", "No Categories found")
726
+ await self._async_make_request("POST", url)
965
727
 
966
- def get_categories_for_glossary(
967
- self,
968
- glossary_guid: str,
969
- start_from: int = 0,
970
- page_size: int = None,
971
- ) -> list | str:
972
- """Return the list of categories associated with a glossary.
728
+ def remove_parent_category(self, parent_category_guid: str, child_category_guid: str) -> None:
729
+ """Remove parent category relationship.
973
730
 
974
731
  Parameters
975
732
  ----------
976
- glossary_guid: str,
977
- Unique identity of the glossary
733
+ parent_category_guid: str,
734
+ Unique identifier for the parent category.
735
+ child_category_guid: str,
736
+ Unique identifier for the child category.
978
737
 
979
- start_from: int, [default=0], optional
980
- When multiple pages of results are available, the page number to start from.
981
- page_size: int, [default=None]
982
- The number of items to return in a single page. If not specified, the default will be taken from
983
- the class instance.
984
738
  Returns
985
739
  -------
986
- List | str
987
-
988
- A list of categories associated with a glossary.
740
+ None
989
741
 
990
742
  Raises
991
743
  ------
@@ -996,406 +748,15 @@ class GlossaryManager(GlossaryBrowser):
996
748
  Raised by the server when an issue arises in processing a valid request
997
749
  NotAuthorizedException
998
750
  The principle specified by the user_id does not have authorization for the requested action
999
-
751
+ ConfigurationErrorException
752
+ Raised when configuration parameters passed on earlier calls turn out to be
753
+ invalid or make the new call invalid.
1000
754
  """
755
+
1001
756
  loop = asyncio.get_event_loop()
1002
- response = loop.run_until_complete(
1003
- self._async_get_categories_for_glossary(
1004
- glossary_guid, start_from, page_size
757
+ loop.run_until_complete(
758
+ self._async_remove_parent_category(parent_category_guid, child_category_guid)
1005
759
  )
1006
- )
1007
- return response
1008
-
1009
- async def _async_get_categories_for_term(
1010
- self,
1011
- glossary_term_guid: str,
1012
- start_from: int = 0,
1013
- page_size: int = None,
1014
- ) -> list | str:
1015
- """Return the list of categories associated with a glossary term.
1016
- Async version.
1017
-
1018
- Parameters
1019
- ----------
1020
- glossary_term_guid: str,
1021
- Unique identity of a glossary term
1022
-
1023
- start_from: int, [default=0], optional
1024
- When multiple pages of results are available, the page number to start from.
1025
- page_size: int, [default=None]
1026
- The number of items to return in a single page. If not specified, the default will be taken from
1027
- the class instance.
1028
- Returns
1029
- -------
1030
- List | str
1031
-
1032
- A list of categories associated with a glossary term.
1033
-
1034
- Raises
1035
- ------
1036
-
1037
- InvalidParameterException
1038
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1039
- PropertyServerException
1040
- Raised by the server when an issue arises in processing a valid request
1041
- NotAuthorizedException
1042
- The principle specified by the user_id does not have authorization for the requested action
1043
-
1044
- """
1045
-
1046
- if page_size is None:
1047
- page_size = self.page_size
1048
-
1049
- url = (
1050
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/terms/"
1051
- f"{glossary_term_guid}/categories/retrieve?startFrom={start_from}&pageSize={page_size}"
1052
- )
1053
-
1054
- response = await self._async_make_request("POST", url)
1055
- return response.json().get("elementList", "No Categories found")
1056
-
1057
- def get_categories_for_term(
1058
- self,
1059
- glossary_term_guid: str,
1060
- start_from: int = 0,
1061
- page_size: int = None,
1062
- ) -> list | str:
1063
- """Return the list of categories associated with a glossary term.
1064
-
1065
- Parameters
1066
- ----------
1067
- glossary_term_guid: str,
1068
- Unique identity of a glossary term
1069
-
1070
- start_from: int, [default=0], optional
1071
- When multiple pages of results are available, the page number to start from.
1072
- page_size: int, [default=None]
1073
- The number of items to return in a single page. If not specified, the default will be taken from
1074
- the class instance.
1075
- Returns
1076
- -------
1077
- List | str
1078
-
1079
- A list of categories associated with a glossary term.
1080
-
1081
- Raises
1082
- ------
1083
-
1084
- InvalidParameterException
1085
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1086
- PropertyServerException
1087
- Raised by the server when an issue arises in processing a valid request
1088
- NotAuthorizedException
1089
- The principle specified by the user_id does not have authorization for the requested action
1090
-
1091
- """
1092
- loop = asyncio.get_event_loop()
1093
- response = loop.run_until_complete(
1094
- self._async_get_categories_for_term(
1095
- glossary_term_guid, start_from, page_size
1096
- )
1097
- )
1098
- return response
1099
-
1100
- async def _async_get_categories_by_name(
1101
- self,
1102
- name: str,
1103
- glossary_guid: str = None,
1104
- status: [str] = ["ACTIVE"],
1105
- start_from: int = 0,
1106
- page_size: int = None,
1107
- ) -> list | str:
1108
- """Retrieve the list of glossary category metadata elements that either have the requested qualified name or display name.
1109
- The name to search for is located in the request body and is interpreted as a plain string.
1110
- The request body also supports the specification of a glossaryGUID to restrict the search to within a single glossary.
1111
-
1112
- Async version.
1113
-
1114
- Parameters
1115
- ----------
1116
- name: str,
1117
- category name to search for.
1118
- glossary_guid: str, optional
1119
- The identity of the glossary to search. If not specified, all glossaries will be searched.
1120
- status: [str], optional
1121
- A list of statuses to optionally restrict results. Default is Active
1122
-
1123
- start_from: int, [default=0], optional
1124
- When multiple pages of results are available, the page number to start from.
1125
- page_size: int, [default=None]
1126
- The number of items to return in a single page. If not specified, the default will be taken from
1127
- the class instance.
1128
- Returns
1129
- -------
1130
- List | str
1131
-
1132
- A list of categories with the corresponding display name or qualified name.
1133
-
1134
- Raises
1135
- ------
1136
-
1137
- InvalidParameterException
1138
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1139
- PropertyServerException
1140
- Raised by the server when an issue arises in processing a valid request
1141
- NotAuthorizedException
1142
- The principle specified by the user_id does not have authorization for the requested action
1143
-
1144
- """
1145
-
1146
- if page_size is None:
1147
- page_size = self.page_size
1148
- validate_name(name)
1149
-
1150
- url = (
1151
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/categories/"
1152
- f"by-name?startFrom={start_from}&pageSize={page_size}"
1153
- )
1154
-
1155
- body = {
1156
- "class": "GlossaryNameRequestBody",
1157
- "name": name,
1158
- "glossaryGUID": glossary_guid,
1159
- "limitResultsByStatus": status,
1160
- }
1161
-
1162
- response = await self._async_make_request("POST", url)
1163
- return response.json().get("elementList", "No Categories found")
1164
-
1165
- def get_categories_by_name(
1166
- self,
1167
- name: str,
1168
- glossary_guid: str = None,
1169
- status: [str] = ["ACTIVE"],
1170
- start_from: int = 0,
1171
- page_size: int = None,
1172
- ) -> list | str:
1173
- """Retrieve the list of glossary category metadata elements that either have the requested qualified name or display name.
1174
- The name to search for is located in the request body and is interpreted as a plain string.
1175
- The request body also supports the specification of a glossaryGUID to restrict the search to within a single glossary.
1176
-
1177
- Parameters
1178
- ----------
1179
- name: str,
1180
- category name to search for.
1181
- glossary_guid: str, optional
1182
- The identity of the glossary to search. If not specified, all glossaries will be searched.
1183
- status: [str], optional
1184
- A list of statuses to optionally restrict results. Default is Active
1185
-
1186
- start_from: int, [default=0], optional
1187
- When multiple pages of results are available, the page number to start from.
1188
- page_size: int, [default=None]
1189
- The number of items to return in a single page. If not specified, the default will be taken from
1190
- the class instance.
1191
- Returns
1192
- -------
1193
- List | str
1194
-
1195
- A list of categories with the corresponding display name or qualified name.
1196
-
1197
- Raises
1198
- ------
1199
-
1200
- InvalidParameterException
1201
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1202
- PropertyServerException
1203
- Raised by the server when an issue arises in processing a valid request
1204
- NotAuthorizedException
1205
- The principle specified by the user_id does not have authorization for the requested action
1206
-
1207
- """
1208
- loop = asyncio.get_event_loop()
1209
- response = loop.run_until_complete(
1210
- self._async_get_categories_by_name(
1211
- name, glossary_guid, status, start_from, page_size
1212
- )
1213
- )
1214
- return response
1215
-
1216
- async def _async_get_categories_by_guid(
1217
- self,
1218
- glossary_category_guid: str,
1219
- effective_time: str = None,
1220
- ) -> list | str:
1221
- """Retrieve the requested glossary category metadata element. The optional request body contain an effective
1222
- time for the query..
1223
-
1224
- Async version.
1225
-
1226
- Parameters
1227
- ----------
1228
- glossary_category_guid: str
1229
- The identity of the glossary category to search.
1230
- effective_time: str, optional
1231
- If specified, the category should only be returned if it was effective at the specified time.
1232
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
1233
-
1234
-
1235
- Returns
1236
- -------
1237
- List | str
1238
-
1239
- Details for the category with the glossary category GUID.
1240
-
1241
- Raises
1242
- ------
1243
-
1244
- InvalidParameterException
1245
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1246
- PropertyServerException
1247
- Raised by the server when an issue arises in processing a valid request
1248
- NotAuthorizedException
1249
- The principle specified by the user_id does not have authorization for the requested action
1250
-
1251
- """
1252
-
1253
- url = (
1254
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/categories/"
1255
- f"{glossary_category_guid}/retrieve"
1256
- )
1257
-
1258
- body = {
1259
- "class": "EffectiveTimeQueryRequestBody",
1260
- "effectiveTime": effective_time,
1261
- }
1262
-
1263
- response = await self._async_make_request("POST", url, body)
1264
- return response.json().get("element", "No Category found")
1265
-
1266
- def get_categories_by_guid(
1267
- self,
1268
- glossary_category_guid: str,
1269
- effective_time: str = None,
1270
- ) -> list | str:
1271
- """Retrieve the requested glossary category metadata element. The optional request body contain an effective
1272
- time for the query..
1273
-
1274
- Parameters
1275
- ----------
1276
- glossary_category_guid: str
1277
- The identity of the glossary category to search.
1278
- effective_time, datetime, optional
1279
- If specified, the category should only be returned if it was effective at the specified time.
1280
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
1281
-
1282
-
1283
- Returns
1284
- -------
1285
- List | str
1286
-
1287
- Details for the category with the glossary category GUID.
1288
-
1289
- Raises
1290
- ------
1291
-
1292
- InvalidParameterException
1293
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1294
- PropertyServerException
1295
- Raised by the server when an issue arises in processing a valid request
1296
- NotAuthorizedException
1297
- The principle specified by the user_id does not have authorization for the requested action
1298
-
1299
- """
1300
- loop = asyncio.get_event_loop()
1301
- response = loop.run_until_complete(
1302
- self._async_get_categories_by_guid(glossary_category_guid, effective_time)
1303
- )
1304
- return response
1305
-
1306
- async def _async_get_category_parent(
1307
- self,
1308
- glossary_category_guid: str,
1309
- effective_time: str = None,
1310
- ) -> list | str:
1311
- """Glossary categories can be organized in a hierarchy. Retrieve the parent glossary category metadata
1312
- element for the glossary category with the supplied unique identifier. If the requested category
1313
- does not have a parent category, null is returned. The optional request body contain an effective time
1314
- for the query.
1315
-
1316
- Async version.
1317
-
1318
- Parameters
1319
- ----------
1320
- glossary_category_guid: str
1321
- The identity of the glossary category to search.
1322
- effective_time, datetime, optional
1323
- If specified, the category should only be returned if it was effective at the specified time.
1324
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
1325
-
1326
-
1327
- Returns
1328
- -------
1329
- List | str
1330
-
1331
- Details for the parent category with the glossary category GUID.
1332
-
1333
- Raises
1334
- ------
1335
-
1336
- InvalidParameterException
1337
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1338
- PropertyServerException
1339
- Raised by the server when an issue arises in processing a valid request
1340
- NotAuthorizedException
1341
- The principle specified by the user_id does not have authorization for the requested action
1342
-
1343
- """
1344
-
1345
- url = (
1346
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/categories/"
1347
- f"{glossary_category_guid}/parent/retrieve"
1348
- )
1349
-
1350
- body = {
1351
- "class": "EffectiveTimeQueryRequestBody",
1352
- "effectiveTime": effective_time,
1353
- }
1354
-
1355
- response = await self._async_make_request("POST", url, body)
1356
- return response.json().get("element", "No Parent Category found")
1357
-
1358
- def get_category_parent(
1359
- self,
1360
- glossary_category_guid: str,
1361
- effective_time: str = None,
1362
- ) -> list | str:
1363
- """Glossary categories can be organized in a hierarchy. Retrieve the parent glossary category metadata
1364
- element for the glossary category with the supplied unique identifier. If the requested category
1365
- does not have a parent category, null is returned. The optional request body contain an effective time
1366
- for the query.
1367
-
1368
- Parameters
1369
- ----------
1370
- glossary_category_guid: str
1371
- The identity of the glossary category to search.
1372
- effective_time, datetime, optional
1373
- If specified, the category should only be returned if it was effective at the specified time.
1374
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
1375
-
1376
-
1377
- Returns
1378
- -------
1379
- List | str
1380
-
1381
- Details for the parent category with the glossary category GUID.
1382
-
1383
- Raises
1384
- ------
1385
-
1386
- InvalidParameterException
1387
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
1388
- PropertyServerException
1389
- Raised by the server when an issue arises in processing a valid request
1390
- NotAuthorizedException
1391
- The principle specified by the user_id does not have authorization for the requested action
1392
-
1393
- """
1394
- loop = asyncio.get_event_loop()
1395
- response = loop.run_until_complete(
1396
- self._async_get_category_parent(glossary_category_guid, effective_time)
1397
- )
1398
- return response
1399
760
 
1400
761
  #
1401
762
  # Terms
@@ -1441,6 +802,7 @@ class GlossaryManager(GlossaryBrowser):
1441
802
  "class" : "GlossaryTermProperties",
1442
803
  "qualifiedName" : "GlossaryTerm: term name : {$isoTimestamp}",
1443
804
  "displayName" : "term name",
805
+ "aliases": []
1444
806
  "summary" : "This is the short description.",
1445
807
  "description" : "This is the long description of the term.",
1446
808
  "abbreviation" : "GT",
@@ -1508,6 +870,7 @@ class GlossaryManager(GlossaryBrowser):
1508
870
  "class" : "GlossaryTermProperties",
1509
871
  "qualifiedName" : "GlossaryTerm: term name : {$isoTimestamp}",
1510
872
  "displayName" : "term name",
873
+ "aliases": []
1511
874
  "summary" : "This is the short description.",
1512
875
  "description" : "This is the long description of the term.",
1513
876
  "abbreviation" : "GT",
@@ -1531,7 +894,7 @@ class GlossaryManager(GlossaryBrowser):
1531
894
 
1532
895
  return response
1533
896
 
1534
- def load_terms_from_file(
897
+ def load_terms_from_csv_file(
1535
898
  self,
1536
899
  glossary_name: str,
1537
900
  filename: str,
@@ -1736,9 +1099,8 @@ class GlossaryManager(GlossaryBrowser):
1736
1099
  continue
1737
1100
 
1738
1101
  # Add the term
1739
- term_qualified_name = (
1740
- f"GlossaryTerm: {term_name} - {datetime.now().isoformat()}"
1741
- )
1102
+ term_qualified_name = self.__create_qualified_name__("Term", term_name)
1103
+
1742
1104
  body = {
1743
1105
  "class": "ReferenceableRequestBody",
1744
1106
  "elementProperties": {
@@ -1995,22 +1357,18 @@ class GlossaryManager(GlossaryBrowser):
1995
1357
 
1996
1358
  return response
1997
1359
 
1998
- async def _async_add_data_field_to_term(
1999
- self, glossary_term_guid: str, body: dict
2000
- ) -> None:
2001
- """Add the data field values classification to a glossary term
2002
1360
 
2003
- Async Version.
1361
+ async def _async_add_term_to_category(
1362
+ self, glossary_term_guid: str, glossary_category_guid: str
1363
+ ) -> None:
1364
+ """Add the term to the specified category. Async Version.
2004
1365
 
2005
1366
  Parameters
2006
1367
  ----------
2007
- glossary_guid : str
2008
- Unique identifier for the glossary category to retrieve terms from.
2009
- glossary_term_guid: str
2010
- Unique identifier for the source glossary term.
2011
- body: dict
2012
- Body containing information about the data field to add
2013
-
1368
+ glossary_term_guid : str
1369
+ Unique identifier for the glossary term to assign.
1370
+ glossary_category_guid: str
1371
+ Unique identifier for the category the term will be assigned to.
2014
1372
 
2015
1373
  Returns
2016
1374
  -------
@@ -2024,43 +1382,139 @@ class GlossaryManager(GlossaryBrowser):
2024
1382
  Raised by the server when an issue arises in processing a valid request.
2025
1383
  NotAuthorizedException
2026
1384
  The principle specified by the user_id does not have authorization for the requested action.
2027
- Notes
2028
- -----
2029
- Body is of the structure:
2030
1385
 
2031
- {
2032
- "class" : "ClassificationRequestBody",
2033
- "properties" :
2034
- {
2035
- "class" : "DataFieldValuesProperties",
2036
- "defaultValue" : "Add default value here",
2037
- "sampleValues" : [ "Sample Value 1", "Sample Value 2"],
2038
- "dataPattern" : ["add data pattern here"],
2039
- "namePattern" : ["add column pattern here"]
2040
- }
2041
- }
2042
1386
  """
2043
1387
 
2044
1388
  validate_guid(glossary_term_guid)
1389
+ validate_guid(glossary_category_guid)
2045
1390
 
2046
1391
  url = (
2047
1392
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
2048
- f"terms/{glossary_term_guid}/is-data-field"
1393
+ f"categories/{glossary_category_guid}/terms/{glossary_term_guid}"
2049
1394
  )
1395
+ body = {
1396
+ "class": "RelationshipRequestBody",
1397
+ "properties": {
1398
+ "class": "GlossaryTermCategorization"
1399
+
1400
+ }
1401
+ }
2050
1402
 
2051
1403
  await self._async_make_request("POST", url, body)
2052
- return
2053
1404
 
2054
- def add_data_field_to_term(self, glossary_term_guid: str, body: dict) -> None:
2055
- """Add the data field values classification to a glossary term
1405
+
1406
+ def add_term_to_category(self, glossary_term_guid: str, glossary_category_guid: str) -> None:
1407
+ """Add the term to the specified category.
2056
1408
 
2057
1409
  Parameters
2058
1410
  ----------
2059
- glossary_term_guid: str
2060
- Unique identifier for the source glossary term.
2061
- body: dict
2062
- Body containing information about the data field to add
1411
+ glossary_term_guid : str
1412
+ Unique identifier for the glossary term to assign.
1413
+ glossary_category_guid: str
1414
+ Unique identifier for the category the term will be assigned to.
1415
+
1416
+ Returns
1417
+ -------
1418
+
1419
+ Raises
1420
+ ------
1421
+ InvalidParameterException
1422
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1423
+ PropertyServerException
1424
+ Raised by the server when an issue arises in processing a valid request.
1425
+ NotAuthorizedException
1426
+ The principle specified by the user_id does not have authorization for the requested action.
1427
+
1428
+ """
1429
+ loop = asyncio.get_event_loop()
1430
+ loop.run_until_complete(
1431
+ self._async_add_term_to_category(glossary_term_guid, glossary_category_guid)
1432
+ )
1433
+
1434
+ async def _async_remove_term_from_category(
1435
+ self, glossary_term_guid: str, glossary_category_guid: str
1436
+ ) -> None:
1437
+ """Remove the term from the specified category. Async Version.
1438
+
1439
+ Parameters
1440
+ ----------
1441
+ glossary_term_guid : str
1442
+ Unique identifier for the glossary term to assign.
1443
+ glossary_category_guid: str
1444
+ Unique identifier for the category the term will be assigned to.
1445
+
1446
+ Returns
1447
+ -------
1448
+ None
1449
+
1450
+ Raises
1451
+ ------
1452
+ InvalidParameterException
1453
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1454
+ PropertyServerException
1455
+ Raised by the server when an issue arises in processing a valid request.
1456
+ NotAuthorizedException
1457
+ The principle specified by the user_id does not have authorization for the requested action.
1458
+
1459
+ """
1460
+
1461
+ validate_guid(glossary_term_guid)
1462
+ validate_guid(glossary_category_guid)
1463
+
1464
+ url = (
1465
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
1466
+ f"categories/{glossary_category_guid}/terms/{glossary_term_guid}/remove"
1467
+ )
1468
+ await self._async_make_request("POST", url)
1469
+
1470
+
1471
+ def remove_term_from_category(self, glossary_term_guid: str, glossary_category_guid: str) -> None:
1472
+ """Remove the term from the specified category.
1473
+
1474
+ Parameters
1475
+ ----------
1476
+ glossary_term_guid : str
1477
+ Unique identifier for the glossary term to assign.
1478
+ glossary_category_guid: str
1479
+ Unique identifier for the category the term will be assigned to.
1480
+
1481
+ Returns
1482
+ -------
1483
+
1484
+ Raises
1485
+ ------
1486
+ InvalidParameterException
1487
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1488
+ PropertyServerException
1489
+ Raised by the server when an issue arises in processing a valid request.
1490
+ NotAuthorizedException
1491
+ The principle specified by the user_id does not have authorization for the requested action.
1492
+
1493
+ """
1494
+ loop = asyncio.get_event_loop()
1495
+ loop.run_until_complete(
1496
+ self._async_remove_term_from_category(glossary_term_guid, glossary_category_guid)
1497
+ )
2063
1498
 
1499
+ async def _async_add_relationship_between_terms(
1500
+ self, term1_guid: str, term2_guid: str, relationship_type: str, body: dict = None,
1501
+ for_lineage: bool = False, for_duplicate_processing: bool = False) -> None:
1502
+ """Add a relationship between terms. Async Version.
1503
+
1504
+ Parameters
1505
+ ----------
1506
+ term1_guid : str
1507
+ Unique identifier of the first glossary term in relationship.
1508
+ term2_guid : str
1509
+ Unique identifier of the second glossary term in relationship.
1510
+ relationship_type: str
1511
+ Type of relationship to add.
1512
+ body: dict, optional, default = None
1513
+ Further optional details for the relationship.
1514
+ for_lineage: bool, default is set by server
1515
+ - determines if elements classified as Memento should be returned - normally false
1516
+ for_duplicate_processing: bool, default is set by server
1517
+ - Normally false. Set true when the caller is part of a deduplication function
2064
1518
 
2065
1519
  Returns
2066
1520
  -------
@@ -2074,28 +1528,356 @@ class GlossaryManager(GlossaryBrowser):
2074
1528
  Raised by the server when an issue arises in processing a valid request.
2075
1529
  NotAuthorizedException
2076
1530
  The principle specified by the user_id does not have authorization for the requested action.
1531
+
2077
1532
  Notes
2078
- -----
2079
- Body is of the structure:
1533
+ ----
1534
+ Body is currently required but can be empty except for class. Basic structure is:
2080
1535
 
2081
- {
2082
- "class" : "ClassificationRequestBody",
2083
- "properties" :
2084
- {
2085
- "class" : "DataFieldValuesProperties",
2086
- "defaultValue" : "Add default value here",
2087
- "sampleValues" : [ "Sample Value 1", "Sample Value 2"],
2088
- "dataPattern" : ["add data pattern here"],
2089
- "namePattern" : ["add column pattern here"]
1536
+ {
1537
+ "class" : "RelationshipRequestBody",
1538
+ "effectiveTime" : {{@isoTimestamp}},
1539
+ "properties" : {
1540
+ "class" : "GlossaryTermRelationship",
1541
+ "expression" : "",
1542
+ "confidence" : 0,
1543
+ "description" : "",
1544
+ "status" : "",
1545
+ "steward" : "",
1546
+ "source" : "",
1547
+ "effectiveFrom" : "{{@isoTimestamp}}",
1548
+ "effectiveTo" : "{{@isoTimestamp}}",
1549
+ "extendedProperties" : {
1550
+ }
1551
+ }
1552
+ }
1553
+ """
1554
+
1555
+ validate_guid(term1_guid)
1556
+ validate_guid(term2_guid)
1557
+
1558
+ if body is None:
1559
+ body = {"class": "RelationshipRequestBody",
1560
+ "properties":
1561
+ {"class": "GlossaryTermRelationship",}
2090
1562
  }
1563
+
1564
+ possible_query_params = query_string(
1565
+ [
1566
+ ("forLineage", for_lineage),
1567
+ ("forDuplicateProcessing", for_duplicate_processing),
1568
+ ]
1569
+ )
1570
+
1571
+ url = (
1572
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
1573
+ f"terms/{term1_guid}/relationships/{relationship_type}/terms/{term2_guid}{possible_query_params}"
1574
+ )
1575
+
1576
+ await self._async_make_request("POST", url, body_slimmer(body))
1577
+
1578
+
1579
+ def add_relationship_between_terms(
1580
+ self, term1_guid: str, term2_guid: str, relationship_type: str, body: dict = None,
1581
+ for_lineage: bool = False, for_duplicate_processing: bool = False) -> None:
1582
+ """Add a relationship between terms.
1583
+
1584
+ Parameters
1585
+ ----------
1586
+ term1_guid : str
1587
+ Unique identifier of the first glossary term in relationship.
1588
+ term2_guid : str
1589
+ Unique identifier of the second glossary term in relationship.
1590
+ relationship_type: str
1591
+ Type of relationship to add. A list of relationship types can be found using get_term_relationship_types().
1592
+ body: dict, optional, default = None
1593
+ Further optional details for the relationship.
1594
+ for_lineage: bool, default is set by server
1595
+ - determines if elements classified as Memento should be returned - normally false
1596
+ for_duplicate_processing: bool, default is set by server
1597
+ - Normally false. Set true when the caller is part of a deduplication function
1598
+
1599
+ Returns
1600
+ -------
1601
+ None
1602
+
1603
+ Raises
1604
+ ------
1605
+ InvalidParameterException
1606
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1607
+ PropertyServerException
1608
+ Raised by the server when an issue arises in processing a valid request.
1609
+ NotAuthorizedException
1610
+ The principle specified by the user_id does not have authorization for the requested action.
1611
+
1612
+ Notes
1613
+ ----
1614
+ Body is currently required but can be empty except for class. Basic structure is:
1615
+
1616
+ {
1617
+ "class" : "RelationshipRequestBody",
1618
+ "effectiveTime" : {{@isoTimestamp}},
1619
+ "properties" : {
1620
+ "class" : "GlossaryTermRelationship",
1621
+ "expression" : "",
1622
+ "confidence" : 0,
1623
+ "description" : "",
1624
+ "status" : "",
1625
+ "steward" : "",
1626
+ "source" : "",
1627
+ "effectiveFrom" : "{{@isoTimestamp}}",
1628
+ "effectiveTo" : "{{@isoTimestamp}}",
1629
+ "extendedProperties" : {
1630
+ }
1631
+ }
1632
+ }
1633
+ """
1634
+ loop = asyncio.get_event_loop()
1635
+ loop.run_until_complete(
1636
+ self._async_add_relationship_between_terms(term1_guid, term2_guid, relationship_type,
1637
+ body, for_lineage, for_duplicate_processing)
1638
+ )
1639
+
1640
+
1641
+ async def _async_update_relationship_between_terms(
1642
+ self, term1_guid: str, term2_guid: str, relationship_type: str, body: dict = None,
1643
+ for_lineage: bool = False, for_duplicate_processing: bool = False) -> None:
1644
+
1645
+ """Update a relationship between terms. Async Version.
1646
+
1647
+ Parameters
1648
+ ----------
1649
+ term1_guid : str
1650
+ Unique identifier of the first glossary term in relationship.
1651
+ term2_guid : str
1652
+ Unique identifier of the second glossary term in relationship.
1653
+ relationship_type: str
1654
+ Type of relationship to update.
1655
+ body: dict, optional, default = None
1656
+ Further optional details for the relationship.
1657
+ for_lineage: bool, default is set by server
1658
+ - determines if elements classified as Memento should be returned - normally false
1659
+ for_duplicate_processing: bool, default is set by server
1660
+ - Normally false. Set true when the caller is part of a deduplication function
1661
+
1662
+ Returns
1663
+ -------
1664
+ None
1665
+
1666
+ Raises
1667
+ ------
1668
+ InvalidParameterException
1669
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1670
+ PropertyServerException
1671
+ Raised by the server when an issue arises in processing a valid request.
1672
+ NotAuthorizedException
1673
+ The principle specified by the user_id does not have authorization for the requested action.
1674
+
1675
+ Notes
1676
+ ----
1677
+ Body is currently required but can be empty except for class. Basic structure is:
1678
+
1679
+ {
1680
+ "class" : "RelationshipRequestBody",
1681
+ "effectiveTime" : {{@isoTimestamp}},
1682
+ "properties" : {
1683
+ "class" : "GlossaryTermRelationship",
1684
+ "expression" : "",
1685
+ "confidence" : 0,
1686
+ "description" : "",
1687
+ "status" : "",
1688
+ "steward" : "",
1689
+ "source" : "",
1690
+ "effectiveFrom" : "{{@isoTimestamp}}",
1691
+ "effectiveTo" : "{{@isoTimestamp}}",
1692
+ "extendedProperties" : {
1693
+ }
1694
+ }
1695
+ }
1696
+ """
1697
+
1698
+ validate_guid(term1_guid)
1699
+ validate_guid(term2_guid)
1700
+
1701
+ possible_query_params = query_string(
1702
+ [
1703
+ ("forLineage", for_lineage),
1704
+ ("forDuplicateProcessing", for_duplicate_processing),
1705
+ ]
1706
+ )
1707
+
1708
+ if body is None:
1709
+ body = {"properties": {"class": "RelationshipRequestBody"}}
1710
+
1711
+ url = (
1712
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
1713
+ f"terms/{term1_guid}/relationships/{relationship_type}/terms/{term2_guid}/update{possible_query_params}"
1714
+ )
1715
+
1716
+ await self._async_make_request("POST", url, body_slimmer(body))
1717
+
1718
+
1719
+ def update_relationship_between_terms(
1720
+ self, term1_guid: str, term2_guid: str, relationship_type: str, body: dict,
1721
+ for_lineage: bool = False, for_duplicate_processing: bool = False) -> None:
1722
+ """Update a relationship between terms.
1723
+
1724
+ Parameters
1725
+ ----------
1726
+ term1_guid : str
1727
+ Unique identifier of the first glossary term in relationship.
1728
+ term2_guid : str
1729
+ Unique identifier of the second glossary term in relationship.
1730
+ relationship_type: str
1731
+ Type of relationship to update. A list of relationship types can be found using get_term_relationship_types().
1732
+ body: dict
1733
+ Details of the relationship to update.
1734
+ for_lineage: bool, default is set by server
1735
+ - determines if elements classified as Memento should be returned - normally false
1736
+ for_duplicate_processing: bool, default is set by server
1737
+ - Normally false. Set true when the caller is part of a deduplication function
1738
+
1739
+ Returns
1740
+ -------
1741
+ None
1742
+
1743
+ Raises
1744
+ ------
1745
+ InvalidParameterException
1746
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1747
+ PropertyServerException
1748
+ Raised by the server when an issue arises in processing a valid request.
1749
+ NotAuthorizedException
1750
+ The principle specified by the user_id does not have authorization for the requested action.
1751
+
1752
+ Notes
1753
+ ----
1754
+ Body is currently required but can be empty except for class. Basic structure is:
1755
+
1756
+ {
1757
+ "class" : "RelationshipRequestBody",
1758
+ "effectiveTime" : {{@isoTimestamp}},
1759
+ "properties" : {
1760
+ "class" : "GlossaryTermRelationship",
1761
+ "expression" : "",
1762
+ "confidence" : 0,
1763
+ "description" : "",
1764
+ "status" : "",
1765
+ "steward" : "",
1766
+ "source" : "",
1767
+ "effectiveFrom" : "{{@isoTimestamp}}",
1768
+ "effectiveTo" : "{{@isoTimestamp}}",
1769
+ "extendedProperties" : {
1770
+ }
1771
+ }
2091
1772
  }
2092
1773
  """
2093
1774
  loop = asyncio.get_event_loop()
2094
1775
  loop.run_until_complete(
2095
- self._async_add_data_field_to_term(glossary_term_guid, body)
1776
+ self._async_update_relationship_between_terms(term1_guid, term2_guid, relationship_type,
1777
+ body,for_lineage,for_duplicate_processing)
1778
+ )
1779
+
1780
+ async def _async_remove_relationship_between_terms(
1781
+ self, term1_guid: str, term2_guid: str, relationship_type: str, effective_time: str = None,
1782
+ for_lineage: bool = False, for_duplicate_processing: bool = False) -> None:
1783
+ """Remove a relationship between terms. Async Version.
1784
+
1785
+ Parameters
1786
+ ----------
1787
+ term1_guid : str
1788
+ Unique identifier of the first glossary term in relationship.
1789
+ term2_guid : str
1790
+ Unique identifier of the second glossary term in relationship.
1791
+ relationship_type: str
1792
+ Type of relationship to add.
1793
+ effective_time: str, optional, default = None
1794
+ Effective time to remove the relationship.
1795
+ for_lineage: bool, default is set by server
1796
+ - determines if elements classified as Memento should be returned - normally false
1797
+ for_duplicate_processing: bool, default is set by server
1798
+ - Normally false. Set true when the caller is part of a deduplication function
1799
+
1800
+ Returns
1801
+ -------
1802
+ None
1803
+
1804
+ Raises
1805
+ ------
1806
+ InvalidParameterException
1807
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1808
+ PropertyServerException
1809
+ Raised by the server when an issue arises in processing a valid request.
1810
+ NotAuthorizedException
1811
+ The principle specified by the user_id does not have authorization for the requested action.
1812
+
1813
+
1814
+ """
1815
+
1816
+ validate_guid(term1_guid)
1817
+ validate_guid(term2_guid)
1818
+
1819
+ possible_query_params = query_string(
1820
+ [
1821
+ ("forLineage", for_lineage),
1822
+ ("forDuplicateProcessing", for_duplicate_processing),
1823
+ ]
1824
+ )
1825
+
1826
+ body = {"properties": {
1827
+ "class": "EffectiveTimeQueryRequestBody",
1828
+ "effectiveTime": effective_time
1829
+ }
1830
+ }
1831
+
1832
+ url = (
1833
+ f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
1834
+ f"terms/{term1_guid}/relationships/{relationship_type}/terms/{term2_guid}/remove{possible_query_params}"
2096
1835
  )
2097
1836
 
2098
- return
1837
+ await self._async_make_request("POST", url, body_slimmer(body))
1838
+
1839
+
1840
+ def remove_relationship_between_terms(
1841
+ self, term1_guid: str, term2_guid: str, relationship_type: str, effective_time: str = None,
1842
+ for_lineage: bool = False, for_duplicate_processing: bool = False) -> None:
1843
+ """Remove a relationship between terms.
1844
+
1845
+ Parameters
1846
+ ----------
1847
+ term1_guid : str
1848
+ Unique identifier of the first glossary term in relationship.
1849
+ term2_guid : str
1850
+ Unique identifier of the second glossary term in relationship.
1851
+ relationship_type: str
1852
+ Type of relationship to remove. A list of relationship types can be found using get_term_relationship_types().
1853
+ effective_time: str, optional, default = None
1854
+ Effective time to remove the relationship.
1855
+ for_lineage: bool, default is set by server
1856
+ - determines if elements classified as Memento should be returned - normally false
1857
+ for_duplicate_processing: bool, default is set by server
1858
+ - Normally false. Set true when the caller is part of a deduplication function
1859
+
1860
+ Returns
1861
+ -------
1862
+ None
1863
+
1864
+ Raises
1865
+ ------
1866
+ InvalidParameterException
1867
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
1868
+ PropertyServerException
1869
+ Raised by the server when an issue arises in processing a valid request.
1870
+ NotAuthorizedException
1871
+ The principle specified by the user_id does not have authorization for the requested action.
1872
+
1873
+ """
1874
+ loop = asyncio.get_event_loop()
1875
+ loop.run_until_complete(
1876
+ self._async_remove_relationship_between_terms(term1_guid, term2_guid, relationship_type,
1877
+ effective_time, for_lineage, for_duplicate_processing)
1878
+ )
1879
+
1880
+
2099
1881
 
2100
1882
  async def _async_add_confidentiality_to_term(
2101
1883
  self,
@@ -2287,7 +2069,7 @@ class GlossaryManager(GlossaryBrowser):
2287
2069
  self,
2288
2070
  glossary_term_guid: str,
2289
2071
  body: dict,
2290
- is_merge_update: bool = True,
2072
+ is_merge_update: bool = False,
2291
2073
  for_lineage: bool = False,
2292
2074
  for_duplicate_processig: bool = False,
2293
2075
  ) -> None:
@@ -2566,122 +2348,15 @@ class GlossaryManager(GlossaryBrowser):
2566
2348
  loop = asyncio.get_event_loop()
2567
2349
  loop.run_until_complete(self._async_undo_term_update(glossary_term_guid))
2568
2350
 
2569
- async def _async_get_terms_for_category(
2351
+
2352
+
2353
+ async def _async_delete_term(
2570
2354
  self,
2571
- glossary_category_guid: str,
2572
- effective_time: str = None,
2573
- start_from: int = 0,
2574
- page_size: int = None,
2355
+ term_guid: str,
2356
+ for_lineage: bool = False,
2357
+ for_duplicate_processing: bool = False,
2575
2358
  ) -> list | str:
2576
- """Retrieve ALL the glossary terms in a category.
2577
- The request body also supports the specification of an effective time for the query.
2578
-
2579
- Async Version.
2580
-
2581
- Parameters
2582
- ----------
2583
- glossary_category_guid : str
2584
- Unique identifier for the glossary category to retrieve terms from.
2585
- effective_time : str, optional
2586
- If specified, the terms are returned if they are active at the `effective_time
2587
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2588
- start_from: int, optional defaults to 0
2589
- The page number to start retrieving elements from
2590
- page_size : int, optional defaults to None
2591
- The number of elements to retrieve
2592
- Returns
2593
- -------
2594
- dict
2595
- The glossary definition associated with the glossary_guid
2596
-
2597
- Raises
2598
- ------
2599
- InvalidParameterException
2600
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2601
- PropertyServerException
2602
- Raised by the server when an issue arises in processing a valid request.
2603
- NotAuthorizedException
2604
- The principle specified by the user_id does not have authorization for the requested action.
2605
- Notes
2606
- -----
2607
- """
2608
-
2609
- validate_guid(glossary_category_guid)
2610
-
2611
- if page_size is None:
2612
- page_size = self.page_size
2613
-
2614
- url = (
2615
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/terms/"
2616
- f"{glossary_category_guid}/terms/retrieve?startFrom={start_from}&pageSize={page_size}"
2617
- )
2618
-
2619
- if effective_time is not None:
2620
- body = {"effectiveTime": effective_time}
2621
- response = await self._async_make_request("POST", url, body)
2622
- else:
2623
- response = await self._async_make_request("POST", url)
2624
-
2625
- return response.json().get("elementList", "No terms found")
2626
-
2627
- def get_terms_for_category(
2628
- self,
2629
- glossary_category_guid: str,
2630
- effective_time: str = None,
2631
- start_from: int = 0,
2632
- page_size: int = None,
2633
- ) -> list | str:
2634
- """Retrieve ALL the glossary terms in a category.
2635
- The request body also supports the specification of an effective time for the query.
2636
-
2637
- Async Version.
2638
-
2639
- Parameters
2640
- ----------
2641
- glossary_category_guid : str
2642
- Unique identifier for the glossary category to retrieve terms from.
2643
- effective_time : str, optional
2644
- If specified, the terms are returned if they are active at the `effective_time.
2645
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)`.
2646
- start_from: int, optional defaults to 0
2647
- The page number to start retrieving elements from
2648
- page_size : int, optional defaults to None
2649
- The number of elements to retrieve
2650
- Returns
2651
- -------
2652
- dict
2653
- The glossary definition associated with the glossary_guid
2654
-
2655
- Raises
2656
- ------
2657
- InvalidParameterException
2658
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2659
- PropertyServerException
2660
- Raised by the server when an issue arises in processing a valid request.
2661
- NotAuthorizedException
2662
- The principle specified by the user_id does not have authorization for the requested action.
2663
- Notes
2664
- -----
2665
- """
2666
- loop = asyncio.get_event_loop()
2667
- response = loop.run_until_complete(
2668
- self._async_get_terms_for_category(
2669
- glossary_category_guid,
2670
- effective_time,
2671
- start_from,
2672
- page_size,
2673
- )
2674
- )
2675
-
2676
- return response
2677
-
2678
- async def _async_delete_term(
2679
- self,
2680
- term_guid: str,
2681
- for_lineage: bool = False,
2682
- for_duplicate_processing: bool = False,
2683
- ) -> list | str:
2684
- """Delete the glossary terms associated with the specified glossary. Async version.
2359
+ """Delete the glossary terms associated with the specified glossary. Async version.
2685
2360
 
2686
2361
  Parameters
2687
2362
  ----------
@@ -2757,840 +2432,8 @@ class GlossaryManager(GlossaryBrowser):
2757
2432
 
2758
2433
  return
2759
2434
 
2760
- async def _async_get_term_relationships(
2761
- self,
2762
- term_guid: str,
2763
- effective_time: str = None,
2764
- start_from: int = 0,
2765
- page_size: int = None,
2766
- ) -> list | str:
2767
- """This call retrieves details of the glossary terms linked to this glossary term.
2768
- Notice the original org 1 glossary term is linked via the "SourcedFrom" relationship..
2769
- Parameters
2770
- ----------
2771
- term_guid : str
2772
- Unique identifier for the glossary term
2773
- effective_time : str, optional
2774
- If specified, term relationships are included if they are active at the `effective_time`.
2775
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2776
- start_from: int, optional defaults to 0
2777
- The page number to start retrieving elements from
2778
- page_size : int, optional defaults to None
2779
- The number of elements to retrieve
2780
- Returns
2781
- -------
2782
- dict
2783
- The glossary definition associated with the glossary_guid
2784
-
2785
- Raises
2786
- ------
2787
- InvalidParameterException
2788
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2789
- PropertyServerException
2790
- Raised by the server when an issue arises in processing a valid request.
2791
- NotAuthorizedException
2792
- The principle specified by the user_id does not have authorization for the requested action.
2793
- Notes
2794
- -----
2795
- """
2796
-
2797
- validate_guid(term_guid)
2798
-
2799
- if page_size is None:
2800
- page_size = self.page_size
2801
-
2802
- url = (
2803
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/terms/"
2804
- f"{term_guid}/related-terms?startFrom={start_from}&pageSize={page_size}"
2805
- )
2806
-
2807
- if effective_time is not None:
2808
- body = {"effectiveTime": effective_time}
2809
- response = await self._async_make_request("POST", url, body)
2810
- else:
2811
- response = await self._async_make_request("POST", url)
2812
-
2813
- return response.json().get("elementList", "No terms found")
2814
-
2815
- def get_term_relationships(
2816
- self,
2817
- term_guid: str,
2818
- effective_time: str = None,
2819
- start_from: int = 0,
2820
- page_size: int = None,
2821
- ) -> list | str:
2822
- """This call retrieves details of the glossary terms linked to this glossary term.
2823
- Notice the original org 1 glossary term is linked via the "SourcedFrom" relationship..
2824
- Parameters
2825
- ----------
2826
- term_guid : str
2827
- Unique identifier for the glossary term
2828
- effective_time : str, optional
2829
- If specified, term relationships are included if they are active at the `effective_time`.
2830
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2831
- start_from: int, optional defaults to 0
2832
- The page number to start retrieving elements from
2833
- page_size : int, optional defaults to None
2834
- The number of elements to retrieve
2835
- Returns
2836
- -------
2837
- dict
2838
- The glossary definition associated with the glossary_guid
2839
-
2840
- Raises
2841
- ------
2842
- InvalidParameterException
2843
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2844
- PropertyServerException
2845
- Raised by the server when an issue arises in processing a valid request.
2846
- NotAuthorizedException
2847
- The principle specified by the user_id does not have authorization for the requested action.
2848
- Notes
2849
- -----
2850
- """
2851
- loop = asyncio.get_event_loop()
2852
- response = loop.run_until_complete(
2853
- self._async_get_term_relationships(
2854
- term_guid, effective_time, start_from, page_size
2855
- )
2856
- )
2857
-
2858
- return response
2859
-
2860
- async def _async_get_glossary_for_term(
2861
- self, term_guid: str, effective_time: str = None
2862
- ) -> dict | str:
2863
- """Retrieve the glossary metadata element for the requested term. The optional request body allows you to specify
2864
- that the glossary element should only be returned if it was effective at a particular time.
2865
-
2866
- Async Version.
2867
-
2868
- Parameters
2869
- ----------
2870
- term_guid : str
2871
- The unique identifier for the term.
2872
-
2873
- effective_time : datetime, optional
2874
- If specified, the term information will be retrieved if it is active at the `effective_time`.
2875
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2876
-
2877
- Returns
2878
- -------
2879
- dict
2880
- The glossary information retrieved for the specified term.
2881
- Raises
2882
- ------
2883
- InvalidParameterException
2884
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2885
- PropertyServerException
2886
- Raised by the server when an issue arises in processing a valid request.
2887
- NotAuthorizedException
2888
- The principle specified by the user_id does not have authorization for the requested action.
2889
- Notes
2890
- -----
2891
- """
2892
-
2893
- validate_guid(term_guid)
2894
-
2895
- body = {
2896
- "class": "EffectiveTimeQueryRequestBody",
2897
- "effectiveTime": effective_time,
2898
- }
2899
- url = (
2900
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
2901
- f"for-term/{term_guid}/retrieve"
2902
- )
2903
-
2904
- response = await self._async_make_request("POST", url, body)
2905
- return response.json().get("element", "No glossary found")
2906
-
2907
- def get_glossary_for_term(
2908
- self, term_guid: str, effective_time: str = None
2909
- ) -> dict | str:
2910
- """Retrieve the glossary metadata element for the requested term. The optional request body allows you to specify
2911
- that the glossary element should only be returned if it was effective at a particular time.
2912
-
2913
- Async Version.
2914
-
2915
- Parameters
2916
- ----------
2917
- term_guid : str
2918
- The unique identifier for the term.
2919
-
2920
- effective_time : datetime, optional
2921
- TIf specified, the term information will be retrieved if it is active at the `effective_time`.
2922
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601).
2923
-
2924
- Returns
2925
- -------
2926
- dict
2927
- The glossary information retrieved for the specified term.
2928
- Raises
2929
- ------
2930
- InvalidParameterException
2931
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2932
- PropertyServerException
2933
- Raised by the server when an issue arises in processing a valid request.
2934
- NotAuthorizedException
2935
- The principle specified by the user_id does not have authorization for the requested action.
2936
- Notes
2937
- -----
2938
- """
2939
- loop = asyncio.get_event_loop()
2940
- response = loop.run_until_complete(
2941
- self._async_get_glossary_for_term(term_guid, effective_time)
2942
- )
2943
- return response
2944
-
2945
- async def _async_get_terms_by_name(
2946
- self,
2947
- term: str,
2948
- glossary_guid: str = None,
2949
- status_filter: list = [],
2950
- effective_time: str = None,
2951
- for_lineage: bool = False,
2952
- for_duplicate_processing: bool = False,
2953
- start_from: int = 0,
2954
- page_size: int = None,
2955
- ) -> list:
2956
- """Retrieve glossary terms by display name or qualified name. Async Version.
2957
-
2958
- Parameters
2959
- ----------
2960
- term : str
2961
- The term to search for in the glossaries.
2962
- glossary_guid : str, optional
2963
- The GUID of the glossary to search in. If not provided, the search will be performed in all glossaries.
2964
- status_filter : list, optional
2965
- A list of status values to filter the search results. Default is an empty list, which means no filtering.
2966
-
2967
- effective_time : datetime, optional
2968
- If specified, the term information will be retrieved if it is active at the `effective_time`.
2969
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
2970
- for_lineage : bool, optional
2971
- Flag to indicate whether the search should include lineage information. Default is False.
2972
- for_duplicate_processing : bool, optional
2973
- Flag to indicate whether the search should include duplicate processing information. Default is False.
2974
- start_from : int, optional
2975
- The index of the first term to retrieve. Default is 0.
2976
- page_size : int, optional
2977
- The number of terms to retrieve per page. If not provided, it will use the default page size.
2978
-
2979
- Returns
2980
- -------
2981
- list
2982
- A list of terms matching the search criteria. If no terms are found, it returns the string "No terms found".
2983
-
2984
- Raises
2985
- ------
2986
- InvalidParameterException
2987
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
2988
- PropertyServerException
2989
- Raised by the server when an issue arises in processing a valid request.
2990
- NotAuthorizedException
2991
- The principle specified by the user_id does not have authorization for the requested action.
2992
- """
2993
-
2994
- if page_size is None:
2995
- page_size = self.page_size
2996
-
2997
- validate_name(term)
2998
-
2999
- for_lineage_s = str(for_lineage).lower()
3000
- for_duplicate_processing_s = str(for_duplicate_processing).lower()
3001
-
3002
- body = {
3003
- "class": "GlossaryNameRequestBody",
3004
- "glossaryGUID": glossary_guid,
3005
- "name": term,
3006
- "effectiveTime": effective_time,
3007
- "limitResultsByStatus": status_filter,
3008
- }
3009
- # body = body_slimmer(body)
3010
-
3011
- url = (
3012
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
3013
- f"terms/by-name?startFrom={start_from}&pageSize={page_size}&"
3014
- f"&forLineage={for_lineage_s}&forDuplicateProcessing={for_duplicate_processing_s}"
3015
- )
3016
-
3017
- # print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
3018
-
3019
- response = await self._async_make_request("POST", url, body)
3020
- return response.json().get("elementList", "No terms found")
3021
-
3022
- def get_terms_by_name(
3023
- self,
3024
- term: str,
3025
- glossary_guid: str = None,
3026
- status_filter: list = [],
3027
- effective_time: str = None,
3028
- for_lineage: bool = False,
3029
- for_duplicate_processing: bool = False,
3030
- start_from: int = 0,
3031
- page_size: int = None,
3032
- ) -> list:
3033
- """Retrieve glossary terms by display name or qualified name.
3034
-
3035
- Parameters
3036
- ----------
3037
- term : str
3038
- The term to search for in the glossaries.
3039
- glossary_guid : str, optional
3040
- The GUID of the glossary to search in. If not provided, the search will be performed in all glossaries.
3041
- status_filter : list, optional
3042
- A list of status values to filter the search results. Default is an empty list, which means no filtering.
3043
-
3044
- effective_time : datetime, optional
3045
- If specified, the term information will be retrieved if it is active at the `effective_time`.
3046
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
3047
- for_lineage : bool, optional
3048
- Flag to indicate whether the search should include lineage information. Default is False.
3049
- for_duplicate_processing : bool, optional
3050
- Flag to indicate whether the search should include duplicate processing information. Default is False.
3051
- start_from : int, optional
3052
- The index of the first term to retrieve. Default is 0.
3053
- page_size : int, optional
3054
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3055
-
3056
- Returns
3057
- -------
3058
- list
3059
- A list of terms matching the search criteria. If no terms are found,
3060
- it returns the string "No terms found".
3061
-
3062
- Raises
3063
- ------
3064
- InvalidParameterException
3065
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3066
- PropertyServerException
3067
- Raised by the server when an issue arises in processing a valid request.
3068
- NotAuthorizedException
3069
- The principle specified by the user_id does not have authorization for the requested action.
3070
- """
3071
- loop = asyncio.get_event_loop()
3072
- response = loop.run_until_complete(
3073
- self._async_get_terms_by_name(
3074
- term,
3075
- glossary_guid,
3076
- status_filter,
3077
- effective_time,
3078
- for_lineage,
3079
- for_duplicate_processing,
3080
- start_from,
3081
- page_size,
3082
- )
3083
- )
3084
- return response
3085
-
3086
- async def _async_get_terms_by_guid(self, term_guid: str) -> dict | str:
3087
- """Retrieve a term using its unique id. Async version.
3088
- Parameters
3089
- ----------
3090
- term_guid : str
3091
- The GUID of the glossary term to retrieve.
3092
-
3093
- Returns
3094
- -------
3095
- dict | str
3096
- A dict detailing the glossary term represented by the GUID. If no term is found, the string
3097
- "No term found" will be returned.
3098
-
3099
- Raises
3100
- ------
3101
- InvalidParameterException
3102
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3103
- PropertyServerException
3104
- Raised by the server when an issue arises in processing a valid request.
3105
- NotAuthorizedException
3106
- The principle specified by the user_id does not have authorization for the requested action.
3107
- """
3108
-
3109
- validate_guid(term_guid)
3110
-
3111
- url = (
3112
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/terms/"
3113
- f"{term_guid}/retrieve"
3114
- )
3115
-
3116
- response = await self._async_make_request("POST", url)
3117
- return response.json().get("element", "No term found")
3118
-
3119
- def get_terms_by_guid(self, term_guid: str) -> dict | str:
3120
- """Retrieve a term using its unique id. Async version.
3121
- Parameters
3122
- ----------
3123
- term_guid : str
3124
- The GUID of the glossary term to retrieve.
3125
-
3126
- Returns
3127
- -------
3128
- dict | str
3129
- A dict detailing the glossary term represented by the GUID. If no term is found, the string
3130
- "No term found" will be returned.
3131
-
3132
- Raises
3133
- ------
3134
- InvalidParameterException
3135
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3136
- PropertyServerException
3137
- Raised by the server when an issue arises in processing a valid request.
3138
- NotAuthorizedException
3139
- The principle specified by the user_id does not have authorization for the requested action.
3140
- """
3141
-
3142
- loop = asyncio.get_event_loop()
3143
- response = loop.run_until_complete(self._async_get_terms_by_guid(term_guid))
3144
-
3145
- return response
3146
-
3147
- async def _async_get_terms_versions(
3148
- self,
3149
- term_guid: str,
3150
- start_from: int = 0,
3151
- page_size=None,
3152
- ) -> dict | str:
3153
- """Retrieve the versions of a glossary term. Async version.
3154
- Parameters
3155
- ----------
3156
- term_guid : str
3157
- The GUID of the glossary term to retrieve.
3158
- start_from : int, optional
3159
- The index of the first term to retrieve. Default is 0.
3160
- page_size : int, optional
3161
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3162
- Returns
3163
- -------
3164
- dict | str
3165
- A dict detailing the glossary term represented by the GUID. If no term is found, the string
3166
- "No term found" will be returned.
3167
-
3168
- Raises
3169
- ------
3170
- InvalidParameterException
3171
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3172
- PropertyServerException
3173
- Raised by the server when an issue arises in processing a valid request.
3174
- NotAuthorizedException
3175
- The principle specified by the user_id does not have authorization for the requested action.
3176
- """
3177
-
3178
- if page_size is None:
3179
- page_size = self.page_size
3180
-
3181
- validate_guid(term_guid)
3182
-
3183
- url = (
3184
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/terms/"
3185
- f"{term_guid}/history?startFrom={start_from}&pageSize={page_size}"
3186
- )
3187
-
3188
- response = await self._async_make_request("POST", url)
3189
- return response.json().get("element", "No term found")
3190
-
3191
- def get_terms_versions(
3192
- self,
3193
- term_guid: str,
3194
- start_from: int = 0,
3195
- page_size=None,
3196
- ) -> dict | str:
3197
- """Retrieve the versions of a glossary term.
3198
- Parameters
3199
- ----------
3200
- term_guid : str
3201
- The GUID of the glossary term to retrieve.
3202
- start_from : int, optional
3203
- The index of the first term to retrieve. Default is 0.
3204
- page_size : int, optional
3205
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3206
- Returns
3207
- -------
3208
- dict | str
3209
- A dict detailing the glossary term represented by the GUID. If no term is found, the string
3210
- "No term found" will be returned.
3211
-
3212
- Raises
3213
- ------
3214
- InvalidParameterException
3215
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3216
- PropertyServerException
3217
- Raised by the server when an issue arises in processing a valid request.
3218
- NotAuthorizedException
3219
- The principle specified by the user_id does not have authorization for the requested action.
3220
- """
3221
-
3222
- loop = asyncio.get_event_loop()
3223
- response = loop.run_until_complete(
3224
- self._async_get_terms_versions(term_guid, start_from, page_size)
3225
- )
3226
-
3227
- return response
3228
-
3229
- async def _async_get_term_revision_logs(
3230
- self,
3231
- term_guid: str,
3232
- start_from: int = 0,
3233
- page_size=None,
3234
- ) -> dict | str:
3235
- """Retrieve the revision log history for a term. Async version.
3236
- Parameters
3237
- ----------
3238
- term_guid : str
3239
- The GUID of the glossary term to retrieve.
3240
- start_from : int, optional
3241
- The index of the first term to retrieve. Default is 0.
3242
- page_size : int, optional
3243
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3244
- Returns
3245
- -------
3246
- dict | str
3247
- A dict detailing the glossary term revision log history. If no term is found, the string
3248
- "No log found" will be returned.
3249
-
3250
- Raises
3251
- ------
3252
- InvalidParameterException
3253
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3254
- PropertyServerException
3255
- Raised by the server when an issue arises in processing a valid request.
3256
- NotAuthorizedException
3257
- The principle specified by the user_id does not have authorization for the requested action.
3258
- """
3259
-
3260
- if page_size is None:
3261
- page_size = self.page_size
3262
-
3263
- validate_guid(term_guid)
3264
-
3265
- url = (
3266
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/elements/"
3267
- f"{term_guid}/notes/retrieve?startFrom={start_from}&pageSize={page_size}"
3268
- )
3269
-
3270
- response = await self._async_make_request("POST", url)
3271
- return response.json().get("elementList", "No log found")
3272
-
3273
- def get_term_revision_logs(
3274
- self,
3275
- term_guid: str,
3276
- start_from: int = 0,
3277
- page_size=None,
3278
- ) -> dict | str:
3279
- """Retrieve the revision log history for a term.
3280
- Parameters
3281
- ----------
3282
- term_guid : str
3283
- The GUID of the glossary term to retrieve.
3284
- start_from : int, optional
3285
- The index of the first term to retrieve. Default is 0.
3286
- page_size : int, optional
3287
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3288
- Returns
3289
- -------
3290
- dict | str
3291
- A dict detailing the glossary term revision log history. If no term is found, the string
3292
- "No log found" will be returned.
3293
-
3294
- Raises
3295
- ------
3296
- InvalidParameterException
3297
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3298
- PropertyServerException
3299
- Raised by the server when an issue arises in processing a valid request.
3300
- NotAuthorizedException
3301
- The principle specified by the user_id does not have authorization for the requested action.
3302
- """
3303
-
3304
- loop = asyncio.get_event_loop()
3305
- response = loop.run_until_complete(
3306
- self._async_get_term_revision_logs(term_guid, start_from, page_size)
3307
- )
3308
-
3309
- return response
3310
-
3311
- async def _async_get_term_revision_history(
3312
- self,
3313
- term_revision_log_guid: str,
3314
- start_from: int = 0,
3315
- page_size=None,
3316
- ) -> dict | str:
3317
- """Retrieve the revision history for a glossary term. Async version.
3318
-
3319
- Parameters
3320
- ----------
3321
- term_revision_log_guid : str
3322
- The GUID of the glossary term revision log to retrieve.
3323
- start_from : int, optional
3324
- The index of the first term to retrieve. Default is 0.
3325
- page_size : int, optional
3326
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3327
- Returns
3328
- -------
3329
- dict | str
3330
- A dict detailing the glossary term revision history.
3331
-
3332
- Raises
3333
- ------
3334
- InvalidParameterException
3335
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3336
- PropertyServerException
3337
- Raised by the server when an issue arises in processing a valid request.
3338
- NotAuthorizedException
3339
- The principle specified by the user_id does not have authorization for the requested action.
3340
-
3341
-
3342
- Notes
3343
- -----
3344
- This revision history is created automatically. The text is supplied on the update request.
3345
- If no text is supplied, the value "None" is show.
3346
- """
3347
-
3348
- if page_size is None:
3349
- page_size = self.page_size
3350
-
3351
- validate_guid(term_revision_log_guid)
3352
-
3353
- url = (
3354
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/note-logs/"
3355
- f"{term_revision_log_guid}/notes/retrieve?startFrom={start_from}&pageSize={page_size}"
3356
- )
3357
-
3358
- response = await self._async_make_request("POST", url)
3359
- return response.json().get("elementList", "No logs found")
3360
-
3361
- def get_term_revision_history(
3362
- self,
3363
- term_revision_log_guid: str,
3364
- start_from: int = 0,
3365
- page_size=None,
3366
- ) -> dict | str:
3367
- """Retrieve the revision history for a glossary term.
3368
-
3369
- Parameters
3370
- ----------
3371
- term_revision_log_guid : str
3372
- The GUID of the glossary term revision log to retrieve.
3373
- start_from : int, optional
3374
- The index of the first term to retrieve. Default is 0.
3375
- page_size : int, optional
3376
- The number of terms to retrieve per page. If not provided, it will use the default page size.
3377
- Returns
3378
- -------
3379
- dict | str
3380
- A dict detailing the glossary term revision history.
3381
-
3382
- Raises
3383
- ------
3384
- InvalidParameterException
3385
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values.
3386
- PropertyServerException
3387
- Raised by the server when an issue arises in processing a valid request.
3388
- NotAuthorizedException
3389
- The principle specified by the user_id does not have authorization for the requested action.
3390
-
3391
-
3392
- Notes
3393
- -----
3394
- This revision history is created automatically. The text is supplied on the update request.
3395
- If no text is supplied, the value "None" is show.
3396
- """
3397
-
3398
- loop = asyncio.get_event_loop()
3399
- response = loop.run_until_complete(
3400
- self._async_get_term_revision_history(
3401
- term_revision_log_guid, start_from, page_size
3402
- )
3403
- )
3404
-
3405
- return response
3406
-
3407
- async def _async_find_glossary_terms(
3408
- self,
3409
- search_string: str,
3410
- glossary_guid: str = None,
3411
- status_filter: list = [],
3412
- effective_time: str = None,
3413
- starts_with: bool = False,
3414
- ends_with: bool = False,
3415
- ignore_case: bool = True,
3416
- for_lineage: bool = False,
3417
- for_duplicate_processing: bool = False,
3418
- start_from: int = 0,
3419
- page_size: int = None,
3420
- ) -> list | str:
3421
- """Retrieve the list of glossary term metadata elements that contain the search string.
3422
-
3423
- Parameters
3424
- ----------
3425
- search_string: str
3426
- Search string to use to find matching glossaries. If the search string is '*' then all glossaries returned.
3427
- glossary_guid str
3428
- Identifier of the glossary to search within. If None, then all glossaries are searched.
3429
- status_filter: list, default = [], optional
3430
- Filters the results by the included Term statuses (such as 'ACTIVE', 'DRAFT'). If not specified,
3431
- the results will not be filtered.
3432
- effective_time: str, [default=None], optional
3433
- If specified, the term information will be retrieved if it is active at the `effective_time`.
3434
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
3435
-
3436
- starts_with : bool, [default=False], optional
3437
- Starts with the supplied string.
3438
- ends_with : bool, [default=False], optional
3439
- Ends with the supplied string
3440
- ignore_case : bool, [default=False], optional
3441
- Ignore case when searching
3442
- for_lineage : bool, [default=False], optional
3443
-
3444
- for_duplicate_processing : bool, [default=False], optional
3445
-
3446
- start_from: str, [default=0], optional
3447
- Page of results to start from
3448
- page_size : int, optional
3449
- Number of elements to return per page - if None, then default for class will be used.
3450
-
3451
- Returns
3452
- -------
3453
- List | str
3454
-
3455
- A list of term definitions
3456
-
3457
- Raises
3458
- ------
3459
- InvalidParameterException
3460
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
3461
- PropertyServerException
3462
- Raised by the server when an issue arises in processing a valid request
3463
- NotAuthorizedException
3464
- The principle specified by the user_id does not have authorization for the requested action
3465
-
3466
- Notes
3467
- -----
3468
- The search string is located in the request body and is interpreted as a plain string.
3469
- The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
3470
- The request body also supports the specification of a glossaryGUID to restrict the search to within a single glossary.
3471
- """
3472
-
3473
- if page_size is None:
3474
- page_size = self.page_size
3475
- if effective_time is None:
3476
- effective_time = datetime.now().isoformat()
3477
- starts_with_s = str(starts_with).lower()
3478
- ends_with_s = str(ends_with).lower()
3479
- ignore_case_s = str(ignore_case).lower()
3480
- for_lineage_s = str(for_lineage).lower()
3481
- for_duplicate_processing_s = str(for_duplicate_processing).lower()
3482
- if search_string == "*":
3483
- search_string = None
3484
-
3485
- # validate_search_string(search_string)
3486
-
3487
- body = {
3488
- "class": "GlossarySearchStringRequestBody",
3489
- "glossaryGUID": glossary_guid,
3490
- "searchString": search_string,
3491
- "effectiveTime": effective_time,
3492
- "limitResultsByStatus": status_filter,
3493
- }
3494
- # body = body_slimmer(body)
3495
-
3496
- url = (
3497
- f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
3498
- f"terms/by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
3499
- f"endsWith={ends_with_s}&ignoreCase={ignore_case_s}&forLineage={for_lineage_s}&"
3500
- f"forDuplicateProcessing={for_duplicate_processing_s}"
3501
- )
3502
-
3503
- # print(f"\n\nURL is: \n {url}\n\nBody is: \n{body}")
3504
-
3505
- response = await self._async_make_request("POST", url, body)
3506
- return response.json().get(
3507
- "elementList", "No terms found"
3508
- ) # return response.text
3509
-
3510
- def find_glossary_terms(
3511
- self,
3512
- search_string: str,
3513
- glossary_guid: str = None,
3514
- status_filter: list = [],
3515
- effective_time: str = None,
3516
- starts_with: bool = False,
3517
- ends_with: bool = False,
3518
- ignore_case: bool = False,
3519
- for_lineage: bool = False,
3520
- for_duplicate_processing: bool = False,
3521
- start_from: int = 0,
3522
- page_size: int = None,
3523
- ) -> list | str:
3524
- """Retrieve the list of glossary term metadata elements that contain the search string.
3525
-
3526
- Parameters
3527
- ----------
3528
- search_string: str
3529
- Search string to use to find matching glossaries. If the search string is '*' then all glossaries returned.
3530
- glossary_guid str
3531
- Identifier of the glossary to search within. If None, then all glossaries are searched.
3532
- status_filter: list, default = [], optional
3533
- Filters the results by the included Term statuses (such as 'ACTIVE', 'DRAFT'). If not specified,
3534
- the results will not be filtered.
3535
- effective_time: str, [default=None], optional
3536
- If specified, the term information will be retrieved if it is active at the `effective_time`.
3537
- Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
3538
-
3539
- starts_with : bool, [default=False], optional
3540
- Starts with the supplied string.
3541
- ends_with : bool, [default=False], optional
3542
- Ends with the supplied string
3543
- ignore_case : bool, [default=False], optional
3544
- Ignore case when searching
3545
- for_lineage : bool, [default=False], optional
3546
-
3547
- for_duplicate_processing : bool, [default=False], optional
3548
-
3549
- start_from: str, [default=0], optional
3550
- Page of results to start from
3551
- page_size : int, optional
3552
- Number of elements to return per page - if None, then default for class will be used.
3553
-
3554
- Returns
3555
- -------
3556
- List | str
3557
-
3558
- A list of term definitions
3559
-
3560
- Raises
3561
- ------
3562
- InvalidParameterException
3563
- If the client passes incorrect parameters on the request - such as bad URLs or invalid values
3564
- PropertyServerException
3565
- Raised by the server when an issue arises in processing a valid request
3566
- NotAuthorizedException
3567
- The principle specified by the user_id does not have authorization for the requested action
3568
-
3569
- Notes
3570
- -----
3571
- The search string is located in the request body and is interpreted as a plain string.
3572
- The request parameters, startsWith, endsWith and ignoreCase can be used to allow a fuzzy search.
3573
- The request body also supports the specification of a glossaryGUID to restrict the search to within a single glossary.
3574
- """
3575
-
3576
- loop = asyncio.get_event_loop()
3577
- response = loop.run_until_complete(
3578
- self._async_find_glossary_terms(
3579
- search_string,
3580
- glossary_guid,
3581
- status_filter,
3582
- effective_time,
3583
- starts_with,
3584
- ends_with,
3585
- ignore_case,
3586
- for_lineage,
3587
- for_duplicate_processing,
3588
- start_from,
3589
- page_size,
3590
- )
3591
- )
3592
-
3593
- return response
2435
+ async def _async_relate_terms(self, term1_guid: str, term2_guid: str, relationship: str) -> None:
2436
+ pass
3594
2437
 
3595
2438
 
3596
2439
  if __name__ == "__main__":