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

    Interface NumberConstraints

    Constraints for the number shape factory.

    Adds the prototype model value, the RDF datatype and the integrality flag, which only the general-purpose factory accepts, to the range constraints shared with the specialised factories.

    interface NumberConstraints {
        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

    model?: number

    Explicit prototype value for runtime model assembly.

    A retrieval placeholder matched by JSON type alone: kept verbatim, its value is immaterial and need not be legal for the value constraints. When omitted, the prototype defaults to 0.

    undefined (the prototype defaults to 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)