Skip to main content

Operations

Batch operations​

The whole request is refused when the body isn't an array or is an empty one, when an item is null, or when an item has no id or one that isn't a URI.

An item's id can be written as id, as @id, or under a term its @context defines for @id, such as {"eid": "@id"}. Such an item is created, or reported against its id, like any other. If its @context can't be retrieved, the id can't be read, and the whole request is refused.

Any other fault is reported against the entity that has it, in a 207, and the rest of the batch goes ahead.

Path and body identity​

Replace Entity refuses a body whose id differs from the entity in the path. Temporal Add Attributes and Modify Attribute Instance refuse a fragment whose id doesn't denote the entity in the path.

Modify Attribute Instance also takes exactly one attribute, holding exactly one instance.

Temporal API​

A temporal write names id and type. Before anything is stored or forwarded, it is checked like a Core API write, with the same rules for attribute types, seals, embedded and scoped @contexts, unit codes and date-times.

Two instances of one attribute can't share an instanceId, whatever their datasetId. A write that gives one instanceId to two of them gets 400 BadRequestData, and when other writes are committed with it, only that entity is refused. Writing an instanceId the history already holds replaces that instance. If two writes give the same instanceId at the same moment, the one committed last is kept.

In the simplified temporal representation, an attribute holds its type and its plural member (values, objects, languageMaps, vocabs, jsons, valueLists or objectLists), and nothing else. Every element is a [value, observedAt] pair, with observedAt as a string. For a LanguageProperty, JsonProperty or VocabProperty, the value in a pair is the one-member object {"languageMap": …}, {"json": …} or {"vocab": …}. An instance object where a pair should be, a pair of another length, and a datasetId, unitCode or sub-attribute next to the pairs are all refused.

Representation and aggregation parameters the operation doesn't take are refused. That means join=inline with the temporal, aggregated or grouped representations, and aggregation given both in temporalQ and in aggrParams. The grouped representation comes from the Temporal aggregation grouping extension.

Snapshots and EntityMaps​

Snapshots covers how a Snapshot lives, from creation to deletion. The rules here are about what a request may send.

A Snapshot body refuses members it doesn't define. A Snapshot's id and query definitions never change, its status moves only along the transitions the specification allows, and its priority is an integer from 1 to 10.

A Snapshot fragment removes endpoint or receiverInfo with the NGSI-LD Null. receiverInfo also takes an array holding only the Null.

Purge Snapshots refuses a q term on snapshotQueries, snapshotTemporalQueries or receiverInfo with BadRequestData, even though the Snapshot data type defines them. Those members hold arrays of structured values, and the purge filter compares only id, type, snapshotLifetime, snapshotPriority and endpoint.

An EntityMap update takes a future expiresAt and nothing else. A request made under an EntityMap with filter parameters other than those of the request that created it gets InvalidRequest.

Distributed operations​

An entity a context source returns is read under the context it was written in, which is either its own @context or the context the answer is spelled in. Keyword spellings, and terms that context defines for core terms, are read as those core terms. A member written in its term's container shape (a @set array of one, a map of one or several keys, a @nest object) is read as that member. A Temporal Evolution may list an attribute's instances or give them as [value, instant] pairs.

The returned entity is then held to the same rules as a local write. If it would be refused locally, for example for an unknown unit code or a position outside the coordinate ranges, it is left out of the answer. Only that element goes, never the rest of the page. Each source gets one 111 Revalidation Failed warning in the NGSILD-Warning header, counting the elements it lost, and the elements themselves are named only in Andromeda's log. An element whose system member (createdAt, modifiedAt or deletedAt) isn't a valid DateTime is left out as well.

An entity in a notification another broker relays is read the same way. The specification doesn't say what to do with an invalid relayed entity, so Andromeda leaves it out of the notification it delivers, logs it, and delivers the rest. A bare NGSI-LD Null in a relayed entity deletes that attribute, and it is relayed as written.

An ordered query that a registered source would take part in is refused (see Sorting and the local scope).