CategoryCodeSet
CategoryCodeSet is a DefinedTermSet subtype for a formal, coded classification scheme: ICD-10 diagnosis codes, NAICS industry codes, ISIC, CPT, SIC, a custom vendor classification. It adds one property: hasCategoryCode (the CategoryCode members).
The inverse relationship on a CategoryCode is inCodeSet. Use CategoryCodeSet (rather than DefinedTermSet) when every member of your taxonomy has a short canonical code, which is the common case for regulated, medical, and industrial classifications.
Full example of schema.org/CategoryCodeSet json-ld markup
The markup is verified as valid with Rich Results Test from Google.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "CategoryCodeSet",
"name": "Xoo Code Severity Taxonomy",
"description": "Five-code classification scheme for structured-data audit findings, used across the XooStructured validator and API.",
"url": "https://xoocode.com/taxonomies/severity",
"hasCategoryCode": [
{ "@type": "CategoryCode", "name": "Critical", "codeValue": "CRIT" },
{ "@type": "CategoryCode", "name": "Error", "codeValue": "ERR" },
{ "@type": "CategoryCode", "name": "Warning", "codeValue": "WARN" },
{ "@type": "CategoryCode", "name": "Info", "codeValue": "INFO" },
{ "@type": "CategoryCode", "name": "Best practice", "codeValue": "BEST" }
]
}
</script>Minimal valid version
The smallest markup that still produces a valid CategoryCodeSet entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "CategoryCodeSet",
"name": "Xoo Code Severity Taxonomy",
"hasCategoryCode": [
{ "@type": "CategoryCode", "name": "Error", "codeValue": "ERR" }
]
}
</script>Google rich results this unlocks
Markup matching this example makes your page eligible for the following Google Search rich results. The primary target drives the required / recommended property classification in the advanced code block above.
- Google docsNo dedicated rich result (used by AI knowledge graphs)
Common CategoryCodeSet mistakes
Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.
- 01
Using CategoryCodeSet when terms have no codes
WrongCategoryCodeSet for a plain-English glossaryRightDefinedTermSet when members have no canonical codes; CategoryCodeSet only when every member has a codeValueThe distinguishing feature is codes. Glossaries without codes are DefinedTermSet; formal code registries are CategoryCodeSet.
Schema properties in this example
About the example data
The Xoo Code Severity Taxonomy rendered as a CategoryCodeSet, with four-letter codes for each severity level.
Comments
Loading comments...