pyegeria 5.4.4.7__py3-none-any.whl → 5.4.4.8__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
- md_processing/data/commands.json +13461 -8239
- md_processing/dr-egeria-outbox/Digital Products-2025-09-21-16-52-50.md +51 -0
- md_processing/dr-egeria-outbox/Digital-Product-Catalog-2025-09-21-16-55-19.md +77 -0
- md_processing/dr_egeria.py +1 -1
- md_processing/md_commands/data_designer_commands.py +10 -5
- md_processing/md_commands/ext_ref_commands.py +3 -3
- md_processing/md_commands/product_manager_commands.py +12 -0
- md_processing/md_commands/view_commands.py +7 -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 +81 -8
- pyegeria/collection_manager.py +7 -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.4.8.dist-info}/METADATA +1 -1
- {pyegeria-5.4.4.7.dist-info → pyegeria-5.4.4.8.dist-info}/RECORD +21 -18
- {pyegeria-5.4.4.7.dist-info → pyegeria-5.4.4.8.dist-info}/LICENSE +0 -0
- {pyegeria-5.4.4.7.dist-info → pyegeria-5.4.4.8.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.4.7.dist-info → pyegeria-5.4.4.8.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
# Digital Product Information
|
2
|
+
Attributes useful to Digital Products.
|
3
|
+
|
4
|
+
# DigitalProduct Report - created at 2025-09-21 16:52
|
5
|
+
DigitalProduct found from the search string: `All`
|
6
|
+
|
7
|
+
<a id="660bfc21-12b5-4de1-a8f3-63239fbb58a0"></a>
|
8
|
+
# DigitalProduct Name: NAICS Codes
|
9
|
+
|
10
|
+
## Display Name
|
11
|
+
NAICS Codes
|
12
|
+
|
13
|
+
## Qualified Name
|
14
|
+
[DigitalProduct::NAICS-Codes::2022](#660bfc21-12b5-4de1-a8f3-63239fbb58a0)
|
15
|
+
|
16
|
+
## Category
|
17
|
+
General Reference Data
|
18
|
+
|
19
|
+
## Description
|
20
|
+
NAICS Codes classify different kinds of businesses based on what they produce. They are organized hierarchically with more digits providing finer granularity in the kind of economic activity.
|
21
|
+
|
22
|
+
## Product Name
|
23
|
+
NAICS Codes - Industry Classifications
|
24
|
+
|
25
|
+
## Identifier
|
26
|
+
NAICS
|
27
|
+
|
28
|
+
## Maturity
|
29
|
+
Mature
|
30
|
+
|
31
|
+
## Mermaid Graph
|
32
|
+
|
33
|
+
```mermaid
|
34
|
+
---
|
35
|
+
title: DigitalProduct - NAICS Codes [660bfc21-12b5-4de1-a8f3-63239fbb58a0]
|
36
|
+
---
|
37
|
+
flowchart TD
|
38
|
+
%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
39
|
+
|
40
|
+
1@{ shape: rounded, label: "*Digital Product*
|
41
|
+
**NAICS Codes**"}
|
42
|
+
2@{ shape: rect, label: "*Collection [ Folder]*
|
43
|
+
**Industry Classifications**"}
|
44
|
+
2==>|"Collection Membership"|1
|
45
|
+
3@{ shape: tag-doc, label: "*C S V File*
|
46
|
+
**NAICS-6-digit_2022_Codes.csv**"}
|
47
|
+
1==>|"Collection Membership"|3
|
48
|
+
style 1 color:#000000, fill:#e0ab18, stroke:#004563
|
49
|
+
style 2 color:#000000, fill:#8fbc8f, stroke:#000000
|
50
|
+
style 3 color:#000000, fill:#bdb76b, stroke:#004563
|
51
|
+
```
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# Catalogs for Digital Products
|
2
|
+
Attributes generic to all Digital Product Catalogs..
|
3
|
+
|
4
|
+
# DigitalProductCatalog Report - created at 2025-09-21 16:55
|
5
|
+
DigitalProductCatalog found from the search string: `All`
|
6
|
+
|
7
|
+
<a id="6b6303ee-a6e9-412c-b91f-852e56293ffa"></a>
|
8
|
+
# DigitalProductCatalog Name: Sustainability Product Catalog
|
9
|
+
|
10
|
+
## Display Name
|
11
|
+
Sustainability Product Catalog
|
12
|
+
|
13
|
+
## Qualified Name
|
14
|
+
[DigProdCatalog::Sustainability-Product-Catalog::2025](#6b6303ee-a6e9-412c-b91f-852e56293ffa)
|
15
|
+
|
16
|
+
## Category
|
17
|
+
Sustainability
|
18
|
+
|
19
|
+
## Description
|
20
|
+
Catalog of Sustainability Assets that includes reference data used in carbon accounting, interim and localized results, aggregated results and finalized sustainability reports.
|
21
|
+
|
22
|
+
## Type Name
|
23
|
+
DigitalProductCatalog
|
24
|
+
|
25
|
+
## Created By
|
26
|
+
erinoverview
|
27
|
+
|
28
|
+
## Create Time
|
29
|
+
2025-09-20T18:57:09.670+00:00
|
30
|
+
|
31
|
+
## Containing Members
|
32
|
+
Collection::Audited-Carbon-Accounting-Data, Collection::Sustainability-Reports, Collection::Scope-3-Related-Data, Collection::Industry-Classifications, Collection::Interim-Carbon-Accounting-Data
|
33
|
+
|
34
|
+
## GUID
|
35
|
+
6b6303ee-a6e9-412c-b91f-852e56293ffa
|
36
|
+
|
37
|
+
## Mermaid Graph
|
38
|
+
|
39
|
+
```mermaid
|
40
|
+
---
|
41
|
+
title: DigitalProductCatalog - Sustainability Product Catalog [6b6303ee-a6e9-412c-b91f-852e56293ffa]
|
42
|
+
---
|
43
|
+
flowchart TD
|
44
|
+
%%{init: {"flowchart": {"htmlLabels": false}} }%%
|
45
|
+
|
46
|
+
1@{ shape: rounded, label: "*Digital Product Catalog*
|
47
|
+
**Sustainability Product Catalog**"}
|
48
|
+
2@{ shape: rect, label: "*Collection [ Folder]*
|
49
|
+
**Audited Carbon Accounting Data**"}
|
50
|
+
1==>|"Collection Membership"|2
|
51
|
+
3@{ shape: rect, label: "*Collection [ Folder]*
|
52
|
+
**Sustainability Reports**"}
|
53
|
+
1==>|"Collection Membership"|3
|
54
|
+
4@{ shape: rect, label: "*Collection [ Folder]*
|
55
|
+
**Scope 3 Related Data**"}
|
56
|
+
1==>|"Collection Membership"|4
|
57
|
+
5@{ shape: rect, label: "*Collection [ Folder]*
|
58
|
+
**Industry Classifications**"}
|
59
|
+
1==>|"Collection Membership"|5
|
60
|
+
6@{ shape: rect, label: "*Digital Product*
|
61
|
+
**NAICS Codes**"}
|
62
|
+
5==>|"Collection Membership"|6
|
63
|
+
7@{ shape: tag-doc, label: "*C S V File*
|
64
|
+
**NAICS-6-digit_2022_Codes.csv**"}
|
65
|
+
6==>|"Collection Membership"|7
|
66
|
+
8@{ shape: rect, label: "*Collection [ Folder]*
|
67
|
+
**Interim Carbon Accounting Data**"}
|
68
|
+
1==>|"Collection Membership"|8
|
69
|
+
style 1 color:#000000, fill:#e0ab18, stroke:#004563
|
70
|
+
style 2 color:#000000, fill:#8fbc8f, stroke:#000000
|
71
|
+
style 3 color:#000000, fill:#8fbc8f, stroke:#000000
|
72
|
+
style 4 color:#000000, fill:#8fbc8f, stroke:#000000
|
73
|
+
style 5 color:#000000, fill:#8fbc8f, stroke:#000000
|
74
|
+
style 6 color:#FFFFFF, fill:#04682b4, stroke:#3079ab
|
75
|
+
style 7 color:#000000, fill:#bdb76b, stroke:#004563
|
76
|
+
style 8 color:#000000, fill:#8fbc8f, stroke:#000000
|
77
|
+
```
|
md_processing/dr_egeria.py
CHANGED
@@ -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']:
|
@@ -454,6 +454,8 @@ def process_data_spec_upsert_command(egeria_client: EgeriaTech, txt: str, direct
|
|
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
456
|
|
457
|
+
print(Markdown(parsed_output['display']))
|
458
|
+
|
457
459
|
if directive == "display":
|
458
460
|
|
459
461
|
return None
|
@@ -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,6 +171,7 @@ 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
|
print(Markdown(parsed_output['display']))
|
@@ -182,6 +184,7 @@ def process_collection_upsert_command(egeria_client: EgeriaTech, txt: str, direc
|
|
182
184
|
status = attributes.get('Status', {}).get('value', None)
|
183
185
|
output_set = make_format_set_name_from_type(object_type)
|
184
186
|
|
187
|
+
|
185
188
|
if directive == "display":
|
186
189
|
|
187
190
|
return None
|
@@ -196,6 +199,13 @@ def process_collection_upsert_command(egeria_client: EgeriaTech, txt: str, direc
|
|
196
199
|
try:
|
197
200
|
if object_type in ["Root Collection", "Folder"]:
|
198
201
|
obj = "Collection"
|
202
|
+
if object_type == "Folder":
|
203
|
+
qn_prefix = "Folder"
|
204
|
+
elif object_type == "Root Collection":
|
205
|
+
qn_prefix = "Root"
|
206
|
+
|
207
|
+
qualified_name = egeria_client.__create_qualified_name__(qn_prefix, element_name, LOCAL_QUALIFIER, version_identifier=version)
|
208
|
+
|
199
209
|
else:
|
200
210
|
obj = object_type
|
201
211
|
|
@@ -791,6 +801,7 @@ def process_add_to_collection_command(egeria_client: EgeriaTech, txt: str,
|
|
791
801
|
"source": source,
|
792
802
|
"notes": notes,
|
793
803
|
}
|
804
|
+
label = "Add Member"
|
794
805
|
try:
|
795
806
|
if object_action in["Detach", "Unlink", "Remove"]:
|
796
807
|
if not exists:
|
@@ -832,6 +843,7 @@ def process_add_to_collection_command(egeria_client: EgeriaTech, txt: str,
|
|
832
843
|
body = set_rel_request_body(object_type, attributes)
|
833
844
|
|
834
845
|
body['properties'] = prop_body
|
846
|
+
body = body_slimmer(body)
|
835
847
|
egeria_client.add_to_collection(collection_guid,
|
836
848
|
element_guid, body)
|
837
849
|
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]:
|
@@ -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,21 @@ base_output_format_sets = FormatSetDict({
|
|
531
569
|
annotations={},
|
532
570
|
formats=[
|
533
571
|
Format(
|
534
|
-
types=["
|
572
|
+
types=["FORM", "DICT", "TABLE", "LIST"],
|
573
|
+
columns=COMMON_COLUMNS + [
|
574
|
+
Column(name="Status", key='status'),
|
575
|
+
Column(name='Product Name', key='product_name'),
|
576
|
+
Column(name='Identifier', key='identifier'),
|
577
|
+
Column(name='Maturity', key='maturity'),
|
578
|
+
Column(name='Service Life', key='service_life'),
|
579
|
+
Column(name='Next Version', key='next_version'),
|
580
|
+
Column(name='Withdraw Date', key='withdraw_date'),
|
581
|
+
Column(name='Members', key='members', format=True),
|
582
|
+
Column(name='Uses Products', key='uses_digital_products'),
|
583
|
+
Column(name='Used by Products', key='used_by_digital_products'),
|
584
|
+
]),
|
585
|
+
Format(
|
586
|
+
types=[ "REPORT", "HTML"],
|
535
587
|
columns=COMMON_COLUMNS + [
|
536
588
|
Column(name="Status", key='status'),
|
537
589
|
Column(name='Product Name', key='product_name'),
|
@@ -543,6 +595,7 @@ base_output_format_sets = FormatSetDict({
|
|
543
595
|
Column(name='Members', key='members', format=True),
|
544
596
|
Column(name='Uses Products', key='uses_digital_products'),
|
545
597
|
Column(name='Used by Products', key='used_by_digital_products'),
|
598
|
+
Column(name="Mermaid",key = "mermaid")
|
546
599
|
],
|
547
600
|
)
|
548
601
|
],
|
@@ -630,11 +683,20 @@ base_output_format_sets = FormatSetDict({
|
|
630
683
|
description="Attributes useful to Data Structures.",
|
631
684
|
aliases=["Data Structure", "DataStructures", "Data Structures", "Data Struct", "DataStructure"],
|
632
685
|
annotations={"wikilinks": ["[[Data Structure]]"]},
|
633
|
-
formats=[Format(types=["
|
686
|
+
formats=[Format(types=["FORM", "DICT", "LIST"], columns=COMMON_COLUMNS +
|
634
687
|
[
|
635
|
-
Column(name="
|
688
|
+
Column(name="In Data Specifications", key='in_data_spec'),
|
689
|
+
Column(name="In Data Dictionaries", key='in_data_dictionary'),
|
690
|
+
Column(name="Member Data Fields", key='member_data_fields') ]
|
691
|
+
), # Reusing common formats and columns
|
692
|
+
Format(types=["REPORT"], 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
|
+
Column(name="Mermaid", key='mermaid')
|
636
698
|
]
|
637
|
-
)],
|
699
|
+
)],
|
638
700
|
action=ActionParameter(
|
639
701
|
function="DataDesigner.find_data_structures",
|
640
702
|
required_params=["search_string"],
|
@@ -642,13 +704,24 @@ base_output_format_sets = FormatSetDict({
|
|
642
704
|
)
|
643
705
|
),
|
644
706
|
|
645
|
-
"
|
707
|
+
"Data Fields": FormatSet(
|
646
708
|
target_type="Data Field",
|
647
709
|
heading="Data Structure Information",
|
648
710
|
description="Attributes useful to Data Structures.",
|
649
711
|
aliases=["Data Field", "Data Fields", "DataFields"],
|
650
712
|
annotations={"wikilinks": ["[[Data Field]]"]},
|
651
|
-
formats=[Format(types=["
|
713
|
+
formats=[Format(types=["MD", "FORM", "DICT"], columns=COMMON_COLUMNS + [
|
714
|
+
Column(name="In Data Dictionaries", key='in_data_dictionary'),
|
715
|
+
Column(name="In Data Structure", key='in_data_structure')]),
|
716
|
+
Format(types=["REPORT"], columns=COMMON_COLUMNS +
|
717
|
+
[
|
718
|
+
Column(name="In Data Structure", key='in_data_structure'),
|
719
|
+
Column(name="In Data Dictionaries", key='in_data_dictionary'),
|
720
|
+
Column(name="Member Data Fields", key='member_data_fields'),
|
721
|
+
Column(name="Mermaid", key='mermaid')
|
722
|
+
]
|
723
|
+
)],
|
724
|
+
|
652
725
|
action=ActionParameter(
|
653
726
|
function="DataDesigner.find_data_fields",
|
654
727
|
required_params=["search_string"],
|
pyegeria/collection_manager.py
CHANGED
@@ -5567,6 +5567,13 @@ 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['resourceList']['properties']['qualifiedName']}, "
|
5575
|
+
added_props["resource_list"] = resource_list[:-2]
|
5576
|
+
|
5570
5577
|
return added_props
|
5571
5578
|
|
5572
5579
|
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]]:
|