Non existing constraints: closed or open interpretation?

David Moner damoca at gmail.com
Thu Jul 5 03:12:50 EDT 2018


El jue., 5 jul. 2018 a las 0:00, Pablo Pazos (<pablo.pazos at cabolabs.com>)
escribió:

> I know, but my case is not the use of ANY, is that no constraint is
> defined, it's just empty. The meaning of ANY or * is clear, but I think the
> meaning of absence of constraints is not so clear. This can affect
> implementation dramatically, since "open" interpretation is "I can add any
> content, even if it's not defined by the archetype/OPT", and the "closed"
> interpretation is "I can only add what's defined by the constraints. One
> case can be when OPTs have SLOTs, should those slots be resolved by
> software at runtime or should a specialization of that OPT define reference
> in the SLOT to have a concrete structure and no other content can be added
> at runtime.
>
> This is the case that troubles me. Because the "open" interpretation means
> that I can define an empty OPT with just a COMPOSITION, but no
> COMPOSITION.content definition, and at runtime I can put anything on the
> content and the instance will be valid against the OPT. Having ANY is a
> different case, as also having all nodes as optional would be another case
> (of course respecting the RM optional/required occurrences).
>
>
>>
>>
In my interpretation, not saying anything means no constraining anything,
including having a path with an empty content. Then the archetype
definition rules. The problem is not of the template, but a problem of the
root archetypes used for the template. If the COMPOSITION.content is open
in the archetype (with the presence of ANY at that point), and the template
doesn't further constraint it, then you have to accept anything from the RM
there. It is not a technical interpretation problem, but a problem of using
a badly designed archetype/template. I always say in my courses that
archetypes provide a great flexibility and power, but you have to accept
the consequences of a bad (or incomplete) archetype design.

This interpretation is also coherent with AOM/ADL 2. There the grammar
won't allow to have those empty definitions in a template.


-- 
David Moner Cano

Web: http://www.linkedin.com/in/davidmoner
Twitter: @davidmoner
Skype: davidmoner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openehr.org/pipermail/openehr-clinical_lists.openehr.org/attachments/20180705/c6156591/attachment.html>


More information about the openEHR-clinical mailing list