@metreeca/blue - v0.10.0
    Preparing search index...

    Interface StringShape

    Shape definition for textual values.

    Validates textual values with length constraints, lexical validation, and value constraints for strings. Supports XSD 1.0 string datatypes and temporal formats.

    Inheritance

    When a resource!ResourceShape extends a parent via extends, string-valued entries are merged according to the following rules. The child is the extending shape; the parent is the inherited shape.

    Field Override Rule
    kind Cannot be overridden
    model Taken from the child: a retrieval placeholder
    datatype Must be strictly equal when both defined; the single defined value carries through
    pattern Must be strictly equal when both defined; the single defined value carries through
    minLength Child ≥ parent, narrowing the minimum length
    maxLength Child ≤ parent, narrowing the maximum length
    in Intersection of parent and child sets; empty result is reported as an error
    hasValue Union of parent and child required values; child must require all parent values

    Cross-Field Validation

    • merged minLength must be ≤ merged maxLength
    • all merged hasValue entries must be members of the merged in set (if defined)
    interface StringShape {
        kind: "string";
        model: string;
        pattern?: string;
        datatype?: string;
        minLength?: number;
        maxLength?: number;
        in?: readonly string[];
        hasValue?: readonly string[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    kind: "string"

    Discriminator identifying this as a textual shape.

    Inheritance — cannot be overridden.

    model: string

    Prototype value for runtime model assembly.

    A retrieval placeholder matched by JSON type alone: its value is immaterial and need not be legal for the value constraints, so factories keep an explicit model verbatim and default an unspecified one to "". A merge keeps the child's value.

    "" (empty string)

    pattern?: string

    Regular expression pattern that values must match.

    The pattern is matched without anchoring: the constraint holds when the pattern occurs anywhere within the value. Use anchors (^ and $) to require a match against the complete string.

    Inheritance — must be strictly equal when both parent and child define it; otherwise the single defined value carries through. Within a union, this equality makes pattern a discriminator: two same-datatype string variants that differ only by pattern are distinct branches.

    undefined (no pattern constraint)

    datatype?: string

    RDF datatype IRI for the textual literal.

    Infers the RDF datatype of validated JSON values, which carry no datatype information of their own.

    Inheritance — must be strictly equal when both parent and child define it; otherwise the single defined value carries through. A mismatch signals incompatible datatypes.

    undefined (falls back to xsd:string)

    minLength?: number

    Minimum string length in characters.

    Inheritance — child value must be ≥ parent value, narrowing the lower bound.

    undefined (no minimum length)

    maxLength?: number

    Maximum string length in characters.

    Inheritance — child value must be ≤ parent value, narrowing the upper bound.

    undefined (no maximum length)

    in?: readonly string[]

    Allowed values (closed enumeration).

    When specified, values must be members of this list. Empty arrays are ignored.

    Inheritance — intersection of parent and child sets; empty result is reported as an error.

    undefined (no enumeration constraint)

    hasValue?: readonly string[]

    Required values that must be present.

    When specified, all listed values must appear in the resource. Empty arrays are ignored.

    Inheritance — union of parent and child required values; child must require all parent values.

    undefined (no required values)