From a9a3fa33e9f257df40efcbecc19d04820775c8a5 Mon Sep 17 00:00:00 2001 From: Dan Wolfson Date: Mon, 23 Nov 2026 14:06:10 -0600 Subject: [PATCH 1/5] PY-19: a preview asks Egeria only for the rows it shows format_set_executor._full_read (page_to=N, the preview) always asked for pages of DEFAULT_FETCH_PAGE_SIZE (100), so a 25-row preview sent pageSize 100. The first request is now min(N, 100), and with the new page_all/async_page_all option trim_to_want the last request is the remainder, so no page is read past N. Paging is otherwise unchanged: a short or empty (filtered) page does not end the read, only a null does, a run that stops at N ends 'capped' with 'stopped at the N rows asked for', and a read without page_to is untouched. /api/about: read once per run in async_paging_for and cached per platform URL for GATE_TTL_SECONDS (3600), not per request. Edited an existing test: test_page_to_pages_fully_up_to_the_rows_asked_for asserted every request was size 100 (the old behaviour); it now expects sizes [2, 2, 1]. _after_first_page (the page-on after an empty first page of a non-preview run, at least 100, bounded to 10 pages) is unchanged. Signed-off-by: Dan Wolfson (cherry picked from commit dc00c184f1896a3c002ed9150d8c3cf7c5b84190) --- docs/release-notes/next.md | 4 + pyegeria/core/paging.py | 32 ++++-- pyegeria/view/format_set_executor.py | 7 +- tests/micro-tests/test_paging_executor.py | 6 +- .../test_py19_preview_page_size.py | 107 ++++++++++++++++++ 5 files changed, 141 insertions(+), 15 deletions(-) create mode 100644 tests/micro-tests/test_py19_preview_page_size.py diff --git a/docs/release-notes/next.md b/docs/release-notes/next.md index fb9820e34..cba74f1e1 100644 --- a/docs/release-notes/next.md +++ b/docs/release-notes/next.md @@ -120,6 +120,10 @@ notes and are not repeated here. before anything is sent, with " needs a name; use to list all", because the Egeria 6.4 by-name and by-type endpoints refuse it (each one checked answered HTTP 400; "*" there is an exact match). `hey_egeria ... deployed-servers` now defaults to `View Server` instead of `*`. +- **A preview asks Egeria only for the rows it shows** (PY-19). A report run with `page_to=N` made its first request + for `min(N, 100)` rows, not always 100, and its last request for the remainder, so no page is read past `N`. Paging is + unchanged otherwise: a short or empty page does not end the read, only Egeria's null does, and a run that stopped at + `N` still says so ("stopped at the N rows asked for; there may be more"). Full reads are untouched. - **`find_digital_product_catalogs` lists catalogs** (PY-71). It sent no type filter and so listed every Collection (a live `find("*")` returned Agreements). It now asks for `DigitalProductCatalog` unless you pass `metadata_element_subtypes`, and it and `get_digital_product_catalogs_by_name` format `output_format="DICT"`, `"MD"` and diff --git a/pyegeria/core/paging.py b/pyegeria/core/paging.py index 1c6ad5a75..6ff771778 100644 --- a/pyegeria/core/paging.py +++ b/pyegeria/core/paging.py @@ -449,6 +449,8 @@ class _Pager: key: Callable[[Any], Hashable] start: int = 0 stall_pages: int = 1 # consecutive pages of only rows already read before "stalled" + trim_to_want: bool = False # ask for no more rows than `want` still needs (a preview's last page) + asked: int = 0 # the size of the request in flight no_new: int = 0 last_keys: Optional[list] = None # the previous page's row keys: the same page again is a stall pages: int = 0 @@ -466,12 +468,15 @@ def request(self) -> Optional[Tuple[int, int]]: self._finish("capped", f"stopped after {self.pages} pages of {self.size}; there may be more", "max_pages") return None - return self.start, self.size + self.asked = self.size + if self.trim_to_want and self.want is not None: + self.asked = max(1, min(self.size, self.want - len(self.items))) + return self.start, self.asked def feed(self, page: Any) -> None: self.pages += 1 at = self.start - self.start += self.size + self.start += self.asked or self.size if not isinstance(page, list): self._null(at) elif not page: @@ -497,10 +502,10 @@ def _null(self, at: int) -> None: def _empty(self, at: int) -> None: self.probes_left = None # an empty page means the server has rows here: not the end - self.empty_rows += self.size + self.empty_rows += self.asked or self.size if self.empty_rows >= self.max_empty_rows: self._finish("not_confirmed", - f"{self.empty_rows} consecutive positions (up to {at + self.size}) were filtered out " + f"{self.empty_rows} consecutive positions (up to {at + (self.asked or self.size)}) were filtered out " f"for you; there may be more", "empty_run_cap") def _rows(self, page: list, at: int) -> None: @@ -536,7 +541,7 @@ def _finish(self, end: str, note: Optional[str], reason: str) -> None: def _pager(want, fetch_page_size, end_policy, probe_pages, max_empty_rows, max_pages, key, - start_from=0, stall_pages=1) -> _Pager: + start_from=0, stall_pages=1, trim_to_want=False) -> _Pager: if end_policy not in END_POLICIES: raise ValueError(f"end_policy must be one of {END_POLICIES}, not {end_policy!r}") for name, value, low in (("fetch_page_size", fetch_page_size, 1), ("probe_pages", probe_pages, 1), @@ -550,7 +555,7 @@ def _pager(want, fetch_page_size, end_policy, probe_pages, max_empty_rows, max_p raise ValueError(f"start_from must be a whole number of at least 0, not {start_from!r}") return _Pager(want=want, size=fetch_page_size, policy=end_policy, probe_pages=probe_pages, max_empty_rows=max_empty_rows, max_pages=max_pages, key=key or default_key, start=start_from, - stall_pages=stall_pages) + stall_pages=stall_pages, trim_to_want=trim_to_want) @contextmanager @@ -586,7 +591,8 @@ def page_all(fetch: Callable[[int, int], Any], *, want: Optional[int] = None, fetch_page_size: int = DEFAULT_FETCH_PAGE_SIZE, end_policy: str = "suspect", probe_pages: int = DEFAULT_PROBE_PAGES, max_empty_rows: int = DEFAULT_MAX_EMPTY_ROWS, max_pages: int = DEFAULT_MAX_PAGES, key: Optional[Callable[[Any], Hashable]] = None, - start_from: int = 0, stall_pages: int = 1, null_not_end: bool = False) -> PageResult: + start_from: int = 0, stall_pages: int = 1, null_not_end: bool = False, + trim_to_want: bool = False) -> PageResult: """Read every row ``fetch(start, size)`` gives (or the first ``want``), paging until the end is known or a limit stops it, starting at ``start_from``. See the module docstring for ``end_policy`` and the ``end`` states. @@ -603,9 +609,12 @@ def page_all(fetch: Callable[[int, int], Any], *, want: Optional[int] = None, (default 1; a path known to return overlapping short pages may allow 2). ``null_not_end`` (a NULL_NOT_END method: pass ``**paging_for(method)``) marks the result so that a null - followed by empty probes is not ``reached_end``.""" + followed by empty probes is not ``reached_end``. + + ``trim_to_want`` (a preview) asks for no more rows than ``want`` still needs, so the last request is the + remainder and no page is read past ``want``; a short or empty page still does not end the read.""" pager = _pager(want, fetch_page_size, end_policy, probe_pages, max_empty_rows, max_pages, key, start_from, - stall_pages) + stall_pages, trim_to_want) while (req := pager.request()) is not None: with _end_signal() as record: page = fetch(*req) @@ -618,10 +627,11 @@ async def async_page_all(fetch: Callable[[int, int], Awaitable[Any]], *, want: O probe_pages: int = DEFAULT_PROBE_PAGES, max_empty_rows: int = DEFAULT_MAX_EMPTY_ROWS, max_pages: int = DEFAULT_MAX_PAGES, key: Optional[Callable[[Any], Hashable]] = None, start_from: int = 0, - stall_pages: int = 1, null_not_end: bool = False) -> PageResult: + stall_pages: int = 1, null_not_end: bool = False, + trim_to_want: bool = False) -> PageResult: """``page_all`` for an async ``fetch`` (same ``key`` and end-signal rules).""" pager = _pager(want, fetch_page_size, end_policy, probe_pages, max_empty_rows, max_pages, key, start_from, - stall_pages) + stall_pages, trim_to_want) while (req := pager.request()) is not None: with _end_signal() as record: page = await fetch(*req) diff --git a/pyegeria/view/format_set_executor.py b/pyegeria/view/format_set_executor.py index f720a39a9..1a25f2b2e 100644 --- a/pyegeria/view/format_set_executor.py +++ b/pyegeria/view/format_set_executor.py @@ -1499,8 +1499,11 @@ def _full_read(plan: Dict[str, Any]) -> Optional[Dict[str, Any]]: """Pager arguments for a run asked to page fully up to page_to rows (preview), or None.""" if not plan["page_to"] or not plan["list"]: return None - return dict(want=plan["page_to"], fetch_page_size=DEFAULT_FETCH_PAGE_SIZE, start_from=plan["start"], - **plan["paging"]) + # PY-19: ask only for the rows shown: a 25-row preview is one request of 25, not of 100. A preview of more than + # the default pages at the default until page_to rows are in (the pager still treats a short page as "more" + # and only a null as the end). + return dict(want=plan["page_to"], fetch_page_size=min(plan["page_to"], DEFAULT_FETCH_PAGE_SIZE), + start_from=plan["start"], trim_to_want=True, **plan["paging"]) def _settle(plan: Dict[str, Any], record: Dict[str, Any], result: Any, paged: Optional[PageResult]): diff --git a/tests/micro-tests/test_paging_executor.py b/tests/micro-tests/test_paging_executor.py index 34870efa6..840a35d6a 100644 --- a/tests/micro-tests/test_paging_executor.py +++ b/tests/micro-tests/test_paging_executor.py @@ -167,10 +167,12 @@ def test_text_format_trusted_null_is_confirmed(server): # ── page_to: preview pages fully ── def test_page_to_pages_fully_up_to_the_rows_asked_for(server): - srv = server("find_authored_elements", {0: [], 100: [ROW(1)], 200: [ROW(2), ROW(3)]}) + # PY-19: a preview asks only for the rows it shows, so the first request is page_to (2), not 100, and the + # last asks for the remainder. (Edited from {0, 100, 200} at size 100: that encoded the old fixed size.) + srv = server("find_authored_elements", {0: [], 2: [ROW(1)], 4: [ROW(2), ROW(3)]}) r = run("DICT", page_to=2) assert [x["GUID"] for x in r["data"]] == ["g1", "g2"] and r["end"] == "capped" - assert {size for _, size in srv.calls} == {100} + assert [size for _, size in srv.calls] == [2, 2, 1] def test_page_to_with_fewer_rows_ends_confirmed_on_a_trusted_path(server): diff --git a/tests/micro-tests/test_py19_preview_page_size.py b/tests/micro-tests/test_py19_preview_page_size.py new file mode 100644 index 000000000..ccb9f3c59 --- /dev/null +++ b/tests/micro-tests/test_py19_preview_page_size.py @@ -0,0 +1,107 @@ +"""PY-19: a preview (page_to=N) asks Egeria only for the rows it shows: the first request is min(N, the default +fetch size), not always the default (100). Paging contract unchanged: a short page is not the last page, only a +null is, and the read stops once N rows are in. A full read (no page_to) is untouched.""" +import asyncio + +import pytest + +from pyegeria.core.paging import DEFAULT_FETCH_PAGE_SIZE, async_page_all, page_all, paging_for +from pyegeria.view import format_set_executor as fse + + +def _plan(page_to, listed=True): + return {"page_to": page_to, "list": listed, "start": 0, "size": 25, "policy": "suspect", + "paging": paging_for(None, None)} + + +@pytest.mark.parametrize("page_to,size", [(1, 1), (25, 25), (99, 99), (100, 100), (101, 100), (250, 100), (5000, 100)]) +def test_the_first_request_is_the_smaller_of_the_preview_and_the_default(page_to, size): + full = fse._full_read(_plan(page_to)) + assert full["fetch_page_size"] == size and full["want"] == page_to + + +def test_a_full_read_and_a_non_list_are_untouched(): + assert fse._full_read(_plan(None)) is None + assert fse._full_read(_plan(25, listed=False)) is None + + +class _Rows: + """A fake Egeria: `rows` rows in all; `short` makes the first page return fewer than asked (filtered).""" + def __init__(self, rows, short=None): + self.rows, self.short, self.calls = rows, short, [] + + def __call__(self, start, size): + self.calls.append((start, size)) + page = [f"r{i}" for i in range(start, min(start + size, self.rows))] + if self.short is not None and len(self.calls) == 1: + page = page[: self.short] + return page or None + + +def test_a_25_row_preview_sends_one_request_of_25(): + fake = _Rows(1000) + got = page_all(fake, **fse._full_read(_plan(25))) + assert fake.calls == [(0, 25)] and len(got.items) == 25 + + +def test_a_preview_larger_than_the_default_pages_at_100_up_to_max_rows(): + fake = _Rows(1000) + got = page_all(fake, **fse._full_read(_plan(250))) + assert fake.calls == [(0, 100), (100, 100), (200, 50)] and len(got.items) == 250 # the last asks for the remainder + + +def test_a_short_first_page_still_pages_on_and_stops_at_max_rows(): + fake = _Rows(1000, short=10) + got = page_all(fake, **fse._full_read(_plan(25))) + assert fake.calls[:2] == [(0, 25), (25, 15)] # a short page is not the last page; ask the rest + assert len(got.items) == 25 and got.end == "capped" # and it stops at the rows asked for + + +def test_a_null_is_the_only_end_and_a_short_dataset_does_not_over_ask(): + fake = _Rows(12) + got = page_all(fake, **fse._full_read(_plan(25))) + assert fake.calls[0] == (0, 25) and len(got.items) == 12 + + +def test_the_async_driver_takes_the_same_arguments(): + fake = _Rows(1000) + + async def fetch(start, size): + return fake(start, size) + got = asyncio.run(async_page_all(fetch, **fse._full_read(_plan(25)))) + assert fake.calls == [(0, 25)] and len(got.items) == 25 + + +def test_the_default_is_still_100(): + assert DEFAULT_FETCH_PAGE_SIZE == 100 + + +def test_an_empty_filtered_page_does_not_end_the_preview(): + rows = {0: [], 25: ["a", "b"], 50: None} + calls = [] + + def fetch(start, size): + calls.append((start, size)) + return rows.get(start) + got = page_all(fetch, **fse._full_read(_plan(25))) + assert calls[:2] == [(0, 25), (25, 25)] and got.items == ["a", "b"] + + +def test_no_request_reads_past_max_rows(): + fake = _Rows(1000) + page_all(fake, **fse._full_read(_plan(130))) + assert sum(size for _, size in fake.calls) == 130 + + +def test_the_result_tells_stopped_at_max_rows_from_everything(): + stopped = page_all(_Rows(1000), **fse._full_read(_plan(25))) + assert stopped.end == "capped" and stopped.end_reason == "want" and not stopped.complete + assert "25 rows asked for" in stopped.note + everything = page_all(_Rows(12), **fse._full_read(_plan(25))) + assert len(everything.items) == 12 and everything.end_reason in ("trusted_null", "null_then_empty_probes") + + +def test_a_pager_without_trim_asks_the_full_size_every_time(): + fake = _Rows(1000) + page_all(fake, want=130, fetch_page_size=100) + assert fake.calls == [(0, 100), (100, 100)] From 9d95d283281c2fb99ba8caa325c325f38a22fb09 Mon Sep 17 00:00:00 2001 From: Dan Wolfson Date: Mon, 23 Nov 2026 14:10:07 -0600 Subject: [PATCH 2/5] PY-61: of: columns are checked against the entity type at their relationship end check_source accepted of:. if ANY entity type had the attribute, which caught typos but not an attribute on the wrong end. The generator now also writes, from the 6.4 typedefs (not the Java classes), ENTITY_SUPERTYPES (getDefaultEntityDef's 2nd argument) and END_ENTITY_TYPES (the entity type at each relationship end, keyed by the end attribute name, which is also the list's name: serverEndpoints -> Endpoint). An of: source is checked against that type and its supertypes; a wrong-end attribute is refused naming the relationship, the end, its type and the attribute. A list whose end type is not in the tables (14 of 307) falls back to the union check and the validator warns; it never passes silently. check_source keeps returning errors; check_source_with_warnings gives (errors, warnings). All 452 report specs re-run: 1783 sourced columns, 3 distinct of: sources, 0 errors, 0 warnings. gen_properties_class_fields.py's docstring now says to re-run test_py59 with EGERIA_6_4_SRC/EGERIA_6_4_REF when regenerating from another ref. Signed-off-by: Dan Wolfson (cherry picked from commit 639a11e519961c6537160f07c4c5215744e42490) --- docs/release-notes/next.md | 4 + .../properties_class_fields.py | 786 ++++++++++++++++++ pyegeria/authoring/validate.py | 7 +- pyegeria/view/column_source.py | 97 ++- scripts/gen_properties_class_fields.py | 61 ++ tests/micro-tests/test_py61_of_end_types.py | 105 +++ 6 files changed, 1039 insertions(+), 21 deletions(-) create mode 100644 tests/micro-tests/test_py61_of_end_types.py diff --git a/docs/release-notes/next.md b/docs/release-notes/next.md index cba74f1e1..67a568fea 100644 --- a/docs/release-notes/next.md +++ b/docs/release-notes/next.md @@ -120,6 +120,10 @@ notes and are not repeated here. before anything is sent, with " needs a name; use to list all", because the Egeria 6.4 by-name and by-type endpoints refuse it (each one checked answered HTTP 400; "*" there is an exact match). `hey_egeria ... deployed-servers` now defaults to `View Server` instead of `*`. +- **An `of:` report column is checked against the entity type at its relationship end** (PY-61). The validator used to + accept `of:.` if any entity type had the attribute; it now checks the entity type(s) at that end of the + relationship and their supertypes, both from the 6.4 typedefs, and refuses a wrong-end attribute naming the relationship, + the end, its type and the attribute. A list whose end type is not in the tables is checked loosely and gets a warning. - **A preview asks Egeria only for the rows it shows** (PY-19). A report run with `page_to=N` made its first request for `min(N, 100)` rows, not always 100, and its last request for the remainder, so no page is read past `N`. Paging is unchanged otherwise: a short or empty page does not end the read, only Egeria's null does, and a run that stopped at diff --git a/md_processing/md_processing_utils/properties_class_fields.py b/md_processing/md_processing_utils/properties_class_fields.py index 56d0a1d4e..52929d7f7 100644 --- a/md_processing/md_processing_utils/properties_class_fields.py +++ b/md_processing/md_processing_utils/properties_class_fields.py @@ -732,3 +732,789 @@ 'Taxonomy': ('CollectionKind',), 'VerificationPoint': ('ExecutionPoint',), } + +#: Each entity type's supertypes, nearest first, from the typedefs (getDefaultEntityDef's 2nd argument). +ENTITY_SUPERTYPES: dict[str, tuple[str, ...]] = { + 'APIManager': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'APIOperation': ('SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'APIParameter': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'APIParameterList': ('ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'APISchemaType': ('RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Action': ('Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'ActivityEntry': ('Notification', 'Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Actor': ('Referenceable', 'OpenMetadataRoot'), + 'ActorProfile': ('Actor', 'Referenceable', 'OpenMetadataRoot'), + 'ActorRole': ('Actor', 'Referenceable', 'OpenMetadataRoot'), + 'Agreement': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'AnalyticalActionProcess': ('GovernanceActionProcess', 'GovernanceAction', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'AnalyticsEngine': ('Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'AnalyticsModelRun': ('TransientEmbeddedProcess', 'EmbeddedProcess', 'Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Annotation': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'AnnotationReview': ('Review', 'Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Application': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'ArchiveFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Asset': ('Referenceable', 'OpenMetadataRoot'), + 'AssetOwner': ('GovernanceRole', 'PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'AudioFile': ('MediaFile', 'DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'AuthoredReferenceable': ('Referenceable', 'OpenMetadataRoot'), + 'AuthorizationManager': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'AvroFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'BareMetalComputer': ('Host', 'ITInfrastructure', 'Infrastructure', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'BlogEntry': ('Notification', 'Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'BuildInstructionFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'BusinessCapability': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'BusinessImperative': ('GovernanceDriver', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'BusinessOwner': ('GovernanceRole', 'PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'CSVFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'CataloguingActionProcess': ('GovernanceActionProcess', 'GovernanceAction', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'CertificationType': ('TermsAndConditions', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ChangeManagementLibrary': ('ResourceManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'CitedDocument': ('ExternalReference', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ClassificationAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'CodeAnalysisAnnotation': ('Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'CohortMember': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'CohortRegistryStore': ('DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Collection': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'CollectionFolder': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Comment': ('Referenceable', 'OpenMetadataRoot'), + 'Community': ('Referenceable', 'OpenMetadataRoot'), + 'CommunityMember': ('PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'ComplexSchemaType': ('SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ComponentOwner': ('GovernanceRole', 'PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'ConceptBead': ('ConceptModelElement', 'DesignModelElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ConceptBeadAttribute': ('ConceptModelElement', 'DesignModelElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ConceptBeadRelationship': ('ConceptModelElement', 'DesignModelElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ConceptModel': ('DesignModel', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ConceptModelElement': ('DesignModelElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Connection': ('Referenceable', 'OpenMetadataRoot'), + 'ConnectorActivityReport': ('Report', 'DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'ConnectorType': ('Referenceable', 'OpenMetadataRoot'), + 'ContactDetails': ('Referenceable', 'OpenMetadataRoot'), + 'ContentCollectionManager': ('ResourceManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'ContextEvent': ('Referenceable', 'OpenMetadataRoot'), + 'ContextEventCollection': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ContributionRecord': ('Referenceable', 'OpenMetadataRoot'), + 'ContributorAnalysisAnnotation': ('Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'CrowdSourcingContributor': ('PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'Dashboard': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DataAccessManager': ('DataManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'DataAsset': ('Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DataClass': ('DataValueSpecification', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataClassAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataDictionary': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataFeed': ('DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DataField': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataFieldAnnotation': ('Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataFile': ('DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DataFileCollection': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DataFolder': ('FileFolder', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DataGrain': ('DataValueSpecification', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataGrainAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataItemOwner': ('GovernanceRole', 'PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'DataLens': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataManager': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'DataMovementEngine': ('Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'DataProcessingAction': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataProcessingDescription': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataProcessingPurpose': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataQualityRule': ('GovernanceRule', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataSet': ('DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DataSharingHub': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataSharingRequest': ('ToDo', 'Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DataSpec': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataStore': ('DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DataStructure': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataValue': ('Referenceable', 'OpenMetadataRoot'), + 'DataValueSpecification': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DataVirtualizationEngine': ('Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'Database': ('DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DatabaseManager': ('DataManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'Decision': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DeletingActionProcess': ('GovernanceActionProcess', 'GovernanceAction', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DeployedAPI': ('DeployedSoftwareComponent', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DeployedAnalyticsModel': ('DeployedSoftwareComponent', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DeployedConnector': ('DeployedSoftwareComponent', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DeployedDatabaseSchema': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DeployedSoftwareComponent': ('Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DesignModel': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DesignModelElement': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DesignPattern': ('Referenceable', 'OpenMetadataRoot'), + 'DigitalProduct': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DigitalProductCatalog': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DigitalProductFamily': ('DigitalProduct', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DigitalProductManager': ('PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'DigitalSubscription': ('Agreement', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DisplayDataContainer': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DisplayDataField': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DisplayDataSchemaType': ('RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Document': ('MediaFile', 'DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'DocumentSchemaAttribute': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DocumentSchemaType': ('RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'DocumentStore': ('DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'EmbeddedProcess': ('Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Endpoint': ('Referenceable', 'OpenMetadataRoot'), + 'Engine': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'EngineAction': ('Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'EnumSchemaType': ('SimpleSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'EventBroker': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'EventManager': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'EventSchemaAttribute': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'EventSet': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'EventType': ('RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'EventTypeList': ('SchemaTypeChoice', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ExceptionType': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ExecutableFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'ExplorerActionEngine': ('GovernanceEngine', 'Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'ExplorerActionService': ('GovernanceService', 'DeployedConnector', 'DeployedSoftwareComponent', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'ExploringActionProcess': ('GovernanceActionProcess', 'GovernanceAction', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ExternalDataSource': ('ExternalReference', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ExternalId': ('Referenceable', 'OpenMetadataRoot'), + 'ExternalModelSource': ('ExternalReference', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ExternalReference': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ExternalSchemaType': ('SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ExternalSourceCode': ('ExternalReference', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ExternalStandard': ('ExternalReference', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'FileFolder': ('DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'FileManager': ('ResourceManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'FileSystem': ('ResourceManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'FingerprintAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Folio': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Form': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'FunctionCall': ('TransientEmbeddedProcess', 'EmbeddedProcess', 'Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Glossary': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GlossaryTerm': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceAction': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceActionEngine': ('GovernanceEngine', 'Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceActionProcess': ('GovernanceAction', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceActionProcessInstance': ('TransientEmbeddedProcess', 'EmbeddedProcess', 'Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceActionProcessStep': ('GovernanceActionType', 'GovernanceAction', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceActionService': ('GovernanceService', 'DeployedConnector', 'DeployedSoftwareComponent', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceActionType': ('GovernanceAction', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceApproach': ('GovernancePolicy', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceControl': ('GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceDefinition': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceDriver': ('GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceEngine': ('Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceMetric': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceObligation': ('GovernancePolicy', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceOfficer': ('GovernanceRole', 'PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'GovernancePolicy': ('GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernancePrinciple': ('GovernancePolicy', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceProcedure': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceRepresentative': ('GovernanceRole', 'PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceResponsibility': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceRole': ('PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceRule': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceService': ('DeployedConnector', 'DeployedSoftwareComponent', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceStrategy': ('GovernanceDriver', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GovernanceZone': ('SecurityAccessControl', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GraphEdge': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GraphSchemaType': ('RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'GraphStore': ('DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'GraphVertex': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'HomeCollection': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Host': ('ITInfrastructure', 'Infrastructure', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'HostCluster': ('Host', 'ITInfrastructure', 'Infrastructure', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'ITInfrastructure': ('Infrastructure', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'ITProfile': ('ActorProfile', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'ITProfileRole': ('ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'ITSubsystem': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ImplementationSnippet': ('Referenceable', 'OpenMetadataRoot'), + 'InformalTag': ('Referenceable', 'OpenMetadataRoot'), + 'InformationSupplyChain': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'InformationView': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Infrastructure': ('Asset', 'Referenceable', 'OpenMetadataRoot'), + 'IntegrationConnector': ('DeployedConnector', 'DeployedSoftwareComponent', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'IntegrationGroup': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'InventoryCatalog': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'JSONFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'JournalEntry': ('Notification', 'Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'KeyStoreFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'LicenseType': ('TermsAndConditions', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Like': ('OpenMetadataRoot',), + 'LiteralDataValue': ('DataValue', 'Referenceable', 'OpenMetadataRoot'), + 'LiteralSchemaType': ('SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Location': ('Referenceable', 'OpenMetadataRoot'), + 'LocationOwner': ('GovernanceRole', 'PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'LogFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'MapSchemaType': ('SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'MasterDataManager': ('ResourceManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'MeasurementSpecification': ('DataValueSpecification', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'MediaCollection': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'MediaFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Meeting': ('Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'MetadataCollection': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'MetadataRepository': ('DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'MetadataRepositoryCohort': ('Referenceable', 'OpenMetadataRoot'), + 'Methodology': ('GovernanceProcedure', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Namespace': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'NamingStandardRule': ('GovernanceRule', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'NamingStandardRuleSet': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Network': ('ITInfrastructure', 'Infrastructure', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'NetworkGateway': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'Note': ('Notification', 'Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'NoteLog': ('Referenceable', 'OpenMetadataRoot'), + 'NoteLogAuthor': ('PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'Notification': ('Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'NotificationManager': ('ResourceManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'NotificationType': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ObjectAttribute': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ObjectSchemaType': ('RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'OperatingPlatform': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Organization': ('Team', 'ActorProfile', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'ParquetFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'PenetrationTestFindingAnnotation': ('SecurityFindingAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Person': ('ActorProfile', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'PersonRole': ('ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'Perspective': ('Actor', 'Referenceable', 'OpenMetadataRoot'), + 'PrimitiveSchemaType': ('SimpleSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Process': ('Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Project': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ProjectManager': ('PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'PropertiesFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'PropertyFacet': ('Referenceable', 'OpenMetadataRoot'), + 'ProvisioningActionProcess': ('GovernanceActionProcess', 'GovernanceAction', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'QualityAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'QueryDataContainer': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'QueryDataField': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'QuerySchemaType': ('RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RESTAPIManager': ('APIManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'RasterFile': ('MediaFile', 'DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Rating': ('OpenMetadataRoot',), + 'ReferenceCodeMappingTable': ('TabularDataSet', 'DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'ReferenceCodeTable': ('TabularDataSet', 'DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'ReferenceDataSet': ('ReferenceDataValue', 'ValidValueDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ReferenceDataValue': ('ValidValueDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ReferenceList': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Referenceable': ('OpenMetadataRoot',), + 'Regulation': ('GovernanceDriver', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RegulationArticle': ('GovernanceDriver', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RelatedMedia': ('ExternalReference', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RelationalColumn': ('TabularColumn', 'SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RelationalDBSchemaType': ('RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RelationalDBSchemaTypeList': ('RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RelationalDatabase': ('Database', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'RelationalTable': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RelationalTableType': ('TabularSchemaType', 'RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RelationshipAdviceAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Report': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'ReportSpec': ('ReportType', 'DataSpec', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ReportType': ('DataSpec', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ReportingEngine': ('Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'RepositoryGovernanceEngine': ('GovernanceEngine', 'Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'RepositoryGovernanceService': ('GovernanceService', 'DeployedConnector', 'DeployedSoftwareComponent', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'RequestForAction': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Requirement': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ResearchQuestion': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ResourceManager': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'ResourceProfileAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ResourceProfileLogAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ResultsSet': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Review': ('Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Risk': ('GovernancePolicy', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RootCollection': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RootSchemaType': ('ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'RunnableSoftwareComponent': ('Asset', 'Referenceable', 'OpenMetadataRoot'), + 'SavedQuery': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'SchemaAnalysisAnnotation': ('Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SchemaAttribute': ('SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SchemaElement': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SchemaType': ('SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SchemaTypeChoice': ('SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ScriptFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'SearchKeyword': ('OpenMetadataRoot',), + 'SecretsCollection': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'SecurityAccessControl': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SecurityFindingAnnotation': ('Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SecurityGroup': ('SecurityList', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SecurityList': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SecurityRole': ('SecurityList', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SemanticAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ServiceAccessControl': ('SecurityAccessControl', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ServiceLevelObjective': ('TermsAndConditions', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SimpleSchemaType': ('SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Skill': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SkillSet': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SoftwareArchive': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SoftwareCapability': ('Referenceable', 'OpenMetadataRoot'), + 'SoftwareComponent': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SoftwareLibrary': ('ResourceManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'SoftwareModule': ('SoftwareComponent', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SoftwareServer': ('ITInfrastructure', 'Infrastructure', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'SoftwareServerPlatform': ('ITInfrastructure', 'Infrastructure', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'SoftwareService': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'SolutionActorRole': ('ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'SolutionBlueprint': ('DesignModel', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SolutionComponent': ('DesignModelElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SolutionOwner': ('GovernanceRole', 'PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'SolutionPort': ('DesignModelElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SourceCodeFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'SourceControlLibrary': ('ResourceManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'SpecificationPropertyValue': ('ValidValueDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SpreadsheetFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'StatementOfApplicability': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'StorageVolume': ('Referenceable', 'OpenMetadataRoot'), + 'StructSchemaType': ('ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SubjectArea': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SubjectAreaOwner': ('GovernanceRole', 'PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'SubscribingActionProcess': ('GovernanceActionProcess', 'GovernanceAction', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SurveyActionEngine': ('GovernanceEngine', 'Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'SurveyActionService': ('GovernanceService', 'DeployedConnector', 'DeployedSoftwareComponent', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'SurveyReport': ('Report', 'DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'SurveyingActionProcess': ('GovernanceActionProcess', 'GovernanceAction', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'TabularColumn': ('SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'TabularDataSet': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'TabularDataSetCollection': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'TabularFileColumn': ('TabularColumn', 'SchemaAttribute', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'TabularSchemaType': ('RootSchemaType', 'ComplexSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Team': ('ActorProfile', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'TeamLeader': ('PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'TeamMember': ('PersonRole', 'ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'TeamRole': ('ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), + 'TechnologyType': ('ValidMetadataValue', 'ValidValueDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'TermsAndConditions': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'Threat': ('GovernanceDriver', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ThreeDImageFile': ('MediaFile', 'DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'ToDo': ('Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'Topic': ('DataFeed', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'TransientEmbeddedProcess': ('EmbeddedProcess', 'Action', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'TranslationDetail': ('OpenMetadataRoot',), + 'UserAccessDirectory': ('ResourceManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'UserAuthenticationManager': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'UserIdentity': ('Actor', 'Referenceable', 'OpenMetadataRoot'), + 'UserProfileManager': ('ResourceManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'ValidMetadataValue': ('ValidValueDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ValidValueDefinition': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'VectorFile': ('MediaFile', 'DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'VideoFile': ('MediaFile', 'DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'VirtualConnection': ('Connection', 'Referenceable', 'OpenMetadataRoot'), + 'VirtualContainer': ('Host', 'ITInfrastructure', 'Infrastructure', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'VirtualMachine': ('Host', 'ITInfrastructure', 'Infrastructure', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'VirtualRelationalTable': ('InformationView', 'DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'VulnerabilityAnnotation': ('SecurityFindingAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'WatchdogActionEngine': ('GovernanceEngine', 'Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'WatchdogActionService': ('GovernanceService', 'DeployedConnector', 'DeployedSoftwareComponent', 'Process', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'WorkItemList': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'WorkflowEngine': ('Engine', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'WorkingSet': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'XMLFile': ('DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), + 'YAMLFile': ('PropertiesFile', 'DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), +} + +#: The entity type(s) at each relationship end, by the end's attribute name, which is also what an element's +#: relationship list is called (serverEndpoints -> Endpoint), from the typedefs (getRelationshipEndDef). PY-61. +END_ENTITY_TYPES: dict[str, tuple[str, ...]] = { + 'acceptedAnswers': ('Comment',), + 'actionCause': ('Referenceable',), + 'actionSource': ('Referenceable',), + 'actionTargets': ('OpenMetadataRoot',), + 'actionsForTarget': ('Action',), + 'actorWithSkills': ('Actor',), + 'actsAsTypeFor': ('ConceptBead',), + 'agreementActors': ('Actor',), + 'agreementContents': ('Agreement',), + 'agreementItems': ('Referenceable',), + 'agreementsForContract': ('Agreement',), + 'alignsToPort': ('SolutionPort',), + 'alsoKnownAs': ('ExternalId',), + 'alternateTerms': ('GlossaryTerm',), + 'annotationExtensions': ('Annotation',), + 'annotationMatches': ('OpenMetadataRoot',), + 'annotationSubjects': ('OpenMetadataRoot',), + 'answeredQuestions': ('Comment',), + 'antonyms': ('GlossaryTerm',), + 'apiEndpoints': ('Endpoint',), + 'apiHeader': ('SchemaType',), + 'apiRequest': ('SchemaType',), + 'apiResponse': ('SchemaType',), + 'approvedForPurposes': ('Referenceable',), + 'approvedPurposes': ('DataProcessingPurpose',), + 'archiveContents': ('Collection',), + 'asOfDataField': ('DataField',), + 'assessedControls': ('GovernanceDefinition',), + 'assessmentDecisions': ('Decision',), + 'assetConnections': ('Connection',), + 'assetsUsingProfile': ('Referenceable',), + 'assignedActors': ('Referenceable',), + 'assignedDataValueSpecifications': ('DataValueSpecification',), + 'assignedItems': ('Referenceable',), + 'assignedRegulators': ('Organization',), + 'assignedToDataValueSpecifications': ('Referenceable',), + 'assignmentScope': ('Referenceable',), + 'associatedAnnotations': ('Annotation',), + 'associatedDecisions': ('Decision',), + 'associatedEventForTimelines': ('ContextEvent',), + 'associatedGovernanceActions': ('GovernanceAction',), + 'associatedLogSubjects': ('Referenceable',), + 'associatedLogs': ('Asset',), + 'associatedSecurityLists': ('SecurityList',), + 'associatedValues1': ('ValidValueDefinition',), + 'associatedValues2': ('ValidValueDefinition',), + 'attributes': ('ConceptBeadAttribute', 'SchemaAttribute'), + 'basisDataField': ('DataField',), + 'beanExtensions': ('ConceptBead',), + 'broaderSubjectArea': ('SubjectArea',), + 'called': ('Referenceable',), + 'calledFromGovernanceEngines': ('GovernanceEngine',), + 'caller': ('Referenceable',), + 'canonicalValidValues': ('ValidValueDefinition',), + 'capabilities': ('SoftwareCapability',), + 'capabilityConsumedAssets': ('Asset',), + 'catalogTargets': ('OpenMetadataRoot',), + 'certifications': ('CertificationType',), + 'certifiedElements': ('Referenceable',), + 'childContextEvents': ('ContextEvent',), + 'childProcesses': ('Process',), + 'childProcessingActions': ('DataProcessingAction',), + 'citedDocuments': ('CitedDocument',), + 'citingItems': ('Referenceable',), + 'classifies': ('GlossaryTerm',), + 'cohortMembership': ('CohortMember',), + 'collectionMembers': ('Referenceable',), + 'commentedOnElement': ('Referenceable',), + 'comments': ('Comment',), + 'conceptModels': ('ConceptModel',), + 'configuredInSecurityCollections': ('SecretsCollection',), + 'connectedAssets': ('Asset',), + 'connectedResources': ('Referenceable',), + 'connections': ('Connection',), + 'connectorType': ('ConnectorType',), + 'consistentValues': ('ValidValueDefinition',), + 'consolidatedDuplicateOrigin': ('Referenceable',), + 'consolidatedDuplicateResult': ('Referenceable',), + 'consumedByCapabilities': ('SoftwareCapability',), + 'consumedDesignPatterns': ('DesignPattern',), + 'consumingBusinessCapabilities': ('BusinessCapability',), + 'consumingDesignPatterns': ('DesignPattern',), + 'contactDetails': ('ActorProfile', 'Referenceable'), + 'contacts': ('ContactDetails',), + 'containsDBSchemas': ('RelationalDBSchemaType',), + 'containsDataFields': ('DataField',), + 'containsOperations': ('APIOperation',), + 'contextEventEvidence': ('Referenceable',), + 'contextRelevantTerms': ('GlossaryTerm',), + 'contracts': ('CitedDocument',), + 'contributorProfile': ('ActorProfile',), + 'controlsZones': ('GovernanceZone',), + 'crowdSourcedContributions': ('Referenceable',), + 'crowdSourcingContributors': ('Actor',), + 'dataConsumer': ('Referenceable',), + 'dataDescription': ('Collection',), + 'dataLineageDestinations': ('Referenceable',), + 'dataLineageSources': ('Referenceable',), + 'dataProcessingActions': ('DataProcessingAction',), + 'dataProcessingDescriptions': ('DataProcessingDescription',), + 'dataProcessingElements': ('Referenceable',), + 'dataProcessingTarget': ('Referenceable',), + 'dataSetContent': ('Referenceable',), + 'dataStructureDefinition': ('DataStructure',), + 'dataSupplier': ('Referenceable',), + 'dataValueSources': ('Asset',), + 'dataValueSpecifications': ('DataValueSpecification',), + 'dataValueUses': ('Referenceable',), + 'databaseSchemaType': ('RelationalDBSchemaTypeList',), + 'decisionOutcomes': ('Referenceable',), + 'definedInSecretsCollection': ('SecretsCollection',), + 'delegationPorts': ('SolutionPort',), + 'dependedOnProcessSteps': ('GovernanceActionProcessStep',), + 'dependentOnForExecution': ('RunnableSoftwareComponent',), + 'dependentProjects': ('Project',), + 'dependsOnBusinessCapability': ('BusinessCapability',), + 'dependsOnForExecution': ('RunnableSoftwareComponent',), + 'dependsOnProjects': ('Project',), + 'dependsOnSoftwarePackages': ('Collection',), + 'deployedTo': ('Asset',), + 'derivedFrom': ('Referenceable',), + 'derivedFromDataField': ('DataField',), + 'derivedFromDataStructure': ('DataStructure',), + 'derivedFromReportType': ('ReportType',), + 'derivedFromSoftwareComponent': ('SoftwareComponent',), + 'describedByDataValueSpecifications': ('Referenceable',), + 'describes': ('Referenceable',), + 'describesConceptsFor': ('Referenceable',), + 'describesDataFor': ('Referenceable',), + 'describesDesignOf': ('Referenceable',), + 'describesStructure': ('Referenceable',), + 'digitalSubscribers': ('Referenceable',), + 'digitalSubscriptions': ('DigitalSubscription',), + 'displayingItems': ('Referenceable',), + 'downstreamFromLineageSource': ('Referenceable',), + 'drivers': ('GovernanceDriver',), + 'edges': ('GraphEdge',), + 'embeddedConnections': ('Connection',), + 'embeddedDataValues': ('DataValue',), + 'endBeads': ('ConceptBead',), + 'endpoint': ('Endpoint',), + 'enforcesRegulations': ('Regulation',), + 'equivalentElements': ('OpenMetadataRoot',), + 'equivalentSchemaAttribute': ('SchemaAttribute',), + 'equivalentSchemaAttributes': ('SchemaAttribute',), + 'equivalentSchemaType': ('SchemaType',), + 'equivalentSchemaTypes': ('SchemaType',), + 'eventEffectedResources': ('Referenceable',), + 'eventImpacts': ('Referenceable',), + 'exceptions': ('Referenceable',), + 'excludedFromRequirements': ('ExceptionType',), + 'extendedBeans': ('ConceptBead',), + 'externalReferences': ('ExternalReference',), + 'externalSchemaType': ('SchemaType',), + 'facetedElements': ('Referenceable',), + 'firstStep': ('GovernanceActionProcessStep',), + 'followOnActions': ('Referenceable',), + 'followOnProcessSteps': ('GovernanceActionProcessStep',), + 'followOnReports': ('Report',), + 'foreignKeys': ('RelationalColumn',), + 'fromSurveyReport': ('SurveyReport',), + 'fromSurveyReports': ('SurveyReport',), + 'gateways': ('NetworkGateway',), + 'generalizedDesignPattern': ('DesignPattern',), + 'generatedReports': ('Report',), + 'governanceActionExecutor': ('GovernanceEngine',), + 'governedBy': ('GovernanceDefinition',), + 'governedElements': ('Referenceable',), + 'groupingLocations': ('Location',), + 'homeFolder': ('FileFolder',), + 'hostCluster': ('HostCluster',), + 'hostedByDeployedITInfrastructure': ('ITInfrastructure',), + 'hostedITAssets': ('ITInfrastructure',), + 'identifiedByRequestForActions': ('RequestForAction',), + 'impactedByContextEvents': ('ContextEvent',), + 'impactedResources': ('Referenceable',), + 'implementationResources': ('Referenceable',), + 'implementedBy': ('Referenceable',), + 'includedInIntegrationGroups': ('IntegrationGroup',), + 'includesSoftwarePackages': ('Collection',), + 'informalTags': ('InformalTag',), + 'inheritingBeads': ('ConceptBead',), + 'inheritsFromBead': ('ConceptBead',), + 'inheritsFromZone': ('GovernanceZone',), + 'inputsToDecision': ('Referenceable',), + 'installedOn': ('ITInfrastructure',), + 'interactingWithActors': ('Actor',), + 'interactingWithSolutionComponents': ('SolutionComponent',), + 'interestingNotificationTypes': ('NotificationType',), + 'involvedInAgreements': ('Agreement',), + 'isA': ('GlossaryTerm',), + 'keywordElements': ('Referenceable',), + 'knownLocations': ('Location',), + 'labeledEnd1': ('OpenMetadataRoot',), + 'labeledEnd2': ('OpenMetadataRoot',), + 'licensedElements': ('Referenceable',), + 'licenses': ('LicenseType',), + 'likedElement': ('Referenceable',), + 'likes': ('Like',), + 'lineageEnd1': ('OpenMetadataRoot',), + 'lineageEnd2': ('OpenMetadataRoot',), + 'linkedControls': ('GovernanceControl',), + 'linkedDrivers': ('GovernanceDriver',), + 'linkedFiles': ('DataFile',), + 'linkedFolders': ('FileFolder',), + 'linkedFromDataFields': ('DataField',), + 'linkedMediaFiles': ('MediaFile',), + 'linkedPolicies': ('GovernancePolicy',), + 'linkedToDataFields': ('DataField',), + 'linkedToPrimaryKey': ('RelationalColumn',), + 'linkingControls': ('GovernanceControl',), + 'linkingDrivers': ('GovernanceDriver',), + 'linkingPolicies': ('GovernancePolicy',), + 'listedInSecretsCollection': ('SecretsCollection',), + 'localResources': ('Referenceable',), + 'madeOfDataClasses': ('DataClass',), + 'managedHosts': ('Host',), + 'managedProjects': ('Project',), + 'managesStorageFor': ('DataStore',), + 'managingProjects': ('Project',), + 'mapFromElement': ('SchemaType',), + 'mapToElement': ('SchemaType',), + 'matchedByAnnotations': ('Annotation',), + 'matchingValue': ('ValidValueDefinition',), + 'meaningForDataElements': ('Referenceable',), + 'meanings': ('GlossaryTerm',), + 'measurements': ('Asset',), + 'mechanisms': ('GovernanceControl',), + 'memberOfCollections': ('Collection',), + 'memberOfValidValueSets': ('ValidValueDefinition',), + 'metrics': ('GovernanceMetric',), + 'monitoredResources': ('Referenceable',), + 'monitoredThrough': ('NotificationType',), + 'myFollowers': ('Person',), + 'myPeers': ('Person',), + 'nestedAttributes': ('SchemaAttribute',), + 'nestedDataFields': ('DataField',), + 'nestedFiles': ('DataFile',), + 'nestedFolders': ('FileFolder',), + 'nestedLocations': ('Location',), + 'nestedSolutionComponents': ('SolutionComponent',), + 'nestedSubjectAreas': ('SubjectArea',), + 'networkConnections': ('Network',), + 'noteLogEntries': ('Action',), + 'noteLogSubjects': ('Referenceable',), + 'noteLogs': ('NoteLog',), + 'operatingPlatforms': ('OperatingPlatform',), + 'packagedInArchiveFiles': ('ArchiveFile',), + 'packagedInOperatingPlatforms': ('OperatingPlatform',), + 'parentAttribute': ('SchemaAttribute',), + 'parentBead': ('ConceptBead',), + 'parentConnections': ('VirtualConnection',), + 'parentContextEvents': ('ContextEvent',), + 'parentDataFields': ('DataField',), + 'parentDataValues': ('DataValue',), + 'parentFolder': ('FileFolder',), + 'parentMapFrom': ('SchemaElement',), + 'parentMapTo': ('SchemaElement',), + 'parentProcesses': ('Process',), + 'parentProcessingActions': ('DataProcessingAction',), + 'parentSchemas': ('ComplexSchemaType',), + 'partOfDataClasses': ('DataClass',), + 'partOfDataStructures': ('DataStructure',), + 'peerDuplicateOrigin': ('Referenceable',), + 'peerDuplicatePartner': ('Referenceable',), + 'peerLocations': ('Location',), + 'performsRoles': ('ITProfileRole', 'PersonRole', 'TeamRole'), + 'permittedProcessing': ('DataProcessingDescription',), + 'policies': ('GovernancePolicy',), + 'populatedUsingQuery': ('SavedQuery',), + 'portOwningProcesses': ('Process',), + 'predefinedTargetForAction': ('OpenMetadataRoot',), + 'preferredTerms': ('GlossaryTerm',), + 'presentInNoteLogs': ('NoteLog',), + 'previousActions': ('Referenceable',), + 'previousAnnotations': ('Annotation',), + 'priorReports': ('Report',), + 'processVariableTypeUses': ('Referenceable',), + 'processVariableTypes': ('SchemaType',), + 'processingVariables': ('DataValue',), + 'profileContributionRecord': ('ContributionRecord',), + 'profilesForAsset': ('ITProfile',), + 'projectTargets': ('Referenceable',), + 'propertyFacets': ('PropertyFacet',), + 'providesAsOfTimeForMeasurements': ('MeasurementSpecification',), + 'providesBasisForMeasurements': ('MeasurementSpecification',), + 'providesDataValues': ('DataValue',), + 'providesMoreInformation': ('Referenceable',), + 'providesStorageFor': ('Referenceable',), + 'queryTarget': ('SchemaElement',), + 'referenceValues': ('ValidValueDefinition',), + 'referencingElements': ('Referenceable',), + 'refreshedByConnectors': ('IntegrationConnector',), + 'registeredWithCohorts': ('MetadataRepositoryCohort',), + 'relatedActions': ('Action',), + 'relatedContextEvents': ('ContextEvent',), + 'relatedDesignPatterns': ('DesignPattern',), + 'relatedMedia': ('RelatedMedia',), + 'relatedRegulations': ('Regulation',), + 'relatedToContextEvents': ('ContextEvent',), + 'relationships': ('ConceptBeadRelationship',), + 'relevantToScopes': ('Referenceable',), + 'replacedTerms': ('GlossaryTerm',), + 'replacementTerms': ('GlossaryTerm',), + 'reportOriginator': ('Referenceable',), + 'reportSubjects': ('OpenMetadataRoot',), + 'reportTypeInstances': ('Report',), + 'reportedAnnotations': ('Annotation',), + 'reports': ('Report',), + 'requestForActionTargets': ('Referenceable',), + 'requestedActions': ('Action',), + 'requiredCertifications': ('CertificationType',), + 'resourceConnections': ('Connection',), + 'resourceList': ('Referenceable',), + 'resourceListUsers': ('Referenceable',), + 'resourceProfileAnnotations': ('ResourceProfileLogAnnotation',), + 'resourceProfileData': ('Asset',), + 'resultsStoredIn': ('ResultsSet',), + 'reusedTechnique': ('Referenceable',), + 'reviewedElement': ('Referenceable',), + 'reviews': ('Rating',), + 'rolePerformers': ('ITProfile', 'Person', 'Team'), + 'roledEnd1': ('OpenMetadataRoot',), + 'roledEnd2': ('OpenMetadataRoot',), + 'runningWithAsset': ('Asset',), + 'sampleData': ('Asset',), + 'schemaOptionalUses': ('SchemaElement',), + 'schemaOptions': ('SchemaType',), + 'schemaType': ('SchemaType',), + 'scopedElements': ('Referenceable',), + 'searchKeywords': ('SearchKeyword',), + 'securityAccessControls': ('SecurityAccessControl',), + 'securityLists': ('SecurityList',), + 'seeAlso': ('GlossaryTerm',), + 'semanticDefinitions': ('GlossaryTerm',), + 'semanticallyAssociatedDefinitions': ('Referenceable',), + 'serverEndpoints': ('Endpoint',), + 'serverForEndpoint': ('ITInfrastructure',), + 'skillSets': ('SkillSet',), + 'softwareComponentUsedBy': ('Asset',), + 'solutionComponent': ('SolutionComponent',), + 'solutionDesigns': ('SolutionBlueprint',), + 'solutionPorts': ('SolutionPort',), + 'sourceAttributes': ('Referenceable',), + 'sourceElement': ('Referenceable',), + 'sourcedFromTemplate': ('OpenMetadataRoot',), + 'sourcesOfSampleData': ('Referenceable',), + 'specializedDesignPattern': ('DesignPattern',), + 'specificationProperties': ('Referenceable',), + 'specificationPropertyUsers': ('ValidValueDefinition',), + 'statementsOfApplicability': ('StatementOfApplicability',), + 'storageVolumes': ('StorageVolume',), + 'storedOn': ('StorageVolume',), + 'subDataValueSpecifications': ('DataValueSpecification',), + 'subTeams': ('Team',), + 'subscribers': ('Referenceable',), + 'superDataValueSpecification': ('DataValueSpecification',), + 'superTeam': ('Team',), + 'supplementaryProperties': ('GlossaryTerm',), + 'supplementsElement': ('Referenceable',), + 'supplyFrom': ('Referenceable',), + 'supplyTo': ('Referenceable',), + 'supportedAPIs': ('DeployedAPI',), + 'supportedDataSets': ('DataSet',), + 'supportedGovernanceServices': ('GovernanceService',), + 'supportedIntegrationConnectors': ('IntegrationConnector',), + 'supportedPurposes': ('DataProcessingPurpose',), + 'supportsBusinessCapabilities': ('BusinessCapability',), + 'supportsGovernanceActions': ('GovernanceActionType',), + 'synonyms': ('GlossaryTerm',), + 'taggedElements': ('Referenceable',), + 'targetAttributes': ('Referenceable',), + 'targetElement': ('Referenceable',), + 'techniqueInUseBy': ('Referenceable',), + 'templateCreatedElements': ('OpenMetadataRoot',), + 'templateUses': ('OpenMetadataRoot',), + 'templatesForCataloguing': ('OpenMetadataRoot',), + 'translates': ('OpenMetadataRoot',), + 'translation': ('TranslationDetail',), + 'triggeredFrom': ('GovernanceActionProcess',), + 'typedByBean': ('ConceptBeadAttribute',), + 'ultimateDestinations': ('Referenceable',), + 'ultimateSources': ('Referenceable',), + 'upstreamFromLineageDestination': ('Referenceable',), + 'usedAsAPIHeader': ('APIOperation',), + 'usedAsAPIRequest': ('APIOperation',), + 'usedAsAPIResponse': ('APIOperation',), + 'usedBy': ('SchemaElement',), + 'usedByDigitalProducts': ('DigitalProduct',), + 'usedInAPI': ('APISchemaType',), + 'usedInAccessControls': ('SecurityAccessControl',), + 'usedInCertifications': ('CertificationType',), + 'usedInContexts': ('Referenceable',), + 'usedInImplementationOf': ('Referenceable',), + 'usedInReports': ('Report',), + 'usedInSchema': ('SchemaElement',), + 'usedInSolutionComponents': ('SolutionComponent',), + 'userAccounts': ('UserIdentity',), + 'userIdentities': ('UserIdentity',), + 'userProfile': ('ActorProfile',), + 'usesDigitalProducts': ('DigitalProduct',), + 'usesDigitalServices': ('Referenceable',), + 'usesResultsSets': ('ResultsSet',), + 'validValueImplementations': ('Referenceable',), + 'validValueMembers': ('ValidValueDefinition',), + 'validValues': ('ValidValueDefinition',), + 'validValuesConsumer': ('Referenceable',), + 'vertices': ('GraphVertex',), + 'visibleEndpoints': ('Endpoint',), + 'visibleInNetworks': ('Network',), + 'wiredFrom': ('Referenceable',), + 'wiredTo': ('Referenceable',), + 'workedOnByProjects': ('Project',), +} diff --git a/pyegeria/authoring/validate.py b/pyegeria/authoring/validate.py index cc30c77c9..c0f35e6d2 100644 --- a/pyegeria/authoring/validate.py +++ b/pyegeria/authoring/validate.py @@ -322,12 +322,15 @@ async def _check_spec(draft: SpecDraft, result: ValidationResult, client: Any = f"and no pyegeria spec uses it.") result.checked.append("target type") action = fs.action - from pyegeria.view.column_source import check_source + from pyegeria.view.column_source import check_source_with_warnings for fmt in fs.formats or []: # PY-53: a column's `source` names real 6.4 classifications, ends and properties for col in getattr(fmt, "attributes", None) or []: source = col.get("source") if isinstance(col, dict) else getattr(col, "source", None) - for words in (check_source(source) if source else []): + errors, warnings = check_source_with_warnings(source) if source else ([], []) + for words in errors: result.error(words) + for words in warnings: # PY-61: an end whose type is not in the 6.4 tables is checked loosely, and said so + result.warn(words) is_find = bool(getattr(action, "function", None)) and not getattr(action, "analytic_function", None) if is_find and target: await _check_find_fit(fs, client, result) diff --git a/pyegeria/view/column_source.py b/pyegeria/view/column_source.py index 772af1940..06adaa4c6 100644 --- a/pyegeria/view/column_source.py +++ b/pyegeria/view/column_source.py @@ -77,14 +77,82 @@ def _fields(type_name: str, kind: str) -> Optional[set]: return {_snake(f) for f in entry[1]} -def check_source(text: str) -> List[str]: - """Why a `source` is wrong, as validator error messages ([] when it is right). Classification and - relationship names and their properties are checked against the 6.4 Properties-class tables; an `of:` - attribute is wrong only when no entity type has it.""" +def _end_entity_types() -> dict: + """{relationship list (end attribute) name: the entity type(s) at that end}, from the 6.4 typedefs.""" + from md_processing.md_processing_utils.properties_class_fields import END_ENTITY_TYPES + return END_ENTITY_TYPES + + +def _entity_supertypes() -> dict: + from md_processing.md_processing_utils.properties_class_fields import ENTITY_SUPERTYPES + return ENTITY_SUPERTYPES + + +_UNIVERSAL_ATTRIBUTES = {"guid", "type", "status", "name", "origin"} + + +def _union_has(wanted: str) -> bool: + """The PY-53 check: some entity type has the attribute (catches a typo, not a wrong end).""" + from md_processing.md_processing_utils.properties_class_fields import PROPERTIES_CLASS_FIELDS + return wanted in _UNIVERSAL_ATTRIBUTES or any( + wanted in {_snake(f) for f in fields} + for kind, fields in PROPERTIES_CLASS_FIELDS.values() if kind == "entity") + + +def _type_attributes(type_name: str) -> Optional[set]: + """The snake_case attributes of an entity type, its typedef supertypes included, or None if none is known.""" + found, known = set(), False + for t in (type_name, *_entity_supertypes().get(type_name, ())): + fields = _fields(t, "entity") + if fields is not None: + known = True + found |= fields + return found if known else None + + +def check_source_with_warnings(text: str) -> Tuple[List[str], List[str]]: + """(errors, warnings) for a `source`. Classification and relationship names and their properties are checked + against the 6.4 Properties-class tables. An `of:` attribute is checked against the entity type(s) at that + relationship end and their supertypes (the typedefs, PY-61); where the end's type is not in the tables it is + checked against the union of all entity types and a warning says so, never silently.""" try: src = parse_source(text) except SourceError as exc: - return [str(exc)] + return [str(exc)], [] + from pyegeria.view.egeria_relationship_fields import RELATIONSHIP_FIELDS + if src.kind != "of": + return check_source_core(text, src), [] + end = src.names[0] + rel_types = RELATIONSHIP_FIELDS.get(end) + if rel_types is None: + return [f"source {text!r}: {end!r} is not a relationship list an Egeria element carries " + f"(RELATIONSHIP_FIELDS)."], [] + wanted = _snake(src.prop) + types = _end_entity_types().get(end) + attrs_by_type = {t: _type_attributes(t) for t in types} if types else {} + if not types or any(a is None for a in attrs_by_type.values()): + unknown = ", ".join(t for t, a in attrs_by_type.items() if a is None) or "unknown" + warning = (f"source {text!r}: the entity type at the {end!r} end ({unknown}) is not in the 6.4 tables, so " + f"{src.prop!r} was checked against the union of all entity types, which cannot tell a wrong end.") + errors = [] if _union_has(wanted) else [f"source {text!r}: no Egeria entity type has the attribute {src.prop!r}."] + return errors, [warning] + if wanted in _UNIVERSAL_ATTRIBUTES or any(wanted in attrs for attrs in attrs_by_type.values()): + return [], [] + held = " / ".join(f"{t} (with its supertypes {', '.join(_entity_supertypes().get(t, ())) or 'none'})" + for t in types) + rel = " / ".join(rel_types) if rel_types else "?" + return [f"source {text!r}: the {end!r} end of relationship {rel} holds {held}, which has no attribute " + f"{src.prop!r}."], [] + + +def check_source(text: str) -> List[str]: + """Why a `source` is wrong, as validator error messages ([] when it is right). See check_source_with_warnings, + which also gives the warnings.""" + return check_source_with_warnings(text)[0] + + +def check_source_core(text: str, src: Source) -> List[str]: + """The class: and rel: checks (an `of:` source goes through check_source_with_warnings).""" from md_processing.md_processing_utils.properties_class_fields import PROPERTIES_CLASS_FIELDS from pyegeria.view.egeria_relationship_fields import RELATIONSHIP_FIELDS errors: List[str] = [] @@ -105,20 +173,11 @@ def check_source(text: str) -> List[str]: if rel_types is None: return [f"source {text!r}: {end!r} is not a relationship list an Egeria element carries " f"(RELATIONSHIP_FIELDS)."] - if src.kind == "rel": - if not rel_types: - return [f"source {text!r}: the end {end!r} names no relationship type, so {src.prop!r} cannot be checked."] - tables = [_fields(t, "relationship") for t in rel_types] - if not any(t is not None and _snake(src.prop) in t for t in tables): - errors.append(f"source {text!r}: relationship {' / '.join(rel_types)} has no property {src.prop!r}.") - return errors - # of: any entity type has the attribute - wanted = _snake(src.prop) - universal = {"guid", "type", "status", "name", "origin"} - if wanted not in universal and not any( - wanted in {_snake(f) for f in fields} - for kind, fields in PROPERTIES_CLASS_FIELDS.values() if kind == "entity"): - errors.append(f"source {text!r}: no Egeria entity type has the attribute {src.prop!r}.") + if not rel_types: + return [f"source {text!r}: the end {end!r} names no relationship type, so {src.prop!r} cannot be checked."] + tables = [_fields(t, "relationship") for t in rel_types] + if not any(t is not None and _snake(src.prop) in t for t in tables): + errors.append(f"source {text!r}: relationship {' / '.join(rel_types)} has no property {src.prop!r}.") return errors diff --git a/scripts/gen_properties_class_fields.py b/scripts/gen_properties_class_fields.py index ee77658cf..eba3999ec 100644 --- a/scripts/gen_properties_class_fields.py +++ b/scripts/gen_properties_class_fields.py @@ -20,6 +20,9 @@ package-private fields and superclasses outside the properties packages (GetOptions, SearchOptions, ...) count. This is the same ground truth scripts/audit_properties_class_bodies.py checks against (PY-45). +Regenerating from another Egeria ref: re-run test_py59 with EGERIA_6_4_SRC/EGERIA_6_4_REF set; CI skips the +equality test. + Reads a git ref (default origin/main) with `git cat-file`, so the Egeria checkout is never modified: python scripts/gen_properties_class_fields.py [--egeria ~/localGit/egeria-v6/egeria] [--ref origin/main] @@ -76,6 +79,15 @@ def read_sources(egeria: str, ref: str) -> dict[str, str]: r"(null|this\.archiveBuilder\.getClassificationDef\(\s*OpenMetadataType\.(\w+)\.typeName\s*\))") +_ENTITY_DEF = re.compile( + r"archiveHelper\.getDefaultEntityDef\(\s*OpenMetadataType\.(\w+)\s*,\s*" + r"(null|this\.archiveBuilder\.getEntityDef\(\s*OpenMetadataType\.(\w+)\.typeName\s*\))") +_STRING_LITERAL = re.compile(r"\bString\s+(\w+)\s*=\s*\"([^\"]*)\"\s*;") +_RELATIONSHIP_END = re.compile( + r"archiveHelper\.getRelationshipEndDef\(\s*this\.archiveBuilder\.getEntityDef\(\s*" + r"OpenMetadataType\.(\w+)\.typeName\s*\)\s*,\s*(\w+)\s*,") + + def read_typedef_sources(egeria: str, ref: str) -> dict[str, str]: """The OpenMetadataTypesArchive*.java files at `ref`, by path (the typedefs the platform loads).""" paths = [p for p in git(egeria, "ls-tree", "-r", "--name-only", ref, "--", ARCHIVES).decode().split("\n") @@ -113,6 +125,34 @@ def classification_typedef_supers(archives: dict[str, str], names: dict[str, str return out +def entity_typedef_supers(archives: dict[str, str], names: dict[str, str]) -> dict[str, str]: + """{entity type: its supertype} from the typedefs: archiveHelper.getDefaultEntityDef(, ).""" + out: dict[str, str] = {} + for src in archives.values(): + for m in _ENTITY_DEF.finditer(_strip_comments(src)): + sub = names.get(m.group(1)) + sup = names.get(m.group(3)) if m.group(3) else None + if sub and sup: + out[sub] = sup + return out + + +def relationship_end_types(archives: dict[str, str], names: dict[str, str]) -> dict[str, tuple[str, ...]]: + """{relationship end attribute name: the entity types at that end}, from the typedefs' getRelationshipEndDef + (, , ...) calls. The attribute name is what an element's relationship + list is called (serverEndpoints), so the type is what a list's related elements are.""" + out: dict[str, set[str]] = {} + for src in archives.values(): + text = _strip_comments(src) + literals: list[tuple[int, str, str]] = [(m.start(), m.group(1), m.group(2)) for m in _STRING_LITERAL.finditer(text)] + for m in _RELATIONSHIP_END.finditer(text): + entity = names.get(m.group(1)) + attr = next((lit for pos, var, lit in reversed(literals) if pos < m.start() and var == m.group(2)), None) + if entity and attr: + out.setdefault(attr, set()).add(entity) + return {k: tuple(sorted(v)) for k, v in sorted(out.items())} + + def supertype_chains(direct: dict[str, str]) -> dict[str, tuple[str, ...]]: """{classification: (supertype, its supertype, ...)}, nearest first, for the ones that have a supertype.""" out = {} @@ -327,6 +367,10 @@ def main(): # the supertypes come from the typedefs the platform loads; the Java class chain is only a cross-check chains = supertype_chains(classification_typedef_supers(read_typedef_sources(args.egeria, args.ref), type_name_constants(sources))) + archives = read_typedef_sources(args.egeria, args.ref) + constants = type_name_constants(sources) + entity_chains = supertype_chains(entity_typedef_supers(archives, constants)) + end_types = relationship_end_types(archives, constants) for cls, above in sorted(java_supertypes.items()): if chains.get(cls) != above: warn(f"classification {cls}: typedef supertypes {chains.get(cls, ())} differ from the Java chain {above}") @@ -360,6 +404,23 @@ def main(): for cls, above in sorted(chains.items()): lines.append(f" {cls!r}: {above!r},") lines.append("}") + lines += [ + "", + "#: Each entity type's supertypes, nearest first, from the typedefs (getDefaultEntityDef's 2nd argument).", + "ENTITY_SUPERTYPES: dict[str, tuple[str, ...]] = {", + ] + for cls, above in sorted(entity_chains.items()): + lines.append(f" {cls!r}: {above!r},") + lines.append("}") + lines += [ + "", + "#: The entity type(s) at each relationship end, by the end's attribute name, which is also what an element's", + "#: relationship list is called (serverEndpoints -> Endpoint), from the typedefs (getRelationshipEndDef). PY-61.", + "END_ENTITY_TYPES: dict[str, tuple[str, ...]] = {", + ] + for attr, types in end_types.items(): + lines.append(f" {attr!r}: {types!r},") + lines.append("}") with open(OUT, "w", encoding="utf-8") as f: f.write("\n".join(lines) + "\n") kinds = {} diff --git a/tests/micro-tests/test_py61_of_end_types.py b/tests/micro-tests/test_py61_of_end_types.py new file mode 100644 index 000000000..ff44f9012 --- /dev/null +++ b/tests/micro-tests/test_py61_of_end_types.py @@ -0,0 +1,105 @@ +"""PY-61: an `of:.` source is checked against the entity type at that relationship end (and its +supertypes), both from the 6.4 typedefs, not against the union of every entity type.""" +import importlib.util +import pathlib + +import pytest + +from pyegeria.view import column_source as cs +from pyegeria.view.column_source import check_source, check_source_with_warnings + +ROOT = pathlib.Path(__file__).resolve().parents[2] + + +def _gen(): + spec = importlib.util.spec_from_file_location("gen_pcf61", ROOT / "scripts/gen_properties_class_fields.py") + gen = importlib.util.module_from_spec(spec) + spec.loader.exec_module(gen) + return gen + + +def test_a_right_end_attribute_passes(): + assert check_source("of:serverEndpoints.networkAddress") == [] # an Endpoint has a network address + assert check_source("of:serverForEndpoint.deployedImplementationType") == [] # the server end is ITInfrastructure + + +def test_a_supertype_attribute_passes(): + assert check_source("of:serverEndpoints.qualifiedName") == [] # Referenceable, an Endpoint supertype + assert check_source("of:serverEndpoints.displayName") == [] + + +def test_a_wrong_end_attribute_is_refused_naming_relationship_end_type_and_attribute(): + errors = check_source("of:serverEndpoints.deployedImplementationType") + assert len(errors) == 1 + words = errors[0] + assert "ServerEndpoint" in words and "serverEndpoints" in words and "Endpoint" in words + assert "deployedImplementationType" in words + assert check_source("of:serverForEndpoint.networkAddress") != [] # the other end has no network address + + +def test_an_attribute_no_type_has_is_still_refused(): + assert check_source("of:serverEndpoints.nonsenseAttribute") != [] + + +def test_an_unknown_end_type_falls_back_to_the_union_and_says_so(monkeypatch): + table = {k: v for k, v in cs._end_entity_types().items() if k != "serverEndpoints"} + monkeypatch.setattr(cs, "_end_entity_types", lambda: table) + errors, warnings = check_source_with_warnings("of:serverEndpoints.deployedImplementationType") + assert errors == [] # accepted by the union check ... + assert warnings and "serverEndpoints" in warnings[0] and "union" in warnings[0] # ... never silently + errors, warnings = check_source_with_warnings("of:serverEndpoints.nonsenseAttribute") + assert errors and warnings # a typo is still refused + + +def test_a_known_end_gives_no_warning(): + assert check_source_with_warnings("of:serverEndpoints.networkAddress") == ([], []) + + +def test_the_validator_reports_the_warning_and_the_error(): + import asyncio + from pyegeria.authoring import SpecDraft, validate + from pyegeria.view._output_format_models import FormatSet + fs = FormatSet(target_type="SoftwareServer", heading="t", description="d", family="x", formats=[ + {"types": ["TABLE"], "attributes": [{"name": "Bad", "key": "bad", "source": "of:serverEndpoints.deployedImplementationType"}]}]) + result = validate(SpecDraft(label="T-Test", format_set=fs)) + assert any("deployedImplementationType" in e and "serverEndpoints" in e for e in result.errors) + + +def test_the_generator_reads_end_types_and_entity_supertypes_from_the_typedefs(): + gen = _gen() + names = gen.type_name_constants({"x/OpenMetadataType.java": """ + ENDPOINT("11111111-1111-1111-1111-111111111111", "Endpoint", X), + IT_INFRASTRUCTURE("22222222-2222-2222-2222-222222222222", "ITInfrastructure", X), + REFERENCEABLE("33333333-3333-3333-3333-333333333333", "Referenceable", X), + OPEN_METADATA_ROOT("44444444-4444-4444-4444-444444444444", "OpenMetadataRoot", X), + """}) + archive = ''' + EntityDef a = archiveHelper.getDefaultEntityDef(OpenMetadataType.OPEN_METADATA_ROOT, + null); + EntityDef b = archiveHelper.getDefaultEntityDef(OpenMetadataType.REFERENCEABLE, + this.archiveBuilder.getEntityDef(OpenMetadataType.OPEN_METADATA_ROOT.typeName)); + EntityDef c = archiveHelper.getDefaultEntityDef(OpenMetadataType.ENDPOINT, + this.archiveBuilder.getEntityDef(OpenMetadataType.REFERENCEABLE.typeName)); + final String end1AttributeName = "serverForEndpoint"; + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(OpenMetadataType.IT_INFRASTRUCTURE.typeName), + end1AttributeName, + d, null, ANY); + final String end2AttributeName = "serverEndpoints"; + relationshipEndDef = archiveHelper.getRelationshipEndDef(this.archiveBuilder.getEntityDef(OpenMetadataType.ENDPOINT.typeName), + end2AttributeName, + d, null, ANY); + ''' + archives = {"x/OpenMetadataTypesArchive1_2.java": archive} + assert gen.supertype_chains(gen.entity_typedef_supers(archives, names)) == { + "Referenceable": ("OpenMetadataRoot",), "Endpoint": ("Referenceable", "OpenMetadataRoot")} + assert gen.relationship_end_types(archives, names) == { + "serverForEndpoint": ("ITInfrastructure",), "serverEndpoints": ("Endpoint",)} + + +def test_the_tables_cover_the_relationship_lists(): + from md_processing.md_processing_utils.properties_class_fields import END_ENTITY_TYPES, ENTITY_SUPERTYPES + from pyegeria.view.egeria_relationship_fields import RELATIONSHIP_FIELDS + assert END_ENTITY_TYPES["serverEndpoints"] == ("Endpoint",) + assert ENTITY_SUPERTYPES["Endpoint"][0] == "Referenceable" + covered = [k for k in RELATIONSHIP_FIELDS if k in END_ENTITY_TYPES] + assert len(covered) > len(RELATIONSHIP_FIELDS) * 0.8, (len(covered), len(RELATIONSHIP_FIELDS)) From 0de69fe19aa121ba2f81ddc1f4aa97c4f5a253a6 Mon Sep 17 00:00:00 2001 From: Dan Wolfson Date: Mon, 23 Nov 2026 14:11:42 -0600 Subject: [PATCH 3/5] docs: release notes for the batch A items (PY-19 and PY-61 were already in) One user-facing line each for PY-21 (FOR_INFO), PY-23, PY-54, PY-55, PY-59, PY-60, PY-66, PY-67, PY-68, PY-69 and PY-70, under Changed or Fixes. PY-54 and PY-55 had no entry. Signed-off-by: Dan Wolfson (cherry picked from commit 204a1afddfa93cdb592c0bf469817788a8f61e32) --- docs/release-notes/next.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/release-notes/next.md b/docs/release-notes/next.md index 67a568fea..60c97ebbb 100644 --- a/docs/release-notes/next.md +++ b/docs/release-notes/next.md @@ -181,6 +181,22 @@ notes and are not repeated here. exceptions carry `egeria_message_id`, as the unauthorized one already did. - **Reading a search keyword by GUID works** (PY-28). `get_search_keyword_by_guid` posts to `.../search-keywords/{guid}/retrieve`; the old path answered 404. +- **`class:` report columns match a classification's subtypes** (PY-59). `class:PolicyManagementPoint` also fills from a + PolicyEnforcementPoint, `class:ProjectKind` from a Campaign, Task, Experiment, GlossaryProject or GovernanceProject, + and so on (23 classifications have supertypes). The supertypes come from the 6.4 typedefs + (`CLASSIFICATION_SUPERTYPES`); a supertype does not fill a subtype column. +- **Governance-level columns show the level name** (PY-60). Confidentiality, Confidence, Criticality, Impact and + Retention classification columns read e.g. "Confidential", "Authoritative", "High", "Regulated Lifetime" instead of 1, 3. + DICT and JSON keep the integer; a number outside the enum shows as "7 (unknown level)", and a missing property stays + blank. +- **Status attributes offer all five element statuses** (PY-68). The Dr.Egeria `Status` attribute looked up the valid + metadata property `Status`, which Egeria does not have, so the templates listed no values. It now looks up `status` + and the templates offer ACTIVE, DELETED, INVALID, OTHER and UNKNOWN. +- **The spec-cache says "not effective for this read"** (PY-70). When Egeria answers OMAG-REPOSITORY-HANDLER-400-010 for a + pinned spec, the reason no longer says the element is gone or "no longer visible". `karma_leaderboard` is declared to + return `list[dict] | None` (None when its find failed). +- **`hey_egeria ... deployed-servers` is one command** (PY-66). It was registered twice and the second silently replaced + the first. ## Fixes @@ -188,6 +204,22 @@ notes and are not repeated here. and every column key must be an attribute of the target type, a key the output formatter derives, a documented related-element or annotation field, or (for a generated -DrE- spec) a Dr.Egeria command attribute. An unknown key is refused by name. The old loose check remains only as `validate(..., legacy=True)`, with a warning per key. +- **Activity Status offers FOR_INFO** (PY-21). The generated Dr.Egeria `activity_status` columns (Meeting, Note, Review, + ToDo ...) listed 13 of Egeria's 14 ActivityStatus values; FOR_INFO is now offered after PAUSED. +- **`start_at_end` reaches Egeria** (PY-23). pyegeria sent `startAtEnd`; the query parameter is `startingAtEnd`, so Egeria + ignored it. The related-element finds now send `startingAtEnd`. +- **A failed valid-values lookup is not "no valid values"** (PY-67). `get_valid_metadata_values` raises when Egeria + cannot be asked, and is never cached as empty; `[]` means Egeria answered with none. Offline `generate_dr_help` and + template output says "valid values not read (no Egeria connection)" or "(Egeria lookup failed: )" instead of + dropping the line, and a failed sign-in counts as no connection. +- **Classification commands send Effective From, Effective To and Extended Properties** (PY-69). Every Dr.Egeria + classification command sent only its own fields and dropped these three. +- **Generated report specs carry fresh data** (PY-54). `md_processing/data/generated_format_sets.json` was regenerated + by `refresh_specs --merge-reports` (it had stale target types and `glossary_term` keys); nothing reads it at runtime. +- **Related-information report columns are settled** (PY-55). The actor list (Contacts) and note log name columns + (Journal Entry) are `of:` source columns filled from the real relationship lists, and the folder names column on + `find_glossaries` is client-derived; the old helpers that ran actor names together and cut the last two characters of + note log names are no longer needed. - **The deployment-status fallback matches Egeria** (PY-21). It offered `REJECTED_FOR_DEPLOYMENT`; Egeria's value is `REJECTED`. - **Dr.Egeria Certification and License send the right fields** (PY-43, PY-50). Link and Update send `coverageStart` / From 12a4106ee655ec5ab05e8ac0c14087c4c030130d Mon Sep 17 00:00:00 2001 From: Dan Wolfson Date: Mon, 23 Nov 2026 14:17:02 -0600 Subject: [PATCH 4/5] PY-19 F3: drop trim_to_want, a preview reads at most one page past page_to trim_to_want sized each request to want - len(items), which becomes one-row requests when the rows near the end are filtered out (zone-filtered empty pages are normal): with want=25, size 25, 24 visible rows then 500 filtered positions it made 501 requests (21 without it), and with 3000 filtered it hit max_pages at 1000 (81, ending at the empty-run cap, without it). The option is removed from page_all/async_page_all altogether. min(page_to, 100) already does the job; the over-read is at most one page. Tests: the two filtered cases stay bounded and end at the empty-run cap; a 250-row preview is 100/100/100; test_page_to_pages_fully_up_to_the_rows_asked_for now expects sizes [2, 2, 2]. The PY-19 release note no longer mentions trimming. Signed-off-by: Dan Wolfson (cherry picked from commit 55c15e338c5d88c6116a0e7558edafbafe49bd8a) --- docs/release-notes/next.md | 4 +- pyegeria/core/paging.py | 32 +++++---------- pyegeria/view/format_set_executor.py | 7 ++-- tests/micro-tests/test_paging_executor.py | 6 +-- .../test_py19_preview_page_size.py | 41 ++++++++++++++----- 5 files changed, 51 insertions(+), 39 deletions(-) diff --git a/docs/release-notes/next.md b/docs/release-notes/next.md index 60c97ebbb..b1772c630 100644 --- a/docs/release-notes/next.md +++ b/docs/release-notes/next.md @@ -124,8 +124,8 @@ notes and are not repeated here. accept `of:.` if any entity type had the attribute; it now checks the entity type(s) at that end of the relationship and their supertypes, both from the 6.4 typedefs, and refuses a wrong-end attribute naming the relationship, the end, its type and the attribute. A list whose end type is not in the tables is checked loosely and gets a warning. -- **A preview asks Egeria only for the rows it shows** (PY-19). A report run with `page_to=N` made its first request - for `min(N, 100)` rows, not always 100, and its last request for the remainder, so no page is read past `N`. Paging is +- **A preview asks Egeria only for the rows it shows** (PY-19). A report run with `page_to=N` made its requests + for `min(N, 100)` rows, not always 100, so it reads at most one page past `N`. Paging is unchanged otherwise: a short or empty page does not end the read, only Egeria's null does, and a run that stopped at `N` still says so ("stopped at the N rows asked for; there may be more"). Full reads are untouched. - **`find_digital_product_catalogs` lists catalogs** (PY-71). It sent no type filter and so listed every Collection diff --git a/pyegeria/core/paging.py b/pyegeria/core/paging.py index 6ff771778..1c6ad5a75 100644 --- a/pyegeria/core/paging.py +++ b/pyegeria/core/paging.py @@ -449,8 +449,6 @@ class _Pager: key: Callable[[Any], Hashable] start: int = 0 stall_pages: int = 1 # consecutive pages of only rows already read before "stalled" - trim_to_want: bool = False # ask for no more rows than `want` still needs (a preview's last page) - asked: int = 0 # the size of the request in flight no_new: int = 0 last_keys: Optional[list] = None # the previous page's row keys: the same page again is a stall pages: int = 0 @@ -468,15 +466,12 @@ def request(self) -> Optional[Tuple[int, int]]: self._finish("capped", f"stopped after {self.pages} pages of {self.size}; there may be more", "max_pages") return None - self.asked = self.size - if self.trim_to_want and self.want is not None: - self.asked = max(1, min(self.size, self.want - len(self.items))) - return self.start, self.asked + return self.start, self.size def feed(self, page: Any) -> None: self.pages += 1 at = self.start - self.start += self.asked or self.size + self.start += self.size if not isinstance(page, list): self._null(at) elif not page: @@ -502,10 +497,10 @@ def _null(self, at: int) -> None: def _empty(self, at: int) -> None: self.probes_left = None # an empty page means the server has rows here: not the end - self.empty_rows += self.asked or self.size + self.empty_rows += self.size if self.empty_rows >= self.max_empty_rows: self._finish("not_confirmed", - f"{self.empty_rows} consecutive positions (up to {at + (self.asked or self.size)}) were filtered out " + f"{self.empty_rows} consecutive positions (up to {at + self.size}) were filtered out " f"for you; there may be more", "empty_run_cap") def _rows(self, page: list, at: int) -> None: @@ -541,7 +536,7 @@ def _finish(self, end: str, note: Optional[str], reason: str) -> None: def _pager(want, fetch_page_size, end_policy, probe_pages, max_empty_rows, max_pages, key, - start_from=0, stall_pages=1, trim_to_want=False) -> _Pager: + start_from=0, stall_pages=1) -> _Pager: if end_policy not in END_POLICIES: raise ValueError(f"end_policy must be one of {END_POLICIES}, not {end_policy!r}") for name, value, low in (("fetch_page_size", fetch_page_size, 1), ("probe_pages", probe_pages, 1), @@ -555,7 +550,7 @@ def _pager(want, fetch_page_size, end_policy, probe_pages, max_empty_rows, max_p raise ValueError(f"start_from must be a whole number of at least 0, not {start_from!r}") return _Pager(want=want, size=fetch_page_size, policy=end_policy, probe_pages=probe_pages, max_empty_rows=max_empty_rows, max_pages=max_pages, key=key or default_key, start=start_from, - stall_pages=stall_pages, trim_to_want=trim_to_want) + stall_pages=stall_pages) @contextmanager @@ -591,8 +586,7 @@ def page_all(fetch: Callable[[int, int], Any], *, want: Optional[int] = None, fetch_page_size: int = DEFAULT_FETCH_PAGE_SIZE, end_policy: str = "suspect", probe_pages: int = DEFAULT_PROBE_PAGES, max_empty_rows: int = DEFAULT_MAX_EMPTY_ROWS, max_pages: int = DEFAULT_MAX_PAGES, key: Optional[Callable[[Any], Hashable]] = None, - start_from: int = 0, stall_pages: int = 1, null_not_end: bool = False, - trim_to_want: bool = False) -> PageResult: + start_from: int = 0, stall_pages: int = 1, null_not_end: bool = False) -> PageResult: """Read every row ``fetch(start, size)`` gives (or the first ``want``), paging until the end is known or a limit stops it, starting at ``start_from``. See the module docstring for ``end_policy`` and the ``end`` states. @@ -609,12 +603,9 @@ def page_all(fetch: Callable[[int, int], Any], *, want: Optional[int] = None, (default 1; a path known to return overlapping short pages may allow 2). ``null_not_end`` (a NULL_NOT_END method: pass ``**paging_for(method)``) marks the result so that a null - followed by empty probes is not ``reached_end``. - - ``trim_to_want`` (a preview) asks for no more rows than ``want`` still needs, so the last request is the - remainder and no page is read past ``want``; a short or empty page still does not end the read.""" + followed by empty probes is not ``reached_end``.""" pager = _pager(want, fetch_page_size, end_policy, probe_pages, max_empty_rows, max_pages, key, start_from, - stall_pages, trim_to_want) + stall_pages) while (req := pager.request()) is not None: with _end_signal() as record: page = fetch(*req) @@ -627,11 +618,10 @@ async def async_page_all(fetch: Callable[[int, int], Awaitable[Any]], *, want: O probe_pages: int = DEFAULT_PROBE_PAGES, max_empty_rows: int = DEFAULT_MAX_EMPTY_ROWS, max_pages: int = DEFAULT_MAX_PAGES, key: Optional[Callable[[Any], Hashable]] = None, start_from: int = 0, - stall_pages: int = 1, null_not_end: bool = False, - trim_to_want: bool = False) -> PageResult: + stall_pages: int = 1, null_not_end: bool = False) -> PageResult: """``page_all`` for an async ``fetch`` (same ``key`` and end-signal rules).""" pager = _pager(want, fetch_page_size, end_policy, probe_pages, max_empty_rows, max_pages, key, start_from, - stall_pages, trim_to_want) + stall_pages) while (req := pager.request()) is not None: with _end_signal() as record: page = await fetch(*req) diff --git a/pyegeria/view/format_set_executor.py b/pyegeria/view/format_set_executor.py index 1a25f2b2e..e1708024a 100644 --- a/pyegeria/view/format_set_executor.py +++ b/pyegeria/view/format_set_executor.py @@ -1500,10 +1500,11 @@ def _full_read(plan: Dict[str, Any]) -> Optional[Dict[str, Any]]: if not plan["page_to"] or not plan["list"]: return None # PY-19: ask only for the rows shown: a 25-row preview is one request of 25, not of 100. A preview of more than - # the default pages at the default until page_to rows are in (the pager still treats a short page as "more" - # and only a null as the end). + # the default pages at the default until page_to rows are in, so it reads at most one page past page_to (the pager + # treats a short or empty page as "more", only a null as the end). The last page is deliberately NOT trimmed to the + # remainder: with filtered rows that would be one-row requests, hundreds of them. return dict(want=plan["page_to"], fetch_page_size=min(plan["page_to"], DEFAULT_FETCH_PAGE_SIZE), - start_from=plan["start"], trim_to_want=True, **plan["paging"]) + start_from=plan["start"], **plan["paging"]) def _settle(plan: Dict[str, Any], record: Dict[str, Any], result: Any, paged: Optional[PageResult]): diff --git a/tests/micro-tests/test_paging_executor.py b/tests/micro-tests/test_paging_executor.py index 840a35d6a..1e1fb543d 100644 --- a/tests/micro-tests/test_paging_executor.py +++ b/tests/micro-tests/test_paging_executor.py @@ -167,12 +167,12 @@ def test_text_format_trusted_null_is_confirmed(server): # ── page_to: preview pages fully ── def test_page_to_pages_fully_up_to_the_rows_asked_for(server): - # PY-19: a preview asks only for the rows it shows, so the first request is page_to (2), not 100, and the - # last asks for the remainder. (Edited from {0, 100, 200} at size 100: that encoded the old fixed size.) + # PY-19: a preview asks only for the rows it shows, so every request is page_to (2) wide, not 100. (Edited + # from {0, 100, 200} at size 100: that encoded the old fixed size.) srv = server("find_authored_elements", {0: [], 2: [ROW(1)], 4: [ROW(2), ROW(3)]}) r = run("DICT", page_to=2) assert [x["GUID"] for x in r["data"]] == ["g1", "g2"] and r["end"] == "capped" - assert [size for _, size in srv.calls] == [2, 2, 1] + assert [size for _, size in srv.calls] == [2, 2, 2] def test_page_to_with_fewer_rows_ends_confirmed_on_a_trusted_path(server): diff --git a/tests/micro-tests/test_py19_preview_page_size.py b/tests/micro-tests/test_py19_preview_page_size.py index ccb9f3c59..b1adfad0d 100644 --- a/tests/micro-tests/test_py19_preview_page_size.py +++ b/tests/micro-tests/test_py19_preview_page_size.py @@ -47,13 +47,13 @@ def test_a_25_row_preview_sends_one_request_of_25(): def test_a_preview_larger_than_the_default_pages_at_100_up_to_max_rows(): fake = _Rows(1000) got = page_all(fake, **fse._full_read(_plan(250))) - assert fake.calls == [(0, 100), (100, 100), (200, 50)] and len(got.items) == 250 # the last asks for the remainder + assert fake.calls == [(0, 100), (100, 100), (200, 100)] and len(got.items) == 250 # one page past, at most def test_a_short_first_page_still_pages_on_and_stops_at_max_rows(): fake = _Rows(1000, short=10) got = page_all(fake, **fse._full_read(_plan(25))) - assert fake.calls[:2] == [(0, 25), (25, 15)] # a short page is not the last page; ask the rest + assert fake.calls[:2] == [(0, 25), (25, 25)] # a short page is not the last page assert len(got.items) == 25 and got.end == "capped" # and it stops at the rows asked for @@ -87,10 +87,37 @@ def fetch(start, size): assert calls[:2] == [(0, 25), (25, 25)] and got.items == ["a", "b"] -def test_no_request_reads_past_max_rows(): +def test_a_preview_reads_at_most_one_page_past_max_rows(): fake = _Rows(1000) page_all(fake, **fse._full_read(_plan(130))) - assert sum(size for _, size in fake.calls) == 130 + assert fake.calls == [(0, 100), (100, 100)] # 200 positions for 130 rows: under one page over + + +class _Filtered: + """24 visible rows, then `filtered` positions Egeria returns as empty (zone-filtered) pages, then the end.""" + def __init__(self, filtered): + self.filtered, self.calls = filtered, [] + + def __call__(self, start, size): + self.calls.append((start, size)) + visible = [f"r{i}" for i in range(start, min(start + size, 24))] + if visible: + return visible + return [] if start < 24 + self.filtered else None + + +def test_filtered_positions_after_the_rows_cost_a_bounded_number_of_requests(): + fake = _Filtered(500) + got = page_all(fake, **fse._full_read(_plan(25))) + assert len(fake.calls) <= 30 and {size for _, size in fake.calls} == {25} # not hundreds of one-row requests + assert len(got.items) == 24 + + +def test_a_long_filtered_run_ends_at_the_empty_run_cap_in_bounded_requests(): + fake = _Filtered(3000) + got = page_all(fake, **fse._full_read(_plan(25))) + assert got.end_reason == "empty_run_cap" and not got.complete + assert len(fake.calls) <= 90 and {size for _, size in fake.calls} == {25} def test_the_result_tells_stopped_at_max_rows_from_everything(): @@ -99,9 +126,3 @@ def test_the_result_tells_stopped_at_max_rows_from_everything(): assert "25 rows asked for" in stopped.note everything = page_all(_Rows(12), **fse._full_read(_plan(25))) assert len(everything.items) == 12 and everything.end_reason in ("trusted_null", "null_then_empty_probes") - - -def test_a_pager_without_trim_asks_the_full_size_every_time(): - fake = _Rows(1000) - page_all(fake, want=130, fetch_page_size=100) - assert fake.calls == [(0, 100), (100, 100)] From 92e7fe393ad1f0ddf2da9ce162277c54d6c9e90e Mon Sep 17 00:00:00 2001 From: Dan Wolfson Date: Mon, 23 Nov 2026 14:19:08 -0600 Subject: [PATCH 5/5] PY-61 F4: the generator reads every OpenMetadataType constant type_name_constants dropped 11 of the 682 enum entries because the GUID pattern was 36 lowercase hex characters, and Egeria wrote some in upper or mixed case or 35 or 37 characters long (PORT, PORT_ALIAS, PORT_IMPLEMENTATION, PORT_DELEGATION_RELATIONSHIP, PROCESS_PORT_RELATIONSHIP, INCIDENT_REPORT, RESOURCE_MEASURE_ANNOTATION, RECENT_ACCESS_COLLECTION, LINEAGE_MAPPING_RELATIONSHIP, CLOUD_PROVIDER_CLASSIFICATION, CLOUD_SERVICE_CLASSIFICATION). The pattern now takes any hex-and-dash string of 20 or more characters. Regenerated from 90232870b2: ENTITY_SUPERTYPES 364 -> 372, END_ENTITY_TYPES 413 -> 417 (incidentReports, ports, portDelegatingFrom, portDelegatingTo), CLASSIFICATION_SUPERTYPES unchanged (23). 10 relationship lists still have no end type (bean list names the typedefs do not know) and keep the warned fallback. Tests: odd GUID shapes parse; the four ends have types; with EGERIA_6_4_SRC set the parser finds exactly the enum entries counted from the source. The PY-59 equality test still passes with EGERIA_6_4_SRC; all 452 specs re-run clean. Signed-off-by: Dan Wolfson (cherry picked from commit db5b5cd5156bf9aa4bec448aa0a47475c5bd49d8) --- .../properties_class_fields.py | 12 ++++++ scripts/gen_properties_class_fields.py | 2 +- tests/micro-tests/test_py61_of_end_types.py | 43 +++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/md_processing/md_processing_utils/properties_class_fields.py b/md_processing/md_processing_utils/properties_class_fields.py index 52929d7f7..5e52b5b2e 100644 --- a/md_processing/md_processing_utils/properties_class_fields.py +++ b/md_processing/md_processing_utils/properties_class_fields.py @@ -920,6 +920,7 @@ 'ITProfileRole': ('ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), 'ITSubsystem': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'ImplementationSnippet': ('Referenceable', 'OpenMetadataRoot'), + 'IncidentReport': ('Report', 'DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), 'InformalTag': ('Referenceable', 'OpenMetadataRoot'), 'InformationSupplyChain': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'InformationView': ('DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), @@ -967,6 +968,9 @@ 'Person': ('ActorProfile', 'Actor', 'Referenceable', 'OpenMetadataRoot'), 'PersonRole': ('ActorRole', 'Actor', 'Referenceable', 'OpenMetadataRoot'), 'Perspective': ('Actor', 'Referenceable', 'OpenMetadataRoot'), + 'Port': ('Referenceable', 'OpenMetadataRoot'), + 'PortAlias': ('Port', 'Referenceable', 'OpenMetadataRoot'), + 'PortImplementation': ('Port', 'Referenceable', 'OpenMetadataRoot'), 'PrimitiveSchemaType': ('SimpleSchemaType', 'SchemaType', 'SchemaElement', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'Process': ('Asset', 'Referenceable', 'OpenMetadataRoot'), 'Project': ('AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), @@ -981,6 +985,7 @@ 'RESTAPIManager': ('APIManager', 'SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), 'RasterFile': ('MediaFile', 'DataFile', 'DataStore', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), 'Rating': ('OpenMetadataRoot',), + 'RecentAccess': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'ReferenceCodeMappingTable': ('TabularDataSet', 'DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), 'ReferenceCodeTable': ('TabularDataSet', 'DataSet', 'DataAsset', 'Asset', 'Referenceable', 'OpenMetadataRoot'), 'ReferenceDataSet': ('ReferenceDataValue', 'ValidValueDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), @@ -1007,6 +1012,8 @@ 'Requirement': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'ResearchQuestion': ('GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'ResourceManager': ('SoftwareCapability', 'Referenceable', 'OpenMetadataRoot'), + 'ResourceMeasureAnnotation': ('Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'ResourcePhysicalStatusAnnotation': ('ResourceMeasureAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'ResourceProfileAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'ResourceProfileLogAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'ResultsSet': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), @@ -1028,6 +1035,7 @@ 'SecurityFindingAnnotation': ('Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'SecurityGroup': ('SecurityList', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'SecurityList': ('Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), + 'SecurityPostureAnnotation': ('ResourceMeasureAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'SecurityRole': ('SecurityList', 'Collection', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'SemanticAnnotation': ('DataFieldAnnotation', 'Annotation', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), 'ServiceAccessControl': ('SecurityAccessControl', 'GovernanceControl', 'GovernanceDefinition', 'AuthoredReferenceable', 'Referenceable', 'OpenMetadataRoot'), @@ -1282,6 +1290,7 @@ 'impactedResources': ('Referenceable',), 'implementationResources': ('Referenceable',), 'implementedBy': ('Referenceable',), + 'incidentReports': ('IncidentReport',), 'includedInIntegrationGroups': ('IntegrationGroup',), 'includesSoftwarePackages': ('Collection',), 'informalTags': ('InformalTag',), @@ -1374,7 +1383,10 @@ 'permittedProcessing': ('DataProcessingDescription',), 'policies': ('GovernancePolicy',), 'populatedUsingQuery': ('SavedQuery',), + 'portDelegatingFrom': ('Port',), + 'portDelegatingTo': ('Port',), 'portOwningProcesses': ('Process',), + 'ports': ('Port',), 'predefinedTargetForAction': ('OpenMetadataRoot',), 'preferredTerms': ('GlossaryTerm',), 'presentInNoteLogs': ('NoteLog',), diff --git a/scripts/gen_properties_class_fields.py b/scripts/gen_properties_class_fields.py index eba3999ec..eab4c03ac 100644 --- a/scripts/gen_properties_class_fields.py +++ b/scripts/gen_properties_class_fields.py @@ -73,7 +73,7 @@ def read_sources(egeria: str, ref: str) -> dict[str, str]: ARCHIVES = "open-metadata-resources/open-metadata-archives/open-metadata-types/src/main/java/" -_ENUM_CONSTANT = re.compile(r"\b([A-Z][A-Z0-9_]*)\(\s*\"[0-9a-f-]{36}\"\s*,\s*\"([^\"]+)\"") +_ENUM_CONSTANT = re.compile(r"\b([A-Z][A-Z0-9_]*)\(\s*\"[0-9a-fA-F-]{20,}\"\s*,\s*\"([^\"]+)\"") _CLASSIFICATION_DEF = re.compile( r"archiveHelper\.getClassificationDef\(\s*OpenMetadataType\.(\w+)\s*,\s*" r"(null|this\.archiveBuilder\.getClassificationDef\(\s*OpenMetadataType\.(\w+)\.typeName\s*\))") diff --git a/tests/micro-tests/test_py61_of_end_types.py b/tests/micro-tests/test_py61_of_end_types.py index ff44f9012..0019a6675 100644 --- a/tests/micro-tests/test_py61_of_end_types.py +++ b/tests/micro-tests/test_py61_of_end_types.py @@ -103,3 +103,46 @@ def test_the_tables_cover_the_relationship_lists(): assert ENTITY_SUPERTYPES["Endpoint"][0] == "Referenceable" covered = [k for k in RELATIONSHIP_FIELDS if k in END_ENTITY_TYPES] assert len(covered) > len(RELATIONSHIP_FIELDS) * 0.8, (len(covered), len(RELATIONSHIP_FIELDS)) + + +def test_the_constant_parser_takes_any_guid_shape_egeria_wrote(): + """F4: 11 constants have a GUID that is upper/mixed case or 35/37 characters long, so a strict 36-char + lowercase pattern dropped them (Port, PortAlias, IncidentReport, CloudProvider ...).""" + gen = _gen() + got = gen.type_name_constants({"x/OpenMetadataType.java": """ + PORT("e3d9FD9F-d5eD-2aed-CC98-0bc21aB6f71C", + "Port", + OpenMetadataWikiPages.MODEL_0217_PORTS), + INCIDENT_REPORT("072f252b-dea7-4b88-bb2e-8f741c9ca7f6e", + "IncidentReport", X), + CLOUD_PROVIDER_CLASSIFICATION("a2bfdd08-d0a8-49db-bc97-7f240628104", + "CloudProvider", X), + PLAIN("11111111-1111-1111-1111-111111111111", "Plain", X), +"""}) + assert got == {"PORT": "Port", "INCIDENT_REPORT": "IncidentReport", "CLOUD_PROVIDER_CLASSIFICATION": "CloudProvider", + "PLAIN": "Plain"} + + +def test_the_four_ends_the_parser_used_to_miss_now_have_types(): + from md_processing.md_processing_utils.properties_class_fields import END_ENTITY_TYPES, ENTITY_SUPERTYPES + for end in ("incidentReports", "ports", "portDelegatingFrom", "portDelegatingTo"): + assert END_ENTITY_TYPES.get(end), end + for entity in ("IncidentReport", "Port", "PortAlias", "PortImplementation", "RecentAccess", + "ResourceMeasureAnnotation"): + assert entity in ENTITY_SUPERTYPES, entity + + +def test_the_parser_finds_every_enum_entry_in_the_6_4_source(): + import os + import re + src, ref = os.environ.get("EGERIA_6_4_SRC"), os.environ.get("EGERIA_6_4_REF", "90232870b2") + if not src: + pytest.skip("set EGERIA_6_4_SRC to a checkout of odpi/egeria at the table's sha") + gen = _gen() + sources = {p: t for p, t in gen.read_sources(src, ref).items() if p.endswith("/OpenMetadataType.java")} + assert sources + text = next(iter(sources.values())) + # every enum entry starts a line as NAME("", with the type name on that or a following line + entries = re.findall(r"^\s{4}([A-Z][A-Z0-9_]*)\(\s*\"[^\"]+\"\s*,\s*\"[^\"]+\"", text, re.M) + assert len(entries) > 600 + assert set(gen.type_name_constants(sources)) == set(entries)