Aggregate data for nodes or edges in a project. You can use an optional query or filter specification to limit the result.
Aggregation specification.
Aggregated query results
The response for a failed request.
from cognite.client.data_classes.data_modeling import ViewId, aggregations as aggs avg_run_time = aggs.Avg("runTimeMinutes") view_id = ViewId("mySpace", "PersonView", "v1") res = client.data_modeling.instances.aggregate(view_id, avg_run_time, group_by="releaseYear") from cognite.client.data_classes.data_modeling import aggregations as aggs, ViewId birth_by_decade = aggs.Histogram("birthYear", interval=10.0) view_id = ViewId("mySpace", "PersonView", "v1") res = client.data_modeling.instances.histogram(view_id, birth_by_decade)
{- "items": [
- {
- "instanceType": "node",
- "group": {
- "name": "PumpName1",
- "tag": "tag01"
}, - "aggregates": [
- {
- "aggregate": "avg",
- "property": "duration",
- "value": 0.2
}
]
}
], - "typing": {
- "space-name1": {
- "view-or-container-external-id1": {
- "property-identifier1": {
- "immutable": false,
- "nullable": true,
- "autoIncrement": false,
- "defaultValue": "string",
- "description": "string",
- "name": "string",
- "type": {
- "type": "text",
- "list": false,
- "maxListSize": 0,
- "collation": "ucs_basic"
}
}, - "property-identifier2": {
- "immutable": false,
- "nullable": true,
- "autoIncrement": false,
- "defaultValue": "string",
- "description": "string",
- "name": "string",
- "type": {
- "type": "text",
- "list": false,
- "maxListSize": 0,
- "collation": "ucs_basic"
}
}
}, - "view-or-container-external-id2": {
- "property-identifier1": {
- "immutable": false,
- "nullable": true,
- "autoIncrement": false,
- "defaultValue": "string",
- "description": "string",
- "name": "string",
- "type": {
- "type": "text",
- "list": false,
- "maxListSize": 0,
- "collation": "ucs_basic"
}
}, - "property-identifier2": {
- "immutable": false,
- "nullable": true,
- "autoIncrement": false,
- "defaultValue": "string",
- "description": "string",
- "name": "string",
- "type": {
- "type": "text",
- "list": false,
- "maxListSize": 0,
- "collation": "ucs_basic"
}
}
}
}, - "space-name2": {
- "view-or-container-external-id1": {
- "property-identifier1": {
- "immutable": false,
- "nullable": true,
- "autoIncrement": false,
- "defaultValue": "string",
- "description": "string",
- "name": "string",
- "type": {
- "type": "text",
- "list": false,
- "maxListSize": 0,
- "collation": "ucs_basic"
}
}, - "property-identifier2": {
- "immutable": false,
- "nullable": true,
- "autoIncrement": false,
- "defaultValue": "string",
- "description": "string",
- "name": "string",
- "type": {
- "type": "text",
- "list": false,
- "maxListSize": 0,
- "collation": "ucs_basic"
}
}
}, - "view-or-container-external-id2": {
- "property-identifier1": {
- "immutable": false,
- "nullable": true,
- "autoIncrement": false,
- "defaultValue": "string",
- "description": "string",
- "name": "string",
- "type": {
- "type": "text",
- "list": false,
- "maxListSize": 0,
- "collation": "ucs_basic"
}
}, - "property-identifier2": {
- "immutable": false,
- "nullable": true,
- "autoIncrement": false,
- "defaultValue": "string",
- "description": "string",
- "name": "string",
- "type": {
- "type": "text",
- "list": false,
- "maxListSize": 0,
- "collation": "ucs_basic"
}
}
}
}
}
}