Skip to main content

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​

FieldTypeDescription
ckTypeIdCkTypeIdThe type identifier
descriptionStringDescription of the type
isAbstractBooleanWhether instances can be created
isFinalBooleanWhether the type can be extended
baseTypeCkTypeThe parent type (if any)
derivedTypesCkTypeConnectionTypes that extend this type
attributesCkTypeAttributeConnectionAttributes defined on this type
availableQueryColumnsAvailableQueryColumnConnectionAll queryable attribute paths
associationsCkTypeAssociationsAssociation definitions for this type

CkTypeAttribute​

FieldTypeDescription
attributeNameStringThe name of the attribute on this type
attributeValueTypeStringThe data type (STRING, INT32, DOUBLE, etc.)
ckAttributeIdCkAttributeIdReference to the attribute definition
isOptionalBooleanWhether the attribute is optional
autoCompleteValues[String]Predefined values for auto-complete
autoIncrementReferenceStringReference to auto-increment configuration

Multiplicity​

ValueDescription
ZERO_OR_ONEOptional single relationship (0..1)
ONERequired single relationship (1)
NMultiple relationships (0..*)