Ontology

Object types

Define the objects your organisation works with.

An object type maps a dataset to a kind of real-world object.

Properties

Each object type has a primary key and a set of typed properties. Supported property types include string, integer, long, short, byte, float, double, decimal, boolean, date, timestamp, geopoint, geoshape, array, struct, vector, attachment, media, marking, cipherText and timeSeries.

Reducers and main values

An array property can name reducers, which pick the element shown for the array. Each one is { "reducer": ..., "field": ... }, with the reducer depending on arraySubType: highest or lowest for numbers, most_recent or least_recent for dates and timestamps, first or last for strings, true_first or false_first for booleans. A struct array (arraySubType: "struct") also names the struct field the reducer compares. Later reducers break ties left by earlier ones.

A struct property can name a mainValue: 1 to 10 of its structFields, the part a client reads when it asks for the main value. A struct array can do the same once it lists its element structFields:

{ "name": "visits", "dataType": "array", "arraySubType": "struct",
  "structFields": [{ "name": "at", "dataType": "date" }, { "name": "site", "dataType": "string" }],
  "reducers": [{ "reducer": "most_recent", "field": "at" }],
  "mainValue": ["site"] }

Neither setting changes the stored data. Filters, sorting and aggregations always use the full value. Reads keep the full value under the property name and add the reduced element under $reducedProperties. A client asks for the reduced or main value per property with applyModifiers on search and objectSets/loadObjects (in the SDKs, $applyModifiers and apply_modifiers=). The object type metadata shows the configuration in Converge's shape: reducers: [{ direction, field }] on the array type and mainValue: { fields, mainValueType } on the struct type.

Status

An object type has a status: EXPERIMENTAL, ACTIVE, DEPRECATED, EXAMPLE or PROMOTED. Once a type is ACTIVE or PROMOTED, its API name, properties and primary key are locked and it cannot be deleted, so applications that depend on it keep working.

Working with objects

Applications and the API can list, search, filter, aggregate and count objects:

MethodPathDoes
GET/api/v2/ontologiesList ontologies
GET/api/v2/ontologies/{ontology}/objects/{objectType}List objects
POST/api/v2/ontologies/{ontology}/objects/{objectType}/searchSearch with filters
POST/api/v2/ontologies/{ontology}/objects/{objectType}/aggregateAggregate

Object sets let you compose searches and reuse them.

Authoring

Object types are created and edited in Ontology Manager, or through POST /api/v2/ontologies/{ontology}/objectTypes and POST …/objectTypes/{apiName}/publish. Authoring requires a builder role.

Converge