Skip to content

Commit 7dde05c

Browse files
author
Niko Stotz
committed
updated M3 docs according to #92, #90, #84, #78, #71
1 parent d5e17e8 commit 7dde05c

File tree

5 files changed

+39
-37
lines changed

5 files changed

+39
-37
lines changed

lioncore/metametamodel.adoc

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ EPackages have instead sub-packages and MPS Languages have virtual folders.
8484
For this use case, different Metamodels could be used instead.
8585

8686
.Characteristics
87-
A Metamodel has a [[Metamodel.name, Metamodel.name]]`name` and an [[Metamodel.id, Metamodel.id]]`id`, similarly to MPS Languages.
87+
A Metamodel has a [[Metamodel.name, Metamodel.name]]`name`, a [[Metamodel.key, Metamodel.key]]`key`, and a [[Metamodel.version, Metamodel.version]]`version`, similar to MPS Languages.
8888

8989
[[Metamodel.elements, Metamodel.elements]]
9090
Each Metamodel will contain a list of <<MetamodelElement, Metamodel elements>> in its `elements` containment.
@@ -112,7 +112,7 @@ Single entities could be Concept instances, such as Invoice #1/2022.
112112
A Concept is roughly equivalent to an `EClass` (with the `isInterface` flag set to `false`) or an MPS’s `ConceptDeclaration`.
113113

114114
.Characteristics
115-
A Concept has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
115+
A Concept has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
116116

117117
[[Concept.abstract, Concept.abstract]]
118118
A Concept can be concrete (i.e., instantiable) or abstract, marked by boolean `abstract` property.
@@ -144,7 +144,7 @@ For example, `Named` would be a ConceptInterface.
144144
A ConceptInterface in LionWeb will be roughly equivalent to an `EClass` (with the `isInterface` flag set to `true`) or an MPS’s `ConceptInterfaceDeclaration`.
145145

146146
.Characteristics
147-
A ConceptInterface has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
147+
A ConceptInterface has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
148148

149149
A ConceptInterface is an <<FeaturesContainer>> (as it has features).
150150
It is indirectly a <<MetamodelElement>> (as it is a top level element in a <<Metamodel>>), a <<NamespacedEntity>> (as it has an identity and it is contained in the namespace of the Metamodel), and a <<NamespaceProvider>> (as it act as the namespace for its features).
@@ -174,7 +174,7 @@ A PrimitiveType is similar to Ecore’s `EDataType` and to MPS’ `PrimitiveData
174174
Differently from ECore’s `EDataType` PrimitiveType has no flag `serializable`, and it does not inherit fields such as `instanceClassName`, `instanceClass`, or `defaultValue`.
175175

176176
.Characteristics
177-
A PrimitiveType has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
177+
A PrimitiveType has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
178178

179179
A PrimitiveType is a <<DataType>> (as it can be used as <<Property.type, type>> of a <<Property>>).
180180
It is indirectly a <<MetamodelElement>> (as it is a top level element in a <<Metamodel>>) and a <<NamespacedEntity>> (as it has an identity and it is contained in the namespace of the Metamodel).
@@ -197,7 +197,7 @@ An Enumeration is similar to Ecore’s `EEnum` and to MPS’ `EnumerationDeclara
197197
Differently from ECore’s `EEnum` Enumeration has no flag `serializable`, and it does not inherit fields such as `instanceClassName`, `instanceClass`, or `defaultValue`.
198198

199199
.Characteristics
200-
An Enumeration has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
200+
An Enumeration has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
201201

202202
[[Enumeration.literals, Enumeration.literals]]
203203
An Enumeration contains <<EnumerationLiteral, EnumerationLiterals>> in its `literals` containment.
@@ -219,7 +219,7 @@ _Monday_, _Tuesday_, _Wednesday_, _Thursday_, _Friday_, _Saturday_ and _Sunday_
219219
An EnumerationLiteral is similar to Ecore’s `EEnumLiteral` and to MPS’ `EnumerationMemberDeclaration`.
220220

221221
.Characteristics
222-
An EnumerationLiteral has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
222+
An EnumerationLiteral has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
223223

224224
An Enumeration is a <<NamespacedEntity>> (as it has an identity and it is contained in the namespace of its <<Enumeration>>).
225225

@@ -283,7 +283,7 @@ A Containment is similar to an MPS’s `LinkDeclaration` with `metaClass` having
283283
Differently from a `LinkDeclaration` there is no field `unordered`.
284284

285285
.Characteristics
286-
A Containment has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
286+
A Containment has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
287287
It can be marked as <<Feature.optional, `optional`>> and <<Link.multiple, `multiple`>>.
288288

289289
A Containment refers its <<Link.type, `type`>>, which is a <<FeaturesContainer>>.
@@ -316,7 +316,7 @@ A Reference is similar to an MPS’s `LinkDeclaration` with `metaClass` having v
316316
Differently from a `LinkDeclaration` there is no field `unordered`.
317317

318318
.Characteristics
319-
A Reference has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
319+
A Reference has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
320320
It can be marked as <<Feature.optional, `optional`>> and <<Link.multiple, `multiple`>>.
321321

322322
A Containment refers its <<Link.type, `type`>>, which is a <<FeaturesContainer>>.
@@ -346,7 +346,7 @@ A Property is similar to Ecore’s `EAttribute`.
346346
A Property is similar to MPS’s `AttributeDeclaration`.
347347

348348
.Characteristics
349-
A Property has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
349+
A Property has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
350350
It can be marked as <<Feature.optional, `optional`>>.
351351

352352
[[Property.type, Property.type]]
@@ -374,16 +374,16 @@ Therefore, _Invoice_ will have the qualifiedName `com.foo.Accounting.Invoice`.
374374
n/a
375375

376376
.Characteristics
377-
[[NamespacedEntity.simpleName, NamespacedEntity.simpleName]]
378-
A NamespacedEntity has a `simpleName`.
377+
[[NamespacedEntity.name, NamespacedEntity.name]]
378+
A NamespacedEntity has a `name`.
379379

380-
[[NamespacedEntity.id, NamespacedEntity.id]]
381-
A NamespacedEntity has an `id`.
382-
383-
It can calculate the `qualifiedName` by combining the name of the namespace, which it can obtain from its own <<NamespaceProvider>>.
380+
[[NamespacedEntity.key, NamespacedEntity.key]]
381+
A NamespacedEntity has an `key`.
384382

385383
.Constraints
386-
A NamespaceEntity's `simpleName` must be unique within the NamespaceProvider.
384+
A NamespaceEntity's `name` must be unique within the NamespaceProvider.
385+
A NamespaceEntity's `key` must be unique within the Metamodel.
386+
387387

388388
[[MetamodelElement]]
389389
==== MetamodelElement
@@ -399,7 +399,7 @@ MetamodelElement is similar to MPS’ `IStructureElement`.
399399
The difference is that `IStructureElement` includes also elements that cannot appear as top level elements of a structure aspects, such as `LinkDeclaration`, `PropertyDeclaration`, and `EnumerationMemberDeclaration`.
400400

401401
.Characteristics
402-
A MetamodelElement has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
402+
A MetamodelElement has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
403403

404404
A MetamodelElement is a <<NamespacedEntity>> (as it has an identity and it is contained in the namespace of its <<Metamodel>>).
405405

@@ -429,7 +429,7 @@ A Concept can have several features.
429429
FeaturesContainer is similar to `EClass` in Ecore (which is used both for classes and interfaces) and to `AbstractConceptDeclaration` in MPS.
430430

431431
.Characteristics
432-
A FeaturesContainer has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
432+
A FeaturesContainer has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
433433

434434
[[FeaturesContainer.features, FeaturesContainer.features]]
435435
A FeaturesContainer owns any number of <<Feature, Features>> in `features` containment.
@@ -459,7 +459,7 @@ It is similar to Ecore’s `EDataType`.
459459
It is similar to MPS’ `DataTypeDeclaration`.
460460

461461
.Characteristics
462-
A DataType has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
462+
A DataType has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
463463

464464
A DataType is a <<MetamodelElement>> (as it is a top level element in a <<Metamodel>>).
465465
It is indirectly a <<NamespacedEntity>> (as it has an identity and it is contained in the namespace of the Metamodel).
@@ -487,7 +487,7 @@ Differently from Ecore’s `EStructureFeature`, Features do not have flags such
487487
They have no `default value`.
488488

489489
.Characteristics
490-
A Feature has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
490+
A Feature has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
491491

492492
[[Feature.optional, Feature.optional]]
493493
A Feature can be set to `optional` or required.
@@ -526,7 +526,7 @@ It is similar to Ecore’s `EReference`.
526526
It is similar to MPS’ `LinkDeclaration`.
527527

528528
.Characteristics
529-
A Link has a <<NamespacedEntity.simpleName, `simpleName`>> and an <<NamespacedEntity.id, `id`>>.
529+
A Link has a <<NamespacedEntity.name, `name`>> and an <<NamespacedEntity.key, `key`>>.
530530
It can be marked as <<Feature.optional, `optional`>>.
531531

532532
[[Link.multiple, Link.multiple]]
@@ -596,7 +596,8 @@ TBD
596596

597597
=== Pre-defined concepts
598598

599-
`BaseConcept`, a <<Concept>> that's the (explicit or implicit) the ancestor of all concepts.
599+
[[Node]]
600+
`Node`, an _abstract_ <<Concept>> that's the (explicit or implicit) the ancestor of all concepts.
600601

601602
=== Pre-defined primitive types
602603

@@ -690,11 +691,11 @@ An implementation might choose to use hierarchical id-spaces internally.
690691
A node can be identified relative to its id-space by the node's id.
691692
To globally identify a node, we use the combination of the id-space id and the node id.
692693

693-
==== Ids of M3 Elements
694+
==== Keys of M3 Elements
694695

695696
[cols="d,d,m"]
696697
|===
697-
|M3 element |Concept |Id
698+
|M3 element |Concept |Key
698699

699700
|<<Concept>> |Concept |LIonCore_M3_Concept
700701
|<<Concept.abstract>> |Property |LIonCore_M3_Concept_abstract
@@ -716,13 +717,13 @@ To globally identify a node, we use the combination of the id-space id and the n
716717
|<<Link.type>> |Reference |LIonCore_M3_Link_type
717718
|<<Metamodel>> |Concept |LIonCore_M3_Metamodel
718719
|<<Metamodel.name>> |Property |LIonCore_M3_Metamodel_name
719-
|<<Metamodel.id>> |Property |LIonCore_M3_Metamodel_id
720+
|<<Metamodel.key>> |Property |LIonCore_M3_Metamodel_key
720721
|<<Metamodel.dependsOn>> |Reference |LIonCore_M3_Metamodel_dependsOn
721722
|<<Metamodel.elements>> |Containment |LIonCore_M3_Metamodel_elements
722723
|<<MetamodelElement>> |Concept |LIonCore_M3_MetamodelElement
723724
|<<NamespacedEntity>> |Concept |LIonCore_M3_NamespacedEntity
724-
|<<NamespacedEntity.simpleName>> |Property |LIonCore_M3_NamespacedEntity_simpleName
725-
|<<NamespacedEntity.id>> |Property |LIonCore_M3_NamespacedEntity_id
725+
|<<NamespacedEntity.name>> |Property |LIonCore_M3_NamespacedEntity_name
726+
|<<NamespacedEntity.key>> |Property |LIonCore_M3_NamespacedEntity_key
726727
|<<NamespaceProvider>> |Concept |LIonCore_M3_NamespaceProvider
727728
|<<PrimitiveType>> |Concept |LIonCore_M3_PrimitiveType
728729
|<<Property>> |Concept |LIonCore_M3_Property
@@ -740,6 +741,7 @@ To globally identify a node, we use the combination of the id-space id and the n
740741
|<<Boolean>> |PrimitiveType |LIonCore_M3_Boolean
741742
|<<Integer>> |PrimitiveType |LIonCore_M3_Integer
742743
|<<JSON>> |PrimitiveType |LIonCore_M3_JSON
744+
|<<Node>> |Concept |LIonCore_M3_Node
743745
|===
744746

745747

lioncore/metametamodel.mermaid

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ Feature <|-- Link
4343

4444
class Metamodel {
4545
String name
46-
Id id
46+
Id key
47+
Integer version
4748
}
4849
NamespaceProvider <|.. Metamodel
4950

@@ -52,9 +53,8 @@ class MetamodelElement
5253
NamespacedEntity <|-- MetamodelElement
5354

5455
class NamespacedEntity {
55-
String simpleName
56-
qualifiedName() String
57-
Id id
56+
String name
57+
Id key
5858
}
5959
<<abstract>> NamespacedEntity
6060

lioncore/metametamodel.puml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ abstract class Link #LightBlue extends Feature {
2929

3030
class Metamodel implements NamespaceProvider {
3131
name: String
32-
id: Id
32+
key: Id
33+
version: Integer
3334
}
3435

3536
abstract class MetamodelElement implements NamespacedEntity
3637

3738
abstract class NamespacedEntity {
38-
simpleName: String
39-
qualifiedName(): String
40-
id: Id
39+
name: String
40+
key: Id
4141
}
4242

4343
interface NamespaceProvider {

lioncore/rendered/metametamodel.svg

Lines changed: 1 addition & 1 deletion
Loading

lioncore/rendered/metametamodel_simplified.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)