diff --git a/docs/release-notes/next.md b/docs/release-notes/next.md index fb9820e3..b1772c63 100644 --- a/docs/release-notes/next.md +++ b/docs/release-notes/next.md @@ -120,6 +120,14 @@ 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 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 (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 @@ -173,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 @@ -180,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` / diff --git a/md_processing/md_processing_utils/properties_class_fields.py b/md_processing/md_processing_utils/properties_class_fields.py index 56d0a1d4..5e52b5b2 100644 --- a/md_processing/md_processing_utils/properties_class_fields.py +++ b/md_processing/md_processing_utils/properties_class_fields.py @@ -732,3 +732,801 @@ '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'), + 'IncidentReport': ('Report', 'DataSet', 'DataAsset', 'Asset', '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'), + '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'), + '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',), + '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'), + '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'), + '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'), + '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'), + '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'), + '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',), + 'incidentReports': ('IncidentReport',), + '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',), + 'portDelegatingFrom': ('Port',), + 'portDelegatingTo': ('Port',), + 'portOwningProcesses': ('Process',), + 'ports': ('Port',), + '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 cc30c77c..c0f35e6d 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 772af194..06adaa4c 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/pyegeria/view/format_set_executor.py b/pyegeria/view/format_set_executor.py index f720a39a..e1708024 100644 --- a/pyegeria/view/format_set_executor.py +++ b/pyegeria/view/format_set_executor.py @@ -1499,8 +1499,12 @@ 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, 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"], **plan["paging"]) def _settle(plan: Dict[str, Any], record: Dict[str, Any], result: Any, paged: Optional[PageResult]): diff --git a/scripts/gen_properties_class_fields.py b/scripts/gen_properties_class_fields.py index ee77658c..eab4c03a 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] @@ -70,12 +73,21 @@ 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*\))") +_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_paging_executor.py b/tests/micro-tests/test_paging_executor.py index 34870efa..1e1fb543 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 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} == {100} + 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 new file mode 100644 index 00000000..b1adfad0 --- /dev/null +++ b/tests/micro-tests/test_py19_preview_page_size.py @@ -0,0 +1,128 @@ +"""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, 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, 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 + + +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_a_preview_reads_at_most_one_page_past_max_rows(): + fake = _Rows(1000) + page_all(fake, **fse._full_read(_plan(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(): + 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") 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 00000000..0019a667 --- /dev/null +++ b/tests/micro-tests/test_py61_of_end_types.py @@ -0,0 +1,148 @@ +"""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)) + + +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)