Field Definition Reference
Audience: collection authors.
Authoritative for:
- frontmatter property types
- core field-definition properties: human-facing metadata, constraints, generation and materialization, uniqueness, relationship contribution, and vocabulary references
See also:
- Foundations: the shared expression language, parsing baselines, and string comparison
- Managed Notes and Properties: the managed note contract, field names, core-defined fields, materialization, and optionality
- Note Links: the link forms and resolution used by
format: note_linkfields - Collection Model: property sets and vocabularies
- Field Compatibility and Conversion: the shared optional conversion contract
- Expressions: computed field definitions and sibling-field derivation
- Authoring: immutable fields and additional optional generation strategies
Frontmatter Property Types#
Field definitions are mappings with type and the applicable properties below.
Core value validation is independent of optional expression or authoring
contracts.
Property applicability at a glance:
| Property | Applies to | Default or key restriction |
|---|---|---|
type |
every field definition | physically required |
items |
list |
required for lists; absent elsewhere |
fields |
object |
required for objects; absent elsewhere |
label, description, icon |
any declared field | optional human-facing metadata |
generated |
declared fields | false; strategies are unavailable on anonymous items; additional strategies |
computed |
top-level text fields |
sibling-field derivation only |
unique |
top-level scalar fields | false; per-note-type or collection scope |
deprecated |
declared fields | false |
immutable |
top-level and nested object fields | false; unavailable on anonymous items |
nullable |
declared fields except anonymous items |
false, subject to the dedicated Core-field contract |
default_value |
declared fields except anonymous items |
unavailable with generation strategies or computed |
relationship_kind |
top-level note-link fields | belongs_to or related_to |
format |
text, link, and time where supported |
required for link and time |
validate_exists, targets |
note-link definitions | false / absent |
not_empty |
object | false |
not_blank, regex |
text and link | false / absent |
min, max |
scalar, temporal, list, and tags types listed below | absent |
allowed_values, allowed_values_from |
supported scalar/list types; vocabularies additionally support tags | mutually exclusive |
const_value |
declared fields | absent; unavailable with computed or a generation strategy |
Property representation:
| Properties | Present-value shape |
|---|---|
label, description, icon, regex |
Non-empty string |
nullable, deprecated, validate_exists, not_empty, not_blank |
Boolean |
unique |
Boolean or collection |
relationship_kind |
belongs_to or related_to |
generated |
false or a supported strategy; now_on_write excludes immutable: true |
targets |
Non-empty list of unique note-type slugs |
min, max |
Scalar bound or count as defined below |
allowed_values |
Non-empty list of unique scalar values |
allowed_values_from |
Vocabulary slug |
Rules:
- FDR-285 A field property MAY be omitted unless its type or dedicated contract requires it.
- FDR-286 Present field properties MUST satisfy their representation and applicability tables.
- FDR-287 Omitted properties MUST use the table's effective default or contribute no constraint when no default is defined.
Field Definition Property Reference#
Rules:
- FDR-1 Field-definition properties apply to top-level fields, to
list.items, and recursively to nested fields insideobject.fieldsunless a type-specific rule says otherwise. - FDR-2 Human-facing field metadata MUST NOT change field identity, types, constraints, relationships, or materialization.
- FDR-3 Value constraints other than nullability apply only to non-null effective values.
- FDR-4 A non-null
default_valueMUST satisfy all declared field constraints.
Field Value Equality#
Several field features compare values. These rules define one type-aware equality model so uniqueness, constants, and allowed values cannot disagree.
Rules:
- FDR-239 Every field-value comparison that this page defines as exact equality MUST compare parsed values under the declared field definition.
- FDR-240
textandlinkstrings are equal when their NFC-normalized code points are equal with case preserved. - FDR-241
integerandnumbervalues are equal when their numeric values are equal, andcheckboxvalues are equal when their boolean values are equal. - FDR-242
dateandtimevalues are equal when they denote the same calendar date or wall-clock time, anddatetimevalues are equal when they denote the same instant regardless of offset notation. - FDR-243
listandtagsvalues are equal when they have the same length and their entries are pairwise equal in sequence order under the applicable item definition. - FDR-244
objectvalues are equal when they have the same keys and their field values are equal recursively;anyvalues use the same scalar, sequence, and mapping equality rules recursively after YAML parsing.
Field Compatibility and Conversion#
The shared conversion contract is authoritative on its own page and is used by both queries and migrations.
type#
Rules:
- FDR-5
typeis REQUIRED on every field definition. - FDR-6 Supported
typevalues aretext,integer,number,checkbox,date,time,datetime,link,list,tags,object, andany. - FDR-7 Field definitions MUST NOT use unknown property types.
- FDR-8
textvalues MUST be YAML strings. - FDR-9
integervalues MUST be YAML numbers with no fractional component. - FDR-11
numbervalues MUST be YAML numbers. - FDR-12
checkboxvalues MUST be eithertrueorfalse. - FDR-13
dateMUST use RFC 3339 full-date formatYYYY-MM-DD. - FDR-14
timevalues MUST be YAML strings and MUST match the declared timeformat. - FDR-15 A datetime MUST contain a valid
YYYY-MM-DDTHH:mmvalue, optionally followed by seconds, fractional seconds when seconds are present, and a timezone designatorZor+HH:mm/-HH:mm. - FDR-281 Omitted datetime seconds MUST be interpreted as zero.
- FDR-282 A datetime without an explicit offset MUST be interpreted in the collection timezone.
- FDR-283 A floating datetime in a daylight-saving gap or overlap MUST be rejected unless an explicit offset disambiguates its instant.
- FDR-284 An explicit datetime offset MUST determine the represented instant independently of the collection timezone.
- FDR-16
dateandtimevalues are floating: they carry no timezone and denote a calendar date or wall-clock time as written; when a rule needs to place them in time, they are interpreted in the collection timezone defined in Collection Model. - FDR-19
linkvalues MUST be YAML strings and MUST follow the declared linkformat. - FDR-20 Stored
listvalues MUST be YAML sequences. - FDR-21
tagsvalues MUST be YAML sequences of tag strings. - FDR-22
tagsentries MUST be non-empty strings. - FDR-23 A
tagsentry is one or more segments joined by single/separators; each segment MUST consist of Unicode letters, digits, underscores, and hyphens, and MUST NOT start with a hyphen. In the ECMA-262 dialect with theuflag:^[\p{L}\p{N}_][\p{L}\p{N}_-]*(?:\/[\p{L}\p{N}_][\p{L}\p{N}_-]*)*$. - FDR-24
tagsentries MUST NOT include a leading#; the#prefix belongs to inline body syntax, which carries no structural meaning. - FDR-25 The
/separator expresses hierarchy; explicit vocabulary constraints remain governed byallowed_values_from. - FDR-26 Entries within one stored
tagsvalue MUST be unique under the string comparison rules defined in Foundations; a duplicate entry is aninvalid_field_valuefailure. - FDR-27 A
tagsentry that violates this grammar is aninvalid_field_valuefailure. - FDR-28 Stored
objectvalues MUST be YAML mappings. - FDR-29
anyvalues MAY be any non-null YAML value, and MAY benullonly whennullable: true.
items#
Rules:
- FDR-33 A field definition with
type: listMUST declareitems. - FDR-35
itemsMUST NOT declaredefault_valuebecause anonymous list elements are not materialized independently. - FDR-36
itemsMUST NOT declarenullablebecause list elements are not materialized independently. - FDR-37
itemsMUST NOT declareimmutablebecause anonymous list elements are not tracked individually.
fields#
Rules:
- FDR-42 A field definition with
type: objectMUST declarefields.
label#
Shapes and defaults follow the shared property tables.
description#
Shapes and defaults follow the shared property tables.
icon#
Rules:
- FDR-55 The core specification treats
iconas opaque and does not standardize icon libraries or rendering behavior.
generated#
Rules:
- FDR-57
generatedMUST befalseor a supported generation strategy. - FDR-59 A field is generated when it declares a supported generation strategy.
- FDR-62 Generated fields follow the effective-value and sparse-storage contract in Managed Notes and Properties.
- FDR-63 A generation strategy does not constrain stored values; validation of stored values uses only the field's declared type and constraints.
- FDR-64 A field declaring a generation strategy MUST NOT declare
default_valueorconst_value. - FDR-65 A generated value MUST satisfy the field's declared type and constraints; a schema MUST NOT combine a strategy with constraints the strategy's values cannot satisfy.
- FDR-66 Anonymous
itemsMUST NOT declare a generation strategy. - FDR-67 Sibling-field derivation uses the optional Expressions contract rather than a generation strategy.
Supported generation strategies:
- FDR-68
nowandnow_on_writeare valid fordate,time, anddatetimefields. - FDR-245 Producing a
nowvalue for an absent field or template placeholder MUST use the current instant in the collection timezone. - FDR-246 A tool MUST render a
nowvalue according to the field's declared type andformat. - FDR-247 A generated
datetimevalue SHOULD carry the collection timezone's offset at the generated instant. - FDR-248 A tool MUST NOT overwrite an existing concrete non-null value of a
nowfield. - FDR-69 A semantic write MUST refresh a concrete
now_on_writevalue, or materialize an absent declared one, using the collection timezone; explicit null preservation follows Managed Notes. - FDR-70
uuidis valid fortextfields. The tool MUST generate an RFC 4122 version 4 UUID in lowercase form, once; it MUST NOT overwrite an existing concrete non-null value. Lowercase UUIDs satisfyformat: slug, souuidMAY be used for the core-definedidfield.
Additional optional generation strategies are defined in Authoring.
Generation behavior rules:
- FDR-74 Creation, scaffolding, and import MUST apply declared generators to absent values or template placeholders, respecting the explicit-value contract in Managed Notes.
- FDR-75 Generation alone guarantees no uniqueness: random values MAY collide and hard deletion MAY free sequence values. When the field also declares
unique, the tool MUST verify the generated value against the field's uniqueness scope and regenerate on collision. - FDR-76 Read-only conformance of a missing generated field MUST follow the effective-value rules without executing the generator.
computed#
Stored sibling-field derivation is defined in Expressions.
unique#
Rules:
- FDR-81
uniqueMAY be declared only on top-level frontmatter fields. - FDR-82
unique: trueandunique: collectionare valid only for scalar field types:text,integer,number,checkbox,date,time,datetime, andlink. - FDR-83
unique: truerequires distinct non-null effective values among managed notes of the same type. - FDR-84
unique: collectionrequires distinct non-null effective values among same-named fields with the same property type across managed notes in the collection. - FDR-85 Uniqueness is evaluated using the type-aware Field Value Equality rules on this page, not by note-link resolution.
deprecated#
Rules:
- FDR-92
deprecated: truemarks a field as discouraged for new use. - FDR-93 A deprecated field remains valid and governed by the same effective-value validation and writing rules as any other declared field.
immutable#
Immutable field semantics are defined in Authoring.
optional#
The former optional property is not part of 0.1.0. Nullability controls
null values; the managed-note contract controls omission. Migration preserves
an old implicit nullable value explicitly before removing optional.
nullable#
Rules:
- FDR-116 A field with
nullable: trueMAY explicitly use the valuenull.
default_value#
Rules:
- FDR-118
default_valueMAY be used on any field definition that does not declare a generation strategy, as defined undergenerated. - FDR-119
default_valueMUST conform to the declared field type, or MAY benullonly whennullable: true. - FDR-120
default_valueapplies to an absent field during effective-value construction. - FDR-121 An explicit
nullvalue is distinct from an absent field and MUST NOT be replaced bydefault_value. - FDR-123 An absent nullable field without an explicit default has effective value
null.
relationship_kind#
Rules:
- FDR-127
relationship_kindMAY be declared only on top-level frontmatter fields. - FDR-128 A field with
relationship_kindMUST havetype: linkandformat: note_link, ortype: listwhoseitems.typeislinkanditems.formatisnote_link.
format#
For example, https://example.com/page#section is a scheme-qualified URI with a fragment.
Rules:
- FDR-132 Supported
formatvalues areslug,note_link,uri,hh:mm,hh:mm:ss, andhh:mm:ss.sss. - FDR-133
type: linkMUST declareformat. - FDR-134
type: timeMUST declareformat. - FDR-135
format: slugis valid only fortype: textorlist.items.type: text. - FDR-136
format: note_linkis valid only fortype: linkorlist.items.type: link. - FDR-137
format: uriis valid only fortype: linkorlist.items.type: link. - FDR-138
format: hh:mm,format: hh:mm:ss, andformat: hh:mm:ss.sssare valid only fortype: timeorlist.items.type: time. - FDR-139 Values with
format: slugMUST match^[a-z0-9]+(?:-[a-z0-9]+)*$. - FDR-140 Values with
format: uriMUST follow RFC 3986'sURIgrammar, with a non-empty scheme and an optional fragment. - FDR-142 Non-null values with
format: note_linkMUST be non-empty strings using the syntax and resolution contract in Note Links. - FDR-144 Values with
format: hh:mmontype: timeorlist.items.type: timeMUST use a 24-hour clock and match^(?:[01]\d|2[0-3]):[0-5]\d$. - FDR-145 Values with
format: hh:mm:ssontype: timeorlist.items.type: timeMUST use a 24-hour clock and match^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$. - FDR-146 Values with
format: hh:mm:ss.sssontype: timeorlist.items.type: timeMUST use a 24-hour clock and match^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d\.\d{3}$.
validate_exists#
Rules:
- FDR-150
validate_existsis valid only on field definitions that declareformat: note_link, includinglist.items. - FDR-151
validate_exists: truemeans every non-empty stored note-link value MUST resolve to exactly one existing collection note under the note-link resolution rules defined in Note Links. - FDR-153 A non-empty value that does not resolve violates
validate_existsand is reported asinvalid_note_link.
targets#
Rules:
- FDR-157
targetsis valid only on field definitions that declareformat: note_link, includinglist.items. - FDR-158 Each identifier in
targetsMUST resolve to a note type defined in the collection; it MAY name an abstract note type. - FDR-159 An abstract note type in
targetsmeans any concrete note type that extends it directly or transitively. - FDR-160 A non-empty stored value that resolves to a managed note MUST resolve to a note whose concrete note type satisfies
targets; a value resolving to an untyped note violatestargets. - FDR-161 A
targetsviolation is aninvalid_field_valuefailure. - FDR-162 An unresolved value does not violate
targets; existence is governed byvalidate_exists. - FDR-163 For values stored in a field declaring
targets, the id, name, and alias passes of name-based resolution consider only managed notes whose concrete note type satisfiestargets; path-formed targets resolve normally and are then validated againsttargets. - FDR-164 A relationship-bearing field MAY declare
targets; its declared targets SHOULD be consistent with the type-level relationship declarations, and a resolved typed relationship instance is validated against both.
not_empty#
Rules:
- FDR-168
not_emptyMUST be used only onobjectfields. - FDR-171 Object
not_empty: truerequires at least one key in the effective mapping.
Text, link, list, and tags fields use min: 1 for non-emptiness instead.
not_blank#
Rules:
- FDR-175
not_blank: trueis valid only fortype: textortype: link. - FDR-176
not_blank: truemeans the stored string MUST contain at least one non-whitespace character.
regex#
Rules:
- FDR-180
regexis valid only fortype: textortype: link. - FDR-181
regexis matched against the entire stored string value. - FDR-182
regexpatterns use the ECMA-262 regular expression dialect defined in Foundations.
min#
Rules:
- FDR-184
minis valid only fortype: text,type: link,type: integer,type: number,type: date,type: time,type: datetime,type: list, ortype: tags. - FDR-185 For
type: textandtype: link,minconstrains string length in Unicode code points and MUST be a non-negative integer. - FDR-186 For
type: listandtype: tags,minconstrains item count and MUST be a non-negative integer. - FDR-187 For
type: integer,type: number,type: date,type: time, andtype: datetime,minconstrains the stored value itself and MUST conform to the declared field type andformatwhen applicable. - FDR-188 For
type: date,type: time, andtype: datetime,mincomparison uses temporal ordering, not raw string comparison.
max#
Rules:
- FDR-190
maxis valid only fortype: text,type: link,type: integer,type: number,type: date,type: time,type: datetime,type: list, ortype: tags. - FDR-191 For
type: textandtype: link,maxconstrains string length in Unicode code points and MUST be a non-negative integer. - FDR-192 For
type: listandtype: tags,maxconstrains item count and MUST be a non-negative integer. - FDR-193 For
type: integer,type: number,type: date,type: time, andtype: datetime,maxconstrains the stored value itself and MUST conform to the declared field type andformatwhen applicable. - FDR-194 For
type: date,type: time, andtype: datetime,maxcomparison uses temporal ordering, not raw string comparison. - FDR-195 If both
minandmaxare present,minMUST be less than or equal tomax.
allowed_values#
Rules:
- FDR-197
allowed_valuesMUST be a non-empty list of unique scalar values. - FDR-198 For scalar field types,
allowed_valuesentries MUST be compatible with the declared propertytype. - FDR-199 For
type: list,allowed_valuesis valid only whenitems.typeis one oftext,integer,number,checkbox,date,time,datetime, orlink, and eachallowed_valuesentry MUST be compatible with that item type. - FDR-200 For
type: list, every stored item value MUST be one of the declaredallowed_values. - FDR-201
allowed_valuesMUST NOT be used withtype: tags,type: object, ortype: any. - FDR-202 Text and link
allowed_valuescomparisons use the Field Value Equality rules on this page. - FDR-203 Non-text scalar
allowed_valuescomparisons use the Field Value Equality rules after normal YAML parsing and type validation.
allowed_values_from#
Rules:
- FDR-205 If present,
allowed_values_fromMUST be a non-empty slug naming a vocabulary defined intypedmark.mdvocabularies, as defined in Collection Model; a reference that does not resolve makes the declaring artifact invalid. - FDR-206
allowed_values_fromandallowed_valuesMUST NOT both be present on the same field definition. - FDR-207
allowed_values_fromis valid whereverallowed_valuesis valid, and additionally ontype: tags. - FDR-208 For every type except
tags,allowed_values_fromhas the same semantics as declaringallowed_valueswith the referenced vocabulary's values. - FDR-209 For
type: tags, every stored entry MUST equal a vocabulary value or be a descendant of one under the tag hierarchy rules; an entry outside the vocabulary is aninvalid_field_valuefailure.
const_value#
Rules:
- FDR-211
const_valueMUST conform to the declared property type. - FDR-213 A non-null effective value constrained by
const_valueMUST equal it under Field Value Equality.
value_from_schema#
This former property is removed. Core supplies the associated note_type
without a redundant field declaration.
Moved rule references
- FDR-100
- FDR-101
- FDR-102
- FDR-103
- FDR-218
- FDR-219
- FDR-220
- FDR-221
- FDR-222
- FDR-223
- FDR-224
- FDR-225
- FDR-226
- FDR-227
- FDR-228
- FDR-229
- FDR-230
- FDR-231
- FDR-232
- FDR-233
- FDR-234
- FDR-235
- FDR-236
- FDR-237
- FDR-238
- FDR-249
- FDR-250
- FDR-251
- FDR-252
- FDR-253
- FDR-254
- FDR-255
- FDR-256
- FDR-257
- FDR-258
- FDR-259
- FDR-260
- FDR-261
- FDR-262
- FDR-263
- FDR-264
- FDR-265
- FDR-266
- FDR-267
- FDR-268
- FDR-269
- FDR-270
- FDR-271
- FDR-272
- FDR-273
- FDR-274
- FDR-275
- FDR-276
- FDR-277
- FDR-278
- FDR-279
- FDR-280
- FDR-71
- FDR-72
- FDR-73
- FDR-95
- FDR-96
- FDR-97
- FDR-98
- FDR-99