Skip to main content

Date-times

Every DateTime has every component, at most six fractional digits, a comma or full stop as the decimal point, and a time zone written as Z. +00:00, +01:00, a lowercase z, a seventh fractional digit and a missing component are all refused.

This applies everywhere a DateTime arrives. That covers observedAt, expiresAt, createdAt, modifiedAt and deletedAt at every depth, plus timeAt and endTimeAt. It also covers the members of subscriptions, registrations, Snapshots and EntityMaps, the observedAt parameter of Partial Attribute Update, Temporal API write bodies, and a peer's Content-Range.

A Property value declared as DateTime, Date or Time must be a valid value of that type, at any depth. The declaration can come from its @type or from the Property's valueType. The rule holds on a sub-attribute, inside a structured value or in a list. The value has to be a string, which rules out {"@type": "DateTime", "@value": 123}. A @type and a valueType that name two different datatypes, one of them a time type, are refused.

valueType declares the datatype of every primitive member of the value next to it. That covers the single value, each value of a multi-valued Property, and each ListProperty item. Inside a structured value, only a member's own @type declares a datatype.

A literal declared as a recognised datatype has to be a value of that datatype. The recognised datatypes are the NGSI-LD DateTime, Date and Time, and the XSD datatypes listed in RDF 1.1 Concepts section 5.1, read by their XSD 1.1 lexical spaces.

A string is read as the datatype's lexical form. A number is read by its exact decimal, so 1.5 isn't an xsd:integer. A boolean is only valid under xsd:boolean. A number or boolean under xsd:string or a time datatype is refused. Any other datatype IRI, such as Annex C's Integer or PostalAddress, carries nothing Andromeda can check.

A valueType expands to an absolute IRI, and a LanguageProperty's valueType is langString.

DateTime, Date and Time literals in a q expression follow the same rules.

On subscriptions, registrations and EntityMaps, an expiresAt has to be in the future when it is written.

createdAt and modifiedAt on an attribute instance or sub-attribute are set by Andromeda. If you send them, they still have to parse, but their values are ignored (see Deliberate tolerances). A deletedAt on an attribute instance in a Core API write is refused. The entity's own createdAt, modifiedAt and deletedAt belong to Andromeda, so a write carrying them changes nothing.

How time values are stored and served, and how quoted and bare q operands differ, is under Date-times.