DefinedTerm, Term Set and CategoryCode in Structured Markup
How Schema.org models glossaries and coded categories, when to use DefinedTerm versus text, and how documentation sites define terms for readers.
This page centers on Schema.org types for glossaries, dictionaries, and classification codes—DefinedTerm, DefinedTermSet, and CategoryCode—and how they connect to dozens of properties that accept a formal term instead of free text. It also covers parallel guidance from Cloudflare’s accessibility and glossary documentation for defining unfamiliar words on technical pages, because the same problem appears in JSON-LD and in prose.
DefinedTerm: what a formal glossary entry is in Schema.org
Section titled “DefinedTerm: what a formal glossary entry is in Schema.org”A DefinedTerm is Schema.org’s type for a word, name, acronym, or phrase that has an explicit definition—typical in glossaries, taxonomies, product types, and subject classification.
A word, name, acronym, phrase, etc. with a formal definition. Often used in the context of category or subject classification, glossaries or dictionaries, product or creative work types, etc. Use the name property for the term being defined, use termCode if the term has an alpha-numeric code allocated, use description to provide the definition of the term. Use the about property to specify what the term is about.
— Schema.org, Schema.org Version 30.1 — DefinedTerm
In practice, publishers map “term + definition (+ optional code)” to name, description, and termCode. If the term belongs to a larger list, link it with inDefinedTermSet to a DefinedTermSet (or URL of that set).
More specific type: CategoryCode is a subtype of DefinedTerm for coded categories (see below).
Which Schema.org properties expect a DefinedTerm
Section titled “Which Schema.org properties expect a DefinedTerm”Many properties allow DefinedTerm (sometimes alongside Text or URL) so machines can reuse the same controlled vocabulary. Examples from the vocabulary include assesses, genre, keywords, jobTitle, educationalLevel, learningResourceType, and skills. The full list appears under “Properties whose values are of this type” for DefinedTerm in Schema.org Version 30.1.
Using DefinedTerm instead of bare text is appropriate when you have—or can point to—a stable definition and preferably a term set maintained by a standards body or your organization.
DefinedTermSet: glossaries, dictionaries, and classification schemes
Section titled “DefinedTermSet: glossaries, dictionaries, and classification schemes”A DefinedTermSet groups related defined terms: a glossary, dictionary, category scheme, or enumeration.
A set of defined terms, for example a set of categories or a classification scheme, a glossary, dictionary or enumeration. Use the about property to specify what the term set is about.
— Schema.org, Schema.org Version 30.1 — DefinedTermSet
Terms are linked from the set with hasDefinedTerm, whose value must be a DefinedTerm. DefinedTermSet also appears on Taxon via the same property. Each member term can declare membership with inDefinedTermSet.
| Role | Property | On type | Value type |
|---|---|---|---|
| Set contains term | hasDefinedTerm |
DefinedTermSet, Taxon |
DefinedTerm |
| Term belongs to set | inDefinedTermSet |
DefinedTerm |
DefinedTermSet or URL |
| Set subject | about |
DefinedTermSet |
Thing |
A specialized set type is CategoryCodeSet (see Schema.org Version 30.1 — CategoryCodeSet), which holds CategoryCode entries via hasCategoryCode.
CategoryCode: coded values inside a code set
Section titled “CategoryCode: coded values inside a code set”CategoryCode models a short code that identifies a category within a formal code set—not just a label string.
A Category Code.
— Schema.org, CategoryCode
Hierarchy in the vocabulary: Thing > Intangible > DefinedTerm > CategoryCode. Key properties on the type:
| Property | Expected type | Purpose |
|---|---|---|
codeValue |
Text |
Short textual code that uniquely identifies the value |
inCodeSet |
CategoryCodeSet or URL |
The set that contains this code |
termCode |
Text |
Code identifying the term within a DefinedTermSet (inherited from DefinedTerm) |
name |
Text |
Human-readable name |
codeValue is documented as “A short textual code that uniquely identifies the value” for CategoryCode and related medical code types.
Where CategoryCode appears on other types
Section titled “Where CategoryCode appears on other types”CategoryCode can be the value of properties such as category (on Product, Service, Offer, and others), occupationalCategory, legislationType, and hasCategoryCode on CategoryCodeSet. For occupationalCategory, Schema.org notes that job categories should ideally come from a taxonomy (for example O*NET-SOC or ISCO-08), with both label and formal code, and that CategoryCode is one of the expected types alongside Text.
category also accepts CategoryCode, Text, URL, and other types—so you can choose a loose text label or a structured code tied to inCodeSet.
Relationship summary:
| From | Property | To |
|---|---|---|
CategoryCodeSet |
hasCategoryCode |
CategoryCode |
CategoryCode |
inCodeSet |
CategoryCodeSet or URL |
Usage notes in the cluster cite Google index aggregations on several of these pages (for example hasDefinedTerm at 10K–100K domains); that reflects adoption in the wild but does not change how you model terms locally.
When to use DefinedTerm, CategoryCode, or plain Text
Section titled “When to use DefinedTerm, CategoryCode, or plain Text”Schema.org deliberately allows either structured terms or simple strings on many properties (Text is listed beside DefinedTerm on types such as genre, industry, and credentialCategory).
| Situation | Prefer |
|---|---|
| You maintain a glossary or API with stable IDs | DefinedTerm + DefinedTermSet, with termCode / inDefinedTermSet |
| The value is a code from a published taxonomy (occupations, legislation types, product categories) | CategoryCode with codeValue and inCodeSet |
| One-off label with no formal definition or code | Text (still valid where allowed) |
| Trust or policy pages as creative works | Often URL to a policy page; news-related trust markup is a separate pattern (see below) |
For errorCode, expected types include DefinedTerm, Integer, StatusEnumeration, and Text—pick the type that matches how your API documents errors.
News, trust indicators, and DefinedTerm in publishing markup
Section titled “News, trust indicators, and DefinedTerm in publishing markup”Much of the cluster’s news-related vocabulary (NewsArticle, publishingPrinciples, and sub-properties such as correctionsPolicy and actionableFeedbackPolicy) is attributed to The Trust Project and IPTC rNews. Those policy fields are usually URLs to human-readable policies, not DefinedTerm objects—but news typing and “type of work” refinements were influenced by Trust Project indicators:
Specifically the clarifications and new types around NewsArticle were inspired by and largely based on the “type of work” indicators identified there, while the addition of publishing principles sub-properties was motivated by the Trust Project’s analysis of “best practices” indicators.
— Schema.org, Markup for News
publishingPrinciples sub-properties listed in the vocabulary include actionableFeedbackPolicy, correctionsPolicy, diversityStaffingReport, masthead, missionCoveragePrioritiesPolicy, noBylinesPolicy, ownershipFundingInfo, unnamedSourcesPolicy, and verificationFactCheckingPolicy. That list is orthogonal to DefinedTerm sets, but both address transparent definitions of what content is and how the publisher operates.
Defining terms in technical documentation (Cloudflare style guide)
Section titled “Defining terms in technical documentation (Cloudflare style guide)”Schema.org solves machine-readable glossaries; readers still need plain-language definitions on docs pages. Cloudflare’s accessibility guidelines align with WCAG 3.1.3 Unusual Words (Level AAA):
When using technical terms that may be unfamiliar to your audience, provide clear definitions, use the GlossaryDefinition component, or link to the relevant glossary.
Define terms inline when first introduced. Link to detailed explanations in a glossary or separate page. Consider your audience’s technical level when determining which terms need definition.
— Cloudflare, Accessibility guidelines
Voice and tone adds consistency: use the same unambiguous term throughout, link to an existing explanation if the term exists elsewhere, or define it when your document introduces it.
Glossary data model on a docs site
Section titled “Glossary data model on a docs site”Cloudflare stores glossary entries in YAML under /src/content/glossary/*. Each glossary entry is “A single term and corresponding definition in the glossary,” used in the Glossary component, inline definitions, and tooltips.
Required fields per entry:
term— the glossary termgeneral_definition— definition general enough to span products; normally starts lowercase unless it is a proper noun
Optional associated_products links terms to product glossaries. A product-level glossary page can render all terms for a product via <Glossary product="dns" /> (pattern described in glossary entry).
Inline reuse:
<GlossaryDefinition term="active zone" prepend="An active zone is " />See Glossary definition for term and optional prepend. Tooltips use Glossary tooltip with the same term key; tooltips show the short definition (text before the first line break).
Common documentation mistakes
- Introducing an acronym without ever spelling it out or linking to the glossary
- Using different labels for the same concept in one page (conflicts with “consistent terminology”)
termin components that does not match any YAMLtermstring- Stuffing long definitions into tooltips when the full
general_definitionis multi-paragraph
Conceptually, YAML term + general_definition + optional product grouping mirrors DefinedTerm + description + inDefinedTermSet—one source of truth reused in many pages.
Minimal JSON-LD illustration
Section titled “Minimal JSON-LD illustration”Short example (properties named as in Schema.org):
{ "@context": "https://schema.org", "@type": "DefinedTermSet", "name": "Support ticket priority", "hasDefinedTerm": { "@type": "DefinedTerm", "name": "P1", "termCode": "P1", "description": "Critical production outage affecting all customers.", "inDefinedTermSet": "https://example.com/vocab/ticket-priority" }}For a taxonomy code:
{ "@type": "CategoryCode", "name": "Software Developers", "codeValue": "15-1252", "inCodeSet": "https://www.onetonline.org/"}Adjust URLs to your real code sets; Schema.org allows URL where noted for inDefinedTermSet and inCodeSet.
How to check this on your site
Section titled “How to check this on your site”-
Open each type you use—
DefinedTerm,DefinedTermSet,CategoryCode—and confirm required properties (name,description,hasDefinedTerm/inDefinedTermSet,codeValue/inCodeSet) match your markup. -
For every property on your pages that lists
DefinedTermas an allowed type (for exampleskillsoroccupationalCategory), verify you did not accidentally use a string where you intended a linked term from a set. -
On documentation, compare first-use terms against accessibility guidelines: inline definition, GlossaryDefinition, or link to a glossary page.
-
If you use Cloudflare-style glossaries, validate YAML entries against the glossary entry schema (
term,general_definition, optionalassociated_products) and spot-check that componenttermattributes match. -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact sentence you are asking about, and we will correct or clarify it.