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
| Field | Type | Description |
|---|---|---|
name | String | The model name (e.g., Industry.Energy) |
version | Int | The model version number |
fullName | String | Combined name and version (e.g., Industry.Energy-1) |
semanticVersionedFullName | String | Semantic name without version (e.g., Industry.Energy) |
Model
| Field | Type | Description |
|---|---|---|
id | CkModelId | The model identifier |
modelState | ModelState | Current state of the model |
dependencies | [CkModelId] | Models this model depends on |
types | CkTypeConnection | Types defined in this model |
attributes | CkAttributeConnection | Attributes defined in this model |
enums | CkEnumConnection | Enums defined in this model |
records | CkRecordConnection | Records defined in this model |
ModelState
| Value | Description |
|---|---|
AVAILABLE | Model is active and can be used |
IMPORTING | Model is getting imported currently |
RESOLVE_FAILED | Model dependencies cannot be resolved, so the model is disabled. |