Skip to Content

AI-102: How to Define Projections for JSON Data in Azure AI Search Knowledge Store?

Learn step-by-step how to define projections in Azure AI Search to store JSON data. Unlock the full potential of your knowledge store for advanced data insights.

Table of Contents

Question

Your organization, Xerigon Corporation, is developing a data-driven application that provides users with detailed insights into customer feedback. You are using Azure Cognitive Search with a knowledge store to enhance the application. As part of the implementation, you need to define projections to extract and structure specific data from your indexed documents.

Which projection type should you define to create a knowledge store containing JSON representations?

A. File
B. Shaper skill
C. Table
D. Object

Answer

D. Object

Explanation

You would define an object projection to create a knowledge store containing JSON representations. An object projection type creates JSON representations of structured data from your indexed documents. This type of projection is designed to extract and organize data in a hierarchical format, ideal for applications that require detailed and structured insights. The JSON output can be used directly in data-driven applications for visualization, analysis, and integration with other services. You must define three properties in an object projection:

  • storageContainer – Specifies the new container name created in Azure Storage.
  • generatedKeyName – Name of the column for the key that uniquely identifies each row.
  • source – Specifies the path to a node that is the root of the projection.

The following JSON script projects individual car documents, one car per blob, into a container named cars:

"knowledgeStore": {
"storageConnectionString": "an Azure storage connection string",
"projections" : [
{
"tables": [ ]
},
{
"objects": [
{
"storageContainer": "cars",
"source": "/document/objectprojection",
}
]
},
{
"files": [ ]
}
]
}

You would not define a file projection to create a knowledge store containing JSON representations. A file projection is used to generate binary files, such as PDFs or images, from the data in your index. These files can then be stored in a knowledge store for applications that require downloadable or viewable content. File projections are useful for scenarios where the output needs to be human-readable in a specific format, such as invoices and reports. You must define the same three properties for a file projection as an object projection.

  • storageContainer – Specifies the new container name created in Azure Storage.
  • generatedKeyName – Name of the column for the key that uniquely identifies each row.
  • source – Specifies the path to the root of the projection.

The following JSON script projects images extracted from a node into a container named XerigonImages:

"projections": [
{
"tables": [ ],
"objects": [ ],
"files": [
{
"storageContainer": "XerigonImages",
"source": "/document/ images/*"
}
]
}
]

You would not define a table projection to create a knowledge store containing JSON representations. A table projection structures data into a flat, tabular format. This projection is useful when you want to export your data into a table-like format for further analysis, reporting, or integration with databases and spreadsheet tools. Each row in the table corresponds to a document or a specific part of a document. You must define the following three properties for a table projection:

  • tableName – Specifies the name of the new table created in Azure Table Storage.
  • generatedKeyName – Name of the column for the key that uniquely identifies each row.
  • source – Specifies the path to a node in the projection tree which represents the columns that are created in the table.

The following defines a table projection:

"projections" : [
{
"tables": [
{
"tableName": "Cars",
"generatedKeyName": "CarsId",
"source": "/document/tableprojection"
}
]
"objects": [ ],
"files": [ ]
}
]

You would not define the shaper skill to create a knowledge store containing JSON representations. The shaper skill utility is used within a skillset to transform and combine data fields during the enrichment process. It helps to reshape data before it is projected but is not a projection type itself. It is particularly useful when you want to customize how data fields are structured before defining projections such as object, table, or file.

Microsoft Azure AI Engineer Associate AI-102 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft Azure AI Engineer Associate AI-102 exam and earn Microsoft Azure AI Engineer Associate AI-102 certification.