XooCode(){

CategoryCode

CategoryCode is a DefinedTerm subtype for a single code in a structured classification scheme: an ICD-10 medical diagnosis code, a NAICS industry code, a school curriculum code, a company's internal SKU category. It adds 2 direct properties: codeValue (the short textual code, e.g. "J18.9") and inCodeSet (the CategoryCodeSet this code belongs to).

CategoryCode is the canonical way to attach coded classifications to anything. Use it inside Product's category, MedicalEntity's code, JobPosting's occupationalCategory, and Course's educationalLevel.

Full example of schema.org/CategoryCode json-ld markup

The markup is verified as valid with Rich Results Test from Google.

Highlight legend:Required by GoogleRecommendedOptional
schema.org/CategoryCode
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "CategoryCode",
  "name": "Error",
  "codeValue": "ERR",
  "description": "Violates the schema.org or Google rich-result contract; likely to prevent rich-result eligibility.",
  "inCodeSet": {
    "@type": "CategoryCodeSet",
    "name": "Xoo Code Severity Taxonomy",
    "url": "https://xoocode.com/taxonomies/severity"
  },
  "url": "https://xoocode.com/taxonomies/severity/err"
}
</script>

Minimal valid version

The smallest markup that still produces a valid CategoryCode 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.

schema.org/CategoryCode (minimal)
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "CategoryCode",
  "name": "Error",
  "codeValue": "ERR",
  "inCodeSet": { "@type": "CategoryCodeSet", "name": "Xoo Code Severity Taxonomy" }
}
</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.

  • No dedicated rich result (used by AI knowledge graphs and coded search indexers)
    Google docs

Common CategoryCode 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.

  1. 01

    codeValue with trailing or leading punctuation

    Wrong
    "codeValue": "J18.9."
    Right
    "codeValue": "J18.9" (exactly as the scheme specifies)

    codeValue must match the scheme's canonical form. Extra punctuation breaks joins with external registries (ICD-10, NAICS, etc.).

  2. 02

    Using CategoryCode where DefinedTerm suffices

    Wrong
    CategoryCode with no codeValue and no inCodeSet
    Right
    DefinedTerm for uncoded taxonomy members; CategoryCode only when a short textual code uniquely identifies the value

    CategoryCode is the coded subtype; without codeValue or inCodeSet, you are just using it as a heavier DefinedTerm for no gain.

About the example data

The "ERR" code in the Xoo Code Severity Taxonomy, meaning "violates the schema.org or Google rich-result contract".

Comments

Loading comments...

Leave a comment