Skip to main content

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

FieldTypeDescription
ckAttributeIdCkAttributeIdThe attribute identifier
descriptionStringDescription of the attribute
attributeValueTypeStringThe data type (STRING, INT32, ENUM, RECORD, etc.)
defaultValues[SimpleScalar]Default values for the attribute
ckEnumCkEnumEnum definition (if attributeValueType is ENUM)
ckRecordCkRecordRecord definition (if attributeValueType is RECORD)

Attribute Value Types

ValueDescription
STRINGText value
INT3232-bit integer
INT6464-bit integer
FLOATFloating-point number
DOUBLEDouble-precision floating-point number
BOOLEANTrue/false value
DATE_TIMEDate and time value
BINARYBinary data (Base64 encoded)
OBJECT_IDMongoDB ObjectId reference
ENUMEnumeration value (see linked ckEnum)
RECORDEmbedded record (see linked ckRecord)
GEO_JSONGeospatial data in GeoJSON format