# A new representation for specifications source and website

**URL:** <https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347>\
**Category:** Specifications\
**Tags:** bmm, uml, specifications\
**Created:** [4 October 2026 18:25 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347 "2026-10-04T18:25:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [4 October 2026 18:25 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347/1 "2026-10-04T18:25:52Z")

</div>

As part of the [SPLASH platform](https://www.arssemantica.com/) I am working on, I have new tools that allow a source code representation of any model, called BMML, i.e. BMM4 Language. It is called BMM4 because it is some way ahead of [BMM3](https://specifications.openehr.org/releases/LANG/development/bmm3.html), which is that most recent development baseline in openEHR.

The [site is here](https://openehr.arssemantica.com/). See the home page for detailed explanations. The BMML source files may currently be found in [this Github repo](https://github.com/wolandscat/openehr-bmm).

The openEHR models for RM, BASE, LANG and AM are included, and all have generated UML diagrams via the PlantUML pathway. These diagrams are of variable visual quality compared to the MagicDraw ones whose visual arrangement was manually done, but since they are generated, they are semantically guaranteed to be correct.

I’m providing this site mainly for those interested in model representation and publishing.

---

<div class="post-metadata">

**Author:** ![Mohammad\_Zawahreh](https://discourse.openehr.org/user_avatar/discourse.openehr.org/mohammad_zawahreh/32/4425_2.png) [@Mohammad\_Zawahreh](https://discourse.openehr.org/u/Mohammad_Zawahreh)\
**Post date:** [5 October 2026 02:11 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347/2 "2026-10-05T02:11:38Z")

</div>

The new grammar is great and clean and it well suited for BMM, and I think it can even reduce a lot of the complexities that exist in the layer of persistence of bmm schemas.  
For first, it is more human readable and easy to understand than `JSON` or `ODIN` objects. Moreover, with this grammar that already support all details found in `BMM_{*}` classes, it would be possible to just load the schemas directly into memory **without** the need of intermediate layer i.e `P_BMM`.  
plus it now can open the door for using it as its own simple programming and language and maybe building its own runtime. specially with its own expression &statement language.

It currently fixes a lot of issues that are in the original `.bmm` just by that clean syntax, there are some missing function paramters though, like in `Interval` and `Container`, if I may assume:

- for the `Container` case: those functions have to do more with _agents as parameters_. It is still not supported in the BMML antlr4 grammars. So it might be added later.

- `Interval` case: is it due to the parameters being generic, like `has(e:T)` or `intersects(other: Interval<T>`), or is it maybe a generation bug?

Other observation is the naming of generic parameters of `Container<T>` later it is inherited by `Map<K, V>` and the `V` is substited with `T`, in BMMv3 it was stated that in such inheritance should have same name generic paramter. so will that rule be removed in SPLASH?

Thank you for your great work.

---

<div class="post-metadata">

**Author:** ![erik.sundvall](https://discourse.openehr.org/user_avatar/discourse.openehr.org/erik.sundvall/32/1961_2.png) [@erik.sundvall](https://discourse.openehr.org/u/erik.sundvall)\
**Post date:** [5 October 2026 08:35 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347/3 "2026-10-05T08:35:28Z")

</div>

Just to reduce risk of confusion, this is currently a community/private suggestion of how to represent openEHR, a bit like [NeoEHR](https://neoehr.com/openehr/uml) provided alternative ways of browsing the openEHR UML based on the open specifications.

The official specification is as usual found at: [https://specifications.openehr.org/](https://specifications.openehr.org/) and some (partly parallell) work has been done regarding converting parts of that site to Antora too.

(Now I’ll need to direct my agents to verify my [experimental openEHR typescript implementation, Ehrtslib](https://github.com/ErikSundvall/ehrtslib), using this BMM dialect too 🙂 )

P.s. @thomas.beale perhaps you could give the short version (a link or just 2-5 sentences) of why BMM was invented in the first place. I believe open UML dialects at the time (and perhaps still) could not express the details wanted.

---

<div class="post-metadata">

**Author:** ![erik.sundvall](https://discourse.openehr.org/user_avatar/discourse.openehr.org/erik.sundvall/32/1961_2.png) [@erik.sundvall](https://discourse.openehr.org/u/erik.sundvall)\
**Post date:** [5 October 2026 09:25 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347/4 "2026-10-05T09:25:46Z")

</div>

@thomas.beale when UML diagrams (like the one below) are extensive it is hard for end user to find a way to zoom in or bring into some kind of fullpage view. Also, beginners may misunderstand that “flat” in the tabs means including all things flattened from the inheritance tree, not sure how to solve, perhaps at least “flattened” helps a bit to not confuse it with openEHR’s simplified FLAT JSON format.

 ![image](https://discourse.openehr.org/uploads/default/original/2X/5/5973262c092f8d6ba13b39ce9c5195963c342bef.png)

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [5 October 2026 09:32 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347/5 "2026-10-05T09:32:56Z")

</div>

> [@Mohammad\_Zawahreh](#):
>
> it would be possible to just load the schemas directly into memory **without** the need of intermediate layer i.e `P_BMM`

Indeed, that was one of the goals. As you can see from the Git repo, it is all just .bmml files.

> [@Mohammad\_Zawahreh](#):
>
> open the door for using it as its own simple programming and language and maybe building its own runtime. specially with its own expression &statement language

The grammar for nearly all statement types, including DL decision tables is already done; an evaluator will take a bit more time.

> [@Mohammad\_Zawahreh](#):
>
> there are some missing function paramters though, like in `Interval` and `Container`

Yes, there were obviously some breakages in the machine-conversion. Thanks for reporting them, they are fixed now. (See here for [Container](https://openehr.arssemantica.com/openehr-doc/latest/representation/builtin_types-gen.html#_class_container)).

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [5 October 2026 10:10 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347/6 "2026-10-05T10:10:52Z")

</div>

> [@erik.sundvall](#):
>
> Just to reduce risk of confusion, this is currently a community/private suggestion of how to represent openEHR, a bit like [NeoEHR](https://neoehr.com/openehr/uml) provided alternative ways of browsing the openEHR UML based on the open specifications.

Exactly - this is some R&D work that I am reporting to obtain community reaction. All the normative releases are on the [https://specifications.openehr.org](https://specifications.openehr.org) site.

> [@erik.sundvall](#):
>
> P.s. @thomas.beale perhaps you could give the short version (a link or just 2-5 sentences) of why BMM was invented in the first place. I believe open UML dialects at the time (and perhaps still) could not express the details wanted.

Why BMM (originally):

- we had no way to computably represent our own models outside of XMI.
- XMI is/was a) unreadable XML for all practical purposes (it is full of UUIDs for one thing); b) not properly standardised (up to 9 different variants at one time - UML tools just couldn’t work with it)
- UML and XMI cannot represent generic types properly. This has become more important in recent years, as languages like Java, C#, Kotlin etc have greatly increased the use and power of generic typing.
- UML (and XMI) cannot represent lambdas or any other functional construct, yet these are also used ubiquitously these days
- Although UML / XMI could theoretically represent expressions (OCL) which we use for pre-, post-conditions and invariants, tools didn’t implement it, and it is not in wide use.
- we didn’t want to be tied to UML tools as the primary representation of models.

The official version of BMM does a fair bit of this, and is [reasonably human readable](https://specifications.openehr.org/releases/LANG/development/bmm_persistence.html#_bmm_persistence_syntax), as well as fully computable. But it was limited to the properties view of classes. A more recent JSON representation now represents (as strings, I think, I have not checked) functions, invariants and pre- and post-conditions.

[Detailed rundown of UML issues](https://wolandscat.net/the-long-slow-death-of-uml/).

SPLASH BMM (aka BMM4) adds more:

- there is a full expression language, using standard grammar constructs that you would find in most programming languages - this is fully parsed into a complete AST, and will be machine evaluable, just like in Typescript or Java (when I build the evaluator). This allows us to write code, i.e. algorithms - in AOM2, there are a lot of small algorithms specifying conformance etc (see below for example);
- there are also complex expressions like decision tables;
- beyond expressions, there are statements - allowing both programming in BMML, but also a much better representation of rules within archetypes;
- full representation of lambdas (e.g. `my_list.for_all (v -> v.is_valid)`), signatures (e.g. `(String) -> Boolean`), also symbolic representations of universal and existential quantification (e.g. `folders_valid: ∃folders ⇒ ∀ f:folders ¦ f.type.is_equal("VERSIONED_FOLDER")`)

Example of code, used to specify an [AOM2 algorithm](https://specifications.openehr.org/releases/AM/development/AOM2.html#_conformance_semantics_c_attribute):

```auto
    |
    | True if the cardinality of this node conforms to other.cardinality, if it exists
    |
    func cardinality_conforms_to (other: C_ATTRIBUTE): Boolean
        do
            Result := (∃cardinality ∧ ∃other.cardinality) ?
                other.cardinality.contains (cardinality) : True;
        ;

```

Oops. More than 5 lines…

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [5 October 2026 10:18 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347/7 "2026-10-05T10:18:40Z")

</div>

> [@erik.sundvall](#):
>
> UML diagrams (like the one below) are extensive it is hard for end user to find a way to zoom in or bring into some kind of fullpage view

Yes, this is a problem I have not solved - it.s not as easy as it should be within the Antora system. However, on Firefox, you can do `right click -> This Frame -> Show only this frame`. I don’t see any equivalent to that in Chrome.

> [@erik.sundvall](#):
>
> beginners may misunderstand that “flat” in the tabs means including all things flattened from the inheritance tree, not sure how to solve, perhaps at least “flattened” helps a bit to not confuse it with openEHR’s simplified FLAT JSON format

Good point, I forgot we are using the word ‘flat’ to mean something else. I might see if I can add some hover help and question mark icons or similar… or just put ‘flattened’, although I prefer to have short words…

---

<div class="post-metadata">

**Author:** ![Mohammad\_Zawahreh](https://discourse.openehr.org/user_avatar/discourse.openehr.org/mohammad_zawahreh/32/4425_2.png) [@Mohammad\_Zawahreh](https://discourse.openehr.org/u/Mohammad_Zawahreh)\
**Post date:** [5 October 2026 13:38 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347/8 "2026-10-05T13:38:05Z")

</div>

> [@thomas.beale](#):
>
> - there is a full expression language, using standard grammar constructs that you would find in most programming languages - this is fully parsed into a complete AST, and will be machine evaluable, just like in Typescript or Java (when I build the evaluator). This allows us to write code, i.e. algorithms - in AOM2, there are a lot of small algorithms specifying conformance etc (see below for example);

That is exactly the logic I am currently trying to implement, I am even trying to use it in the deserialisation itself (i.e from JSON).  
my strategy is as following:  
1- **BMML loader** that loads the file to an in memory BMM (implemented in C++, because it provide both classic OOP and also low level language).  
2- **model analysis** : create a lower representation for how each class memory layout should, and also build a dispatcher for all features functions and properties as setter and getters to support polymorphic dispatch in setters when there’s type narrowing when overriding.  
3- **execution** : evaluator or interpreter can be used to run anything, e.g object serialization: can take any object with `_type` property, create instance, and then evaluate assertions (of invariants) and inside it you can also dispatch functions. Similar thing with ADL.

So I have BMM-to-native binding layer and I can implement more complex logic in C++. I think that overall such strategy would allow more flexibilty for extending openehr classes in the future. and even more unification of tooling currently used.

I am not going to lie, it is not so easy because it is like basically building a small runtime, but i think it worth exploring. That is why I think that the idea of BMM would take the spec and expand it into a full-blown ecosystem.

---

<div class="post-metadata">

**Author:** ![Mohammad\_Zawahreh](https://discourse.openehr.org/user_avatar/discourse.openehr.org/mohammad_zawahreh/32/4425_2.png) [@Mohammad\_Zawahreh](https://discourse.openehr.org/u/Mohammad_Zawahreh)\
**Post date:** [6 October 2026 18:00 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347/9 "2026-10-06T18:00:09Z")

</div>

While experimenting with parsing bmml files it. there are some functions that cause problems in the process that take arguments as lamdas/agents, for example in AM there’s a function called

```auto
c_conforms_to (
   other: ARCHETYPE_CONSTRAINT,
   rmcc: (String, String) -> Boolean 
): Boolean

```

or even in `Container` class like `has` and `for_all`…etc. the reason for this bug is that there’s no support for lambdas/agent in the grammars in [bmml parser](https://github.com/openEHR/openEHR-antlr4/blob/master/reader_bmml/src/main/antlr/BmmlParser.g4) or [El parser](https://github.com/openEHR/openEHR-antlr4/blob/master/reader_common/src/main/antlr/ElParser.g4).

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [6 October 2026 21:17 UTC](https://discourse.openehr.org/t/a-new-representation-for-specifications-source-and-website/17347/10 "2026-10-06T21:17:23Z")

</div>

> [@Mohammad\_Zawahreh](#):
>
> the reason for this bug is that there’s no support for lambdas/agent in the grammars in [bmml parser](https://github.com/openEHR/openEHR-antlr4/blob/master/reader_bmml/src/main/antlr/BmmlParser.g4) or [El parser](https://github.com/openEHR/openEHR-antlr4/blob/master/reader_common/src/main/antlr/ElParser.g4).

Mohammed - I did not remember you were using those grammars - they are out of date. I copied in the current grammars for BMML, everything compiles. That should help.
