pyegeria 5.4.4.7__py3-none-any.whl → 5.4.5__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.2025-09-20_11-10-54_418109.log.zip +0 -0
- commands/cat/debug_log.2025-09-21_11-59-27_391328.log.zip +0 -0
- md_processing/data/commands.json +13462 -8240
- md_processing/dr_egeria.py +3 -3
- md_processing/md_commands/data_designer_commands.py +11 -6
- md_processing/md_commands/ext_ref_commands.py +3 -3
- md_processing/md_commands/product_manager_commands.py +20 -5
- md_processing/md_commands/view_commands.py +10 -3
- md_processing/md_processing_utils/common_md_proc_utils.py +2 -1
- md_processing/md_processing_utils/md_processing_constants.py +1 -1
- pyegeria/_output_formats.py +88 -9
- pyegeria/collection_manager.py +33 -0
- pyegeria/data_designer.py +20 -21
- pyegeria/external_references.py +4 -1
- pyegeria/output_formatter.py +10 -3
- {pyegeria-5.4.4.7.dist-info → pyegeria-5.4.5.dist-info}/METADATA +1 -1
- {pyegeria-5.4.4.7.dist-info → pyegeria-5.4.5.dist-info}/RECORD +20 -19
- md_processing/dr-egeria-outbox/DataStruct-DrE-2025-09-19-22-35-57.md +0 -46
- {pyegeria-5.4.4.7.dist-info → pyegeria-5.4.5.dist-info}/LICENSE +0 -0
- {pyegeria-5.4.4.7.dist-info → pyegeria-5.4.5.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.4.7.dist-info → pyegeria-5.4.5.dist-info}/entry_points.txt +0 -0
md_processing/dr_egeria.py
CHANGED
@@ -12,8 +12,8 @@ from .md_commands.project_commands import process_link_project_dependency_comman
|
|
12
12
|
|
13
13
|
log_format = "{time} | {level} | {function} | {line} | {message} | {extra}"
|
14
14
|
logger.remove()
|
15
|
-
logger.add(sys.stderr, level="
|
16
|
-
logger.add("debug_log.log", rotation="1 day", retention="1 week", compression="zip", level="
|
15
|
+
logger.add(sys.stderr, level="ERROR", format=log_format, colorize=True)
|
16
|
+
logger.add("debug_log.log", rotation="1 day", retention="1 week", compression="zip", level="INFO", format=log_format,
|
17
17
|
colorize=True)
|
18
18
|
|
19
19
|
from rich import print
|
@@ -226,7 +226,7 @@ def process_md_file(input_file: str, output_folder:str, directive: str, server:
|
|
226
226
|
result = process_link_agreement_item_command(client, current_block, directive)
|
227
227
|
elif potential_command in ['Link Collection->Resource', 'Detach Collection->Resource']:
|
228
228
|
result = process_attach_collection_command(client, current_block, directive)
|
229
|
-
elif potential_command in ['
|
229
|
+
elif potential_command in ['Add Member->Collection', 'Detach Member->Collection', 'Add Member', 'Remove Member',
|
230
230
|
'Add to Folder', 'Remove from Folder']:
|
231
231
|
result = process_add_to_collection_command(client, current_block, directive)
|
232
232
|
elif potential_command in ['Link Subscriber->Subscription', 'Detach Subscriber->Subscription']:
|
@@ -453,6 +453,8 @@ def process_data_spec_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
453
453
|
in_data_spec_valid = attributes.get('In Data Specification', {}).get('valid', None)
|
454
454
|
in_data_spec_exists = attributes.get('In Data Specification', {}).get('exists', None)
|
455
455
|
output_set = make_format_set_name_from_type(object_type)
|
456
|
+
object_type = "DataSpec"
|
457
|
+
print(Markdown(parsed_output['display']))
|
456
458
|
|
457
459
|
if directive == "display":
|
458
460
|
|
@@ -480,7 +482,7 @@ def process_data_spec_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
480
482
|
f"==> Validation of {command} completed successfully! Proceeding to apply the changes.\n"))
|
481
483
|
|
482
484
|
body = set_update_body(object_type, attributes)
|
483
|
-
body['properties'] = set_element_prop_body(
|
485
|
+
body['properties'] = set_element_prop_body(object_type, qualified_name, attributes)
|
484
486
|
|
485
487
|
egeria_client.update_collection(guid, body)
|
486
488
|
if status:
|
@@ -490,7 +492,7 @@ def process_data_spec_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
490
492
|
update_element_dictionary(qualified_name, {
|
491
493
|
'guid': guid, 'display_name': display_name
|
492
494
|
})
|
493
|
-
return egeria_client.get_collection_by_guid(guid, element_type='Data
|
495
|
+
return egeria_client.get_collection_by_guid(guid, element_type='Data-Specification-DrE',
|
494
496
|
output_format='MD', output_format_set=output_set)
|
495
497
|
|
496
498
|
elif object_action == "Create":
|
@@ -670,6 +672,7 @@ def process_data_structure_upsert_command(egeria_client: EgeriaTech, txt: str,
|
|
670
672
|
guid = parsed_output.get('guid', None)
|
671
673
|
output_set = make_format_set_name_from_type(object_type)
|
672
674
|
|
675
|
+
print(Markdown(parsed_output['display']))
|
673
676
|
|
674
677
|
if directive == "display":
|
675
678
|
return None
|
@@ -731,6 +734,8 @@ def process_data_structure_upsert_command(egeria_client: EgeriaTech, txt: str,
|
|
731
734
|
|
732
735
|
update_data_collection_memberships(egeria_client, object_type, data_spec_guid_list, "DataSpec", guid,
|
733
736
|
display_name, merge_update)
|
737
|
+
update_data_collection_memberships(egeria_client, object_type, data_dict_guid_list, "DataSpec",
|
738
|
+
guid,display_name, merge_update)
|
734
739
|
core_props += f"## In Data Dictionary\n\n{data_dict_name_list}\n\n"
|
735
740
|
core_props += f"## In Data Specification\n\n{data_spec_name_list}\n\n"
|
736
741
|
logger.success(f"Updated {object_type} `{display_name}` with GUID {guid}\n\n___")
|
@@ -764,13 +769,13 @@ def process_data_structure_upsert_command(egeria_client: EgeriaTech, txt: str,
|
|
764
769
|
|
765
770
|
if in_data_dictionary:
|
766
771
|
logger.info(f"Will add to data dictionary(s) `{in_data_dictionary}`")
|
767
|
-
|
768
|
-
guid)
|
772
|
+
add_member_to_data_collections(egeria_client, data_dict_guid_list,
|
773
|
+
display_name,guid)
|
769
774
|
core_props += f"## In Data Dictionary\n\n{data_dict_name_list}\n\n"
|
770
775
|
|
771
776
|
if data_spec_guid_list:
|
772
|
-
|
773
|
-
guid)
|
777
|
+
add_member_to_data_collections(egeria_client, data_spec_guid_list,
|
778
|
+
display_name, guid)
|
774
779
|
core_props += f"## In Data Specifications\n\n`{data_spec_name_list}`\n\n"
|
775
780
|
|
776
781
|
logger.info(f"Created Element `{display_name}` with GUID {guid}\n\n___")
|
@@ -223,11 +223,11 @@ def process_link_to_external_reference_command(egeria_client: EgeriaTech, txt: s
|
|
223
223
|
attributes = parsed_output['attributes']
|
224
224
|
|
225
225
|
element_guid = attributes.get('Element Name', {}).get('guid', None)
|
226
|
-
external_reference_guid = attributes.get('
|
226
|
+
external_reference_guid = attributes.get('External Reference', {}).get('guid', None)
|
227
227
|
|
228
228
|
valid = parsed_output['valid']
|
229
229
|
exists = element_guid is not None and external_reference_guid is not None
|
230
|
-
prop_body = set_rel_prop_body("
|
230
|
+
prop_body = set_rel_prop_body("ExternalReferenceLink", attributes)
|
231
231
|
|
232
232
|
if directive == "display":
|
233
233
|
|
@@ -276,7 +276,7 @@ def process_link_to_external_reference_command(egeria_client: EgeriaTech, txt: s
|
|
276
276
|
return
|
277
277
|
|
278
278
|
else:
|
279
|
-
body = set_rel_request_body_for_type("
|
279
|
+
body = set_rel_request_body_for_type("ExternalReferencesLink", attributes)
|
280
280
|
body['properties'] = prop_body
|
281
281
|
|
282
282
|
egeria_client.link_external_reference(element_guid,
|
@@ -40,6 +40,7 @@ EGERIA_GLOSSARY_PATH = os.environ.get("EGERIA_GLOSSARY_PATH", None)
|
|
40
40
|
EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", "../../")
|
41
41
|
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "md_processing/dr_egeria_inbox")
|
42
42
|
EGERIA_OUTBOX_PATH = os.environ.get("EGERIA_OUTBOX_PATH", "md_processing/dr_egeria_outbox")
|
43
|
+
LOCAL_QUALIFIER = os.environ.get("EGERIA_LOCAL_QUALIFIER", None)
|
43
44
|
|
44
45
|
load_commands('commands.json')
|
45
46
|
debug_level = DEBUG_LEVEL
|
@@ -170,17 +171,32 @@ def process_collection_upsert_command(egeria_client: EgeriaTech, txt: str, direc
|
|
170
171
|
exists = parsed_output['exists']
|
171
172
|
|
172
173
|
qualified_name = parsed_output.get('qualified_name', None)
|
174
|
+
|
173
175
|
guid = parsed_output.get('guid', None)
|
174
176
|
|
175
|
-
|
177
|
+
|
176
178
|
|
177
179
|
logger.debug(json.dumps(parsed_output, indent=4))
|
178
180
|
|
179
181
|
attributes = parsed_output['attributes']
|
180
182
|
|
181
183
|
display_name = attributes['Display Name'].get('value', None)
|
184
|
+
version = attributes['Version Identifier'].get('value', None)
|
182
185
|
status = attributes.get('Status', {}).get('value', None)
|
183
186
|
output_set = make_format_set_name_from_type(object_type)
|
187
|
+
if object_type in ["Root Collection", "Folder"]:
|
188
|
+
obj = "Collection"
|
189
|
+
if object_type == "Folder":
|
190
|
+
qn_prefix = "Folder"
|
191
|
+
elif object_type == "Root Collection":
|
192
|
+
qn_prefix = "Root"
|
193
|
+
|
194
|
+
qualified_name = egeria_client.__create_qualified_name__(qn_prefix, display_name, LOCAL_QUALIFIER,
|
195
|
+
version_identifier=version)
|
196
|
+
|
197
|
+
else:
|
198
|
+
obj = object_type
|
199
|
+
print(Markdown(parsed_output['display']))
|
184
200
|
|
185
201
|
if directive == "display":
|
186
202
|
|
@@ -194,10 +210,7 @@ def process_collection_upsert_command(egeria_client: EgeriaTech, txt: str, direc
|
|
194
210
|
|
195
211
|
elif directive == "process":
|
196
212
|
try:
|
197
|
-
|
198
|
-
obj = "Collection"
|
199
|
-
else:
|
200
|
-
obj = object_type
|
213
|
+
|
201
214
|
|
202
215
|
if object_action == "Update":
|
203
216
|
if not exists:
|
@@ -791,6 +804,7 @@ def process_add_to_collection_command(egeria_client: EgeriaTech, txt: str,
|
|
791
804
|
"source": source,
|
792
805
|
"notes": notes,
|
793
806
|
}
|
807
|
+
label = "Add Member"
|
794
808
|
try:
|
795
809
|
if object_action in["Detach", "Unlink", "Remove"]:
|
796
810
|
if not exists:
|
@@ -832,6 +846,7 @@ def process_add_to_collection_command(egeria_client: EgeriaTech, txt: str,
|
|
832
846
|
body = set_rel_request_body(object_type, attributes)
|
833
847
|
|
834
848
|
body['properties'] = prop_body
|
849
|
+
body = body_slimmer(body)
|
835
850
|
egeria_client.add_to_collection(collection_guid,
|
836
851
|
element_guid, body)
|
837
852
|
msg = f"==>Linked `{element_guid}` to collection `{collection_guid}` \n"
|
@@ -8,6 +8,7 @@ import time
|
|
8
8
|
from typing import Optional
|
9
9
|
|
10
10
|
from loguru import logger
|
11
|
+
from pydantic import ValidationError
|
11
12
|
from rich import print
|
12
13
|
from rich.console import Console
|
13
14
|
from rich.markdown import Markdown
|
@@ -16,7 +17,7 @@ from md_processing.md_processing_utils.common_md_proc_utils import (parse_upsert
|
|
16
17
|
from md_processing.md_processing_utils.common_md_utils import update_element_dictionary
|
17
18
|
from md_processing.md_processing_utils.extraction_utils import (extract_command_plus, update_a_command)
|
18
19
|
from md_processing.md_processing_utils.md_processing_constants import (load_commands, ERROR)
|
19
|
-
from pyegeria import DEBUG_LEVEL, body_slimmer, print_basic_exception
|
20
|
+
from pyegeria import DEBUG_LEVEL, body_slimmer, print_basic_exception, print_validation_error
|
20
21
|
from pyegeria.egeria_tech_client import EgeriaTech, NO_ELEMENTS_FOUND
|
21
22
|
from pyegeria.config import settings
|
22
23
|
from pyegeria.logging_configuration import config_logging
|
@@ -202,8 +203,9 @@ def process_format_set_action(
|
|
202
203
|
return json.dumps(output, indent=4)
|
203
204
|
elif isinstance(output, (str, list)) and output_format in ["REPORT", "LIST", "FORM"]:
|
204
205
|
return output ## used to include pre-amble
|
205
|
-
elif isinstance(output, (str, list)) and output_format
|
206
|
-
return output
|
206
|
+
elif isinstance(output, (str, list)) and output_format in ["HTML", "MERMAID"]:
|
207
|
+
return '\n\n'.join(output)
|
208
|
+
|
207
209
|
|
208
210
|
elif isinstance(output, (str, list)) and output_format == "TABLE":
|
209
211
|
return "Table is not a legal output format for this command."
|
@@ -211,6 +213,8 @@ def process_format_set_action(
|
|
211
213
|
|
212
214
|
except PyegeriaException as e:
|
213
215
|
print_basic_exception(e)
|
216
|
+
except ValidationError as e:
|
217
|
+
print_validation_error(e)
|
214
218
|
|
215
219
|
|
216
220
|
def process_output_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[str]:
|
@@ -226,6 +230,9 @@ def process_output_command(egeria_client: EgeriaTech, txt: str, directive: str =
|
|
226
230
|
print(Markdown(f"# {command}\n"))
|
227
231
|
|
228
232
|
parsed_output = parse_view_command(egeria_client, object_type, object_action, txt, directive)
|
233
|
+
if parsed_output is None:
|
234
|
+
logger.error(f"No valid output found for command '{command}'.")
|
235
|
+
return None
|
229
236
|
|
230
237
|
attributes = parsed_output['attributes']
|
231
238
|
|
@@ -37,6 +37,7 @@ from pyegeria._globals import DEBUG_LEVEL
|
|
37
37
|
# Constants
|
38
38
|
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
39
39
|
EGERIA_USAGE_LEVEL = os.environ.get("EGERIA_USAGE_LEVEL", "Advanced")
|
40
|
+
LOCAL_QUALIFIER = os.environ.get("EGERIA_LOCAL_QUALIFIER", None)
|
40
41
|
console = Console(width=EGERIA_WIDTH)
|
41
42
|
|
42
43
|
debug_level = DEBUG_LEVEL
|
@@ -812,7 +813,7 @@ def proc_el_id(egeria_client: EgeriaTech, element_type: str, qn_prefix: str, ele
|
|
812
813
|
logger.info(msg)
|
813
814
|
|
814
815
|
if q_name is None and qualified_name is None:
|
815
|
-
q_name = egeria_client.__create_qualified_name__(qn_prefix, element_name,
|
816
|
+
q_name = egeria_client.__create_qualified_name__(qn_prefix, element_name, LOCAL_QUALIFIER, version)
|
816
817
|
update_element_dictionary(q_name, {'display_name': element_name})
|
817
818
|
|
818
819
|
elif qualified_name:
|
@@ -212,7 +212,7 @@ command_list = ["Provenance", "Create Glossary", "Update Glossary", "Create Term
|
|
212
212
|
"Link Subscriber->Subscription", "Detach Subscriber->Subscription",
|
213
213
|
"Link Collection->Resource", "Attach Collection->Resource",
|
214
214
|
"Unlink Collection->Resource", "Detach Collection->Resource",
|
215
|
-
"Add Member to Collection", "Add Member", "Member->Collection", 'Add Member', 'Add to Folder',
|
215
|
+
"Add Member to Collection", "Add Member", "Add Member->Collection", 'Add Member', 'Add to Folder',
|
216
216
|
"Remove Member from Collection", "Remove Member->Collection", ' Remove Member', 'Remove from Folder',
|
217
217
|
"View Governance Definitions", "View Gov Definitions",
|
218
218
|
"List Governance Definitions", "List Gov Definitions",
|
pyegeria/_output_formats.py
CHANGED
@@ -123,6 +123,7 @@ COMMON_COLUMNS = [
|
|
123
123
|
Column(name='Status', key='status'),
|
124
124
|
]
|
125
125
|
|
126
|
+
|
126
127
|
COMMON_METADATA_COLUMNS = [
|
127
128
|
Column(name='GUID', key='guid', format=True),
|
128
129
|
Column(name='Type Name', key='type_name'),
|
@@ -152,6 +153,12 @@ COMMON_FORMATS_ALL = Format(
|
|
152
153
|
columns=COMMON_COLUMNS,
|
153
154
|
)
|
154
155
|
|
156
|
+
|
157
|
+
MERMAID_FORMAT = Format(
|
158
|
+
types = ["MERMAID"],
|
159
|
+
columns = [Column(name='Mermaid', key='mermaid')]
|
160
|
+
)
|
161
|
+
|
155
162
|
EXT_REF_COLUMNS = COMMON_COLUMNS + [
|
156
163
|
Column(name='Reference Title', key='reference_title'),
|
157
164
|
Column(name='Reference Abstract', key='reference_abstract'),
|
@@ -466,7 +473,7 @@ base_output_format_sets = FormatSetDict({
|
|
466
473
|
aliases=["Collection", "RootCollection", "Folder", "ReferenceList", "HomeCollection",
|
467
474
|
"ResultSet", "RecentAccess", "WorkItemList", "Namespace"],
|
468
475
|
annotations=COMMON_ANNOTATIONS,
|
469
|
-
formats=[COLLECTION_DICT, COLLECTION_TABLE, COLLECTION_REPORT, COMMON_FORMATS_ALL], # Reusing common formats
|
476
|
+
formats=[MERMAID_FORMAT, COLLECTION_DICT, COLLECTION_TABLE, COLLECTION_REPORT, COMMON_FORMATS_ALL], # Reusing common formats
|
470
477
|
action=ActionParameter(
|
471
478
|
function="CollectionManager.find_collections",
|
472
479
|
required_params=["search_string"],
|
@@ -523,7 +530,38 @@ base_output_format_sets = FormatSetDict({
|
|
523
530
|
spec_params={"output_format": "DICT"},
|
524
531
|
)
|
525
532
|
),
|
526
|
-
"Digital
|
533
|
+
"Digital-Product-Catalog": FormatSet(
|
534
|
+
target_type="DigitalProductCatalog",
|
535
|
+
heading="Catalogs for Digital Products",
|
536
|
+
description="Attributes generic to all Digital Product Catalogs..",
|
537
|
+
aliases=["Product Catalog", "DataProductCatalog"],
|
538
|
+
annotations={"Wikilinks": ["[[Digital Products]]"]},
|
539
|
+
formats=[
|
540
|
+
Format(
|
541
|
+
types=["DICT", "TABLE", "LIST", "MD", "FORM"],
|
542
|
+
columns=COLLECTIONS_MEMBERS_COLUMNS
|
543
|
+
),
|
544
|
+
Format(
|
545
|
+
types=["REPORT", "HTML"],
|
546
|
+
columns=COLLECTIONS_MEMBERS_COLUMNS + [
|
547
|
+
Column(name="GUID", key='GUID'),
|
548
|
+
Column(name="Mermaid", key='mermaid'),
|
549
|
+
]),
|
550
|
+
Format(
|
551
|
+
types=["MERMAID"],
|
552
|
+
columns= [
|
553
|
+
Column(name="Mermaid", key='mermaid'),
|
554
|
+
])
|
555
|
+
],
|
556
|
+
action=ActionParameter(
|
557
|
+
function="CollectionManager.find_collections",
|
558
|
+
required_params=["search_string"],
|
559
|
+
optional_params=OPTIONAL_PARAMS,
|
560
|
+
spec_params={"metadata_element_types": ["DigitalProductCatalog"]},
|
561
|
+
),
|
562
|
+
),
|
563
|
+
|
564
|
+
"Digital-Products": FormatSet(
|
527
565
|
target_type="DigitalProduct",
|
528
566
|
heading="Digital Product Information",
|
529
567
|
description="Attributes useful to Digital Products.",
|
@@ -531,7 +569,7 @@ base_output_format_sets = FormatSetDict({
|
|
531
569
|
annotations={},
|
532
570
|
formats=[
|
533
571
|
Format(
|
534
|
-
types=["
|
572
|
+
types=["FORM", "DICT", "TABLE", "LIST"],
|
535
573
|
columns=COMMON_COLUMNS + [
|
536
574
|
Column(name="Status", key='status'),
|
537
575
|
Column(name='Product Name', key='product_name'),
|
@@ -543,6 +581,27 @@ base_output_format_sets = FormatSetDict({
|
|
543
581
|
Column(name='Members', key='members', format=True),
|
544
582
|
Column(name='Uses Products', key='uses_digital_products'),
|
545
583
|
Column(name='Used by Products', key='used_by_digital_products'),
|
584
|
+
Column(name='Product Manager', key='assigned_actors'),
|
585
|
+
Column(name='License', key='governed_by'),
|
586
|
+
Column(name='Solution Blueprint', key='solution_designs'),
|
587
|
+
]),
|
588
|
+
Format(
|
589
|
+
types=[ "REPORT", "HTML"],
|
590
|
+
columns=COMMON_COLUMNS + [
|
591
|
+
Column(name="Status", key='status'),
|
592
|
+
Column(name='Product Name', key='product_name'),
|
593
|
+
Column(name='Identifier', key='identifier'),
|
594
|
+
Column(name='Maturity', key='maturity'),
|
595
|
+
Column(name='Service Life', key='service_life'),
|
596
|
+
Column(name='Next Version', key='next_version'),
|
597
|
+
Column(name='Withdraw Date', key='withdraw_date'),
|
598
|
+
Column(name='Members', key='members', format=True),
|
599
|
+
Column(name='Uses Products', key='uses_digital_products'),
|
600
|
+
Column(name='Used by Products', key='used_by_digital_products'),
|
601
|
+
Column(name='Product Manager', key='assigned_actors'),
|
602
|
+
Column(name='License', key='governed_by'),
|
603
|
+
Column(name='Solution Blueprint', key='solution_designs'),
|
604
|
+
Column(name="Mermaid",key = "mermaid")
|
546
605
|
],
|
547
606
|
)
|
548
607
|
],
|
@@ -630,11 +689,20 @@ base_output_format_sets = FormatSetDict({
|
|
630
689
|
description="Attributes useful to Data Structures.",
|
631
690
|
aliases=["Data Structure", "DataStructures", "Data Structures", "Data Struct", "DataStructure"],
|
632
691
|
annotations={"wikilinks": ["[[Data Structure]]"]},
|
633
|
-
formats=[Format(types=["
|
692
|
+
formats=[Format(types=["FORM", "DICT", "LIST"], columns=COMMON_COLUMNS +
|
693
|
+
[
|
694
|
+
Column(name="In Data Specifications", key='in_data_spec'),
|
695
|
+
Column(name="In Data Dictionaries", key='in_data_dictionary'),
|
696
|
+
Column(name="Member Data Fields", key='member_data_fields') ]
|
697
|
+
), # Reusing common formats and columns
|
698
|
+
Format(types=["REPORT"], columns=COMMON_COLUMNS +
|
634
699
|
[
|
635
|
-
Column(name="
|
700
|
+
Column(name="In Data Specifications", key='in_data_spec'),
|
701
|
+
Column(name="In Data Dictionaries", key='in_data_dictionary'),
|
702
|
+
Column(name="Member Data Fields", key='member_data_fields'),
|
703
|
+
Column(name="Mermaid", key='mermaid')
|
636
704
|
]
|
637
|
-
)],
|
705
|
+
)],
|
638
706
|
action=ActionParameter(
|
639
707
|
function="DataDesigner.find_data_structures",
|
640
708
|
required_params=["search_string"],
|
@@ -642,13 +710,24 @@ base_output_format_sets = FormatSetDict({
|
|
642
710
|
)
|
643
711
|
),
|
644
712
|
|
645
|
-
"
|
713
|
+
"Data Fields": FormatSet(
|
646
714
|
target_type="Data Field",
|
647
715
|
heading="Data Structure Information",
|
648
716
|
description="Attributes useful to Data Structures.",
|
649
717
|
aliases=["Data Field", "Data Fields", "DataFields"],
|
650
718
|
annotations={"wikilinks": ["[[Data Field]]"]},
|
651
|
-
formats=[Format(types=["
|
719
|
+
formats=[Format(types=["MD", "FORM", "DICT"], columns=COMMON_COLUMNS + [
|
720
|
+
Column(name="In Data Dictionaries", key='in_data_dictionary'),
|
721
|
+
Column(name="In Data Structure", key='in_data_structure')]),
|
722
|
+
Format(types=["REPORT"], columns=COMMON_COLUMNS +
|
723
|
+
[
|
724
|
+
Column(name="In Data Structure", key='in_data_structure'),
|
725
|
+
Column(name="In Data Dictionaries", key='in_data_dictionary'),
|
726
|
+
Column(name="Member Data Fields", key='member_data_fields'),
|
727
|
+
Column(name="Mermaid", key='mermaid')
|
728
|
+
]
|
729
|
+
)],
|
730
|
+
|
652
731
|
action=ActionParameter(
|
653
732
|
function="DataDesigner.find_data_fields",
|
654
733
|
required_params=["search_string"],
|
@@ -1090,7 +1169,7 @@ generated_format_sets = FormatSetDict({
|
|
1090
1169
|
'metadata_element_types': ['DataDictionary']})),
|
1091
1170
|
'Data-Field-DrE': FormatSet(target_type='Data-Field-DrE', heading='Data-Field-DrE Attributes',
|
1092
1171
|
description='Auto-generated format for Data Field (Create).', formats=[
|
1093
|
-
Format(types=['ALL'], columns=[Column(name='Display Name', key='display_name'),
|
1172
|
+
Format(types=['ALL', 'MD'], columns=[Column(name='Display Name', key='display_name'),
|
1094
1173
|
Column(name='Description', key='description'),
|
1095
1174
|
Column(name='Category', key='category'),
|
1096
1175
|
Column(name='Status', key='element_status'),
|
pyegeria/collection_manager.py
CHANGED
@@ -5567,6 +5567,39 @@ class CollectionManager(Client2):
|
|
5567
5567
|
uses_digital_products_list += f"{prod["relatedElement"]["properties"]["qualifiedName"]}, "
|
5568
5568
|
added_props["uses_digital_products"] = uses_digital_products_list[:-2]
|
5569
5569
|
|
5570
|
+
resources = element.get("resourceList", "")
|
5571
|
+
if isinstance(resources, (list | dict)):
|
5572
|
+
resource_list = ""
|
5573
|
+
for resource in resources:
|
5574
|
+
resource_list += f"{resource.get('properties',{}).get('qualifiedName', None)}, "
|
5575
|
+
added_props["resource_list"] = resource_list[:-2] if resource_list else ""
|
5576
|
+
|
5577
|
+
actors = element.get("assignedActors", "")
|
5578
|
+
if isinstance(actors, (list | dict)):
|
5579
|
+
actor_list = ""
|
5580
|
+
for actor in actors:
|
5581
|
+
actor_type = actor['relatedElement']['elementHeader']['type']['typeName']
|
5582
|
+
actor_qname = actor['relatedElement']['properties']['qualifiedName']
|
5583
|
+
actor_list += actor_qname
|
5584
|
+
added_props["actor_list"] = actor_list[:-2] if actor_list else ""
|
5585
|
+
|
5586
|
+
governed_by = element.get("governedBy", "")
|
5587
|
+
if isinstance(governed_by, (list | dict)):
|
5588
|
+
governed_by_list = ""
|
5589
|
+
for gov in governed_by:
|
5590
|
+
license_type = gov['relatedElement']['properties'].get('typeName',"")
|
5591
|
+
license_type_qname = gov['relatedElement']['properties'].get('qualifiedName','')
|
5592
|
+
governed_by_list += license_type_qname
|
5593
|
+
added_props["governed_list"] = governed_by_list[:-2] if governed_by_list else ""
|
5594
|
+
|
5595
|
+
solution_designs = element.get("solutionDesigns", "")
|
5596
|
+
if isinstance(solution_designs, (list | dict)):
|
5597
|
+
solution_design_list = ""
|
5598
|
+
for design in solution_designs:
|
5599
|
+
solution_design_qname = design['relatedElement']['properties'].get('qualifiedName', "")
|
5600
|
+
solution_design_list += solution_design_qname
|
5601
|
+
added_props["solution_design_list"] = solution_design_list[:-2] if solution_design_list else ""
|
5602
|
+
|
5570
5603
|
return added_props
|
5571
5604
|
|
5572
5605
|
def _extract_agreement_properties(self, element: dict, guid: str, output_format: str) -> dict:
|
pyegeria/data_designer.py
CHANGED
@@ -1277,23 +1277,21 @@ class DataDesigner(Client2):
|
|
1277
1277
|
assigned_meanings_qnames.append(meaning['relatedElement']['properties']['qualifiedName'])
|
1278
1278
|
|
1279
1279
|
# extract existing related data structure and data field elements
|
1280
|
-
|
1281
|
-
if
|
1282
|
-
for rel in
|
1280
|
+
part_of_data_struct = el_struct.get("partOfDataStructures", None)
|
1281
|
+
if part_of_data_struct:
|
1282
|
+
for rel in part_of_data_struct:
|
1283
1283
|
related_element = rel["relatedElement"]
|
1284
|
-
type = related_element["elementHeader"]["type"]["typeName"]
|
1285
1284
|
guid = related_element["elementHeader"]["guid"]
|
1286
1285
|
qualified_name = related_element["properties"].get("qualifiedName", "") or ""
|
1287
1286
|
display_name = related_element["properties"].get("displayName", "") or ""
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
data_structure_qnames.append(qualified_name)
|
1287
|
+
data_structure_guids.append(guid)
|
1288
|
+
data_structure_names.append(display_name)
|
1289
|
+
data_structure_qnames.append(qualified_name)
|
1292
1290
|
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1291
|
+
elif type == "DataField":
|
1292
|
+
parent_guids.append(guid)
|
1293
|
+
parent_names.append(display_name)
|
1294
|
+
parent_qnames.append(qualified_name)
|
1297
1295
|
|
1298
1296
|
member_of_collections = el_struct.get("memberOfCollections", {})
|
1299
1297
|
for collection in member_of_collections:
|
@@ -1311,11 +1309,12 @@ class DataDesigner(Client2):
|
|
1311
1309
|
member_of_data_spec_names.append(name)
|
1312
1310
|
member_of_data_spec_qnames.append(qualifiedName)
|
1313
1311
|
|
1314
|
-
member_data_fields = el_struct.get("
|
1312
|
+
member_data_fields = el_struct.get("containsDataFields", {})
|
1315
1313
|
for data_field in member_data_fields:
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1314
|
+
rel_el = data_field.get("relatedElement",{})
|
1315
|
+
member_data_field_guids.append(rel_el["elementHeader"]["guid"])
|
1316
|
+
member_data_field_names.append(rel_el["properties"]["displayName"])
|
1317
|
+
member_data_field_qnames.append(rel_el["properties"]["qualifiedName"])
|
1319
1318
|
|
1320
1319
|
data_classes = el_struct.get("assignedDataClasses", {})
|
1321
1320
|
for data_class in data_classes:
|
@@ -1344,7 +1343,7 @@ class DataDesigner(Client2):
|
|
1344
1343
|
|
1345
1344
|
"data_structure_guids": data_structure_guids,
|
1346
1345
|
"data_structure_names": data_structure_names,
|
1347
|
-
"
|
1346
|
+
"in_data_structure": data_structure_qnames,
|
1348
1347
|
|
1349
1348
|
"assigned_meanings_guids": assigned_meanings_guids,
|
1350
1349
|
"assigned_meanings_names": assigned_meanings_names,
|
@@ -1368,15 +1367,15 @@ class DataDesigner(Client2):
|
|
1368
1367
|
|
1369
1368
|
"member_of_data_dicts_guids": member_of_data_dicts_guids,
|
1370
1369
|
"member_of_data_dicts_names": member_of_data_dicts_names,
|
1371
|
-
"
|
1370
|
+
"in_data_dictionary": member_of_data_dicts_qnames,
|
1372
1371
|
|
1373
1372
|
"member_of_data_spec_guids": member_of_data_spec_guids,
|
1374
1373
|
"member_of_data_spec_names": member_of_data_spec_names,
|
1375
|
-
"
|
1374
|
+
"in_data_spec": member_of_data_spec_qnames,
|
1376
1375
|
|
1377
1376
|
"member_data_field_guids": member_data_field_guids,
|
1378
1377
|
"member_data_field_names": member_data_field_names,
|
1379
|
-
"
|
1378
|
+
"member_data_fields": member_data_field_qnames,
|
1380
1379
|
|
1381
1380
|
"mermaid": mermaid,
|
1382
1381
|
}
|
@@ -4900,7 +4899,7 @@ class DataDesigner(Client2):
|
|
4900
4899
|
if output_format_set:
|
4901
4900
|
if isinstance(output_format_set, str):
|
4902
4901
|
output_formats = select_output_format_set(output_format_set, output_format)
|
4903
|
-
|
4902
|
+
elif isinstance(output_format_set, dict):
|
4904
4903
|
output_formats = get_output_format_type_match(output_format_set, output_format)
|
4905
4904
|
else:
|
4906
4905
|
output_formats = None
|
pyegeria/external_references.py
CHANGED
@@ -577,8 +577,11 @@ class ExternalReferences(Client2):
|
|
577
577
|
"effectiveTo": "{{$isoTimestamp}}"
|
578
578
|
}
|
579
579
|
}
|
580
|
+
{{baseURL}}/servers/{{viewServer}}/api/open-metadata/external-references/elements/660bfc21-12b5-4de1-a8f3-63239fbb58a0/external-references/850ffe6c-c551-497b-9b7a-6efcadcf2c88/attach
|
581
|
+
`https://localhost:9443/servers/qs-view-server/api/open-metadata/external-references/elements/660bfc21-12b5-4de1-a8f3-63239fbb58a0/external_references/850ffe6c-c551-497b-9b7a-6efcadcf2c88/attach
|
580
582
|
"""
|
581
|
-
|
583
|
+
|
584
|
+
url = url = (f"{self.command_root}/elements/{element_guid}/external-references/{ext_ref_guid}/attach")
|
582
585
|
await self._async_new_relationship_request(url, "ExternalReferenceLinkProperties", body)
|
583
586
|
logger.info(f"Linking element {element_guid} to ext. ref. {ext_ref_guid}")
|
584
587
|
|
pyegeria/output_formatter.py
CHANGED
@@ -201,7 +201,7 @@ def make_md_attribute(attribute_name: str, attribute_value: str, output_type: st
|
|
201
201
|
return '\n'
|
202
202
|
|
203
203
|
output = f"## {attribute_title}\n{attribute_value}\n\n"
|
204
|
-
elif output_type
|
204
|
+
elif output_type in ["REPORT", "MERMAID"]:
|
205
205
|
if attribute_title in ['Mermaid Graph', 'Mermaid']:
|
206
206
|
output = f"## Mermaid Graph\n\n```mermaid\n{attribute_value}\n```\n"
|
207
207
|
elif attribute_value:
|
@@ -853,11 +853,18 @@ def extract_mermaid_only(elements: Union[Dict, List[Dict]]) -> Union[str, List[s
|
|
853
853
|
String or list of strings containing mermaid graph data
|
854
854
|
"""
|
855
855
|
if isinstance(elements, dict):
|
856
|
-
|
856
|
+
mer = elements.get('mermaidGraph', None)
|
857
|
+
if mer:
|
858
|
+
return f"\n```mermaid\n{mer}\n```"
|
859
|
+
else:
|
860
|
+
return "---"
|
861
|
+
|
857
862
|
|
858
863
|
result = []
|
859
864
|
for element in elements:
|
860
|
-
|
865
|
+
mer = element.get('mermaidGraph', "---")
|
866
|
+
mer_out = f"\n\n```mermaid\n{mer}\n\n```" if mer else "---"
|
867
|
+
result.append(mer_out)
|
861
868
|
return result
|
862
869
|
|
863
870
|
def extract_basic_dict(elements: Union[Dict, List[Dict]]) -> Union[Dict, List[Dict]]:
|