Thomas Beale wrote:
> The CR SPEC-260 (http://www.openehr.org/issues/browse/SPEC-260) being
> processed for Release-1.0.2 proposes an updated regular expression and
> syntax to match Archetype identifiers. The changes are visible in
> section 4.3.10 of the Support IM document at
> http://www.openehr.org/svn/specification/BRANCHES/Release-1.0.2-candidate/publishing/architecture/rm/support_im.pdf
The regular expressions in section 4.3.10 are a big improvement, but there
are some errors and surprises.
The first surprise is that single-character specialisation concepts are now
rejected. They used to be accepted. (An example would be "blood_type-o".)
It's now consistent with the pattern for the concept name. Was this change
intentional?
The version_id part of the regex -- v[1-9]\d*(\.\d)* -- has bigger problems.
In section 4.3.10, the regex matches these version_ids:
v1 -- good
v10 -- good
v1.0 -- is this intentional to allow a zero in a minor version
part?
v1.1 -- good
v1.1.1 -- is this intentional to allow three parts?
v1.1.1.1 -- or even more than three parts?
The version_id regex rejects these:
v0 -- good, this was Eric Browne's point that version_id
shouldn't be zero
v1.10 -- surely this should be allowed!
I believe the version_id regex should be one of the following:
[R1] v[1-9]\d*(\.\d+)* -- allows v1.10
[R2] v[1-9]\d*(\.[1-9]\d*)* -- allows v1.10 and disallows v1.0
[R3] v[1-9]\d*(\.\d+)? -- allows v1.10 and disallows v1.1.1
[R3] v[1-9]\d*(\.[1-9]\d*)? -- allows v1.10 and disallows v1.1.1 and
v1.0
Another error is that the production rules in section 4.3.10 are
inconsistent with the version_id regex:
version_id: 'v' V_NATURAL_DIGIT { '.' V_NUMBER }*
V_NUMBER: [0-9]*
V_NATURAL_DIGIT: [1-9]
V_NAME: [a-zA-Z][a-zA-Z0-9_]+
The corresponding regex would be v[1-9](\.\d*)* , which differs from section
4.3.10's regex in three respects:
* It allows "v1.10", which surely is good; but
* It allows "v1.", and
* It disallows "v10"!
So, once the regex is right, the production rules have to be fixed too.
- Peter