nx_metadata_sdk  1.0
Metadata SDK
Analytics Taxonomy

// Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/

This document describes the mechanism for defining Event and Object types and their Attributes. Such definitions are made in "typeLibrary" field in the Engine or DeviceAgent JSON manifest; for details of those manifests see src/nx/sdk/analytics/manifests.md.

In the VMS there is a number of pre-defined types which can be used by Plugins either directly, or via inheriting and extending. Such types are called Taxonomy Base Type Library; their definition can be found in the file src/nx/sdk/analytics/taxonomy_base_type_library.json supplied with the SDK.

The example of defining a Type Library, as well as using the Base Library, can be found in Stub Analytics Plugin, "Taxonomy features" sub-plugin, located in this SDK: samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/taxonomy_features/device_agent_manifest.h


General information

A Type Library is a JSON object which contain the following lists of entities (in any order):

"typeLibrary":
{
"enumTypes": [ ... ],
"colorTypes": [ ... ],
"objectTypes": [ ... ],
"eventTypes": [ ... ],
"groups": [ ... ],
"extendedObjectTypes": [ ... ]
}

Each such entity is described in detail below.

Enum types

This JSON object describes an Enum type which can be used as a type of an Attribute. It has the following fields:

Color types

This JSON object describes a Color type which can be used as a type of an Attribute. It has the following fields:

Object types

This JSON object describes an Object type. It has the following fields:

Event types

This JSON object describes an Event type. It has the following fields:

Groups

This JSON object describes a Group for Event types. The particular Group is referenced from an Event Type via its "groupId" field. The Group definition has the following fields:

Extended Object Types

This section provides an alternative simplified syntax of defining "hidden" derived Object Types. Each entity in the "extendedObjectTypes" array is technically a definition of a "hidden" derived Object Type with an auto-generated id using the template "<pluginId>$<baseObjectTypeId>". The "id" field of an Extended Object Type is an id of the base Object Type. The name of the derived Type must be empty. The Extended Object Type definition has the following fields:

Attribute Lists

Describes a list of Type Attributes, which can be used in the Type definition. Each List must have an id, and a list of Attributes which uses that same syntax as used in specifying Attributes in Object and Event Types. Semantically an Attribute List is like a macro - it can be used instead of an Attribute definition in any Object Type or Event Type definition; its contents simply substitute the invocation. The Attribute List definition has the following fields:

Objects and Events can have a list of Attributes, each Attribute being defined with a JSON object containing the following fields:

Other fields depend on the particular attribute type.

Attributes that are inherited from the base type can be "re-defined" as follows:

Overriden Attributes

The following behavior is observed in the GUI when several types inherited from the same base type override the same Attribute and declare it as a supported one.

Attribute types