Skip to main content

Models

Models are containers that group related types, attributes, enums, and records. Each model has a name, version, and can depend on other models.

List Models

Retrieve all available models:

query getCkModels($after: String, $first: Int) {
constructionKit {
models(after: $after, first: $first) {
totalCount
items {
id {
name
version
fullName
semanticVersionedFullName
}
modelState
dependencies {
fullName
}
}
}
}
}

Response

{
"data": {
"constructionKit": {
"models": {
"totalCount": 5,
"items": [
{
"id": {
"name": "Industry.Energy",
"version": 1,
"fullName": "Industry.Energy-1",
"semanticVersionedFullName": "Industry.Energy"
},
"modelState": "AVAILABLE",
"dependencies": [
{
"fullName": "Basic-1"
}
]
}
]
}
}
}
}

Filter by Model ID

Retrieve a specific model by its ID:

query {
constructionKit {
models(ckId: "Industry.Energy-1") {
items {
id {
name
version
fullName
}
modelState
dependencies {
fullName
}
}
}
}
}

Filter by Model State

Retrieve only available models:

query {
constructionKit {
models(
fieldFilter: [
{ attributePath: "modelState", operator: EQUALS, comparisonValue: "AVAILABLE" }
]
) {
items {
id {
fullName
}
modelState
}
}
}
}

Model Details

Retrieve detailed information about a model including its types, attributes, and enums:

query getCkModelDetails($model: SimpleScalar!) {
constructionKit {
models(
fieldFilter: [
{ attributePath: "modelState", operator: EQUALS, comparisonValue: "AVAILABLE" }
{ attributePath: "modelId", operator: EQUALS, comparisonValue: $model }
]
) {
items {
id {
name
version
fullName
semanticVersionedFullName
}
modelState
types {
totalCount
items {
ckTypeId {
fullName
semanticVersionedFullName
}
}
}
attributes {
totalCount
items {
ckAttributeId {
fullName
semanticVersionedFullName
}
}
}
enums {
totalCount
items {
ckEnumId {
fullName
semanticVersionedFullName
}
}
}
records {
totalCount
items {
ckRecordId {
fullName
semanticVersionedFullName
}
}
}
dependencies {
fullName
}
}
}
}
}

Variables:

{
"model": "Industry.Energy-1"
}

Response

{
"data": {
"constructionKit": {
"models": {
"items": [
{
"id": {
"name": "Industry.Energy",
"version": 1,
"fullName": "Industry.Energy-1",
"semanticVersionedFullName": "Industry.Energy"
},
"modelState": "AVAILABLE",
"types": {
"totalCount": 3,
"items": [
{ "ckTypeId": { "fullName": "Industry.Energy-1.0.0/EnergyMeter-1", "semanticVersionedFullName": "Industry.Energy/EnergyMeter" } },
{ "ckTypeId": { "fullName": "Industry.Energy-1.0.0/PowerPlant-1", "semanticVersionedFullName": "Industry.Energy/PowerPlant" } }
]
},
"attributes": {
"totalCount": 5,
"items": [
{ "ckAttributeId": { "fullName": "Industry.Energy-1.0.0/Voltage-1", "semanticVersionedFullName": "Industry.Energy/Voltage" } }
]
},
"enums": {
"totalCount": 2,
"items": [
{ "ckEnumId": { "fullName": "Industry.Energy-1.0.0/EnergyMeterState-1", "semanticVersionedFullName": "Industry.Energy/EnergyMeterState" } }
]
},
"records": {
"totalCount": 0,
"items": []
},
"dependencies": [
{ "fullName": "Basic-1" }
]
}
]
}
}
}
}

Model Fields

CkModelId

FieldTypeDescription
nameStringThe model name (e.g., Industry.Energy)
versionIntThe model version number
fullNameStringCombined name and version (e.g., Industry.Energy-1)
semanticVersionedFullNameStringSemantic name without version (e.g., Industry.Energy)

Model

FieldTypeDescription
idCkModelIdThe model identifier
modelStateModelStateCurrent state of the model
dependencies[CkModelId]Models this model depends on
typesCkTypeConnectionTypes defined in this model
attributesCkAttributeConnectionAttributes defined in this model
enumsCkEnumConnectionEnums defined in this model
recordsCkRecordConnectionRecords defined in this model

ModelState

ValueDescription
AVAILABLEModel is active and can be used
IMPORTINGModel is getting imported currently
RESOLVE_FAILEDModel dependencies cannot be resolved, so the model is disabled.