Doubt regarding relationshipAttributeDefs of Entities

Yeshan Santhush Indiketiya Hewage 0 Reputation points
2024-06-17T06:55:33.5166667+00:00

I was looking into the Entity Type Def of the built-int Purview REST API's "column" type. And I noticed that when it comes to relationshipAttributeDefs, certain definitions contain the property "isOptional". Some defs has the value for this as True and some has False.

According to my understanding, the isOptional value governs the fact that this relationship needs to be present or not. For eg: when it comes to the "Column" type, it contains a relationshipAttribute named "composeSchema", which contains a isOptional value set as "false" as shown below, meaning the relationship should be present whenever you create a Column type entitiy.

        {

            ``"name": "composeSchema",

            ``"typeName": "tabular_schema",

            ``"isOptional": false,

            ``"cardinality": "SINGLE",

            ``"valuesMinCount": -1,

            ``"valuesMaxCount": -1,

            ``"isUnique": false,

            ``"isIndexable": false,

            ``"includeInNotification": false,

            ``"relationshipTypeName": "tabular_schema_columns",

            ``"isLegacyAttribute": false

        ``}

However I can still create entities of the column type without defining the "composeSchema" relationship with the created Column entity, how is this possible?

Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,221 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 90,221 Reputation points Microsoft Employee
    2024-06-18T07:40:39.9466667+00:00

    @Yeshan Santhush Indiketiya Hewage - Thanks for the question and using MS Q&A platform.

    The "isOptional" property in the relationshipAttributeDefs of the Purview REST API's "column" type specifies whether the relationship is optional or not. If the value of "isOptional" is set to "false", it means that the relationship is mandatory and must be present whenever you create a Column type entity. On the other hand, if the value of "isOptional" is set to "true", it means that the relationship is optional and may or may not be present when you create a Column type entity.

    Regarding your question, it is possible to create entities of the column type without defining the "composeSchema" relationship with the created Column entity because the "isOptional" property only specifies whether the relationship is mandatory or optional. It does not prevent you from creating an entity without the relationship. However, if you try to use the entity without the required relationship, you may encounter errors or unexpected behavior. Therefore, it is recommended to always define the required relationships when creating entities to ensure that they function as intended.

    Hope this helps. Do let us know if you any further queries.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.