Types
Types define the structure of entities in the Runtime Model. Each type has attributes, can inherit from a base type, and can participate in associations with other types.
List Types
Retrieve all types:
query getCkTypes($after: String, $first: Int, $ckModelIds: [String]) {
constructionKit {
types(after: $after, first: $first, ckModelIds: $ckModelIds) {
totalCount
items {
ckTypeId {
fullName
semanticVersionedFullName
}
isAbstract
isFinal
baseType {
ckTypeId {
fullName
}
isAbstract
isFinal
}
}
}
}
}
Response
{
"data": {
"constructionKit": {
"types": {
"totalCount": 15,
"items": [
{
"ckTypeId": {
"fullName": "Industry.Energy-1.0.0/EnergyMeter-1",
"semanticVersionedFullName": "Industry.Energy/EnergyMeter"
},
"isAbstract": false,
"isFinal": false,
"baseType": {
"ckTypeId": {
"fullName": "System-1.0.3/Entity-1"
},
"isAbstract": true,
"isFinal": false
}
}
]
}
}
}
}
Type Details
Retrieve detailed information about a specific type:
query getCkTypeDetails($ckId: String) {
constructionKit {
types(ckId: $ckId) {
items {
ckTypeId {
fullName
semanticVersionedFullName
}
description
isAbstract
isFinal
baseType {
ckTypeId {
fullName
semanticVersionedFullName
}
isAbstract
isFinal
}
derivedTypes {
pageInfo {
endCursor
hasNextPage
}
items {
ckTypeId {
fullName
}
description
isAbstract
isFinal
}
}
availableQueryColumns {
pageInfo {
endCursor
hasNextPage
}
items {
attributePath
attributeValueType
}
}
}
}
}
}
Variables:
{
"ckId": "Industry.Energy-1.0.0/EnergyMeter-1"
}
Response
{
"data": {
"constructionKit": {
"types": {
"items": [
{
"ckTypeId": {
"fullName": "Industry.Energy-1.0.0/EnergyMeter-1",
"semanticVersionedFullName": "Industry.Energy/EnergyMeter"
},
"description": "An energy meter device",
"isAbstract": false,
"isFinal": false,
"baseType": {
"ckTypeId": {
"fullName": "System-1.0.3/Entity-1",
"semanticVersionedFullName": "System/Entity"
},
"isAbstract": true,
"isFinal": false
},
"derivedTypes": {
"pageInfo": {
"endCursor": null,
"hasNextPage": false
},
"items": [
{
"ckTypeId": {
"fullName": "Industry.Energy-1.0.0/SmartMeter-1"
},
"description": "A smart energy meter with remote reading capabilities",
"isAbstract": false,
"isFinal": false
}
]
},
"availableQueryColumns": {
"pageInfo": {
"endCursor": "YXJyYXljb25uZWN0aW9uOjk=",
"hasNextPage": true
},
"items": [
{ "attributePath": "rtId", "attributeValueType": "STRING" },
{ "attributePath": "name", "attributeValueType": "STRING" },
{ "attributePath": "voltage", "attributeValueType": "DOUBLE" },
{ "attributePath": "state", "attributeValueType": "ENUM" }
]
}
}
]
}
}
}
}
Type Attributes
Retrieve the attributes defined on a type:
query getCkTypeAttributes($after: String, $first: Int, $ckTypeId: String!) {
constructionKit {
types(ckId: $ckTypeId) {
items {
ckTypeId {
fullName
}
attributes(after: $after, first: $first) {
totalCount
pageInfo {
hasNextPage
endCursor
}
items {
attributeName
attributeValueType
autoCompleteValues
autoIncrementReference
ckAttributeId {
fullName
semanticVersionedFullName
}
isOptional
}
}
}
}
}
}
Variables:
{
"ckTypeId": "Industry.Energy-1.0.0/EnergyMeter-1"
}
Response
{
"data": {
"constructionKit": {
"types": {
"items": [
{
"ckTypeId": {
"fullName": "Industry.Energy-1.0.0/EnergyMeter-1"
},
"attributes": {
"totalCount": 5,
"pageInfo": {
"hasNextPage": false,
"endCursor": "YXJyYXljb25uZWN0aW9uOjQ="
},
"items": [
{
"attributeName": "name",
"attributeValueType": "STRING",
"autoCompleteValues": null,
"autoIncrementReference": null,
"ckAttributeId": {
"fullName": "Industry.Energy-1.0.0/Name-1",
"semanticVersionedFullName": "Industry.Energy/Name"
},
"isOptional": false
},
{
"attributeName": "voltage",
"attributeValueType": "DOUBLE",
"autoCompleteValues": null,
"autoIncrementReference": null,
"ckAttributeId": {
"fullName": "Industry.Energy-1.0.0/Voltage-1",
"semanticVersionedFullName": "Industry.Energy/Voltage"
},
"isOptional": true
}
]
}
}
]
}
}
}
}
Available Query Columns
Retrieve all queryable attribute paths for a type (including inherited and nested attributes):
query getCkTypeAvailableQueryColumns($ckId: String!, $filter: String, $first: Int, $after: String) {
constructionKit {
types(ckId: $ckId) {
items {
ckTypeId {
fullName
}
availableQueryColumns(
after: $after
first: $first
attributePathContains: $filter
) {
totalCount
pageInfo {
hasNextPage
endCursor
}
items {
attributePath
attributeValueType
}
}
}
}
}
}
Variables:
{
"ckId": "EnergyCommunity-1.0.0/Customer-1",
"filter": "contact",
"first": 10
}
Response
{
"data": {
"constructionKit": {
"types": {
"items": [
{
"ckTypeId": {
"fullName": "EnergyCommunity-1.0.0/Customer-1"
},
"availableQueryColumns": {
"totalCount": 8,
"pageInfo": {
"hasNextPage": false,
"endCursor": "YXJyYXljb25uZWN0aW9uOjc="
},
"items": [
{ "attributePath": "contact.firstName", "attributeValueType": "STRING" },
{ "attributePath": "contact.lastName", "attributeValueType": "STRING" },
{ "attributePath": "contact.companyName", "attributeValueType": "STRING" },
{ "attributePath": "contact.address.street", "attributeValueType": "STRING" },
{ "attributePath": "contact.address.cityTown", "attributeValueType": "STRING" },
{ "attributePath": "contact.address.zipcode", "attributeValueType": "INT32" }
]
}
}
]
}
}
}
}
Type Associations
Types can have associations to other types. Associations are organized by direction (inbound/outbound) and ownership (owned/inherited):
query getCkTypeAssociations($ckId: String) {
constructionKit {
types(ckId: $ckId) {
items {
ckTypeId {
fullName
}
associations {
out {
owned {
roleId {
fullName
}
navigationPropertyName
multiplicity
originCkTypeId {
fullName
}
targetCkTypeId {
fullName
}
}
inherited {
roleId {
fullName
}
navigationPropertyName
multiplicity
originCkTypeId {
fullName
}
targetCkTypeId {
fullName
}
}
}
in {
owned {
roleId {
fullName
}
navigationPropertyName
multiplicity
originCkTypeId {
fullName
}
targetCkTypeId {
fullName
}
}
inherited {
roleId {
fullName
}
navigationPropertyName
multiplicity
originCkTypeId {
fullName
}
targetCkTypeId {
fullName
}
}
}
}
}
}
}
}
Response
{
"data": {
"constructionKit": {
"types": {
"items": [
{
"ckTypeId": {
"fullName": "EnergyCommunity-1.0.0/Customer-1"
},
"associations": {
"out": {
"owned": [
{
"roleId": {
"fullName": "EnergyCommunity-1.0.0/AssociatedCustomer-1"
},
"navigationPropertyName": "facilities",
"multiplicity": "N",
"originCkTypeId": {
"fullName": "EnergyCommunity-1.0.0/Customer-1"
},
"targetCkTypeId": {
"fullName": "EnergyCommunity-1.0.0/OperatingFacility-1"
}
}
],
"inherited": []
},
"in": {
"owned": [],
"inherited": []
}
}
}
]
}
}
}
}
Type Fields
CkType
| Field | Type | Description |
|---|---|---|
ckTypeId | CkTypeId | The type identifier |
description | String | Description of the type |
isAbstract | Boolean | Whether instances can be created |
isFinal | Boolean | Whether the type can be extended |
baseType | CkType | The parent type (if any) |
derivedTypes | CkTypeConnection | Types that extend this type |
attributes | CkTypeAttributeConnection | Attributes defined on this type |
availableQueryColumns | AvailableQueryColumnConnection | All queryable attribute paths |
associations | CkTypeAssociations | Association definitions for this type |
CkTypeAttribute
| Field | Type | Description |
|---|---|---|
attributeName | String | The name of the attribute on this type |
attributeValueType | String | The data type (STRING, INT32, DOUBLE, etc.) |
ckAttributeId | CkAttributeId | Reference to the attribute definition |
isOptional | Boolean | Whether the attribute is optional |
autoCompleteValues | [String] | Predefined values for auto-complete |
autoIncrementReference | String | Reference to auto-increment configuration |
Multiplicity
| Value | Description |
|---|---|
ZERO_OR_ONE | Optional single relationship (0..1) |
ONE | Required single relationship (1) |
N | Multiple relationships (0..*) |