DefinedTerm and DefinedTermSet
A DefinedTerm is "a word, name, acronym, phrase, etc. with a formal definition," and a DefinedTermSet is "a set of defined terms, for example a set of categories or a classification scheme, a glossary, dictionary or enumeration."[1][2] Together they let a site mark up a glossary, a list of service categories or a classification code so that each term is a node other markup can point to. Schema.org sets out the pattern: use name for the term, termCode for any code, description for the definition and about for what the term is about.[1] Google documents no search feature for these types.[3]
Definitions
| Property | Expected values | Schema.org definition (quoted) |
|---|---|---|
| hasDefinedTerm | DefinedTerm | "A Defined Term contained in this term set."[4] |
| inDefinedTermSet | DefinedTermSet, URL | "A DefinedTermSet that contains this term."[5] |
| termCode | Text | "A code that identifies this DefinedTerm within a DefinedTermSet."[6] |
| name | Text | "The name of the item."[7] |
| description | Text, TextObject | "A description of the item."[8] |
DefinedTerm is an Intangible; DefinedTermSet is a CreativeWork, so a glossary can carry author, publisher, dateModified and the other creative work properties.[1][2] inDefinedTermSet accepts a DefinedTermSet or a URL, so a term can point to its set by @id or by the set's page address.[5]
The glossary pattern
The pattern has two directions. The set lists its terms with hasDefinedTerm, "a Defined Term contained in this term set"; each term points back with inDefinedTermSet, "a DefinedTermSet that contains this term."[4][5] On a glossary page, the WebPage's mainEntity can be the DefinedTermSet, with each term given a fragment @id such as
Each term's description should be the definition shown on the page, and its about can link to the thing the term names, for example a Thing with a sameAs to a Wikidata entry.[1][11]
Codes and classification schemes
termCode is "a code that identifies this DefinedTerm within a DefinedTermSet."[6] The subtype CategoryCode, with CategoryCodeSet, is meant for codes in a category scheme.[12][13] Google's merchant listing documentation uses CategoryCode for a Google Product Category: "Set @type to CategoryCode. Set inCodeSet to a Google Product Taxonomy URL" and set codeValue to the category ID or path.[14] Schema.org's occupationalCategory property similarly prefers "a term from a taxonomy such as BLS O*NET-SOC, ISCO-08 or similar," with both the label and the code.[15]
Terms as property values
Several schema.org properties accept a DefinedTerm as a value, so a defined vocabulary can be reused across the graph. Examples in the current release include jobTitle, which takes Text or DefinedTerm, and competencyRequired.[16][17] A service business can use a DefinedTermSet for its service categories and point each Service's category to a term, keeping the names consistent across pages.[18]
CategoryCode properties
CategoryCode is the only direct subtype of DefinedTerm, and it has one subtype of its own, MedicalCode.[12] Its two own properties link a code to its code list:
| Property | Expected values | Schema.org definition (quoted) |
|---|---|---|
| termCode | Text | "A code that identifies this DefinedTerm within a DefinedTermSet."[6] |
| codeValue | Text | "A short textual code that uniquely identifies the value."[19] |
| inCodeSet | CategoryCodeSet, URL | "A CategoryCodeSet that contains this category code."[20] |
DefinedTermSet has a matching subtype, CategoryCodeSet, defined as "A set of Category Code values."[13] The inverse links are hasDefinedTerm on the set and inDefinedTermSet on the term, so a code list can either list its codes or each code can point back to its list.
Common mistakes
- Terms without the set. A DefinedTerm with no inDefinedTermSet floats free of the vocabulary it belongs to.[5]
- Definitions that differ from the page. The description should match the visible definition.[21]
- Codes without a scheme. A termCode is meaningful only within its DefinedTermSet.[6]
- One-way links only. hasDefinedTerm and inDefinedTermSet can both be given, so either node leads to the other.[4]
Example
A fictional plumbing glossary with two terms.
{
"@context": "https://schema.org",
"@type": "DefinedTermSet",
"@id": "https://www.example.com/glossary#terms",
"name": "Example Plumbing glossary",
"hasDefinedTerm": [
{ "@type": "DefinedTerm", "@id": "https://www.example.com/glossary#term-backflow",
"name": "Backflow", "description": "Water flowing in the reverse of its intended direction.",
"inDefinedTermSet": { "@id": "https://www.example.com/glossary#terms" } },
{ "@type": "DefinedTerm", "@id": "https://www.example.com/glossary#term-trap",
"name": "P-trap", "description": "A curved pipe section that holds water to block sewer gas.",
"inDefinedTermSet": { "@id": "https://www.example.com/glossary#terms" } }
]
}
Common questions
Is DefinedTermSet a creative work?
Yes. It descends from CreativeWork.[2]
Does Google show glossary rich results?
Google documents no feature for DefinedTerm or DefinedTermSet.[3]
Where does a term code go?
In termCode.[6]
Related topics
References
- ^ "DefinedTerm (type)". Schema.org.
- ^ "DefinedTermSet (type)". Schema.org.
- ^ "Structured data markup that Google Search supports (search gallery)". Google Search Central.
- ^ "hasDefinedTerm (property)". Schema.org.
- ^ "inDefinedTermSet (property)". Schema.org.
- ^ "termCode (property)". Schema.org.
- ^ "name (property)". Schema.org.
- ^ "description (property)". Schema.org.
- ^ "mainEntity (property)". Schema.org.
- ^ "JSON-LD 1.1, section 3.3 Node Identifiers". World Wide Web Consortium (W3C).
- ^ "sameAs (property)". Schema.org.
- ^ "CategoryCode (type)". Schema.org.
- ^ "CategoryCodeSet (type)". Schema.org.
- ^ "Merchant listing (Product, Offer) structured data". Google Search Central.
- ^ "occupationalCategory (property)". Schema.org.
- ^ "jobTitle (property)". Schema.org.
- ^ "competencyRequired (property)". Schema.org.
- ^ "Service (type)". Schema.org.
- ^ "codeValue (property)". Schema.org.
- ^ "inCodeSet (property)". Schema.org.
- ^ "Introduction to structured data markup in Google Search". Google Search Central.