How does Purview Query API work on schema classifications?

Anonymous
2024-10-18T02:33:53.42+00:00

POST {endpoint}/datamap/api/search/query?api-version=2023-09-01

When using above API to list all entity, the classifications value of entity (SAP ECC) in response is not matched with actual value in entity detail page, but more likely the value in schema classifications. Is it correct?

How ever when the entity type is custom type, the classification value in response turns to be classification, not schema classifications.

For example, data in purview entity detail page like below.

EntityEntity typeClassificationsSchema classificationssap_entity1sap_ecc_tableNULLNULLsap_entity2sap_ecc_tableNULLText1custom_type_entity1cutom_type1NULLText2The query API response results:

{
	"value" : [
		{"displayText" : "sap_entity1", "entityType" : "sap_ecc_table"},

  		{"displayText" : "sap_entity2", "entityType" : "sap_ecc_table", "classification" : ["Text1"]},

  		{"displayText" : "custom_type_entity1", "entityType" : "custom_type1"}
   ]
}

So, my question is How does Purview Query API work on schema classifications? And what should I do to make custom type entity result same as non-custom type entity?

Many thanks.

Microsoft Security | Microsoft Purview
{count} votes

Accepted answer
  1. phemanth 15,765 Reputation points Microsoft External Staff Moderator
    2024-10-18T04:29:44.0366667+00:00

    @Gao, Michael (M)

    Thanks for reaching out to Microsoft Q&A

    The Purview Query API allows you to interact with Azure Purview’s data map, enabling you to retrieve metadata about data assets, including their classifications. Here’s how it works regarding schema classifications and the differences you observed between entity types:

    How Purview Query API Works on Schema Classifications

    1. Endpoint and Request: You use the endpoint {endpoint}/datamap/api/search/query?api-version=2023-09-01 to send a POST request. This retrieves a list of entities along with their classifications.
    2. Response Structure: The API response includes entities with their respective classifications. For example, in your JSON response: JSON
         {
             "value": [
                 {"displayText": "sap_entity1", "entityType": "sap_ecc_table"},
                 {"displayText": "sap_entity2", "entityType": "sap_ecc_table", "classification": ["Text1"]},
                 {"displayText": "custom_type_entity1", "entityType": "custom_type1"}
             ]
         }
         
      
    3. Classification Values:

    For standard entities (like sap_entity1 and sap_entity2), the classification may reflect values from the schema classifications rather than the detailed entity page.

    For custom types, the classification appears directly as the classification value, not linked to schema classifications.

    Addressing Your Observations

    Mismatch in Classifications: The discrepancy you noted—where the classification in the API response does not match the entity detail page—can occur because the API may prioritize schema classifications over individual entity classifications for standard types. This is likely by design, as schema classifications provide a broader context for data governance.

    Custom Type Entities: For custom types, the API response directly reflects the assigned classifications. If you want the custom type entities to behave similarly to non-custom types (i.e., to show schema classifications), you might need to ensure that:

    • The custom types are properly configured to inherit or reference schema classifications.
    • You apply the same classification rules to custom types as you do for standard types,

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


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most 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.