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

    Interface NumberShape

    Shape definition for numeric values.

    Validates numeric values with range and value constraints. Supports XSD 1.0 numeric datatypes including integers, decimals, and floating-point values.

    Inheritance

    When a resource!ResourceShape extends a parent via extends, numeric-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
    integral Child may add but not drop; an integral parent cannot be overridden by a non-integral child
    minExclusive Child ≥ parent, narrowing the exclusive lower bound
    maxExclusive Child ≤ parent, narrowing the exclusive upper bound
    minInclusive Child ≥ parent, narrowing the inclusive lower bound
    maxInclusive Child ≤ parent, narrowing the inclusive upper bound
    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

    Inclusive/exclusive pairs are independently merged: a child may define an exclusive bound alongside a parent's inclusive bound (or vice versa), narrowing the range without removing the original constraint.

    Cross-Field Validation

    • merged minExclusive must be < merged maxExclusive
    • merged minInclusive must be ≤ merged maxInclusive
    • exclusive and inclusive bounds must not contradict
    • all merged hasValue entries must be members of the merged in set (if defined)
    interface NumberShape {
        kind: "number";
        model: number;
        datatype?: string;
        integral?: boolean;
        minExclusive?: number;
        maxExclusive?: number;
        minInclusive?: number;
        maxInclusive?: number;
        in?: readonly number[];
        hasValue?: readonly number[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    kind: "number"

    Discriminator identifying this as a numeric shape.

    Inheritance — cannot be overridden.

    model: number

    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 0. A merge keeps the child's value.

    0

    datatype?: string

    RDF datatype IRI for the numeric 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:double)

    integral?: boolean

    Restricts values to integers.

    When true, validated values must be integers (no fractional part); fractional values are rejected. Decouples integrality from datatype, so custom or non-XSD integral types are declarable without relying on a recognised datatype IRI. The integer-family factories (byte, short, int, long, integer) set it; float, double, and decimal leave it unset.

    Inheritance — a child may add the constraint but not drop it: overriding an integral parent with a non-integral child is rejected.

    undefined (fractional values allowed)

    minExclusive?: number

    Exclusive minimum value (value must be strictly greater).

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

    undefined (no minimum constraint)

    maxExclusive?: number

    Exclusive maximum value (value must be strictly less).

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

    undefined (no maximum constraint)

    minInclusive?: number

    Inclusive minimum value (value must be greater than or equal).

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

    undefined (no minimum constraint)

    maxInclusive?: number

    Inclusive maximum value (value must be less than or equal).

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

    undefined (no maximum constraint)

    in?: readonly number[]

    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 number[]

    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)