A data category selection represents a data category that classifies an article. This object can be used to associate an article with data categories from a data category group or to query the category selections for an article.
The object name is variable and has a syntax of Article Type__DataCategorySelection, where Article Type is the Object Name for the article type associated with the article. For example, Offer__DataCategorySelection represents the association between the Offer article type and its data categories. Every article is associated with an article type.
Users can only access, create or delete data category selection visible to their role, permission set, or profile. If a user has partial visibility on an article's categorization, only the visible categories are returned.
Every article in Salesforce Knowledge can be categorized. A data category selection represents a category that has been selected to classify an article. You can use the Article Type__DataCategorySelection object to query and manage article categorization in your organization. Client applications can create a categorization for an article with a Draft status. They can also delete and query article categorizations.
When using Article Type__DataCategorySelection to classify an article, you can't select both a category (for example USA) and one of its descendants (California) or ascendant categories (North America). In this case, only the first category is selected.
Answer communities use QuestionDataCategorySelection to classify questions.
The following SOQL query returns the data category selections used to classify the article whose ID is ka0D000000005ApIAI.
SELECT Id,DataCategoryName, ParentId FROM Offer__DataCategorySelection WHERE ParentId='ka0D000000005ApIAI'
This clause only returns category unique names. To retrieve category labels use the following clause:
SELECT Id,toLabel(DataCategoryName), ParentId FROM Offer__DataCategorySelection WHERE ParentId='ka0D000000005ApIAI'
You can also use relationship queries to retrieve categorizations from an article type.