-
Key: KERML11-88
-
Status: open Implementation work Blocked
-
Source: Dassault Systemes ( Mrs. Gintare Krisciuniene)
-
Summary:
Currently the only possibility to retrieve metadata of the model element is to use indicate element by specifying its (possibly qualified)name in conjunction with .metadata or meta SomeType syntax.
During profile building there is a necessity to retrieve metadata of model element that is indicated (somewhat) dynamically – by navigating from current model element (given by annotatedElement).
This is currently not possible.
Another use case is to check two stereotypes in the view expose filtering conditions. Currently the metadata is fed into the filtering conditions one by one, separately (thus if you have model element E with two metadatas applied: #M1 #M2, then filtering condition is invoked 3 times – once for the “primary” metadata of E, and once for each metadata application). And writing a filter which checks two stereotype applications is impossible as you need some facility to jump/navigate from one metadata to another
Thus:
1) Some operation or some syntactic structure shall be introduced that takes model element (as a metadata value) as input and returns it’s other metadatas. This operation is model-level evaluable.
2) Reference implementation shall be able to evaluate this operation – whether used in assert constraints or view expose filters
3) A test case in the conformance WG should check both cases – usage in assert constraints and usage in view expose filters
Example1 (assert constraints at meta level):
/**** Some domain library - e.g. UAF *****/metadata def M1;
metadata def M2;metadata def CheckOwnerStereo:> Metaobjects::SemanticMetadata{
{ RETRIEVEMETADATA(annotatedElement.owner) @M1;//check if owner is stereotyped by M1 }
:>> annotatedElement: KerML::Type;
assert constraint ownerMustBeM1}
/****** User Model ******/
#M1 part def GoodParent
{ #CheckOwnerStereo part p1;//succeed }part def BadParent
{ #CheckOwnerStereo part p2;//fail }Example2 (view expose filters):
{ part def notStereotyped; #M1 part def singlyStereotyped1; #M2 part def singlyStereotyped2; #M1 #M2 part def doublyStereotyped; }
/*********User Model Example with Exposes ***********/
package Containerview v
{ export Container::*; filter (RETRIEVEMETADATA(self @SysML::PartDefinition) @M1) and (RETRIEVEMETADATA(self @SysML::PartDefinition) @M2);//only pick up the doublyStereotyped }Expectation – make RETRIEVEMETADATA possible – by any syntactic means necessary
-
Reported: KerML 1.0 — Fri, 10 Oct 2025 14:38 GMT
-
Updated: Fri, 10 Oct 2025 15:42 GMT
KERML11 — Dynamic Metadata Retrieval
- Key: KERML11-88
- OMG Task Force: Kernel Modeling Language (KerML) 1.1 RTF