I’m parsing some ADL v1.4 using the very helpful antlr4 grammars and using an archetype from the CKM which can be downloaded in both XML and ADL to check how I’m doing. I have a question about the existence parameter.
The specification says “The default existence constraint, if none is shown, is {1..1}.” so I’d take the below snippet of cADL
However in the XML downloaded from CKM, the lower is 0, which doesn’t match the spec. My question is - have I found a bug in the CKM XML output, or is my interpretation of the spec/the spec itself wrong?
It’s not clear for me if you uploaded and downloaded the same archetype, and in the upload it was 1..1 and in the download it was 0..1. That’s a quick test to find if the issue is in the CKM.
The existence of events is not explicitly given in the ADL and thus my thought is that it should have 1..1 existence in the XML but this is not the case and it is 0..1.
In ADL 1.4, an unstated existence historically defaulted to 1..1 (mandatory) as you noted. However, modern interpretations and ADL 2 derive effective constraints and defaults directly from the underlying Reference Model (RM) or treat unstated constraints as optional/implicit.
If you want your ADL parser to be ready for ADL2, I suggest you also use the RM during parsing ADL 1.4. The defaults for HISTORY.events should be taken from the RM HISTORY class where they are optional.
Check the ADL 2.4 (experimental) radio button on the bottom of ADL tab in CKM. There is also ANTLR4 for ADL2.