Type Definition
A Type Definition is a first-class document whose Document id is itself a Type IRI. Resolving the Type IRI yields the TypeDefinition document — prose describing the Type's intent, usage, rules, examples, and an RDF body carrying the Type's SHACL shape and any custom vocabulary.
This document is itself a TypeDefinition (a TypeDefinition for sdg:TypeDefinition). The registry's self-descriptive bootstrap starts here.
Why
Treating Types as documents unifies the authoring experience. Declaring a new Type is publishing a TypeDefinition document; evolving a Type is publishing a new Version. Editors can surface type hints, tooltips, and SHACL validation directly from the graph — no separate admin surface.
Identity rule
For every built-in Type IRI under the sdg: namespace, a matching TypeDefinition is seeded at service startup. The loader treats these as reserved — samples may not redefine them.
Typical body
- Intent. One paragraph explaining what the Type is for.
- Schema. A SHACL shape (optional in Phase 1 — gate 3 is stubbed). When present, it defines the constraints a
rdf:type <Type>assertion implies. - Renderer hints. Optional RDF metadata about which component renders instances and in which slot.
- Examples. One or more cross-references to sample documents of the Type.
Relationships
- A TypeDefinition is simultaneously a
sd:Document, asdg:SparqdownDocument, asdg:TypeDefinition, and anrdfs:Class. Multi-typing is standard RDF. - Every Type declared in the Documentation Index should have a TypeDefinition. Types without one are "informal" and are reported by the audit script.
- A Document's
rdf:typeassertion points to the Type IRI, which is resolvable to this kind of document.
Coherence rules
These rules are checked against every sdg:TypeDefinition document. They are authored as first-class @rule blocks and evaluated over the document's canonical RDF (see the Coherence Engine spec).
has-labelA Type Definition must carry rdfs:label. The expectation is enforced by consumption: the Lexicon's definition harvest reads rdfs:label for every definition class, and editor tooling presents it.
SELECT ?this ?message WHERE {
FILTER NOT EXISTS { ?this rdfs:label ?label }
BIND("A Type Definition must carry rdfs:label — the Lexicon definition harvest and editor tooling read it." AS ?message)
}has-tooltip-summaryEvery Type Definition should carry sdg:tooltipSummary — editors surface it in hover cards.
SELECT ?this ?message WHERE {
FILTER NOT EXISTS { ?this sdg:tooltipSummary ?summary }
BIND("A Type Definition should carry sdg:tooltipSummary — editors surface it in hover cards." AS ?message)
}