Aggregate data across nodes/edges

Aggregate data for nodes or edges in a project. You can use an optional query or filter specification to limit the result.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
Request Body schema: application/json
required

Aggregation specification.

query
string

Optional query string. The API will parse the query string, and use it to match the text properties on elements to use for the aggregate(s).

properties
Array of strings [ 1 .. 200 ] items

Optional list (array) of properties you want to apply the query above to. If you do not list any properties, you search through text fields by default.

limit
integer [ 1 .. 1000 ]
Default: 100

Limit the number of results returned. The default limit is currently at 100 items.

Array of avg (object) or count (object) or min (object) or max (object) or sum (object) or histogram (object) (AggregationDefinition) <= 5 items
groupBy
Array of strings [ 1 .. 5 ] items

The selection of fields to group the results by when doing aggregations. You can specify up to 5 items to group by.

When you do not specify any aggregates, the fields listed in the groupBy clause will return the unique values stored for each field.

(BoolFilter (and (object) or or (object) or not (object))) or (LeafFilter (equals (object) or in (object) or range (object) or prefix (object) or exists (object) or containsAny (object) or containsAll (object) or matchAll (object) or nested (object) or overlaps (object) or hasData (object))) (FilterDefinition)

A filter Domain Specific Language (DSL) used to create advanced filter queries.

instanceType
string (InstanceType)
Default: "node"

The type of instance

Enum: "node" "edge"
required
object (ViewReference)

Reference to a view

Array of objects (TargetUnits) [ 1 .. 10 ] items

Properties to convert to another unit. The API can only convert to another unit, if a unit has been defined as part of the type on the underlying container being queried.

includeTyping
boolean (IncludeTyping)
Default: false

Should we return property type information as part of the result?

Responses
200

Aggregated query results

400

The response for a failed request.

post/models/instances/aggregate
Request samples
application/json
{
  • "query": "string",
  • "properties": [
    • "string"
    ],
  • "limit": 100,
  • "aggregates": [
    • {
      }
    ],
  • "groupBy": [
    • "string"
    ],
  • "filter": {
    • "and": [
      ]
    },
  • "instanceType": "node",
  • "view": {
    • "type": "view",
    • "space": "string",
    • "externalId": "string",
    • "version": "string"
    },
  • "targetUnits": [
    • {
      }
    ],
  • "includeTyping": false
}
Response samples
application/json
{
  • "items": [
    • {
      }
    ],
  • "typing": {
    • "space-name1": {
      },
    • "space-name2": {
      }
    }
}