pyegeria 5.3.6.3__py3-none-any.whl → 5.3.6.4__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.
- pyegeria/_client.py +10 -0
- pyegeria/commands/cat/dr_egeria_md.py +13 -4
- pyegeria/commands/cli/egeria.py +1 -1
- pyegeria/glossary_browser_omvs.py +50 -32
- pyegeria/glossary_manager_omvs.py +4 -5
- pyegeria/md_processing_utils.py +141 -104
- {pyegeria-5.3.6.3.dist-info → pyegeria-5.3.6.4.dist-info}/METADATA +1 -1
- {pyegeria-5.3.6.3.dist-info → pyegeria-5.3.6.4.dist-info}/RECORD +11 -12
- pyegeria/commands/cat/dr_egeria_inbox/freddie_intro.md +0 -269
- {pyegeria-5.3.6.3.dist-info → pyegeria-5.3.6.4.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.6.3.dist-info → pyegeria-5.3.6.4.dist-info}/WHEEL +0 -0
- {pyegeria-5.3.6.3.dist-info → pyegeria-5.3.6.4.dist-info}/entry_points.txt +0 -0
pyegeria/_client.py
CHANGED
@@ -11,6 +11,7 @@ import asyncio
|
|
11
11
|
import inspect
|
12
12
|
import json
|
13
13
|
import os
|
14
|
+
import re
|
14
15
|
from datetime import datetime
|
15
16
|
|
16
17
|
import httpx
|
@@ -769,6 +770,15 @@ class Client:
|
|
769
770
|
)
|
770
771
|
return result
|
771
772
|
|
773
|
+
def __create_qualified_name__(self, type: str, display_name: str, local_qualifier: str = None) -> str:
|
774
|
+
"""Helper function to create a qualified name for a given type and display name.
|
775
|
+
If present, the local qualifier will be prepended to the qualified name."""
|
776
|
+
EGERIA_LOCAL_QUALIFIER = os.environ.get("EGERIA_LOCAL_QUALIFIER", local_qualifier)
|
777
|
+
display_name = re.sub(r'\s','-',display_name.strip())
|
778
|
+
q_name = f"{type}:{display_name}"
|
779
|
+
if EGERIA_LOCAL_QUALIFIER:
|
780
|
+
q_name = f"{EGERIA_LOCAL_QUALIFIER}:{q_name}"
|
781
|
+
return q_name
|
772
782
|
|
773
783
|
if __name__ == "__main__":
|
774
784
|
print("Main-__client")
|
@@ -8,7 +8,8 @@ from rich.console import Console
|
|
8
8
|
from rich.markdown import Markdown
|
9
9
|
|
10
10
|
from pyegeria.md_processing_utils import (extract_command, process_glossary_upsert_command, process_term_upsert_command,
|
11
|
-
get_current_datetime_string, process_per_proj_upsert_command, commands
|
11
|
+
get_current_datetime_string, process_per_proj_upsert_command, commands,
|
12
|
+
process_provenance_command)
|
12
13
|
|
13
14
|
import click
|
14
15
|
from pyegeria import (extract_command, process_glossary_upsert_command, process_term_upsert_command,
|
@@ -76,7 +77,8 @@ def process_markdown_file(
|
|
76
77
|
print(f"Error: File not found at path: {full_file_path}")
|
77
78
|
return {} # Return empty dict if file not found
|
78
79
|
|
79
|
-
final_output =
|
80
|
+
final_output =""
|
81
|
+
prov_output = (f"\n* Results from processing file {file_path} on "
|
80
82
|
f"{datetime.now().strftime("%Y-%m-%d %H:%M")}\n")
|
81
83
|
h1_blocks = []
|
82
84
|
current_block = ""
|
@@ -103,13 +105,16 @@ def process_markdown_file(
|
|
103
105
|
|
104
106
|
if current_block: # Add the last H1 block
|
105
107
|
h1_blocks.append(current_block)
|
106
|
-
|
108
|
+
prov_found = False
|
107
109
|
# Process each identified H1 block
|
108
110
|
for block in h1_blocks:
|
109
111
|
potential_command = extract_command(block) # Extract potential command
|
110
112
|
|
111
113
|
if potential_command in commands:
|
112
114
|
# Process the block based on the command
|
115
|
+
if potential_command == "Provenance":
|
116
|
+
prov_found = True
|
117
|
+
result = process_provenance_command(file_path, block)
|
113
118
|
if potential_command in ["Create Glossary", "Update Glossary"]:
|
114
119
|
result = process_glossary_upsert_command(client, element_dictionary, block, directive)
|
115
120
|
elif potential_command in ["Create Category", "Update Category"]:
|
@@ -125,7 +130,7 @@ def process_markdown_file(
|
|
125
130
|
if result:
|
126
131
|
if directive == "process":
|
127
132
|
updated = True
|
128
|
-
final_output += f"\n---\n{
|
133
|
+
final_output += f"\n---\n{result}\n---\n\n"
|
129
134
|
print(json.dumps(element_dictionary, indent=4))
|
130
135
|
elif directive == "process":
|
131
136
|
# Handle case with errors (skip this block but notify the user)
|
@@ -136,6 +141,7 @@ def process_markdown_file(
|
|
136
141
|
# If no command is detected, add the block to the final output as-is
|
137
142
|
final_output += f"\n---\n{block}\n---\n\n"
|
138
143
|
|
144
|
+
|
139
145
|
# Write the final_output to a new file if updated
|
140
146
|
try:
|
141
147
|
if updated:
|
@@ -146,6 +152,9 @@ def process_markdown_file(
|
|
146
152
|
|
147
153
|
with open(new_file_path, 'w') as f2:
|
148
154
|
f2.write(final_output)
|
155
|
+
if not prov_found:
|
156
|
+
prov_output += f"\n# Provenance:\n{prov_output}\n"
|
157
|
+
f2.write(prov_output)
|
149
158
|
click.echo(f"\n==> Notebook written to {new_file_path}")
|
150
159
|
else:
|
151
160
|
click.echo("\nNo updates detected. New File not created.")
|
pyegeria/commands/cli/egeria.py
CHANGED
@@ -34,7 +34,7 @@ from pyegeria.commands.cat.glossary_actions import (
|
|
34
34
|
remove_term_from_category
|
35
35
|
)
|
36
36
|
from pyegeria.commands.cat.dr_egeria_jupyter import process_jupyter_notebook
|
37
|
-
from pyegeria.commands.cat.
|
37
|
+
from pyegeria.commands.cat.dr_egeria_md import process_markdown_file
|
38
38
|
|
39
39
|
from pyegeria.commands.cat.list_categories import display_categories
|
40
40
|
from pyegeria.commands.cat.list_assets import display_assets
|
@@ -75,7 +75,7 @@ class GlossaryBrowser(Client):
|
|
75
75
|
- A string or None indicating the action description for the elements,
|
76
76
|
depending on the output format.
|
77
77
|
"""
|
78
|
-
search_string = search_string if search_string else "All
|
78
|
+
search_string = search_string if search_string else "All Elements"
|
79
79
|
elements_action = "Update " + obj_type
|
80
80
|
if output_format == "FORM":
|
81
81
|
preamble = (f"\n# Update {obj_type} Form - created at {datetime.now().strftime('%Y-%m-%d %H:%M')}\n"
|
@@ -87,9 +87,22 @@ class GlossaryBrowser(Client):
|
|
87
87
|
f"\t{obj_type} found from the search string: `{search_string}`\n\n")
|
88
88
|
elements_action = None
|
89
89
|
return elements_md, elements_action
|
90
|
+
|
90
91
|
else:
|
91
92
|
return "\n", elements_action
|
92
93
|
|
94
|
+
def make_md_attribute(self, attribute_name: str, attribute_value: str, output_type: str) -> str | None:
|
95
|
+
output = ""
|
96
|
+
attribute_value = attribute_value.strip() if attribute_value else None
|
97
|
+
attribute_title = attribute_name.title() if attribute_name else None
|
98
|
+
if output_type in ["FORM", "MD"]:
|
99
|
+
output = f"## {attribute_title}\n{attribute_value}\n\n"
|
100
|
+
elif output_type == "REPORT":
|
101
|
+
if attribute_value:
|
102
|
+
output = f"## {attribute_title}\n{attribute_value}\n\n"
|
103
|
+
return output
|
104
|
+
|
105
|
+
|
93
106
|
def generate_glossaries_md(self, elements: list | dict, search_string: str, output_format: str = 'MD')-> str:
|
94
107
|
elements_md, elements_action = self.make_preamble(obj_type="Glossary", search_string=search_string,
|
95
108
|
output_format=output_format)
|
@@ -105,26 +118,26 @@ class GlossaryBrowser(Client):
|
|
105
118
|
usage = properties.get("usage", None)
|
106
119
|
qualified_name = properties.get("qualifiedName", None)
|
107
120
|
|
108
|
-
if output_format
|
121
|
+
if output_format in ['FORM','MD']:
|
109
122
|
elements_md += f"# {elements_action}\n\n"
|
110
123
|
elements_md += f"## Glossary Name \n\n{display_name}\n\n"
|
111
|
-
|
124
|
+
|
112
125
|
elif output_format == 'REPORT':
|
113
126
|
elements_md += f"# Glossary Name: {display_name}\n\n"
|
114
127
|
else:
|
115
128
|
elements_md += f"## Glossary Name \n\n{display_name}\n\n"
|
116
|
-
elements_md += "## Update Description\n\n\n"
|
117
129
|
|
118
|
-
elements_md +=
|
119
|
-
elements_md +=
|
120
|
-
elements_md +=
|
121
|
-
elements_md +=
|
122
|
-
elements_md +=
|
123
|
-
elements_md += MD_SEPERATOR
|
130
|
+
elements_md += self.make_md_attribute( "description", description, output_format)
|
131
|
+
elements_md += self.make_md_attribute("language", language, output_format)
|
132
|
+
elements_md += self.make_md_attribute("usage", usage, output_format)
|
133
|
+
elements_md += self.make_md_attribute("qualified name", qualified_name, output_format)
|
134
|
+
elements_md += self.make_md_attribute("GUID", guid, output_format)
|
135
|
+
# elements_md += MD_SEPERATOR
|
136
|
+
|
124
137
|
return elements_md
|
125
138
|
|
126
139
|
def generate_terms_md(self, elements: list | dict, search_string: str, output_format: str = 'MD') -> str:
|
127
|
-
elements_md, elements_action = self.make_preamble(obj_type="
|
140
|
+
elements_md, elements_action = self.make_preamble(obj_type="Term", search_string=search_string, output_format=output_format)
|
128
141
|
if isinstance(elements, dict):
|
129
142
|
elements = [elements]
|
130
143
|
|
@@ -140,34 +153,38 @@ class GlossaryBrowser(Client):
|
|
140
153
|
qualified_name = element_properties.get("qualifiedName", None)
|
141
154
|
status = element['elementHeader'].get('status', None)
|
142
155
|
|
156
|
+
glossary_guid = element['elementHeader'].get('classifications', [{}])[0].get('classificationProperties', {}).get('anchorGUID', None)
|
157
|
+
glossary_qualified_name = self.get_glossary_by_guid(glossary_guid)['glossaryProperties']['qualifiedName']
|
158
|
+
|
143
159
|
category_list_md = "\n"
|
144
160
|
category_list = self.get_categories_for_term(guid)
|
145
161
|
if type(category_list) is str and category_list == NO_CATEGORIES_FOUND:
|
146
162
|
category_list_md = ['---']
|
147
163
|
elif isinstance(category_list, list) and len(category_list) > 0:
|
148
164
|
for category in category_list:
|
149
|
-
category_name = category["glossaryCategoryProperties"].get("
|
165
|
+
category_name = category["glossaryCategoryProperties"].get("qualifiedName", '---')
|
150
166
|
category_list_md += f" {category_name}\n"
|
151
167
|
|
152
|
-
if output_format
|
168
|
+
if output_format in ['FORM', 'MD']:
|
153
169
|
elements_md += f"# {elements_action}\n\n"
|
154
170
|
elements_md += f"## Term Name \n\n{display_name}\n\n"
|
155
|
-
elements_md += "## Update Description\n\n\n"
|
156
171
|
elif output_format == 'REPORT':
|
157
172
|
elements_md += f"# Term Name: {display_name}\n\n"
|
158
173
|
else:
|
159
174
|
elements_md += f"## Term Name \n\n{display_name}\n\n"
|
160
|
-
|
161
|
-
elements_md +=
|
162
|
-
elements_md +=
|
163
|
-
elements_md +=
|
164
|
-
elements_md +=
|
165
|
-
elements_md +=
|
166
|
-
elements_md +=
|
167
|
-
elements_md +=
|
168
|
-
elements_md +=
|
169
|
-
elements_md +=
|
170
|
-
elements_md +=
|
175
|
+
|
176
|
+
elements_md += self.make_md_attribute("summary", summary, output_format)
|
177
|
+
elements_md += self.make_md_attribute("in glossary", glossary_qualified_name, output_format)
|
178
|
+
elements_md += self.make_md_attribute( "categories", category_list_md, output_format)
|
179
|
+
elements_md += self.make_md_attribute( "status", status, output_format)
|
180
|
+
elements_md += self.make_md_attribute( "description", description, output_format)
|
181
|
+
elements_md += self.make_md_attribute( "examples", examples, output_format)
|
182
|
+
elements_md += self.make_md_attribute("usage", usage, output_format)
|
183
|
+
elements_md += self.make_md_attribute("published version", pub_version, output_format)
|
184
|
+
elements_md += self.make_md_attribute("qualified name", qualified_name, output_format)
|
185
|
+
elements_md += self.make_md_attribute("GUID", guid, output_format)
|
186
|
+
# elements_md += MD_SEPERATOR
|
187
|
+
|
171
188
|
return elements_md
|
172
189
|
|
173
190
|
def generate_categories_md(self, elements: list | dict, search_string: str, output_format: str = 'MD')-> str:
|
@@ -190,21 +207,22 @@ class GlossaryBrowser(Client):
|
|
190
207
|
glossary_qualified_name = (
|
191
208
|
self.get_glossary_by_guid(glossary_guid))['glossaryProperties']['qualifiedName']
|
192
209
|
|
193
|
-
if output_format
|
210
|
+
if output_format in ['FORM', 'MD']:
|
194
211
|
elements_md += f"# {elements_action}\n\n"
|
195
212
|
elements_md += f"## Category Name \n\n{display_name}\n\n"
|
196
|
-
|
213
|
+
|
197
214
|
elif output_format == 'REPORT':
|
198
215
|
elements_md += f"# Category Name: {display_name}\n\n"
|
199
216
|
else:
|
200
217
|
elements_md += f"## Category Name \n\n{display_name}\n\n"
|
201
|
-
elements_md += "## Update Description\n\n\n"
|
202
218
|
|
203
|
-
|
204
|
-
elements_md +=
|
205
|
-
elements_md +=
|
206
|
-
elements_md +=
|
219
|
+
|
220
|
+
elements_md += self.make_md_attribute("description", description, output_format)
|
221
|
+
elements_md += self.make_md_attribute("in glossary", glossary_qualified_name, output_format)
|
222
|
+
elements_md += self.make_md_attribute("qualified name", qualified_name, output_format)
|
223
|
+
elements_md += self.make_md_attribute("GUID", guid, output_format)
|
207
224
|
elements_md += MD_SEPERATOR
|
225
|
+
|
208
226
|
return elements_md
|
209
227
|
|
210
228
|
#
|
@@ -100,7 +100,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
100
100
|
"class": "ReferenceableRequestBody",
|
101
101
|
"elementProperties": {
|
102
102
|
"class": "GlossaryProperties",
|
103
|
-
"qualifiedName":
|
103
|
+
"qualifiedName": self.__create_qualified_name__("Glossary", display_name),
|
104
104
|
"displayName": display_name,
|
105
105
|
"description": description,
|
106
106
|
"language": language,
|
@@ -351,7 +351,7 @@ class GlossaryManager(GlossaryBrowser):
|
|
351
351
|
"class": "ReferenceableRequestBody",
|
352
352
|
"elementProperties": {
|
353
353
|
"class": "GlossaryCategoryProperties",
|
354
|
-
"qualifiedName":
|
354
|
+
"qualifiedName": self.__create_qualified_name__("Category", display_name),
|
355
355
|
"displayName": display_name,
|
356
356
|
"description": description,
|
357
357
|
},
|
@@ -936,9 +936,8 @@ class GlossaryManager(GlossaryBrowser):
|
|
936
936
|
continue
|
937
937
|
|
938
938
|
# Add the term
|
939
|
-
term_qualified_name = (
|
940
|
-
|
941
|
-
)
|
939
|
+
term_qualified_name = self.__create_qualified_name("Term", display_name),
|
940
|
+
|
942
941
|
body = {
|
943
942
|
"class": "ReferenceableRequestBody",
|
944
943
|
"elementProperties": {
|
pyegeria/md_processing_utils.py
CHANGED
@@ -8,6 +8,8 @@ This file contains functions to parse and process Egeria Markdown (Freddie)
|
|
8
8
|
import json
|
9
9
|
from jupyter_notebook_parser import JupyterNotebookParser
|
10
10
|
import nbformat
|
11
|
+
from typing import List, Optional
|
12
|
+
|
11
13
|
import os
|
12
14
|
import re
|
13
15
|
from pyegeria import EgeriaTech, NO_CATEGORIES_FOUND
|
@@ -23,12 +25,13 @@ import datetime
|
|
23
25
|
|
24
26
|
console = Console(width=120)
|
25
27
|
|
26
|
-
commands = ["Create Glossary", "Update Glossary", "Create Term", "Update Term", "Create Personal Project",
|
28
|
+
commands = ["Provenance", "Create Glossary", "Update Glossary", "Create Term", "Update Term", "Create Personal Project",
|
27
29
|
"Update Personal Project", "Create Category", "Update Category"]
|
28
30
|
ERROR = "ERROR-> "
|
29
31
|
INFO = "INFO- "
|
30
32
|
WARNING = "WARNING-> "
|
31
33
|
pre_command = "\n---\n==> Processing command:"
|
34
|
+
EGERIA_LOCAL_QUALIFIER = os.environ.get("EGERIA_LOCAL_QUALIFIER", "PDR")
|
32
35
|
element_dictionary = {}
|
33
36
|
|
34
37
|
|
@@ -44,18 +47,18 @@ def is_valid_iso_date(date_text) -> bool:
|
|
44
47
|
def get_current_datetime_string():
|
45
48
|
"""Returns the current date and time as a human-readable string."""
|
46
49
|
now = datetime.datetime.now()
|
47
|
-
return now.strftime("%Y
|
50
|
+
return now.strftime("%Y-%m-%d-%H-%M")
|
48
51
|
|
49
52
|
def add_term_to_categories(egeria_client: EgeriaTech, term_guid: str, categories_exist: bool, categories_list: [str], element_dictionary: dict)-> None:
|
50
53
|
if categories_exist is True and categories_list is not None:
|
51
54
|
for category in categories_list:
|
52
55
|
cat_guid = None
|
53
|
-
cat_el =
|
56
|
+
cat_el = category.strip()
|
54
57
|
if cat_el in element_dictionary:
|
55
58
|
cat= element_dictionary.get(cat_el, None)
|
56
59
|
cat_guid = cat.get('guid', None) if cat else None
|
57
60
|
if cat_guid is None:
|
58
|
-
cat_guid = egeria_client.__get_guid__(
|
61
|
+
cat_guid = egeria_client.__get_guid__(qualified_name=category)
|
59
62
|
egeria_client.add_term_to_category(term_guid, cat_guid)
|
60
63
|
|
61
64
|
|
@@ -67,36 +70,39 @@ def extract_command(block: str) -> str | None:
|
|
67
70
|
return None
|
68
71
|
|
69
72
|
|
70
|
-
def extract_attribute(text: str,
|
73
|
+
def extract_attribute(text: str, labels: List[str]) -> str | None:
|
71
74
|
"""
|
72
75
|
Extracts the glossary name from a string.
|
73
76
|
|
74
77
|
Args:
|
75
78
|
text: The input string.
|
76
|
-
label:
|
79
|
+
label: List of equivalent labels to search for
|
77
80
|
|
78
81
|
Returns:
|
79
82
|
The glossary name, or None if not found.
|
80
83
|
"""
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
# Iterate over the list of labels
|
85
|
+
for label in labels:
|
86
|
+
# Construct pattern for the current label
|
87
|
+
pattern = rf"## {re.escape(label)}\n(.*?)(?:##|$)"
|
88
|
+
match = re.search(pattern, text, re.DOTALL)
|
89
|
+
if match and not match.group(1).isspace(): # Ensure extracted text is not blank
|
90
|
+
return match.group(1).strip() # Return the matched text
|
91
|
+
|
92
|
+
return None # Return None if no match is found
|
87
93
|
|
88
94
|
|
89
95
|
def update_a_command(txt: str, command: str, obj_type: str, q_name: str, u_guid: str) -> str:
|
90
96
|
u_guid = u_guid if u_guid else " "
|
91
97
|
verb = command.split(' ')[0].strip()
|
92
98
|
action = "Update" if (verb == "Create" and u_guid is not None) else "Create"
|
93
|
-
txt = txt.replace(f"{command}", f'
|
94
|
-
txt = txt.replace('<GUID>', f'
|
95
|
-
txt = txt.replace('<Qualified Name>', f"
|
99
|
+
txt = txt.replace(f"{command}", f'{action} {obj_type}\n') # update the command
|
100
|
+
txt = txt.replace('<GUID>', f'GUID\n{u_guid}') # update with GUID
|
101
|
+
txt = txt.replace('<Qualified Name>', f"Qualified Name\n{q_name}")
|
96
102
|
if "Qualified Name" not in txt:
|
97
|
-
txt += f"\n##
|
103
|
+
txt += f"\n## Qualified Name\n{q_name}\n"
|
98
104
|
if "GUID" not in txt:
|
99
|
-
txt += f"\n##
|
105
|
+
txt += f"\n## GUID\n{u_guid}\n"
|
100
106
|
|
101
107
|
# if (command in {"Update Term", "Update Category", 'Update Glossary'}) and ("Update Description" not in txt):
|
102
108
|
# txt += '\n** Update Description\n\n\n'
|
@@ -112,6 +118,14 @@ def update_a_command(txt: str, command: str, obj_type: str, q_name: str, u_guid:
|
|
112
118
|
txt = re.sub(pattern, replacement, txt)
|
113
119
|
return txt
|
114
120
|
|
121
|
+
def process_provenance_command(file_path: str, txt: str) -> str:
|
122
|
+
"""This commands processes a provenence command by pre-pending the current file name and time to the provenance output"""
|
123
|
+
output = (f"* Derived from processing file {file_path} on "
|
124
|
+
f"{datetime.now().strftime("%Y-%m-%d %H:%M")}\n")
|
125
|
+
existing_prov = extract_attribute(txt,'Provenance')
|
126
|
+
return f"# Provenance:\n{existing_prov}\n{output}\n"
|
127
|
+
|
128
|
+
|
115
129
|
|
116
130
|
def process_glossary_upsert_command(egeria_client: EgeriaTech, element_dictionary: dict, txt: str,
|
117
131
|
directive: str = "display") -> str | None:
|
@@ -128,19 +142,19 @@ def process_glossary_upsert_command(egeria_client: EgeriaTech, element_dictionar
|
|
128
142
|
object_type = command.split(' ')[1].strip()
|
129
143
|
object_action = command.split(' ')[0].strip()
|
130
144
|
|
131
|
-
glossary_name = extract_attribute(txt, 'Glossary Name')
|
145
|
+
glossary_name = extract_attribute(txt, ['Glossary Name'])
|
132
146
|
print(Markdown(f"{pre_command} `{command}` for glossary: `\'{glossary_name}\'` with directive: `{directive}` "))
|
133
|
-
language = extract_attribute(txt, 'Language')
|
134
|
-
description = extract_attribute(txt, 'Description')
|
135
|
-
usage = extract_attribute(txt, 'Usage')
|
147
|
+
language = extract_attribute(txt, ['Language'])
|
148
|
+
description = extract_attribute(txt, ['Description'])
|
149
|
+
usage = extract_attribute(txt, ['Usage'])
|
136
150
|
|
137
151
|
glossary_display = (f"\n* Command: {command}\n\t* Glossary Name: {glossary_name}\n\t"
|
138
152
|
f"* Language: {language}\n\t* Description:\n{description}\n"
|
139
153
|
f"* Usage: {usage}\n")
|
140
154
|
|
141
155
|
if object_action == 'Update':
|
142
|
-
q_name = extract_attribute(txt, 'Qualified Name')
|
143
|
-
guid = extract_attribute(txt, 'GUID')
|
156
|
+
q_name = extract_attribute(txt, ['Qualified Name'])
|
157
|
+
guid = extract_attribute(txt, ['GUID', 'guid', 'Guid'])
|
144
158
|
glossary_display += f"* Qualified Name: {q_name}\n\t* GUID: {guid}\n\n"
|
145
159
|
|
146
160
|
def validate_glossary(obj_action: str) -> tuple[bool, bool, str | None, str | None]:
|
@@ -236,11 +250,11 @@ def process_glossary_upsert_command(egeria_client: EgeriaTech, element_dictionar
|
|
236
250
|
}
|
237
251
|
egeria_client.update_glossary(known_guid, body)
|
238
252
|
print(f"\n-->Updated Glossary {glossary_name} with GUID {known_guid}")
|
239
|
-
element_dictionary[
|
240
|
-
'guid': known_guid, '
|
253
|
+
element_dictionary[known_q_name] = {
|
254
|
+
'guid': known_guid, 'display_name': glossary_name
|
241
255
|
}
|
242
256
|
# return update_a_command(txt, command, object_type, known_q_name, known_guid)
|
243
|
-
return egeria_client.get_glossary_by_guid(known_guid, output_format='
|
257
|
+
return egeria_client.get_glossary_by_guid(known_guid, output_format='MD')
|
244
258
|
elif object_action == "Create":
|
245
259
|
glossary_guid = None
|
246
260
|
|
@@ -254,11 +268,11 @@ def process_glossary_upsert_command(egeria_client: EgeriaTech, element_dictionar
|
|
254
268
|
print(f"{ERROR}Just created with GUID {glossary_guid} but Glossary not found\n")
|
255
269
|
return None
|
256
270
|
qualified_name = glossary['glossaryProperties']["qualifiedName"]
|
257
|
-
element_dictionary[
|
258
|
-
'guid': glossary_guid, '
|
271
|
+
element_dictionary[qualified_name] = {
|
272
|
+
'guid': glossary_guid, 'display_name': glossary_name
|
259
273
|
}
|
260
274
|
# return update_a_command(txt, command, object_type, qualified_name, glossary_guid)
|
261
|
-
return egeria_client.get_glossary_by_guid(glossary_guid, output_format = '
|
275
|
+
return egeria_client.get_glossary_by_guid(glossary_guid, output_format = 'MD')
|
262
276
|
|
263
277
|
|
264
278
|
def process_categories_upsert_command(egeria_client: EgeriaTech, element_dictionary: dict, txt: str,
|
@@ -276,19 +290,20 @@ def process_categories_upsert_command(egeria_client: EgeriaTech, element_diction
|
|
276
290
|
object_type = command.split(' ')[1].strip()
|
277
291
|
object_action = command.split(' ')[0].strip()
|
278
292
|
|
279
|
-
category_name = extract_attribute(txt, 'Category Name')
|
293
|
+
category_name = extract_attribute(txt, ['Category Name', 'category_name', 'Cat'])
|
280
294
|
print(Markdown(f"{pre_command} `{command}` for category: `\'{category_name}\'` with directive: `{directive}` "))
|
281
|
-
|
282
|
-
description = extract_attribute(txt, 'Description')
|
283
|
-
|
284
|
-
|
295
|
+
owning_glossary_qn = extract_attribute(txt, ['Owning Glossary', '[In Glossary'])
|
296
|
+
description = extract_attribute(txt, ['Description'])
|
297
|
+
q_name = extract_attribute(txt, ['Qualified Name'])
|
298
|
+
|
299
|
+
category_display = (f"\n* Command: {command}\n\t* Category: {category_name}\n\t* In Glossary: {owning_glossary_qn}\n\t"
|
300
|
+
f"* Description:\n{description}\n\t* Qualified Name: {q_name}\n\t")
|
285
301
|
update_description = None
|
286
302
|
|
287
303
|
if object_action == 'Update':
|
288
|
-
|
289
|
-
guid = extract_attribute(txt, 'GUID')
|
304
|
+
guid = extract_attribute(txt, ['GUID','guid','Guid'])
|
290
305
|
update_description = extract_attribute(txt, 'Update Description')
|
291
|
-
category_display += (f"*
|
306
|
+
category_display += (f"* GUID: {guid}\n\n"
|
292
307
|
f"* Update Description: \n {update_description}\n\t")
|
293
308
|
|
294
309
|
def validate_category(obj_action: str) -> tuple[bool, bool, str | None, str | None, str | None]:
|
@@ -303,28 +318,33 @@ def process_categories_upsert_command(egeria_client: EgeriaTech, element_diction
|
|
303
318
|
category_exists = False
|
304
319
|
else:
|
305
320
|
category_exists = True
|
306
|
-
|
307
|
-
if
|
308
|
-
msg += f"* {ERROR}Owning Glossary is missing\n"
|
321
|
+
|
322
|
+
if owning_glossary_qn is None:
|
323
|
+
msg += f"* {ERROR}Owning Glossary Qualified Name is missing\n"
|
309
324
|
valid = False
|
310
325
|
|
311
|
-
elif
|
312
|
-
|
313
|
-
glossary_guid = element_dictionary[
|
314
|
-
|
326
|
+
elif owning_glossary_qn in element_dictionary: # Check to see if we already know about this glossary
|
327
|
+
glossary_name = element_dictionary[owning_glossary_qn].get('display_name', None)
|
328
|
+
glossary_guid = element_dictionary[owning_glossary_qn].get('guid', None)
|
329
|
+
|
315
330
|
else:
|
316
331
|
# need to ask Egeria if it knows the Glossary Name
|
317
|
-
glossary = egeria_client.get_glossaries_by_name(
|
332
|
+
glossary = egeria_client.get_glossaries_by_name(owning_glossary_qn)
|
318
333
|
if glossary == NO_GLOSSARIES_FOUND:
|
319
|
-
msg += f"* {ERROR}Glossary `{
|
334
|
+
msg += f"* {ERROR}Glossary `{owning_glossary_qn}` does not exist\n\n"
|
320
335
|
valid = False
|
321
336
|
else:
|
322
|
-
msg += f"* {INFO}Glossary `{
|
337
|
+
msg += f"* {INFO}Glossary `{owning_glossary_qn}` exists\n\n"
|
323
338
|
glossary_guid = glossary[0]['elementHeader'].get('guid', None)
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
}
|
339
|
+
glossary_name = glossary[0]['glossaryProperties'].get('displayName', None)
|
340
|
+
glossary_qn = glossary[0]['glossaryProperties'].get('qualifiedName', None)
|
341
|
+
if glossary_qn != owning_glossary_qn: # we were given the right qualified name - maybe a display_name
|
342
|
+
msg += f"* {ERROR}Glossary `{owning_glossary_qn}` is known by qualifiedName `{glossary_qn}`\n\n"
|
343
|
+
valid = False
|
344
|
+
else:
|
345
|
+
element_dictionary[owning_glossary_qn] = {
|
346
|
+
'guid': glossary_guid, 'display_name': glossary_name
|
347
|
+
}
|
328
348
|
|
329
349
|
if category_name is None:
|
330
350
|
msg = f"* {ERROR}Category name is missing\n"
|
@@ -396,11 +416,11 @@ def process_categories_upsert_command(egeria_client: EgeriaTech, element_diction
|
|
396
416
|
egeria_client.update_category(glossary_guid, category_name, description, known_q_name, None,
|
397
417
|
update_description)
|
398
418
|
print(f"\n-->Updated category `{category_name}`with GUID {known_guid}")
|
399
|
-
element_dictionary[
|
400
|
-
'guid': known_guid, '
|
419
|
+
element_dictionary[known_q_name] = {
|
420
|
+
'guid': known_guid, 'display_name': category_name
|
401
421
|
}
|
402
422
|
# return update_a_command(txt, command, object_type, known_q_name, known_guid)
|
403
|
-
return egeria_client.get_categories_by_guid(known_guid, output_format='
|
423
|
+
return egeria_client.get_categories_by_guid(known_guid, output_format='FORM')
|
404
424
|
|
405
425
|
elif object_action == "Create":
|
406
426
|
is_root = False
|
@@ -416,11 +436,11 @@ def process_categories_upsert_command(egeria_client: EgeriaTech, element_diction
|
|
416
436
|
print(f"{ERROR}Just created with GUID {category_guid} but category not found\n")
|
417
437
|
return None
|
418
438
|
qualified_name = category['glossaryCategoryProperties']["qualifiedName"]
|
419
|
-
element_dictionary[
|
420
|
-
'guid': category_guid, '
|
439
|
+
element_dictionary[qualified_name] = {
|
440
|
+
'guid': category_guid, 'display_name': category_name
|
421
441
|
}
|
422
442
|
# return update_a_command(txt, command, object_type, qualified_name, category_guid)
|
423
|
-
return egeria_client.get_categories_by_guid(category_guid, output_format='
|
443
|
+
return egeria_client.get_categories_by_guid(category_guid, output_format='MD')
|
424
444
|
|
425
445
|
def process_term_upsert_command(egeria_client: EgeriaTech, element_dictionary: dict, txt: str,
|
426
446
|
directive: str = "display") -> str | None:
|
@@ -438,30 +458,39 @@ def process_term_upsert_command(egeria_client: EgeriaTech, element_dictionary: d
|
|
438
458
|
object_type = command.split(' ')[1].strip()
|
439
459
|
object_action = command.split(' ')[0].strip()
|
440
460
|
|
441
|
-
term_name = extract_attribute(txt, 'Term Name')
|
442
|
-
summary = extract_attribute(txt, 'Summary')
|
443
|
-
description = extract_attribute(txt, 'Description')
|
444
|
-
abbreviation = extract_attribute(txt, 'Abbreviation')
|
445
|
-
examples = extract_attribute(txt, 'Examples')
|
446
|
-
usage = extract_attribute(txt, 'Usage')
|
447
|
-
status = extract_attribute(txt, 'Status')
|
448
|
-
version = extract_attribute(txt, 'Version')
|
449
|
-
categories = extract_attribute(txt, 'Categories')
|
461
|
+
term_name = extract_attribute(txt, ['Term Name'])
|
462
|
+
summary = extract_attribute(txt, ['Summary'])
|
463
|
+
description = extract_attribute(txt, ['Description'])
|
464
|
+
abbreviation = extract_attribute(txt, ['Abbreviation'])
|
465
|
+
examples = extract_attribute(txt, ['Examples'])
|
466
|
+
usage = extract_attribute(txt, ['Usage'])
|
467
|
+
status = extract_attribute(txt, ['Status'])
|
468
|
+
version = extract_attribute(txt, ['Version', "Version Identifier"])
|
469
|
+
categories = extract_attribute(txt, ['Categories'])
|
470
|
+
q_name = extract_attribute(txt, ['Qualified Name'])
|
471
|
+
# q_name = q_name if q_name else " "
|
472
|
+
|
450
473
|
categories_list = None
|
451
474
|
cats_exist = True
|
452
475
|
|
453
|
-
|
476
|
+
glossary_qn = extract_attribute(txt, ['In Glossary','Owning Glossary'])
|
454
477
|
|
455
478
|
print(Markdown(f"{pre_command} `{command}` for term: `\'{term_name}\'` with directive: `{directive}`"))
|
456
479
|
|
457
480
|
def validate_term(obj_action: str) -> tuple[bool, bool, str | None, str | None]:
|
458
|
-
nonlocal version, status, categories, categories_list, cats_exist
|
481
|
+
nonlocal version, status, categories, categories_list, cats_exist, q_name
|
459
482
|
valid = True
|
460
483
|
msg = ""
|
461
484
|
known_term_guid = None
|
462
485
|
known_q_name = None
|
463
486
|
|
464
|
-
|
487
|
+
# If the user has specified a qualified_name then use it to look for matching terms.
|
488
|
+
# If not, use the display_name.
|
489
|
+
if q_name:
|
490
|
+
term_details = egeria_client.get_terms_by_name(q_name)
|
491
|
+
else:
|
492
|
+
term_details = egeria_client.get_terms_by_name(term_name)
|
493
|
+
|
465
494
|
if term_details == NO_TERMS_FOUND:
|
466
495
|
term_exists = False
|
467
496
|
else:
|
@@ -475,28 +504,33 @@ def process_term_upsert_command(egeria_client: EgeriaTech, element_dictionary: d
|
|
475
504
|
if term_name is None:
|
476
505
|
msg = f"* {ERROR}Term name is missing\n"
|
477
506
|
valid = False
|
478
|
-
if
|
479
|
-
msg += f"* {ERROR}Glossary name is missing\n"
|
507
|
+
if glossary_qn is None:
|
508
|
+
msg += f"* {ERROR}Glossary qualified name is missing\n"
|
480
509
|
valid = False
|
481
510
|
else:
|
482
|
-
|
483
|
-
|
484
|
-
glossary = egeria_client.get_glossaries_by_name(glossary_name)
|
511
|
+
if glossary_qn not in element_dictionary:
|
512
|
+
glossary = egeria_client.get_glossaries_by_name(glossary_qn) #assuming q_name?
|
485
513
|
if isinstance(glossary,str):
|
486
|
-
msg += f"* {ERROR}Glossary `{
|
514
|
+
msg += f"* {ERROR}Glossary `{glossary_qn}` is unknown\n "
|
487
515
|
valid = False
|
516
|
+
else:
|
517
|
+
element_dictionary[glossary_qn] = {
|
518
|
+
'guid': glossary[0]['elementHeader'].get('guid', None),
|
519
|
+
'display_name': glossary[0]['glossaryProperties'].get('displayName', None)
|
520
|
+
}
|
521
|
+
|
488
522
|
|
489
523
|
if categories is None:
|
490
|
-
msg += f"* {INFO}
|
524
|
+
msg += f"* {INFO} No categories found\n"
|
491
525
|
else:
|
492
526
|
categories_list = re.split(r'[,\n]+', categories)
|
493
527
|
categories = ""
|
494
528
|
for category in categories_list:
|
495
|
-
category_el =
|
529
|
+
category_el = category.strip()
|
496
530
|
if category_el not in element_dictionary:
|
497
|
-
cat = egeria_client.get_categories_by_name(category)
|
531
|
+
cat = egeria_client.get_categories_by_name(category) # assuming qualified name?
|
498
532
|
if isinstance(cat,str):
|
499
|
-
msg += (f"* {WARNING}Category `{category}`
|
533
|
+
msg += (f"* {WARNING}Category `{category}` not found -> "
|
500
534
|
f"categories for this term won't be processed!\n")
|
501
535
|
cats_exist = False
|
502
536
|
categories = f"{category}, {categories}"
|
@@ -519,8 +553,10 @@ def process_term_upsert_command(egeria_client: EgeriaTech, element_dictionary: d
|
|
519
553
|
if usage is None:
|
520
554
|
msg += f"* {INFO}Term usage is missing\n"
|
521
555
|
if version is None:
|
522
|
-
msg += f"* {INFO}Term version is missing
|
523
|
-
version = "0.0.1"
|
556
|
+
msg += f"* {INFO}Term version is missing\n"
|
557
|
+
# version = "0.0.1"
|
558
|
+
|
559
|
+
|
524
560
|
|
525
561
|
if obj_action == "Update": # check to see if provided information exists and is consistent with existing info
|
526
562
|
if not term_exists:
|
@@ -528,7 +564,8 @@ def process_term_upsert_command(egeria_client: EgeriaTech, element_dictionary: d
|
|
528
564
|
valid = False
|
529
565
|
|
530
566
|
if len(term_details) > 1 and term_exists:
|
531
|
-
msg += f"* {ERROR}More than one term with name {term_name} found
|
567
|
+
msg += (f"* {ERROR}More than one term with name {term_name} found, please specify a "
|
568
|
+
f"**Qualified Name**\n")
|
532
569
|
valid = False
|
533
570
|
elif len(term_details) == 1:
|
534
571
|
known_term_guid = term_details[0]['elementHeader'].get('guid', None)
|
@@ -537,7 +574,7 @@ def process_term_upsert_command(egeria_client: EgeriaTech, element_dictionary: d
|
|
537
574
|
msg += (f"* {ERROR}Term {term_name} qualifiedName mismatch between {q_name} and {known_q_name}\n")
|
538
575
|
valid = False
|
539
576
|
else:
|
540
|
-
msg += f"--> * Term {term_name} exists and can be updated\n"
|
577
|
+
msg += f"\n--> * Term {term_name} exists and can be updated\n"
|
541
578
|
msg += term_display
|
542
579
|
|
543
580
|
print(Markdown(msg))
|
@@ -554,15 +591,15 @@ def process_term_upsert_command(egeria_client: EgeriaTech, element_dictionary: d
|
|
554
591
|
print(Markdown(msg))
|
555
592
|
return valid, term_exists, known_term_guid, known_q_name
|
556
593
|
|
594
|
+
|
557
595
|
if object_action == "Update":
|
558
596
|
term_guid = extract_attribute(txt, 'GUID')
|
559
597
|
term_guid = term_guid if term_guid else " "
|
560
|
-
|
561
|
-
q_name = q_name if q_name else " "
|
598
|
+
|
562
599
|
|
563
600
|
update_description = extract_attribute(txt, 'Update Description')
|
564
601
|
update_description = update_description if update_description else " "
|
565
|
-
term_display = (f"\n* Command: {command}\n\t* Glossary: {
|
602
|
+
term_display = (f"\n* Command: {command}\n\t* Glossary: {glossary_qn}\n\t"
|
566
603
|
f"* Term Name: {term_name}\n\t* Categories: {categories}\n\t* Summary: {summary}"
|
567
604
|
f"\n\t* Description: {description}\n\t"
|
568
605
|
f"* Abbreviation: {abbreviation}\n\t* Examples: {examples}\n\t* Usage: {usage}\n\t"
|
@@ -570,7 +607,7 @@ def process_term_upsert_command(egeria_client: EgeriaTech, element_dictionary: d
|
|
570
607
|
f"{q_name}"
|
571
608
|
f"\n\t* Update Description: {update_description}\n")
|
572
609
|
else:
|
573
|
-
term_display = (f"\n* Command: {command}\n\t* Glossary: {
|
610
|
+
term_display = (f"\n* Command: {command}\n\t* Glossary: {glossary_qn}\n\t"
|
574
611
|
f"* Term Name: {term_name}\n\t* Categories: {categories}\n\t* Summary: {summary}\n\t"
|
575
612
|
f"* Description: {description}\n\t"
|
576
613
|
f"* Abbreviation: {abbreviation}\n\t* Examples: {examples}\n\t* Usage: {usage}\n\t"
|
@@ -618,23 +655,24 @@ def process_term_upsert_command(egeria_client: EgeriaTech, element_dictionary: d
|
|
618
655
|
|
619
656
|
elif object_action == "Create":
|
620
657
|
guid = None
|
621
|
-
|
658
|
+
|
659
|
+
q_name = egeria_client.__create_qualified_name__("Term",term_name, EGERIA_LOCAL_QUALIFIER)
|
622
660
|
if exists:
|
623
661
|
print(f"\n{WARNING}Term {term_name} exists and result document updated")
|
624
662
|
return update_a_command(txt, command, object_type, q_name, known_guid)
|
625
663
|
else:
|
626
664
|
## get the guid for the glossary from the name - first look locally
|
627
|
-
glossary = element_dictionary.get(
|
665
|
+
glossary = element_dictionary.get(glossary_qn, None)
|
628
666
|
|
629
667
|
if glossary is not None:
|
630
668
|
glossary_guid = glossary.get('guid', None)
|
631
669
|
if glossary_guid is None:
|
632
|
-
print(f"{ERROR}Glossary reference {
|
670
|
+
print(f"{ERROR}Glossary reference {glossary_qn} not found")
|
633
671
|
return None
|
634
672
|
else:
|
635
|
-
glossary_guid = egeria_client.__get_guid__(
|
673
|
+
glossary_guid = egeria_client.__get_guid__(qualified_name=glossary_qn)
|
636
674
|
if glossary_guid == NO_ELEMENTS_FOUND:
|
637
|
-
print(f"{ERROR}Glossary {
|
675
|
+
print(f"{ERROR}Glossary {glossary_qn} not found")
|
638
676
|
return None
|
639
677
|
term_body = {
|
640
678
|
"class": "ReferenceableRequestBody", "elementProperties": {
|
@@ -657,9 +695,8 @@ def process_term_upsert_command(egeria_client: EgeriaTech, element_dictionary: d
|
|
657
695
|
egeria_client, term_guid, cats_exist, categories_list,
|
658
696
|
element_dictionary)
|
659
697
|
print(f"\n-->Created Term {term_name} with GUID {term_guid}")
|
660
|
-
|
661
|
-
|
662
|
-
return egeria_client.get_terms_by_guid(term_guid, 'md')
|
698
|
+
element_dictionary[q_name] = {'guid': term_guid, 'display_name': term_name}
|
699
|
+
return egeria_client.get_terms_by_guid(term_guid, 'MD')
|
663
700
|
# return update_a_command(txt, command, object_type, q_name, term_guid)
|
664
701
|
except Exception as e:
|
665
702
|
print(f"{ERROR}Error creating term {term_name}: {e}")
|
@@ -682,14 +719,14 @@ def process_per_proj_upsert_command(egeria_client: EgeriaTech, element_dictionar
|
|
682
719
|
object_type = f"{object[1]} {object[2]}"
|
683
720
|
object_action = object[0]
|
684
721
|
|
685
|
-
project_name = extract_attribute(txt, 'Project Name')
|
686
|
-
description = extract_attribute(txt, 'Description')
|
687
|
-
project_identifier = extract_attribute(txt, 'Project Identifier')
|
688
|
-
project_status = extract_attribute(txt, 'Project Status')
|
689
|
-
project_phase = extract_attribute(txt, 'Project Phase')
|
690
|
-
project_health = extract_attribute(txt, 'Project Health')
|
691
|
-
start_date = extract_attribute(txt, 'Start Date')
|
692
|
-
planned_end_date = extract_attribute(txt, 'Planned End Date')
|
722
|
+
project_name = extract_attribute(txt, ['Project Name'])
|
723
|
+
description = extract_attribute(txt, ['Description'])
|
724
|
+
project_identifier = extract_attribute(txt, ['Project Identifier'])
|
725
|
+
project_status = extract_attribute(txt, ['Project Status'])
|
726
|
+
project_phase = extract_attribute(txt, ['Project Phase'])
|
727
|
+
project_health = extract_attribute(txt, ['Project Health'])
|
728
|
+
start_date = extract_attribute(txt, ['Start Date'])
|
729
|
+
planned_end_date = extract_attribute(txt, ['Planned End Date'])
|
693
730
|
print(Markdown(f"{pre_command} `\'{command}\'` for project: `{project_name}` with directive: `{directive}` "))
|
694
731
|
|
695
732
|
project_display = (f"\n* Command: {command}\n\t* Project: {project_name}\n\t"
|
@@ -812,5 +849,5 @@ def process_per_proj_upsert_command(egeria_client: EgeriaTech, element_dictionar
|
|
812
849
|
return None
|
813
850
|
|
814
851
|
q_name = project_g['projectProperties']["qualifiedName"]
|
815
|
-
element_dictionary[
|
852
|
+
element_dictionary[q_name] = {'guid': guid, 'display_name': project_name}
|
816
853
|
return update_a_command(txt, command, object_type, q_name, guid)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
pyegeria/README.md,sha256=PwX5OC7-YSZUCIsoyHh1O-WBM2hE84sm3Bd4O353NOk,1464
|
2
2
|
pyegeria/__init__.py,sha256=08v01IyeVZ-YlRZU0qGPAGDhNsdEscX1IHvPcsAYZrE,30187
|
3
|
-
pyegeria/_client.py,sha256=
|
3
|
+
pyegeria/_client.py,sha256=nhUPmeQFHqbobM6_3EGmUy-STYURxb15BEXf6erY2oI,31733
|
4
4
|
pyegeria/_deprecated_gov_engine.py,sha256=dWNcwVsE5__dF2u4QiIyQrssozzzOjBbLld8MdpmVCQ,17264
|
5
5
|
pyegeria/_exceptions.py,sha256=1SrnV194V4_YJNnNAU0myTHQ3dhLn4GF2B2gZcj1u90,18153
|
6
6
|
pyegeria/_globals.py,sha256=a_irI6oGuBLks2LzQHkSdK6xWbPdJCPRjqxK7PKxwgw,991
|
@@ -13,11 +13,10 @@ pyegeria/commands/README.md,sha256=hJdOWhZ5eCfwTkY4Tx6De6Y1XVo7cbaddQEvjqppvls,2
|
|
13
13
|
pyegeria/commands/__init__.py,sha256=R2o66ctVicTZ8B5VSPtc7EDRKNiNclzFbYX0o2Zg2dQ,1120
|
14
14
|
pyegeria/commands/cat/README.md,sha256=-aaAnIT2fcfU63vajgB-RzQk4l4yFdhkyVfSaTPiqRY,967
|
15
15
|
pyegeria/commands/cat/__init__.py,sha256=5OCy4m_yZsnSxdy_gvkCyP_OkjvuWKimqUGHYCJc_qA,450
|
16
|
-
pyegeria/commands/cat/dr_egeria_inbox/freddie_intro.md,sha256=xiikqqouWFBTCCBgZh7SXTaIy61i7fTWN9J2zbvZ2Ao,6548
|
17
16
|
pyegeria/commands/cat/dr_egeria_inbox/glossary_creation_experiment.ipynb,sha256=dbzNu90fCKNohOWVSRBOB1GLyd95x8Qw51I5AkaPtso,11552
|
18
17
|
pyegeria/commands/cat/dr_egeria_inbox/glossary_exp.md,sha256=KsUeTzDe5QkrTmIfIAXR74qZ29oSfRW-NAEn0RYIRqM,2534
|
19
18
|
pyegeria/commands/cat/dr_egeria_jupyter.py,sha256=4LcmD5CrtazLgUK_LCjgOnwtxZqTBB6lrMR8tsugl94,6036
|
20
|
-
pyegeria/commands/cat/dr_egeria_md.py,sha256=
|
19
|
+
pyegeria/commands/cat/dr_egeria_md.py,sha256=jMioOrViTFuExh8AlFpJvrEZt4U5I9oUICvKhQPx4D0,7675
|
21
20
|
pyegeria/commands/cat/exp_list_glossaries.py,sha256=dC6Bnfm3YSMTKPP146qeslIFRiZnGu5b7iDYE07p4iU,5817
|
22
21
|
pyegeria/commands/cat/get_asset_graph.py,sha256=xnXJfpDTVH1TJ2TwE3dtjaXU36Di6-N6JAyhothzz2o,12461
|
23
22
|
pyegeria/commands/cat/get_collection.py,sha256=KbSFoGZeK30_bMCa0BpIuCwBF5ywCX0g4hgDPnI0lEo,5356
|
@@ -41,7 +40,7 @@ pyegeria/commands/cat/list_terms.py,sha256=D0tCD2f8j-UgnV4Bgisj9a11CCEOneNsRT7_3
|
|
41
40
|
pyegeria/commands/cat/list_todos.py,sha256=NitCw0uyVVjmN1hxb1W-I4FbOsa8wQxW2ICyOElHyc8,6556
|
42
41
|
pyegeria/commands/cat/list_user_ids.py,sha256=X5Q-YNEp38saPYDuy9VwdQC5Qpa4HyC3WvAdbyp_P6M,5108
|
43
42
|
pyegeria/commands/cli/__init__.py,sha256=hpTVSMP2gnPRhcAZPdeUEsQ-eaDySlXlk239dNWYmng,292
|
44
|
-
pyegeria/commands/cli/egeria.py,sha256=
|
43
|
+
pyegeria/commands/cli/egeria.py,sha256=Rtqru3Dp61SspzMVQ_UMHhtPc4_kq7S3Ocf-SqdfTN0,52635
|
45
44
|
pyegeria/commands/cli/egeria_cat.py,sha256=_1qA7PS3fMH22j9BTGqFLnqVOTMRewP8-6jIPBvjuCI,18237
|
46
45
|
pyegeria/commands/cli/egeria_login_tui.py,sha256=W5ouG3nlN7z2Waa-wzYFS7yyoGfOrK-lNB0FMt2JdOk,9492
|
47
46
|
pyegeria/commands/cli/egeria_my.py,sha256=0KTH7OIeKyp16ZeN7zK5uhadbPfAQsq38GMzJNWYG8g,6386
|
@@ -225,10 +224,10 @@ pyegeria/egeria_my_client.py,sha256=eOKLk2zdI6FHZnhAimfR_0yNdBjpUgD41dJZcJODcqE,
|
|
225
224
|
pyegeria/egeria_tech_client.py,sha256=uycgYfCpb4jzFfaQ7I5JxbZ5PKsWdaWxLOJjbw6C2Zk,3817
|
226
225
|
pyegeria/feedback_manager_omvs.py,sha256=0xBs0p54vmdfVYYgQ8pOanLC4fxfgTk1Z61Y6D1U7_I,152978
|
227
226
|
pyegeria/full_omag_server_config.py,sha256=CQqLCy_3DZFvJZEOcGf50HWdFaWpiAIs6z-kKyjvpDA,47464
|
228
|
-
pyegeria/glossary_browser_omvs.py,sha256=
|
229
|
-
pyegeria/glossary_manager_omvs.py,sha256=
|
227
|
+
pyegeria/glossary_browser_omvs.py,sha256=r8PYlNTN-Ej2pGg1SigKQn8Qu1wDmFvWG5vM2I12JyI,109391
|
228
|
+
pyegeria/glossary_manager_omvs.py,sha256=QSOVqbwEASueCQzpvYNEOaUIAhOvwqLWWhfzwT8hrrs,70275
|
230
229
|
pyegeria/m_test.py,sha256=M5-M2ZczsAJLXWfSeqTTADHdx6Ku-y4PbQ4M21JthAE,7778
|
231
|
-
pyegeria/md_processing_utils.py,sha256=
|
230
|
+
pyegeria/md_processing_utils.py,sha256=FiZqeN39YH9LeZvzY_YZ8wo6DnRRvQif3-BBHLebcBg,40329
|
232
231
|
pyegeria/mermaid_utilities.py,sha256=sQqdFUWdNpHu9d3Tk9UVe80M-5bOzses0XcFYX5FF-E,54254
|
233
232
|
pyegeria/metadata_explorer_omvs.py,sha256=xHnZTQKbd6XwOhYia-RiIisrvZcqHi0SL1l6OCf04Gk,86911
|
234
233
|
pyegeria/my_profile_omvs.py,sha256=d0oJYCJG7pS9BINPuGciVa00ac0jwPHNANXDCLginEc,34720
|
@@ -242,8 +241,8 @@ pyegeria/template_manager_omvs.py,sha256=PfJ9dOfmBvf59DgRdZ9Dl1Kl_UYqjF-JncXVnbC
|
|
242
241
|
pyegeria/utils.py,sha256=GCt1C0bp0Xng1ahzbZhzV9qQwH7Dj93IaCt2dvWb-sg,5417
|
243
242
|
pyegeria/valid_metadata_omvs.py,sha256=Xq9DqBQvBFFJzaFIRKcVZ2k4gJvSh9yeXs_j-O3vn1w,65050
|
244
243
|
pyegeria/x_action_author_omvs.py,sha256=RcqSzahUKCtvb_3u_wyintAlc9WFkC_2v0E12TZs8lQ,6433
|
245
|
-
pyegeria-5.3.6.
|
246
|
-
pyegeria-5.3.6.
|
247
|
-
pyegeria-5.3.6.
|
248
|
-
pyegeria-5.3.6.
|
249
|
-
pyegeria-5.3.6.
|
244
|
+
pyegeria-5.3.6.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
245
|
+
pyegeria-5.3.6.4.dist-info/METADATA,sha256=yd4UPOQI1S90JJ0hO89N5EIKSu6t5CvWuywJ9c4PFh4,2743
|
246
|
+
pyegeria-5.3.6.4.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
247
|
+
pyegeria-5.3.6.4.dist-info/entry_points.txt,sha256=eAvQ_vkejlF3JzMzEc5VD93ymLA_hSFV0HM8fntG-d8,6791
|
248
|
+
pyegeria-5.3.6.4.dist-info/RECORD,,
|
@@ -1,269 +0,0 @@
|
|
1
|
-
|
2
|
-
# Introduction to Freddie - an Egeria Markdown Processor
|
3
|
-
|
4
|
-
|
5
|
-
A constant challenge in managing information is gathering enough metadata about the information to
|
6
|
-
allow us to manage it. A common approach is to build fancy graphical user interfaces hoping that they
|
7
|
-
will be attractive enough and easy enough to use that people will do so.
|
8
|
-
|
9
|
-
Unfortunately, however, this ignores the fundamental fact that to use one of these nice GUI
|
10
|
-
applications, you have to step away from the tools and processes that you were in the midst of performing.
|
11
|
-
You have to leave your world and enter a new, often less familiar one.
|
12
|
-
|
13
|
-
Freddie, is an experiment in turning this around. Its not that fancy graphical user
|
14
|
-
interfaces don't have a role - but rather, to look at what we can do to support the
|
15
|
-
tools and approaches people already use. And maybe even make their day job a little
|
16
|
-
easier.
|
17
|
-
|
18
|
-
So this is what we are exploring with Freddie. An Egeria Markdown language that allows
|
19
|
-
users to intermix requests to Egeria with other text through the use of standard Markdown.
|
20
|
-
|
21
|
-
This file is an example. You will see that we intersperse normal narrative text (such as this)
|
22
|
-
with Commands to Egeria. We introduce a specific vocabulary to make Egeria requests.
|
23
|
-
|
24
|
-
In the example below we will create a new Egeria glossary to hold definitions related to Freddie:
|
25
|
-
---
|
26
|
-
|
27
|
-
# Create Glossary
|
28
|
-
|
29
|
-
## Glossary Name
|
30
|
-
|
31
|
-
test
|
32
|
-
|
33
|
-
## Language
|
34
|
-
|
35
|
-
English
|
36
|
-
|
37
|
-
## Description
|
38
|
-
|
39
|
-
Glossary to describe the vocabulary of Freddie - an Egeria Markdown language to support the exchange of metadata in a
|
40
|
-
Markdown form.
|
41
|
-
Freddie allows users to input metadata using any text entry system that supports the entry of standard Markdown
|
42
|
-
characters and through post-processing
|
43
|
-
commands, validates the Egeria content and allows the requests to be sent to Egeria. This is an update
|
44
|
-
|
45
|
-
## Usage
|
46
|
-
|
47
|
-
a quick test glossary
|
48
|
-
## <Qualified Name>
|
49
|
-
|
50
|
-
## <GUID>
|
51
|
-
|
52
|
-
---
|
53
|
-
|
54
|
-
# First Walk-Through
|
55
|
-
The block of markdown above is a request to create a new Egeria Glossary called `Egeria-Markdown`. Let's briefly walk
|
56
|
-
through. The command starts when we see `# Create Glossary`. This is a known phrase in Freddie. When we see this
|
57
|
-
phrase we recognize that this is an egeria markdown request block. The request block ends if we encounter another `#` or
|
58
|
-
`---`, or run out of text. Within this request block we note some **attributes** that begin with a `## `. The first that
|
59
|
-
we encounter is `## Glossary Name`. Not all attributes need to be filled in. Later, we'll process this file and demonstrate
|
60
|
-
how to tell - but first, lets look at the attributes shown:
|
61
|
-
|
62
|
-
* `## Glossary Name` - this is the display name of the glossary. In this case the name is `Egeria-Markdown` As you can
|
63
|
-
see, the value of the attribute is the plain text that follows it.
|
64
|
-
* `## Language` - what language will the terms of the glossary be in (yes there are ways to have mixed language but
|
65
|
-
Freddie strives to be as simple as possible).
|
66
|
-
* `## Description` - a description of the glossary and its purpose.
|
67
|
-
* `## Usage` - how the glossary is meant to be used and by whom.
|
68
|
-
* `## <Qualified Name>` - every element in Egeria must have a unique qualified name that we use to distinguish
|
69
|
-
it from all other elements. The qualified name is meant to be understandable by humans, although it may follow
|
70
|
-
formatting conventions. This attributes is in angle brackets because at this point we can't fill it in - we are just
|
71
|
-
in the midst of creating the glossary. A qualified name will be created for us as part of the glossary creation. We'll
|
72
|
-
see a little later how we get that.
|
73
|
-
* `## <GUID>` - same story as qualified name except that this is meant for automation and not people.
|
74
|
-
|
75
|
-
And that's it. That's all we need to do to specify the creation of a new glossary (well - mostly - we'll reveal a few
|
76
|
-
more details a bit later).
|
77
|
-
|
78
|
-
## Great! That was easy!
|
79
|
-
|
80
|
-
We now have a nice, clean, new...and empty...glossary - guess we better start filling it. Lets create a couple of terms.
|
81
|
-
|
82
|
-
---
|
83
|
-
|
84
|
-
# Create Category
|
85
|
-
|
86
|
-
## Category Name
|
87
|
-
|
88
|
-
cat1
|
89
|
-
|
90
|
-
## Owning Glossary
|
91
|
-
|
92
|
-
test
|
93
|
-
|
94
|
-
## Description
|
95
|
-
|
96
|
-
These terms describe features of writing markdown files that can use Egeria-Markdown
|
97
|
-
|
98
|
-
|
99
|
-
## <Qualified Name>
|
100
|
-
|
101
|
-
## <GUID>
|
102
|
-
|
103
|
-
---
|
104
|
-
|
105
|
-
# Create Category
|
106
|
-
|
107
|
-
## Category Name
|
108
|
-
|
109
|
-
cat2
|
110
|
-
|
111
|
-
## Owning Glossary
|
112
|
-
|
113
|
-
test
|
114
|
-
|
115
|
-
## Description
|
116
|
-
|
117
|
-
These terms describe concepts related to processing Egeria-Markdown
|
118
|
-
|
119
|
-
|
120
|
-
## <Qualified Name>
|
121
|
-
|
122
|
-
## <GUID>
|
123
|
-
---
|
124
|
-
|
125
|
-
# Create Term
|
126
|
-
|
127
|
-
## Glossary Name
|
128
|
-
|
129
|
-
test
|
130
|
-
|
131
|
-
## Term Name
|
132
|
-
|
133
|
-
t1
|
134
|
-
|
135
|
-
## Categories
|
136
|
-
|
137
|
-
cat1, cat2
|
138
|
-
|
139
|
-
## Summary
|
140
|
-
|
141
|
-
Commands are how a user of the Freddie markdown language requests an action.
|
142
|
-
|
143
|
-
## Description
|
144
|
-
|
145
|
-
Commands are how a user can request Egeria to take an action such as Create or Update an Egeria element. Freddie
|
146
|
-
provides
|
147
|
-
a limited (but growing) set of commands. Freddie commands align with the pyegeria 'hey-egeria' command line interface.
|
148
|
-
|
149
|
-
## Abbreviation
|
150
|
-
|
151
|
-
## Examples
|
152
|
-
|
153
|
-
Create Glossary or
|
154
|
-
Update Glossary or
|
155
|
-
Create Term or
|
156
|
-
Update Term
|
157
|
-
|
158
|
-
## Usage
|
159
|
-
|
160
|
-
Commands are used in the Freddie Egeria markdown language.
|
161
|
-
|
162
|
-
## Version
|
163
|
-
|
164
|
-
v1
|
165
|
-
|
166
|
-
## Status
|
167
|
-
|
168
|
-
|
169
|
-
## Qualified Name
|
170
|
-
|
171
|
-
---
|
172
|
-
|
173
|
-
# Create Term
|
174
|
-
|
175
|
-
## Glossary Name
|
176
|
-
|
177
|
-
test
|
178
|
-
|
179
|
-
## Term Name
|
180
|
-
|
181
|
-
t2
|
182
|
-
|
183
|
-
## Categories
|
184
|
-
Writing Markdown
|
185
|
-
|
186
|
-
Processing Markdown
|
187
|
-
|
188
|
-
## Summary
|
189
|
-
|
190
|
-
Source of the markdown content.
|
191
|
-
|
192
|
-
## Description
|
193
|
-
|
194
|
-
Source of the markdown content - could be jupter or plain markdown file.
|
195
|
-
|
196
|
-
## Abbreviation
|
197
|
-
|
198
|
-
## Examples
|
199
|
-
|
200
|
-
## Usage
|
201
|
-
|
202
|
-
## Version
|
203
|
-
|
204
|
-
0.1
|
205
|
-
|
206
|
-
## Status
|
207
|
-
|
208
|
-
DRAFT
|
209
|
-
|
210
|
-
|
211
|
-
---
|
212
|
-
|
213
|
-
# Create Term
|
214
|
-
|
215
|
-
## Glossary Name
|
216
|
-
|
217
|
-
Egeria-Markdown
|
218
|
-
|
219
|
-
## Term Name
|
220
|
-
|
221
|
-
Directive
|
222
|
-
|
223
|
-
## Categories
|
224
|
-
|
225
|
-
meow mix
|
226
|
-
|
227
|
-
## Summary
|
228
|
-
|
229
|
-
A directive defines how the command is to be processed.
|
230
|
-
|
231
|
-
## Description
|
232
|
-
|
233
|
-
Directives are one of:
|
234
|
-
|
235
|
-
* display - just display what we've found
|
236
|
-
* validate - check the validity of the requested action
|
237
|
-
* process - process the requested action
|
238
|
-
|
239
|
-
## Abbreviation
|
240
|
-
|
241
|
-
## Examples
|
242
|
-
|
243
|
-
## Usage
|
244
|
-
|
245
|
-
## Version
|
246
|
-
|
247
|
-
0.1
|
248
|
-
|
249
|
-
## Status
|
250
|
-
|
251
|
-
DRAFT
|
252
|
-
|
253
|
-
---
|
254
|
-
|
255
|
-
# Some terms specified - Now what?
|
256
|
-
|
257
|
-
Ok - we've now created a glossary and three terms to go into the glossary. Here is what we'll do next.
|
258
|
-
|
259
|
-
>Note: This is changing - so will be somewhat abstrct
|
260
|
-
|
261
|
-
We will run a small program called freddie_md.py to operate on this markdown file. When we run this program we
|
262
|
-
tell it not just the name of the file to process but also provide a directive on what to do. Currently we have the
|
263
|
-
choice of:
|
264
|
-
|
265
|
-
1. Display - just parse the file, breaking it down into request blocks, and display what we find
|
266
|
-
2. Validate - parse the file and validate if the commands can be processed - showing information about what we observe.
|
267
|
-
3. Process - parse the request blocks and execute the commands - and produce a new output file to simplify further processing.
|
268
|
-
|
269
|
-
# Great --> let's give it a try!
|
File without changes
|
File without changes
|
File without changes
|