pyegeria 5.3.9.9.7__py3-none-any.whl → 5.4.0__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.
- commands/cat/debug_log +2806 -0
- commands/cat/debug_log.2025-07-15_14-28-38_087378.zip +0 -0
- commands/cat/debug_log.2025-07-16_15-48-50_037087.zip +0 -0
- commands/cat/dr_egeria_command_help.py +273 -0
- commands/cat/dr_egeria_md.py +90 -20
- commands/cat/glossary_actions.py +2 -2
- commands/cat/list_collections.py +24 -10
- commands/cat/list_data_designer.py +183 -0
- md_processing/__init__.py +28 -5
- md_processing/data/commands.json +31474 -1096
- md_processing/dr_egeria_outbox-pycharm/.obsidian/app.json +1 -0
- md_processing/dr_egeria_outbox-pycharm/.obsidian/appearance.json +1 -0
- md_processing/dr_egeria_outbox-pycharm/.obsidian/core-plugins.json +31 -0
- md_processing/dr_egeria_outbox-pycharm/.obsidian/workspace.json +177 -0
- md_processing/dr_egeria_outbox-pycharm/monday/processed-2025-07-14 12:38-data_designer_out.md +663 -0
- md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 15:00-Derive-Dr-Gov-Defs.md +719 -0
- md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:13-Derive-Dr-Gov-Defs.md +41 -0
- md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:14-Derive-Dr-Gov-Defs.md +33 -0
- md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:50-Derive-Dr-Gov-Defs.md +192 -0
- md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-16 19:15-gov_def2.md +527 -0
- md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-17 12:08-gov_def2.md +527 -0
- md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-17 14:27-gov_def2.md +474 -0
- md_processing/family_docs/Data Designer/Create_Data_Class.md +164 -0
- md_processing/family_docs/Data Designer/Create_Data_Dictionary.md +30 -0
- md_processing/family_docs/Data Designer/Create_Data_Field.md +162 -0
- md_processing/family_docs/Data Designer/Create_Data_Specification.md +36 -0
- md_processing/family_docs/Data Designer/Create_Data_Structure.md +38 -0
- md_processing/family_docs/Data Designer/View_Data_Classes.md +78 -0
- md_processing/family_docs/Data Designer/View_Data_Dictionaries.md +78 -0
- md_processing/family_docs/Data Designer/View_Data_Fields.md +78 -0
- md_processing/family_docs/Data Designer/View_Data_Specifications.md +78 -0
- md_processing/family_docs/Data Designer/View_Data_Structures.md +78 -0
- md_processing/family_docs/Data Designer.md +842 -0
- md_processing/family_docs/Digital Product Manager/Add_Member->Collection.md +42 -0
- md_processing/family_docs/Digital Product Manager/Attach_Collection->Resource.md +36 -0
- md_processing/family_docs/Digital Product Manager/Create_Agreement.md +96 -0
- md_processing/family_docs/Digital Product Manager/Create_Data_Sharing_Agreement.md +72 -0
- md_processing/family_docs/Digital Product Manager/Create_DigitalSubscription.md +102 -0
- md_processing/family_docs/Digital Product Manager/Create_Digital_Product.md +134 -0
- md_processing/family_docs/Digital Product Manager/Link_Agreement_Items.md +60 -0
- md_processing/family_docs/Digital Product Manager/Link_Contracts.md +26 -0
- md_processing/family_docs/Digital Product Manager/Link_Digital_Product_-_Digital_Product.md +30 -0
- md_processing/family_docs/Digital Product Manager/Link_Subscribers.md +48 -0
- md_processing/family_docs/Digital Product Manager.md +668 -0
- md_processing/family_docs/Glossary/Attach_Category_Parent.md +18 -0
- md_processing/family_docs/Glossary/Attach_Term-Term_Relationship.md +26 -0
- md_processing/family_docs/Glossary/Create_Category.md +38 -0
- md_processing/family_docs/Glossary/Create_Glossary.md +42 -0
- md_processing/family_docs/Glossary/Create_Term.md +70 -0
- md_processing/family_docs/Glossary.md +206 -0
- md_processing/family_docs/Governance Officer/Create_Business_Imperative.md +106 -0
- md_processing/family_docs/Governance Officer/Create_Certification_Type.md +112 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Approach.md +114 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Obligation.md +114 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Principle.md +114 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Procedure.md +128 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Process.md +122 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Processing_Purpose.md +106 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Responsibility.md +122 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Rule.md +122 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Strategy.md +106 -0
- md_processing/family_docs/Governance Officer/Create_License_Type.md +112 -0
- md_processing/family_docs/Governance Officer/Create_Naming_Standard_Rule.md +122 -0
- md_processing/family_docs/Governance Officer/Create_Regulation_Article.md +106 -0
- md_processing/family_docs/Governance Officer/Create_Regulation_Definition.md +118 -0
- md_processing/family_docs/Governance Officer/Create_Security_Access_Control.md +114 -0
- md_processing/family_docs/Governance Officer/Create_Security_Group.md +120 -0
- md_processing/family_docs/Governance Officer/Create_Service_Level_Objectives.md +122 -0
- md_processing/family_docs/Governance Officer/Create_Threat_Definition.md +106 -0
- md_processing/family_docs/Governance Officer/Link_Governance_Controls.md +32 -0
- md_processing/family_docs/Governance Officer/Link_Governance_Drivers.md +32 -0
- md_processing/family_docs/Governance Officer/Link_Governance_Policies.md +32 -0
- md_processing/family_docs/Governance Officer/View_Governance_Definitions.md +82 -0
- md_processing/family_docs/Governance Officer.md +2412 -0
- md_processing/family_docs/Solution Architect/Create_Information_Supply_Chain.md +70 -0
- md_processing/family_docs/Solution Architect/Create_Solution_Blueprint.md +44 -0
- md_processing/family_docs/Solution Architect/Create_Solution_Component.md +96 -0
- md_processing/family_docs/Solution Architect/Create_Solution_Role.md +66 -0
- md_processing/family_docs/Solution Architect/Link_Information_Supply_Chain_Peers.md +32 -0
- md_processing/family_docs/Solution Architect/Link_Solution_Component_Peers.md +32 -0
- md_processing/family_docs/Solution Architect/View_Information_Supply_Chains.md +32 -0
- md_processing/family_docs/Solution Architect/View_Solution_Blueprints.md +32 -0
- md_processing/family_docs/Solution Architect/View_Solution_Components.md +32 -0
- md_processing/family_docs/Solution Architect/View_Solution_Roles.md +32 -0
- md_processing/family_docs/Solution Architect.md +490 -0
- md_processing/md_commands/data_designer_commands.py +1192 -710
- md_processing/md_commands/glossary_commands.py +19 -32
- md_processing/md_commands/governance_officer_commands.py +420 -0
- md_processing/md_commands/product_manager_commands.py +1180 -0
- md_processing/md_commands/project_commands.py +5 -2
- md_processing/md_commands/solution_architect_commands.py +1140 -0
- md_processing/md_processing_utils/common_md_proc_utils.py +288 -96
- md_processing/md_processing_utils/common_md_utils.py +205 -6
- md_processing/md_processing_utils/debug_log +574 -0
- md_processing/md_processing_utils/dr-egeria-help-2025-07-17T17:22:09.md +2065 -0
- md_processing/md_processing_utils/extraction_utils.py +1 -1
- md_processing/md_processing_utils/generate_dr_help.py +165 -0
- md_processing/md_processing_utils/generate_md_cmd_templates.py +143 -0
- md_processing/md_processing_utils/generate_md_templates.py +92 -0
- md_processing/md_processing_utils/generated_help_terms.md +842 -0
- md_processing/md_processing_utils/md_processing_constants.py +94 -17
- pyegeria/__init__.py +1 -0
- pyegeria/_client.py +39 -1
- pyegeria/classification_manager_omvs.py +1 -1
- pyegeria/collection_manager_omvs.py +4667 -1178
- pyegeria/data_designer_omvs.py +348 -31
- pyegeria/egeria_tech_client.py +9 -25
- pyegeria/glossary_browser_omvs.py +5 -6
- pyegeria/glossary_manager_omvs.py +2 -2
- pyegeria/governance_officer_omvs.py +2367 -0
- pyegeria/output_formatter.py +157 -32
- pyegeria/solution_architect_omvs.py +5063 -1110
- pyegeria/utils.py +22 -2
- {pyegeria-5.3.9.9.7.dist-info → pyegeria-5.4.0.dist-info}/METADATA +3 -1
- pyegeria-5.4.0.dist-info/RECORD +243 -0
- {pyegeria-5.3.9.9.7.dist-info → pyegeria-5.4.0.dist-info}/entry_points.txt +5 -0
- commands/cat/.DS_Store +0 -0
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro.md +0 -254
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_more_terms.md +0 -696
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part1.md +0 -254
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part2.md +0 -298
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part3.md +0 -608
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part4.md +0 -94
- md_processing/dr_egeria_inbox/archive/freddie_intro.md +0 -284
- md_processing/dr_egeria_inbox/archive/freddie_intro_orig.md +0 -275
- md_processing/dr_egeria_inbox/archive/test-term.md +0 -110
- md_processing/dr_egeria_inbox/cat_test.md +0 -100
- md_processing/dr_egeria_inbox/data_field.md +0 -54
- md_processing/dr_egeria_inbox/data_spec.md +0 -77
- md_processing/dr_egeria_inbox/data_spec_test.md +0 -2406
- md_processing/dr_egeria_inbox/data_test.md +0 -86
- md_processing/dr_egeria_inbox/dr_egeria_intro_categories.md +0 -168
- md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +0 -280
- md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +0 -313
- md_processing/dr_egeria_inbox/dr_egeria_intro_part3.md +0 -1073
- md_processing/dr_egeria_inbox/dr_egeria_isc1.md +0 -44
- md_processing/dr_egeria_inbox/glossary_test1.md +0 -324
- md_processing/dr_egeria_inbox/rel.md +0 -8
- md_processing/dr_egeria_inbox/sb.md +0 -119
- md_processing/dr_egeria_inbox/search_test.md +0 -39
- md_processing/dr_egeria_inbox/solution-components.md +0 -154
- md_processing/dr_egeria_inbox/solution_blueprints.md +0 -118
- md_processing/dr_egeria_inbox/synonym_test.md +0 -42
- md_processing/dr_egeria_inbox/t1.md +0 -0
- md_processing/dr_egeria_inbox/t2.md +0 -268
- md_processing/dr_egeria_outbox/processed-2025-05-15 19:52-data_test.md +0 -94
- md_processing/dr_egeria_outbox/processed-2025-05-16 07:39-data_test.md +0 -88
- md_processing/dr_egeria_outbox/processed-2025-05-17 16:01-data_field.md +0 -56
- md_processing/dr_egeria_outbox/processed-2025-05-18 15:51-data_test.md +0 -103
- md_processing/dr_egeria_outbox/processed-2025-05-18 16:47-data_test.md +0 -94
- md_processing/dr_egeria_outbox/processed-2025-05-19 07:14-data_test.md +0 -96
- md_processing/dr_egeria_outbox/processed-2025-05-19 07:20-data_test.md +0 -100
- md_processing/dr_egeria_outbox/processed-2025-05-19 07:22-data_test.md +0 -88
- md_processing/dr_egeria_outbox/processed-2025-05-19 09:26-data_test.md +0 -91
- md_processing/dr_egeria_outbox/processed-2025-05-19 10:27-data_test.md +0 -91
- md_processing/dr_egeria_outbox/processed-2025-05-19 14:04-data_test.md +0 -91
- md_processing/md_commands/blueprint_commands.py +0 -303
- pyegeria/.DS_Store +0 -0
- pyegeria/m_test.py +0 -118
- pyegeria-5.3.9.9.7.dist-info/RECORD +0 -196
- /commands/cat/{list_data_structures.py → list_data_structures_full.py} +0 -0
- {pyegeria-5.3.9.9.7.dist-info → pyegeria-5.4.0.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.9.9.7.dist-info → pyegeria-5.4.0.dist-info}/WHEEL +0 -0
@@ -1,91 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
Data Specification for the Teddy Bear Drop Foot Clinical Trial
|
8
|
-
|
9
|
-
# foo Create Data Specification
|
10
|
-
|
11
|
-
## Data Specification
|
12
|
-
|
13
|
-
|
14
|
-
Data Specification for the Teddy Bear Drop Foot Clinical Trial
|
15
|
-
>woof
|
16
|
-
## Description
|
17
|
-
>Meow -
|
18
|
-
|
19
|
-
Principle data requirements for Teddy Bear Drop Foot Clinical Trial.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
# foo Create Data Dictionary
|
25
|
-
## Name
|
26
|
-
Clinical Trial Data Dictionary
|
27
|
-
|
28
|
-
## Description
|
29
|
-
A data dictionary for clinical trial data elements.
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
___
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
TBDF-Incoming Weekly Measurement Data
|
39
|
-
|
40
|
-
|
41
|
-
# Update Data Structure
|
42
|
-
|
43
|
-
## Data Structure Name
|
44
|
-
|
45
|
-
TBDF-Incoming Weekly Measurement Data
|
46
|
-
|
47
|
-
## Description
|
48
|
-
This describes the weekly measurement data for each patient for the Teddy Bear drop foot clinical trial
|
49
|
-
|
50
|
-
## Qualified Name
|
51
|
-
DataStruct::TBDF-Incoming Weekly Measurement Data
|
52
|
-
|
53
|
-
## Namespace
|
54
|
-
|
55
|
-
|
56
|
-
## Version Identifier
|
57
|
-
|
58
|
-
|
59
|
-
## Guid
|
60
|
-
3eb5d206-6d3f-4b61-8f45-d7fbc05a870e
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
WWT-Incoming Weekly Measurement Data
|
65
|
-
|
66
|
-
# foo Create Data Structure
|
67
|
-
|
68
|
-
## Qualified Name
|
69
|
-
DataStruct::WWT-Incoming Weekly Measurement Data
|
70
|
-
|
71
|
-
## GUID
|
72
|
-
ae221834-a3a6-4f32-ac94-110dff761b49
|
73
|
-
|
74
|
-
## Data Structure
|
75
|
-
|
76
|
-
WWT-Incoming Weekly Measurement Data
|
77
|
-
|
78
|
-
|
79
|
-
## Description
|
80
|
-
A collection of data fields that form a data structure.
|
81
|
-
|
82
|
-
|
83
|
-
## In Data Specification
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
## Qualified Name
|
88
|
-
|
89
|
-
# Provenance
|
90
|
-
|
91
|
-
* Results from processing file data_test.md on 2025-05-19 14:04
|
@@ -1,303 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
This file contains blueprint/solution-related object_action functions for processing Egeria Markdown
|
3
|
-
"""
|
4
|
-
from typing import Optional
|
5
|
-
|
6
|
-
from rich.markdown import Markdown
|
7
|
-
|
8
|
-
from pyegeria.egeria_tech_client import EgeriaTech
|
9
|
-
from md_processing.md_processing_utils.common_md_utils import (
|
10
|
-
debug_level, print_msg, update_element_dictionary
|
11
|
-
)
|
12
|
-
from md_processing.md_processing_utils.extraction_utils import (
|
13
|
-
extract_command_plus, process_simple_attribute, process_name_list, process_element_identifiers, update_a_command
|
14
|
-
)
|
15
|
-
|
16
|
-
from md_processing.md_processing_utils.md_processing_constants import (
|
17
|
-
BLUEPRINT_NAME_LABELS, COMPONENT_NAME_LABELS, ALWAYS, ERROR, INFO, pre_command, EXISTS_REQUIRED,
|
18
|
-
)
|
19
|
-
|
20
|
-
def process_blueprint_upsert_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[str]:
|
21
|
-
"""
|
22
|
-
Processes a solution blueprint create or update object_action by extracting key attributes such as
|
23
|
-
blueprint name, description, and usage from the given text.
|
24
|
-
|
25
|
-
:param txt: A string representing the input cell to be processed for
|
26
|
-
extracting blueprint-related attributes.
|
27
|
-
:param directive: an optional string indicating the directive to be used - display, validate or execute
|
28
|
-
:return: A string summarizing the outcome of the processing.
|
29
|
-
"""
|
30
|
-
from md_processing.md_processing_utils.common_md_utils import set_debug_level
|
31
|
-
|
32
|
-
command, object_type, object_action = extract_command_plus(txt)
|
33
|
-
set_debug_level(directive)
|
34
|
-
|
35
|
-
blueprint_name = process_simple_attribute(txt, BLUEPRINT_NAME_LABELS, ERROR)
|
36
|
-
print(Markdown(f"{pre_command} `{object_action}` `{object_type}` for blueprint: `\'{blueprint_name}\'` with directive: `{directive}` "))
|
37
|
-
description = process_simple_attribute(txt, ['Description'], INFO)
|
38
|
-
usage = process_simple_attribute(txt, ['Usage'], INFO)
|
39
|
-
q_name = process_simple_attribute(txt, ['Qualified Name'], INFO)
|
40
|
-
valid = True
|
41
|
-
|
42
|
-
if blueprint_name is None:
|
43
|
-
valid = False
|
44
|
-
known_q_name = None
|
45
|
-
known_guid = None
|
46
|
-
blueprint_exists = False
|
47
|
-
else:
|
48
|
-
element_labels = BLUEPRINT_NAME_LABELS
|
49
|
-
element_labels.append('Display Name')
|
50
|
-
known_q_name, known_guid, valid, blueprint_exists = process_element_identifiers(egeria_client, object_type,
|
51
|
-
element_labels, txt,
|
52
|
-
object_action, None)
|
53
|
-
|
54
|
-
blueprint_display = (f"\n* Command: `{command}`\n\t* Blueprint Name: {blueprint_name}\n\t"
|
55
|
-
f"* Description: {description}\n\t* Usage: {usage}\n")
|
56
|
-
|
57
|
-
if object_action == 'Update':
|
58
|
-
guid = process_simple_attribute(txt, ['GUID', 'guid', 'Guid'])
|
59
|
-
blueprint_display += f"* Qualified Name: `{q_name}`\n\t* GUID: {guid}\n\n"
|
60
|
-
if not blueprint_exists:
|
61
|
-
msg = f"Blueprint can't be updated; `{blueprint_name}` not found"
|
62
|
-
print_msg("ERROR", msg, debug_level)
|
63
|
-
valid = False
|
64
|
-
else:
|
65
|
-
msg = f"Blueprint can be updated; `{blueprint_name}` found"
|
66
|
-
print_msg(ALWAYS, msg, debug_level)
|
67
|
-
|
68
|
-
elif object_action == "Create":
|
69
|
-
if blueprint_exists:
|
70
|
-
msg = f"Blueprint `{blueprint_name}` can't be created because it already exists.\n"
|
71
|
-
print_msg("ERROR", msg, debug_level)
|
72
|
-
valid = False
|
73
|
-
elif valid:
|
74
|
-
msg = f"It is valid to create Blueprint `{blueprint_name}` with:\n"
|
75
|
-
print_msg("ALWAYS", msg, debug_level)
|
76
|
-
|
77
|
-
if directive == "display":
|
78
|
-
print(Markdown(blueprint_display))
|
79
|
-
return None
|
80
|
-
|
81
|
-
elif directive == "validate":
|
82
|
-
if valid:
|
83
|
-
print(Markdown(blueprint_display))
|
84
|
-
else:
|
85
|
-
msg = f"Validation failed for Blueprint `{blueprint_name}`\n"
|
86
|
-
print_msg(ERROR, msg, debug_level)
|
87
|
-
print(Markdown(blueprint_display))
|
88
|
-
|
89
|
-
return valid
|
90
|
-
|
91
|
-
elif directive == "process":
|
92
|
-
if valid:
|
93
|
-
print(Markdown(blueprint_display))
|
94
|
-
else:
|
95
|
-
if blueprint_exists and object_action == "Create":
|
96
|
-
msg = f"Create failed because blueprint `{blueprint_name}` exists - changing `Create` to `Update` in processed output \n"
|
97
|
-
print_msg(ERROR, msg, debug_level)
|
98
|
-
print(Markdown(blueprint_display))
|
99
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
100
|
-
else:
|
101
|
-
return None
|
102
|
-
|
103
|
-
if object_action == "Update":
|
104
|
-
if not blueprint_exists:
|
105
|
-
print(f"\n{ERROR}Blueprint `{blueprint_name}` does not exist! Updating result document with Create "
|
106
|
-
f"object_action\n")
|
107
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
108
|
-
|
109
|
-
body = {
|
110
|
-
"class": "ReferenceableRequestBody", "elementProperties": {
|
111
|
-
"class": "SolutionBlueprintProperties", "qualifiedName": known_q_name, "description": description,
|
112
|
-
"usage": usage
|
113
|
-
}
|
114
|
-
}
|
115
|
-
egeria_client.update_solution_blueprint(known_guid, body)
|
116
|
-
print_msg(ALWAYS, f"Updated Blueprint `{blueprint_name}` with GUID {known_guid}", debug_level)
|
117
|
-
update_element_dictionary(known_q_name, {
|
118
|
-
'guid': known_guid, 'display_name': blueprint_name
|
119
|
-
})
|
120
|
-
return egeria_client.get_solution_blueprint_by_guid(known_guid, output_format='MD')
|
121
|
-
|
122
|
-
elif object_action == "Create":
|
123
|
-
if blueprint_exists:
|
124
|
-
print(f"\nBlueprint `{blueprint_name}` already exists and result document updated\n")
|
125
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
126
|
-
else:
|
127
|
-
blueprint_guid = egeria_client.create_solution_blueprint(blueprint_name, description, usage)
|
128
|
-
if blueprint_guid:
|
129
|
-
print_msg(ALWAYS, f"Created Blueprint `{blueprint_name}` with GUID {blueprint_guid}", debug_level)
|
130
|
-
return egeria_client.get_solution_blueprint_by_guid(blueprint_guid, output_format='MD')
|
131
|
-
else:
|
132
|
-
print_msg(ERROR, f"Failed to create Blueprint `{blueprint_name}`", debug_level)
|
133
|
-
return None
|
134
|
-
|
135
|
-
|
136
|
-
def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[str]:
|
137
|
-
"""
|
138
|
-
Processes a solution component create or update object_action by extracting key attributes such as
|
139
|
-
component name, description, and parent components from the given text.
|
140
|
-
|
141
|
-
:param txt: A string representing the input cell to be processed for
|
142
|
-
extracting component-related attributes.
|
143
|
-
:param directive: an optional string indicating the directive to be used - display, validate or execute
|
144
|
-
:return: A string summarizing the outcome of the processing.
|
145
|
-
"""
|
146
|
-
from md_processing.md_processing_utils.common_md_utils import set_debug_level
|
147
|
-
|
148
|
-
command, object_type, object_action = extract_command_plus(txt)
|
149
|
-
set_debug_level(directive)
|
150
|
-
|
151
|
-
component_name = process_simple_attribute(txt, COMPONENT_NAME_LABELS, ERROR)
|
152
|
-
print(Markdown(f"{pre_command} `{object_action}` `{object_type}` for component: `\'{component_name}\'` with directive: `{directive}` "))
|
153
|
-
description = process_simple_attribute(txt, ['Description'], INFO)
|
154
|
-
q_name = process_simple_attribute(txt, ['Qualified Name'], INFO)
|
155
|
-
valid = True
|
156
|
-
|
157
|
-
if component_name is None:
|
158
|
-
valid = False
|
159
|
-
known_q_name = None
|
160
|
-
known_guid = None
|
161
|
-
component_exists = False
|
162
|
-
else:
|
163
|
-
element_labels = COMPONENT_NAME_LABELS
|
164
|
-
element_labels.append('Display Name')
|
165
|
-
known_q_name, known_guid, valid, component_exists = process_element_identifiers(egeria_client, object_type,
|
166
|
-
element_labels, txt,
|
167
|
-
object_action, None)
|
168
|
-
|
169
|
-
# Get the blueprint this component is in
|
170
|
-
blueprint_name = process_simple_attribute(txt, BLUEPRINT_NAME_LABELS)
|
171
|
-
if blueprint_name:
|
172
|
-
known_blueprint_q_name, known_blueprint_guid, blueprint_valid, blueprint_exists = process_element_identifiers(
|
173
|
-
egeria_client, "Solution Blueprint", BLUEPRINT_NAME_LABELS, txt, EXISTS_REQUIRED, None)
|
174
|
-
if not blueprint_exists:
|
175
|
-
valid = False
|
176
|
-
else:
|
177
|
-
known_blueprint_q_name = None
|
178
|
-
known_blueprint_guid = None
|
179
|
-
blueprint_valid = True
|
180
|
-
blueprint_exists = False
|
181
|
-
|
182
|
-
# Get the parent components if specified
|
183
|
-
parent_components = process_simple_attribute(txt, ['Parent Components', 'Parent Component'])
|
184
|
-
if parent_components:
|
185
|
-
parent_components_list, parent_q_name_list, parents_valid, parents_exist = process_name_list(
|
186
|
-
egeria_client, 'Solution Components', txt, COMPONENT_NAME_LABELS)
|
187
|
-
if not parents_exist:
|
188
|
-
valid = False
|
189
|
-
else:
|
190
|
-
parent_components_list = None
|
191
|
-
parent_q_name_list = None
|
192
|
-
parents_valid = True
|
193
|
-
parents_exist = False
|
194
|
-
|
195
|
-
component_display = (f"\n* Command: `{command}`\n\t* Component Name: {component_name}\n\t"
|
196
|
-
f"* Blueprint: {blueprint_name}\n\t* Parent Components: {parent_components}\n\t"
|
197
|
-
f"* Description: {description}\n")
|
198
|
-
|
199
|
-
if object_action == 'Update':
|
200
|
-
guid = process_simple_attribute(txt, ['GUID', 'guid', 'Guid'])
|
201
|
-
component_display += f"* Qualified Name: `{q_name}`\n\t* GUID: {guid}\n\n"
|
202
|
-
if not component_exists:
|
203
|
-
msg = f"Component can't be updated; `{component_name}` not found"
|
204
|
-
print_msg("ERROR", msg, debug_level)
|
205
|
-
valid = False
|
206
|
-
else:
|
207
|
-
msg = f"Component can be updated; `{component_name}` found"
|
208
|
-
print_msg(ALWAYS, msg, debug_level)
|
209
|
-
|
210
|
-
elif object_action == "Create":
|
211
|
-
if component_exists:
|
212
|
-
msg = f"Component `{component_name}` can't be created because it already exists.\n"
|
213
|
-
print_msg("ERROR", msg, debug_level)
|
214
|
-
valid = False
|
215
|
-
elif valid:
|
216
|
-
msg = f"It is valid to create Component `{component_name}` with:\n"
|
217
|
-
print_msg("ALWAYS", msg, debug_level)
|
218
|
-
|
219
|
-
if directive == "display":
|
220
|
-
print(Markdown(component_display))
|
221
|
-
return None
|
222
|
-
|
223
|
-
elif directive == "validate":
|
224
|
-
if valid:
|
225
|
-
print(Markdown(component_display))
|
226
|
-
else:
|
227
|
-
msg = f"Validation failed for Component `{component_name}`\n"
|
228
|
-
print_msg(ERROR, msg, debug_level)
|
229
|
-
print(Markdown(component_display))
|
230
|
-
|
231
|
-
return valid
|
232
|
-
|
233
|
-
elif directive == "process":
|
234
|
-
if valid:
|
235
|
-
print(Markdown(component_display))
|
236
|
-
else:
|
237
|
-
if component_exists and object_action == "Create":
|
238
|
-
msg = f"Create failed because component `{component_name}` exists - changing `Create` to `Update` in processed output \n"
|
239
|
-
print_msg(ERROR, msg, debug_level)
|
240
|
-
print(Markdown(component_display))
|
241
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
242
|
-
else:
|
243
|
-
return None
|
244
|
-
|
245
|
-
if object_action == "Update":
|
246
|
-
if not component_exists:
|
247
|
-
print(f"\n{ERROR}Component `{component_name}` does not exist! Updating result document with Create "
|
248
|
-
f"object_action\n")
|
249
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
250
|
-
|
251
|
-
body = {
|
252
|
-
"class": "ReferenceableRequestBody", "elementProperties": {
|
253
|
-
"class": "SolutionComponentProperties", "qualifiedName": known_q_name, "description": description
|
254
|
-
}
|
255
|
-
}
|
256
|
-
egeria_client.update_solution_component(known_guid, body)
|
257
|
-
print_msg(ALWAYS, f"Updated Component `{component_name}` with GUID {known_guid}", debug_level)
|
258
|
-
update_element_dictionary(known_q_name, {
|
259
|
-
'guid': known_guid, 'display_name': component_name
|
260
|
-
})
|
261
|
-
|
262
|
-
# Update parent components if specified
|
263
|
-
if parent_components and parents_exist and parents_valid:
|
264
|
-
# Get the current parent components
|
265
|
-
component_details = egeria_client.get_solution_component_by_guid(known_guid)
|
266
|
-
current_parents = []
|
267
|
-
if 'parentComponents' in component_details:
|
268
|
-
for parent in component_details['parentComponents']:
|
269
|
-
current_parents.append(parent.get('guid', None))
|
270
|
-
|
271
|
-
# Add new parent components
|
272
|
-
for parent in parent_q_name_list:
|
273
|
-
if parent not in current_parents:
|
274
|
-
egeria_client.add_parent_component(parent, known_guid)
|
275
|
-
print_msg(INFO, f"Added parent component to {component_name}", debug_level)
|
276
|
-
|
277
|
-
# Remove parent components that are not in the new list
|
278
|
-
for parent in current_parents:
|
279
|
-
if parent not in parent_q_name_list:
|
280
|
-
egeria_client.remove_parent_component(parent, known_guid)
|
281
|
-
print_msg(INFO, f"Removed parent component from {component_name}", debug_level)
|
282
|
-
|
283
|
-
return egeria_client.get_solution_component_by_guid(known_guid, output_format='MD')
|
284
|
-
|
285
|
-
elif object_action == "Create":
|
286
|
-
if component_exists:
|
287
|
-
print(f"\nComponent `{component_name}` already exists and result document updated\n")
|
288
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
289
|
-
else:
|
290
|
-
component_guid = egeria_client.create_solution_component(component_name, description, known_blueprint_guid)
|
291
|
-
if component_guid:
|
292
|
-
print_msg(ALWAYS, f"Created Component `{component_name}` with GUID {component_guid}", debug_level)
|
293
|
-
|
294
|
-
# Add parent components if specified
|
295
|
-
if parent_components and parents_exist and parents_valid:
|
296
|
-
for parent in parent_q_name_list:
|
297
|
-
egeria_client.add_parent_component(parent, component_guid)
|
298
|
-
print_msg(INFO, f"Added parent component to {component_name}", debug_level)
|
299
|
-
|
300
|
-
return egeria_client.get_solution_component_by_guid(component_guid, output_format='MD')
|
301
|
-
else:
|
302
|
-
print_msg(ERROR, f"Failed to create Component `{component_name}`", debug_level)
|
303
|
-
return None
|
pyegeria/.DS_Store
DELETED
Binary file
|
pyegeria/m_test.py
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
from pyegeria.mermaid_utilities import construct_mermaid_web, construct_mermaid_jup, render_mermaid
|
2
|
-
|
3
|
-
m = """
|
4
|
-
---
|
5
|
-
title: Component for Solution Blueprint - Clinical Trial Management Solution Blueprint [c4f8d707-7c85-4125-b5fd-c3257a2ef2ef]
|
6
|
-
---
|
7
|
-
flowchart TD
|
8
|
-
%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
9
|
-
|
10
|
-
subgraph c4f8d707-7c85-4125-b5fd-c3257a2ef2ef [Components and Actors]
|
11
|
-
fc2de77f-7320-48ea-8750-d434c6e870db@{ shape: text, label: "*Description*
|
12
|
-
**A description of how a clinical trial is managed in Coco Pharmaceuticals.**"}
|
13
|
-
37b8560d-84d4-434b-9b0d-105420fcc924@{ shape: subproc, label: "*Solution Component*
|
14
|
-
**Certify Hospital**"}
|
15
|
-
f37f3735-28a1-4e03-9ff5-3fe2f137f661@{ shape: trap-t, label: "*Solution Actor Role*
|
16
|
-
**Clinical Trial Manager**"}
|
17
|
-
f37f3735-28a1-4e03-9ff5-3fe2f137f661-->|"Certifier"|37b8560d-84d4-434b-9b0d-105420fcc924
|
18
|
-
72a86eec-9734-4bc0-babb-4fec0aa7c9ff@{ shape: docs, label: "*Solution Component*
|
19
|
-
**Assemble Treatment Assessment Report**"}
|
20
|
-
48bc201e-3d4e-4beb-bdb2-0fd9d134f6d5@{ shape: rect, label: "*Solution Component*
|
21
|
-
**Treatment Efficacy Evidence**"}
|
22
|
-
48bc201e-3d4e-4beb-bdb2-0fd9d134f6d5-->|"Solution Linking Wire"|72a86eec-9734-4bc0-babb-4fec0aa7c9ff
|
23
|
-
f37f3735-28a1-4e03-9ff5-3fe2f137f661-->|"Author"|72a86eec-9734-4bc0-babb-4fec0aa7c9ff
|
24
|
-
b5c8da4c-f925-4cf1-8294-e43cd2c1a584@{ shape: rect, label: "*Solution Component*
|
25
|
-
**Analyse Patient Data**"}
|
26
|
-
b5c8da4c-f925-4cf1-8294-e43cd2c1a584-->|"Solution Linking Wire"|48bc201e-3d4e-4beb-bdb2-0fd9d134f6d5
|
27
|
-
7f5dca65-50b4-4103-9ac7-3a406a09047a@{ shape: subproc, label: "*Solution Component*
|
28
|
-
**Weekly Measurements Onboarding Pipeline**"}
|
29
|
-
07705e15-efff-4f80-8992-f04ac85e0ef1@{ shape: rect, label: "*Solution Component*
|
30
|
-
**Landing Folder Cataloguer**"}
|
31
|
-
07705e15-efff-4f80-8992-f04ac85e0ef1-->|"Solution Linking Wire"|7f5dca65-50b4-4103-9ac7-3a406a09047a
|
32
|
-
f37f3735-28a1-4e03-9ff5-3fe2f137f661-->|"Steward"|7f5dca65-50b4-4103-9ac7-3a406a09047a
|
33
|
-
b0290339-c96c-4b05-904f-12fc98e54e14@{ shape: trap-t, label: "*Solution Actor Role*
|
34
|
-
**Certified Data Engineer**"}
|
35
|
-
b0290339-c96c-4b05-904f-12fc98e54e14-->|"Steward"|7f5dca65-50b4-4103-9ac7-3a406a09047a
|
36
|
-
d48f579f-76d3-4c49-b1b4-575f5645a9d0@{ shape: lin-cyl, label: "*Solution Component*
|
37
|
-
**Treatment Validation Sandbox**"}
|
38
|
-
26c07ca4-3b8e-484b-812b-36c1ace4b275@{ shape: rect, label: "*Solution Component*
|
39
|
-
**Populate Sandbox**"}
|
40
|
-
26c07ca4-3b8e-484b-812b-36c1ace4b275-->|"Solution Linking Wire"|d48f579f-76d3-4c49-b1b4-575f5645a9d0
|
41
|
-
ee2bb773-e630-4cf9-bdf1-7c2dd64fe4ec@{ shape: processes, label: "*Solution Component*
|
42
|
-
**Hospital Processes**"}
|
43
|
-
a8bd84ca-0aae-4534-b0e8-87e8659467a6@{ shape: trap-t, label: "*Solution Actor Role*
|
44
|
-
**Clinical Trial Participating Hospital Coordinator**"}
|
45
|
-
a8bd84ca-0aae-4534-b0e8-87e8659467a6-->|"Coordinator on behalf of hospital"|ee2bb773-e630-4cf9-bdf1-7c2dd64fe4ec
|
46
|
-
30adaab5-8870-47a8-8ae9-facbf84cb05a@{ shape: trap-t, label: "*Solution Actor Role*
|
47
|
-
**Clinical Trial Participating Hospital**"}
|
48
|
-
30adaab5-8870-47a8-8ae9-facbf84cb05a-->|"Owner"|ee2bb773-e630-4cf9-bdf1-7c2dd64fe4ec
|
49
|
-
d48f579f-76d3-4c49-b1b4-575f5645a9d0-->|"Solution Linking Wire"|b5c8da4c-f925-4cf1-8294-e43cd2c1a584
|
50
|
-
ece17806-836c-4756-b3a2-2d12dde215f6@{ shape: trap-t, label: "*Solution Actor Role*
|
51
|
-
**New Treatment Data Scientist**"}
|
52
|
-
ece17806-836c-4756-b3a2-2d12dde215f6-->|"Data Analyser"|b5c8da4c-f925-4cf1-8294-e43cd2c1a584
|
53
|
-
0c757e35-8a42-4d5f-b01b-c72a6cea65cc@{ shape: trap-t, label: "*Solution Actor Role*
|
54
|
-
**New Treatment Researcher.**"}
|
55
|
-
0c757e35-8a42-4d5f-b01b-c72a6cea65cc-->|"Results Interpreter"|b5c8da4c-f925-4cf1-8294-e43cd2c1a584
|
56
|
-
e9c2f911-ffcb-40c6-aeee-8c4d43811576@{ shape: subproc, label: "*Solution Component*
|
57
|
-
**Onboard Hospital**"}
|
58
|
-
b0290339-c96c-4b05-904f-12fc98e54e14-->|"Initiator"|e9c2f911-ffcb-40c6-aeee-8c4d43811576
|
59
|
-
849b0b42-f465-452b-813c-477d6398e082@{ shape: subproc, label: "*Solution Component*
|
60
|
-
**Set up clinical trial**"}
|
61
|
-
f37f3735-28a1-4e03-9ff5-3fe2f137f661-->|"Initiator"|849b0b42-f465-452b-813c-477d6398e082
|
62
|
-
a5d4d638-6836-47e5-99d0-fdcde637e13f@{ shape: lin-cyl, label: "*Solution Component*
|
63
|
-
**Weekly Measurements Data Lake Folder**"}
|
64
|
-
7f5dca65-50b4-4103-9ac7-3a406a09047a-->|"Solution Linking Wire"|a5d4d638-6836-47e5-99d0-fdcde637e13f
|
65
|
-
0bf2547c-937c-41b6-814f-6284849271a1@{ shape: odd, label: "*Solution Component*
|
66
|
-
**Treatment Assessment Report Validation and Delivery**"}
|
67
|
-
72a86eec-9734-4bc0-babb-4fec0aa7c9ff-->|"Solution Linking Wire"|0bf2547c-937c-41b6-814f-6284849271a1
|
68
|
-
f6bc847b-868d-43cc-b767-41f5fe3e47d1@{ shape: trap-t, label: "*Solution Actor Role*
|
69
|
-
**Clinical Trial Sponsor**"}
|
70
|
-
f6bc847b-868d-43cc-b767-41f5fe3e47d1-->|"Reviewer"|0bf2547c-937c-41b6-814f-6284849271a1
|
71
|
-
a5d4d638-6836-47e5-99d0-fdcde637e13f-->|"Solution Linking Wire"|26c07ca4-3b8e-484b-812b-36c1ace4b275
|
72
|
-
fb32bef2-e79f-4893-b500-2e547f24d482@{ shape: subproc, label: "*Solution Component*
|
73
|
-
**Set up Data Lake Folder**"}
|
74
|
-
b0290339-c96c-4b05-904f-12fc98e54e14-->|"Initiator"|fb32bef2-e79f-4893-b500-2e547f24d482
|
75
|
-
1c150d6e-30cf-481c-9afb-3b06c9c9e78f@{ shape: lin-cyl, label: "*Solution Component*
|
76
|
-
**Hospital Landing Area Folder**"}
|
77
|
-
ee2bb773-e630-4cf9-bdf1-7c2dd64fe4ec-->|"Solution Linking Wire"|1c150d6e-30cf-481c-9afb-3b06c9c9e78f
|
78
|
-
1c150d6e-30cf-481c-9afb-3b06c9c9e78f-->|"Solution Linking Wire"|07705e15-efff-4f80-8992-f04ac85e0ef1
|
79
|
-
11c7c850-c67c-41cc-9423-d74db47cbf3a@{ shape: subproc, label: "*Solution Component*
|
80
|
-
**Nominate Hospital**"}
|
81
|
-
f37f3735-28a1-4e03-9ff5-3fe2f137f661-->|"Initiator"|11c7c850-c67c-41cc-9423-d74db47cbf3a
|
82
|
-
end
|
83
|
-
style 48bc201e-3d4e-4beb-bdb2-0fd9d134f6d5 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
84
|
-
style ece17806-836c-4756-b3a2-2d12dde215f6 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7
|
85
|
-
style e9c2f911-ffcb-40c6-aeee-8c4d43811576 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
86
|
-
style a5d4d638-6836-47e5-99d0-fdcde637e13f color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
87
|
-
style 0bf2547c-937c-41b6-814f-6284849271a1 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
88
|
-
style 30adaab5-8870-47a8-8ae9-facbf84cb05a color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7
|
89
|
-
style b0290339-c96c-4b05-904f-12fc98e54e14 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7
|
90
|
-
style 26c07ca4-3b8e-484b-812b-36c1ace4b275 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
91
|
-
style 1c150d6e-30cf-481c-9afb-3b06c9c9e78f color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
92
|
-
style 07705e15-efff-4f80-8992-f04ac85e0ef1 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
93
|
-
style a8bd84ca-0aae-4534-b0e8-87e8659467a6 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7
|
94
|
-
style 0c757e35-8a42-4d5f-b01b-c72a6cea65cc color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7
|
95
|
-
style c4f8d707-7c85-4125-b5fd-c3257a2ef2ef color:#3079ab, fill:#b7c0c7, stroke:#3079ab
|
96
|
-
style 37b8560d-84d4-434b-9b0d-105420fcc924 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
97
|
-
style 11c7c850-c67c-41cc-9423-d74db47cbf3a color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
98
|
-
style fc2de77f-7320-48ea-8750-d434c6e870db color:#000000, fill:#F9F7ED, stroke:#b7c0c7
|
99
|
-
style 849b0b42-f465-452b-813c-477d6398e082 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
100
|
-
style 7f5dca65-50b4-4103-9ac7-3a406a09047a color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
101
|
-
style ee2bb773-e630-4cf9-bdf1-7c2dd64fe4ec color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
102
|
-
style 72a86eec-9734-4bc0-babb-4fec0aa7c9ff color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
103
|
-
style b5c8da4c-f925-4cf1-8294-e43cd2c1a584 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
104
|
-
style f6bc847b-868d-43cc-b767-41f5fe3e47d1 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7
|
105
|
-
style d48f579f-76d3-4c49-b1b4-575f5645a9d0 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
106
|
-
style f37f3735-28a1-4e03-9ff5-3fe2f137f661 color:#FFFFFF, fill:#AA00FF, stroke:#E1D5E7
|
107
|
-
style fb32bef2-e79f-4893-b500-2e547f24d482 color:#FFFFFF, fill:#838cc7, stroke:#3079ab
|
108
|
-
"""
|
109
|
-
|
110
|
-
h = construct_mermaid_web(m)
|
111
|
-
print(h)
|
112
|
-
with open("test_w.html", "w") as f:
|
113
|
-
f.write(h)
|
114
|
-
|
115
|
-
h = render_mermaid(m)
|
116
|
-
print(h)
|
117
|
-
with open("test_j.html", "w") as f:
|
118
|
-
f.write(h)
|