From bf511cd674aab230cc031c3799315a9c4c84e599 Mon Sep 17 00:00:00 2001 From: Dan Wolfson Date: Sat, 7 Nov 2026 13:34:51 +0000 Subject: [PATCH] fix(omvs): five link methods named a properties class Egeria lacks With body=None, _async_new_relationship_request sends {"properties": {"class": prop[0]}}. These methods passed a bare relationship type name (or the wrong class), so the default body was refused: - ClassificationExplorer.add_scope_to_element: ScopedBy -> ScopedByProperties (seen live 2026-11-07: HTTP 400 "Could not resolve type id 'ScopedBy'") - ClassificationExplorer.add_resource_to_element: ResourceList -> ResourceListProperties - ClassificationExplorer.add_more_information: MoreInformation -> MoreInformationProperties - TimeKeeper.link_related_context_events: ContextEventEvidenceProperties -> RelatedContextEventProperties (its own docstring and URL are the related-events link) - TimeKeeper.link_context_event_impact: ContextEventImpact -> ContextEventImpactProperties Egeria's known-type list (from the 400 above) has each Properties name. The ISSUE-111 test gains the five cases. Micro-tests on 3.13: 1842, 0 failed. Signed-off-by: Dan Wolfson --- pyegeria/omvs/classification_explorer.py | 6 +++--- pyegeria/omvs/time_keeper.py | 4 ++-- .../test_issue_111_link_default_properties_class.py | 9 +++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pyegeria/omvs/classification_explorer.py b/pyegeria/omvs/classification_explorer.py index fbfcdbb5..c2578b7f 100644 --- a/pyegeria/omvs/classification_explorer.py +++ b/pyegeria/omvs/classification_explorer.py @@ -6701,7 +6701,7 @@ async def _async_add_scope_to_element( url = f"{self.classification_command_root}/elements/{element_guid}/scoped-by/{scoped_by_guid}/attach" - return await self._async_new_relationship_request(url, ['ScopedBy'], body) + return await self._async_new_relationship_request(url, ['ScopedByProperties'], body) def add_scope_to_element( self, @@ -6841,7 +6841,7 @@ async def _async_add_resource_to_element( url = f"{self.classification_command_root}/elements/{element_guid}/resource-list/{resource_guid}/attach" - return await self._async_new_relationship_request(url, ['ResourceList'], body) + return await self._async_new_relationship_request(url, ['ResourceListProperties'], body) def add_resource_to_element( self, @@ -7240,7 +7240,7 @@ async def _async_add_more_information( url = f"{self.classification_command_root}/elements/{element_guid}/more-information/{more_info_guid}/attach" - return await self._async_new_relationship_request(url, ['MoreInformation'], body) + return await self._async_new_relationship_request(url, ['MoreInformationProperties'], body) def add_more_information( self, diff --git a/pyegeria/omvs/time_keeper.py b/pyegeria/omvs/time_keeper.py index 7e5c12f2..a4c7b501 100644 --- a/pyegeria/omvs/time_keeper.py +++ b/pyegeria/omvs/time_keeper.py @@ -662,7 +662,7 @@ async def _async_link_related_context_events( ``` """ url = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/time-keeper/context-events/{context_event_one_guid}/related-context-events/{context_event_two_guid}/attach" - return await self._async_new_relationship_request(url, ['ContextEventEvidence'],body) + return await self._async_new_relationship_request(url, ['RelatedContextEventProperties'],body) def link_related_context_events( self, @@ -991,7 +991,7 @@ async def _async_link_context_event_impact( ``` """ url = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/time-keeper/context-events/{context_event_guid}/impacts/{impacted_element_guid}/attach" - return await self._async_new_relationship_request(url, ['ContextEventImpact'],body) + return await self._async_new_relationship_request(url, ['ContextEventImpactProperties'],body) def link_context_event_impact( self, context_event_guid: str, impacted_element_guid: str, body: dict | NewRelationshipRequestBody diff --git a/tests/micro-tests/test_issue_111_link_default_properties_class.py b/tests/micro-tests/test_issue_111_link_default_properties_class.py index 02f5e880..6d8b84c4 100644 --- a/tests/micro-tests/test_issue_111_link_default_properties_class.py +++ b/tests/micro-tests/test_issue_111_link_default_properties_class.py @@ -13,7 +13,9 @@ import pytest from pyegeria.omvs.connection_maker import ConnectionMaker +from pyegeria.omvs.classification_explorer import ClassificationExplorer from pyegeria.omvs.data_discovery import DataDiscovery +from pyegeria.omvs.time_keeper import TimeKeeper class _Response: @@ -46,6 +48,13 @@ async def fake_make_request(method, url, body=None, *args, **kwargs): (DataDiscovery, "_async_link_resource_profile_data", "ResourceProfileDataProperties"), (DataDiscovery, "_async_link_annotation_match", "AnnotationMatchProperties"), (DataDiscovery, "_async_link_request_for_action_target", "RequestForActionTargetProperties"), + # 2026-11-07: ScopedBy refused live (HTTP 400 "Could not resolve type id 'ScopedBy'") on the + # Trellis perspective migration; the same bare-name pattern was in four more methods. + (ClassificationExplorer, "_async_add_scope_to_element", "ScopedByProperties"), + (ClassificationExplorer, "_async_add_resource_to_element", "ResourceListProperties"), + (ClassificationExplorer, "_async_add_more_information", "MoreInformationProperties"), + (TimeKeeper, "_async_link_related_context_events", "RelatedContextEventProperties"), + (TimeKeeper, "_async_link_context_event_impact", "ContextEventImpactProperties"), ]