|
1 | 1 | = MPS solution for metamodel-export
|
2 | 2 | :navtitle: `metamodel-export` (MPS)
|
| 3 | + |
| 4 | +:tip-caption: 🔗 Quick Links |
| 5 | +[TIP] |
| 6 | +-- |
| 7 | +https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/metamodel-export/build.gradle.kts[buildfile^] | Artifacts: https://artifacts.itemis.cloud/service/rest/repository/browse/maven-mps/org/modelix/mps/metamodel-export/[Nexus^] https://github.com/modelix/modelix.core/packages/1834640[GitHub Packages^] |
| 8 | +-- |
| 9 | + |
| 10 | +== Overview |
| 11 | + |
| 12 | +In order to export a meta-model (i.e. the structure aspect of a langauge) from MPS, modelix uses the MPS solution `metamodel-export`. |
| 13 | +This solution maps the structure of a language to corresponding serializable data classes of the https://api.modelix.org/2.3.0/model-api/org.modelix.model.data/index.html[`model-api`] (e.g. `LanguageData` and `ConcepData`). |
| 14 | +Further, the `metamodel-expor` provides a command line interface to export these data classes to a JSON file from outside of MPS. |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +.Unfold to see an exemplary JSON file which is generated from the export |
| 19 | +[%collapsible] |
| 20 | +==== |
| 21 | +[,json] |
| 22 | +---- |
| 23 | +{ |
| 24 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca", |
| 25 | + "name": "University.Schedule", |
| 26 | + "concepts": [ |
| 27 | + { |
| 28 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010560", |
| 29 | + "name": "Lecture", |
| 30 | + "properties": [ |
| 31 | + { |
| 32 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010560/4128798754188010563", |
| 33 | + "name": "description" |
| 34 | + }, |
| 35 | + { |
| 36 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010560/4128798754188010565", |
| 37 | + "name": "maxParticipants", |
| 38 | + "type": "INT" |
| 39 | + } |
| 40 | + ], |
| 41 | + "children": [ |
| 42 | + { |
| 43 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010560/4128798754188058355", |
| 44 | + "name": "schedule", |
| 45 | + "type": "University.Schedule.Schedule", |
| 46 | + "optional": false |
| 47 | + } |
| 48 | + ], |
| 49 | + "references": [ |
| 50 | + { |
| 51 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010560/4128798754188058364", |
| 52 | + "name": "room", |
| 53 | + "type": "University.Schedule.Room", |
| 54 | + "optional": false |
| 55 | + } |
| 56 | + ], |
| 57 | + "extends": [ |
| 58 | + "jetbrains.mps.lang.core.BaseConcept", |
| 59 | + "jetbrains.mps.lang.core.INamedConcept" |
| 60 | + ] |
| 61 | + }, |
| 62 | + { |
| 63 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010568", |
| 64 | + "name": "Schedule", |
| 65 | + "abstract": true, |
| 66 | + "properties": [ |
| 67 | + ], |
| 68 | + "children": [ |
| 69 | + { |
| 70 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010568/4128798754188010578", |
| 71 | + "name": "at", |
| 72 | + "type": "University.Schedule.DateAndTime", |
| 73 | + "optional": false |
| 74 | + } |
| 75 | + ], |
| 76 | + "references": [ |
| 77 | + ], |
| 78 | + "extends": [ |
| 79 | + "jetbrains.mps.lang.core.BaseConcept" |
| 80 | + ] |
| 81 | + }, |
| 82 | + { |
| 83 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010569", |
| 84 | + "name": "Recurring", |
| 85 | + "properties": [ |
| 86 | + ], |
| 87 | + "children": [ |
| 88 | + ], |
| 89 | + "references": [ |
| 90 | + ], |
| 91 | + "extends": [ |
| 92 | + "University.Schedule.Schedule" |
| 93 | + ] |
| 94 | + }, |
| 95 | + { |
| 96 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010570", |
| 97 | + "name": "DateAndTime", |
| 98 | + "properties": [ |
| 99 | + { |
| 100 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010570/4128798754188010571", |
| 101 | + "name": "date" |
| 102 | + }, |
| 103 | + { |
| 104 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010570/4128798754188010573", |
| 105 | + "name": "time" |
| 106 | + } |
| 107 | + ], |
| 108 | + "children": [ |
| 109 | + ], |
| 110 | + "references": [ |
| 111 | + ], |
| 112 | + "extends": [ |
| 113 | + "jetbrains.mps.lang.core.BaseConcept" |
| 114 | + ] |
| 115 | + }, |
| 116 | + { |
| 117 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010580", |
| 118 | + "name": "Room", |
| 119 | + "properties": [ |
| 120 | + { |
| 121 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010580/4128798754188010583", |
| 122 | + "name": "maxPlaces", |
| 123 | + "type": "INT" |
| 124 | + }, |
| 125 | + { |
| 126 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010580/4128798754188010585", |
| 127 | + "name": "hasRemoteEquipment", |
| 128 | + "type": "BOOLEAN" |
| 129 | + } |
| 130 | + ], |
| 131 | + "children": [ |
| 132 | + ], |
| 133 | + "references": [ |
| 134 | + ], |
| 135 | + "extends": [ |
| 136 | + "jetbrains.mps.lang.core.BaseConcept", |
| 137 | + "jetbrains.mps.lang.core.INamedConcept" |
| 138 | + ] |
| 139 | + }, |
| 140 | + { |
| 141 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010588", |
| 142 | + "name": "Rooms", |
| 143 | + "properties": [ |
| 144 | + ], |
| 145 | + "children": [ |
| 146 | + { |
| 147 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010588/4128798754188010589", |
| 148 | + "name": "rooms", |
| 149 | + "type": "University.Schedule.Room", |
| 150 | + "multiple": true |
| 151 | + } |
| 152 | + ], |
| 153 | + "references": [ |
| 154 | + ], |
| 155 | + "extends": [ |
| 156 | + "jetbrains.mps.lang.core.BaseConcept" |
| 157 | + ] |
| 158 | + }, |
| 159 | + { |
| 160 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188057192", |
| 161 | + "name": "Courses", |
| 162 | + "properties": [ |
| 163 | + ], |
| 164 | + "children": [ |
| 165 | + { |
| 166 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188057192/4128798754188057193", |
| 167 | + "name": "lectures", |
| 168 | + "type": "University.Schedule.Lecture", |
| 169 | + "multiple": true |
| 170 | + } |
| 171 | + ], |
| 172 | + "references": [ |
| 173 | + ], |
| 174 | + "extends": [ |
| 175 | + "jetbrains.mps.lang.core.BaseConcept" |
| 176 | + ] |
| 177 | + }, |
| 178 | + { |
| 179 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188059567", |
| 180 | + "name": "OneOff", |
| 181 | + "properties": [ |
| 182 | + ], |
| 183 | + "children": [ |
| 184 | + ], |
| 185 | + "references": [ |
| 186 | + ], |
| 187 | + "extends": [ |
| 188 | + "University.Schedule.Schedule" |
| 189 | + ] |
| 190 | + }, |
| 191 | + { |
| 192 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048449", |
| 193 | + "name": "Student", |
| 194 | + "properties": [ |
| 195 | + { |
| 196 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048449/1648392019017048450", |
| 197 | + "name": "name" |
| 198 | + }, |
| 199 | + { |
| 200 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048449/1648392019017048454", |
| 201 | + "name": "semester", |
| 202 | + "type": "INT" |
| 203 | + } |
| 204 | + ], |
| 205 | + "children": [ |
| 206 | + { |
| 207 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048449/1648392019017048452", |
| 208 | + "name": "born", |
| 209 | + "type": "University.Schedule.DateAndTime", |
| 210 | + "optional": false |
| 211 | + } |
| 212 | + ], |
| 213 | + "references": [ |
| 214 | + ], |
| 215 | + "extends": [ |
| 216 | + "jetbrains.mps.lang.core.BaseConcept" |
| 217 | + ] |
| 218 | + }, |
| 219 | + { |
| 220 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048457", |
| 221 | + "name": "Students", |
| 222 | + "properties": [ |
| 223 | + ], |
| 224 | + "children": [ |
| 225 | + { |
| 226 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048457/1648392019017048458", |
| 227 | + "name": "students", |
| 228 | + "type": "University.Schedule.Student", |
| 229 | + "multiple": true |
| 230 | + } |
| 231 | + ], |
| 232 | + "references": [ |
| 233 | + ], |
| 234 | + "extends": [ |
| 235 | + "jetbrains.mps.lang.core.BaseConcept" |
| 236 | + ] |
| 237 | + }, |
| 238 | + { |
| 239 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048460", |
| 240 | + "name": "LectureAssignments", |
| 241 | + "properties": [ |
| 242 | + ], |
| 243 | + "children": [ |
| 244 | + { |
| 245 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048460/1648392019017048466", |
| 246 | + "name": "lectures", |
| 247 | + "type": "University.Schedule.Assignment", |
| 248 | + "multiple": true |
| 249 | + } |
| 250 | + ], |
| 251 | + "references": [ |
| 252 | + { |
| 253 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048460/1648392019017048461", |
| 254 | + "name": "student", |
| 255 | + "type": "University.Schedule.Student", |
| 256 | + "optional": false |
| 257 | + } |
| 258 | + ], |
| 259 | + "extends": [ |
| 260 | + "jetbrains.mps.lang.core.BaseConcept" |
| 261 | + ] |
| 262 | + }, |
| 263 | + { |
| 264 | + "uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048463", |
| 265 | + "name": "Assignment", |
| 266 | + "properties": [ |
| 267 | + ], |
| 268 | + "children": [ |
| 269 | + ], |
| 270 | + "references": [ |
| 271 | + { |
| 272 | + "uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048463/1648392019017048464", |
| 273 | + "name": "lecture", |
| 274 | + "type": "University.Schedule.Lecture", |
| 275 | + "optional": false |
| 276 | + } |
| 277 | + ], |
| 278 | + "extends": [ |
| 279 | + "jetbrains.mps.lang.core.BaseConcept" |
| 280 | + ] |
| 281 | + } |
| 282 | + ] |
| 283 | +} |
| 284 | +---- |
| 285 | +==== |
| 286 | + |
| 287 | + |
| 288 | +The `metamodel-export` is primarily intended to be used by the xref:core:reference/component-model-api-gen.adoc[]. |
| 289 | + |
0 commit comments