Skip to main content

Identifiers, units and scopes

Identifiers and names​

An entity id, a datasetId, an instanceId you supply and every identifier in a request path are absolute URIs. A relative reference such as Building1 is refused, and so is an identifier with whitespace anywhere in it or a character the URI grammar doesn't allow.

The object of a Relationship and every member of a ListRelationship objectList are absolute URIs as well. An empty object is refused.

A name starts with a letter and goes on with letters, digits or _. That covers attribute names, entity type names and the names in query parameters (attrs, pick, omit, orderBy, q paths and type). A name may sit behind one prefix, and a compact or absolute IRI works too. speed-limit, a.b and 1st are refused with BadRequestData, in a query parameter as much as in a body.

When your @context defines the prefix of a written attribute name or entity type, such as ex in ex:speedLimit, the name is read as that prefixed form, and the part after the colon follows the same grammar. ex:bad-name and ex:42x are refused on every write, including in the attribute paths of the delete and temporal instance routes. When the part before the colon isn't a term of the @context, as in urn:x-y, the name is the absolute IRI it is written as, and this check doesn't apply.

A term the core @context defines as a non-reified member can't be an attribute name. There are three groups of them.

  • The value members value, object, objectList, languageMap, vocab, json and valueList.
  • The structural members datasetId, instanceId, observedAt, unitCode, valueType, objectType, createdAt, modifiedAt, deletedAt, expiresAt and scope.
  • The data-integrity seals, and the members only a response carries.

Reified attributes the core @context defines, such as location, observationSpace and operationSpace, are ordinary attribute names. So are plain term mappings such as description and name.

valueType, objectType and every vocab entry are names too, and they follow the same grammar.

How long an identifier can be is under Identifiers and references.

Units​

A unitCode is a UN/CEFACT Recommendation 20 common code, matched exactly. KGM is accepted, and kgm, km/h and Celsius are refused. It is one plain string, so an array or a reified unit code is refused too.

Five attribute types have no unit, and a unitCode on any of them is refused. They are Relationship, LanguageProperty, VocabProperty, ListRelationship and JsonProperty.

Units covers which codes are accepted and how units are stored.

Scope​

A Scope is an optional leading / followed by levels separated by /. Each level starts with a letter and goes on with letters, digits or _. /a-b, /1st, //x, a lone / and a trailing / are all refused.

The scope member holds strings only, and it can't be empty. It takes the NGSI-LD Null only on its own, and only in a partial update or merge fragment.

Scopes has more on Scopes, including their length limits.