Attributes
Attributes are reusable property definitions that can be applied to types. Each attribute has a value type and optional constraints.
List Attributes
Retrieve all attributes:
query getCkAttributes($after: String, $first: Int, $ckModelIds: [String]) {
constructionKit {
attributes(after: $after, first: $first, ckModelIds: $ckModelIds) {
totalCount
items {
ckAttributeId {
fullName
semanticVersionedFullName
}
attributeValueType
}
}
}
}
Response
{
"data": {
"constructionKit": {
"attributes": {
"totalCount": 25,
"items": [
{
"ckAttributeId": {
"fullName": "Basic-1.0.0/Name-1",
"semanticVersionedFullName": "Basic/Name"
},
"attributeValueType": "STRING"
},
{
"ckAttributeId": {
"fullName": "Industry.Energy-1.0.0/Voltage-1",
"semanticVersionedFullName": "Industry.Energy/Voltage"
},
"attributeValueType": "DOUBLE"
}
]
}
}
}
}
Filter by Model
Retrieve attributes from specific models:
query {
constructionKit {
attributes(ckModelIds: ["Industry.Energy-1"]) {
totalCount
items {
ckAttributeId {
fullName
}
attributeValueType
}
}
}
}
Attribute Details
Retrieve detailed information about a specific attribute:
query getCkAttributeDetails($attributeId: String) {
constructionKit {
attributes(ckId: $attributeId) {
items {
ckAttributeId {
fullName
semanticVersionedFullName
}
description
attributeValueType
defaultValues
ckEnum {
ckEnumId {
fullName
semanticVersionedFullName
}
useFlags
isExtensible
values {
key
name
description
isExtension
}
}
ckRecord {
ckRecordId {
fullName
semanticVersionedFullName
}
isAbstract
isFinal
}
}
}
}
}
Variables:
{
"attributeId": "Industry.Energy-1.0.0/State-1"
}
Response for Enum Attribute
{
"data": {
"constructionKit": {
"attributes": {
"items": [
{
"ckAttributeId": {
"fullName": "Industry.Energy-1.0.0/State-1",
"semanticVersionedFullName": "Industry.Energy/State"
},
"description": "The operational state of the energy meter",
"attributeValueType": "ENUM",
"defaultValues": null,
"ckEnum": {
"ckEnumId": {
"fullName": "Industry.Energy-1.0.0/EnergyMeterState-1",
"semanticVersionedFullName": "Industry.Energy/EnergyMeterState"
},
"useFlags": false,
"isExtensible": false,
"values": [
{ "key": 0, "name": "OFF", "description": "Meter is off", "isExtension": false },
{ "key": 1, "name": "ON", "description": "Meter is on", "isExtension": false },
{ "key": 2, "name": "STANDBY", "description": "Meter is in standby", "isExtension": false }
]
},
"ckRecord": null
}
]
}
}
}
}
Response for Record Attribute
{
"data": {
"constructionKit": {
"attributes": {
"items": [
{
"ckAttributeId": {
"fullName": "Basic-1.0.0/Contact-1",
"semanticVersionedFullName": "Basic/Contact"
},
"description": "Contact information",
"attributeValueType": "RECORD",
"defaultValues": null,
"ckEnum": null,
"ckRecord": {
"ckRecordId": {
"fullName": "Basic-1.0.0/Contact-1",
"semanticVersionedFullName": "Basic/Contact"
},
"isAbstract": false,
"isFinal": false
}
}
]
}
}
}
}
Search Attributes
Search for attributes by name:
query {
constructionKit {
attributes(
searchFilter: {
searchTerm: "voltage"
type: ATTRIBUTE_FILTER
attributePaths: ["ckAttributeId.fullName"]
}
) {
items {
ckAttributeId {
fullName
}
attributeValueType
}
}
}
}
Attribute Fields
CkAttribute
| Field | Type | Description |
|---|---|---|
ckAttributeId | CkAttributeId | The attribute identifier |
description | String | Description of the attribute |
attributeValueType | String | The data type (STRING, INT32, ENUM, RECORD, etc.) |
defaultValues | [SimpleScalar] | Default values for the attribute |
ckEnum | CkEnum | Enum definition (if attributeValueType is ENUM) |
ckRecord | CkRecord | Record definition (if attributeValueType is RECORD) |
Attribute Value Types
| Value | Description |
|---|---|
STRING | Text value |
INT32 | 32-bit integer |
INT64 | 64-bit integer |
FLOAT | Floating-point number |
DOUBLE | Double-precision floating-point number |
BOOLEAN | True/false value |
DATE_TIME | Date and time value |
BINARY | Binary data (Base64 encoded) |
OBJECT_ID | MongoDB ObjectId reference |
ENUM | Enumeration value (see linked ckEnum) |
RECORD | Embedded record (see linked ckRecord) |
GEO_JSON | Geospatial data in GeoJSON format |