Describes a numeric value.
Constraints accepted by the number shape factory.
Value range bounds accepted by the number shape factories.
Creates a number shape.
Creates a shape for 8-bit signed integer values.
Creates a shape for 16-bit signed integer values.
Creates a shape for 32-bit signed integer values.
Creates a shape for 64-bit signed integer values.
Creates a shape for IEEE 754 single-precision floating-point values.
Creates a shape for IEEE 754 double-precision floating-point values.
Creates a shape for arbitrary-precision integer values.
Creates a shape for arbitrary-precision decimal values.
Number shape types and operations.
Defines the shape describing the numeric values a resource may carry and its constraint types, and provides the factories stating them, mapping the JSON number type to XSD 1.0 numeric datatypes. The number factory bounds a shape by range and enumeration constraints; the typed factories fix the datatype and precision of a particular XSD type.
Contradictory constraints are rejected as the shape is built, so a shape that exists admits at least one value: stating
minInclusiveabovemaxInclusivethrows a TraceError.¹ XSD 1.0 datatypes are referenced by RDF 1.1 and JSON-LD 1.1 as normative
² Numeric types with ranges exceeding JavaScript's safe integer range (±2⁵³-1) or requiring arbitrary precision cannot be fully represented in JSON/JavaScript
Compatibility
Defining number shapes
An enumeration also narrows the value the shape describes:
dieadmits1 | 2 | 3 | 4 | 5 | 6, not the whole numeric domain.Typed numeric factories
Specialised factories map to XSD numeric datatypes with predefined precision:
Using in resource shapes
See