On 15/05/2014 17:51, Bert Verhees wrote:
> On 14-05-14 11:49, Thomas Beale wrote:
>> I would recommend a 2 or 3 pass validator. It's tempting to try to do
>> everything in one pass, and it may be more efficient, but it's much
>> harder to get the logic right.
>
> I have a one-phase validator, and because an archetype is strictly
> hierarchical, it is easy going from the top down to the leafnodes, and
> at every CAttribute or CObject, validate the constraints. I have no
> problem with this, except for some things, like the one we are
> discussing, which I solved by using a recursion-counter, which starts
> counting as soon an CComplexObject has no attributes in the AOM (then
> it is wildcarded)
> But that is an arbitrary-solution. It works, but it gives an
> unpleasant feeling because, in fact, it is breaking in the logic.
>
> So, just for learning. To get rid of that unpleasant feeling, which
> phases would you distinguish in validating a dataset?
I think Pablo has summarised some useful things:
* validate based on OPTs - this is a must; it's based on the fact that
all your data are _templated_, not just archetyped
* RM validation pass - you could detect pathological structures at
this point
* archetype (OPT) pass
Nobody should feel bad about having to experiment a bit here. There's no
standard answer yet.
- thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/attachments/20140516/29e4c2b2/attachment.html>