MAP Value Type Import Guide (v2.0)¶
ChangeLog¶
v2.0¶
- aligns value type import guidance with the MAP Type System v2.0 meta-schema model
- removes the former
TypeDescriptor/MetaTypeDescriptorrecursion pattern - treats
MetaValueTypeas the TypeKind-specific meta-type that describes value type descriptors - treats
ValueTypeas the abstract inheritance anchor for value type descriptors - removes the old non-descriptor constraint-facet pattern from
Extends - clarifies that value descriptors use single inheritance and may not extend both
ValueTypeand a separate constraint facet
1. Starting Point: Value Types as Descriptors¶
In MAP, a value type definition is represented as a type descriptor holon.
A concrete value type descriptor:
- is
DescribedByMetaValueType - declares a value-related
TypeKind, such asValue(String)orValue(Integer) - extends exactly one parent in the value descriptor hierarchy
- usually extends the abstract
ValueTypeanchor directly - belongs to exactly one schema through
ComponentOf
The JSON import field type is shorthand for DescribedBy.
Example:
{
"key": "MapStringValueType",
"type": "#MetaValueType",
"properties": {
"type_name": "MapStringValueType",
"type_kind": "Value(String)",
"is_abstract_type": false
},
"relationships": [
{ "name": "Extends", "target": { "$ref": "#ValueType" } },
{ "name": "ComponentOf", "target": { "$ref": "#MAP Core Schema" } }
]
}
This means:
MapStringValueTypeis a value type descriptor because it is described byMetaValueType.- It inherits the general obligations of value type descriptors by extending
ValueType. - It is a concrete descriptor and may be referenced by property descriptors.
2. Example: General and Specialized String Value Types¶
Consider two value type descriptors:
MapStringValueType: the general MAP string value typePropertyNameValueType: a string value type specialized for property names
Both represent string-like scalar values, but they may carry different semantic constraints.
The v2.0 pattern is:
MapStringValueType --[DescribedBy]--> MetaValueType
MapStringValueType --[Extends]-----> ValueType
PropertyNameValueType --[DescribedBy]--> MetaValueType
PropertyNameValueType --[Extends]-----> MapStringValueType
PropertyNameValueType chooses MapStringValueType as its single parent when it is intended to refine the general string value type. If no refinement chain is desired, it may instead extend ValueType directly.
The important invariant is that each descriptor has one inheritance parent. A value type descriptor does not extend both ValueType and a separate constraint facet.
3. Constraint Modeling¶
The earlier value-type guide used examples such as:
MapStringValueType --[Extends]--> StringValueConstraints
That pattern is retired in v2.0.
Extends is the type inheritance relationship. Its target must be a real type descriptor, and each type may extend at most one other type. A free-floating object such as StringValueConstraints cannot be an Extends target unless it is itself modeled as a descriptor in the schema.
Use these rules instead:
- Put scalar runtime representation in
BaseValueand the MAP base type wrappers. - Put value-category identity in
TypeKind, such asValue(String)orValue(Bytes). - Put property-to-value binding on property descriptors through the
ValueTyperelationship. - Put reusable semantic refinements in explicit value type descriptors, using a single inheritance chain.
- Introduce new constraint fields only as explicit schema elements governed by the relevant meta-type design, not as anonymous composition facets.
This preserves the simplification introduced by DescriptorRoot: description, inheritance, and instantiation stay separate.
4. How Property Types Refer to Value Types¶
Property type descriptors are described by MetaPropertyType.
They point to value type descriptors through the ValueType relationship.
Example:
Description.Property --[DescribedBy]--> MetaPropertyType
Description.Property --[Extends]-----> PropertyType
Description.Property --[ValueType]---> MapStringValueType
Validation should confirm that the ValueType target is a value type descriptor:
- The target is described by
MetaValueTypeor by an allowed future sub-meta-type ofMetaValueType. - The target is concrete unless the schema intentionally allows an abstract value-type anchor.
- The target conforms through
ExtendstoValueType.
5. Why Keys Still Matter¶
Semantic keys remain important for value type imports.
They allow import files to reference descriptors before permanent storage identifiers exist. For example, a property descriptor can refer to $ref: "MapStringValueType" before either descriptor has been committed.
Keys support:
- cross-file linkage between staged descriptors
- ID-free
$refexpressions in JSON - relationship validation prior to commit
- deduplication and merging of equivalent descriptors
- semantic lookup in distributed storage
Key behavior is declared through UsesKeyRule, inherited from the descriptor model rooted at DescriptorRoot.
6. Import Validation Checklist¶
When importing value type descriptors:
- Resolve the
typefield asDescribedBy. - Confirm ordinary value type descriptors are described by
MetaValueType. - Confirm each descriptor has at most one
Extendstarget. - Confirm concrete value type descriptors ultimately conform to
ValueType. - Reject references to the removed
MetaTypeDescriptormodel. - Reject non-descriptor constraint facets as
Extendstargets. - Confirm property descriptors reference valid value descriptors through
ValueType. - Confirm key materialization follows the descriptor's
UsesKeyRule.
7. Summary¶
The v2.0 value type model is intentionally simpler:
MetaValueTypedescribes value type descriptors.ValueTypeanchors value descriptor inheritance.- Concrete value descriptors define reusable scalar semantics.
- Property descriptors reference value descriptors through
ValueType. BaseValueremains the runtime scalar representation.Extendsis single inheritance, not a general-purpose constraint composition mechanism.