Mattias Forss wrote:
Hi Mattias,
Mattias Forss wrote:
> Hello development team,
>
> I think we need to start a discussion on possible changes/updates to
> the current implementation plan for the Java reference
implementation.
> What I've seen this far is that the UCL team has done a fair
part of
> the RM and I wonder if the team can possibly implement some parts in
> the AOM and the parser in the near future.
we're just getting the date/time stuff sorted - it's amazingly
annoyingly difficult....
In the Java reference implementation? I thought it was okay according
to the specifications.
The parser says question marks are okay and I believe we have to
deviate from the ISO8601 in order to see what we are dealing with when
dates are too inaccurate. I guess that is needed for all the peculiar
situations that can occur in this domain.
< V_ISO8601_DATE_CONSTRAINT_PATTERN: (<YY>){4}"-"<MMQX_2>"-"<DDQX_2> >
< #YY: ["y","Y"]>
>
< #MMQX_2: (["m","M","?","X"]){2}>
>
< #MMQ_2: (["m","M","?"]){2}>
We have made a major effort to upgrade the specs to be ISO8601-compliant
(the latest drafts will go online today) but in places where there is no
context - e.g. you don't know what data type you are dealing with, which
is the case with dADL, ISO8601 is not great, because they didn't take
care to make the syntax context-insensitive. Thus you can't safely
differentiate the following:
- 1924 (an integer)
- 1924 (a year)
- 1924 (a time, i.e. 19:24 in the evening)
Nevertheless, for all other dates and times, if extended format is used
(':', '-' markers) then ISO8601 is distinguishable from other things.
My proposal in dADL is to support standard ISO8601 as far as possible -
allow extended form only; but also to support the form I describe using
the ?? characters, so that a single year lke 1924 can be written
unambiguously as 1924-??-??.
This means:
- for me in Eiffel, adding in the ?? support in dADL
- for you in Java - adding in ISO8601 support for extended form.
This means that both parsers will be "forgiving" but still allow a way
of avoiding the ambiguity of ISO8601.
I have all the parsing patterns and ISO8601 classes in Eiffel if you
want to look at them, and Yin Su is nearly done converting these to
Java, which you should be able to look at very soon.
thoughts on this approach?
>
> Personally I believe the assertion package of the AOM and its
link to
> the parser is important to implement so that the Java archetype
editor
> can handle archetype slots properly.
do you have some examples of where more complex assertions are needed
than are now possible?
>
> Further, there is a need to implement support for assumed values of
> CDomainType datatypes in the AOM and parser. Currently only
CPrimitive
> datatypes can have assumed values and I'm not even sure if the
current
> implementation support assumed values for all primitive datatypes.
I had originally envisaged assumed values for non-prmitive types, but
have never seen an example of where it is needed. Do you have such an
example?
Yes, a good example is for body positions when measuring a blood
pressure:
ELEMENT[at0008] occurrences matches {0..1} matches
{ -- Position
value matches {
CODED_TEXT matches {
code matches {
[local::
at1000, -- Standing
at1001, -- Sitting
at1002, -- Reclining
at1003; -- Lying
at1001] -- assumed value
}
}
}
}
ah - this is already supported in the specs and in the Eiffel parser -
so it is just a limitation of the Java parser at the moment.
>
> Another important upgrade is to deal with the adl_version
keyword and
> also to finish the description part which doesn't work fully for
round
> trips (save/load) with the editor. I have encountered problems with
> keywords, originial_resource_uri and other_contributors in the
> description part.
is this because the java parser doesn't yet implement dADL completely?
Yes, but also due to the ADLOutputter which is not outputting some
parts at all.
In the Eiffel parser, there is an AOM object ARCHETYPE_DESCRIPTION and a
generic dADL serialiser / deserialiser. I read that part of the
archetype in using the generic dADL reader and then call the dADL
deserialiser and it generates the ARCHETYPE_DESCRIPTION object. And the
reverse for deserialising. When we get to ADL 2, the whole archetype
will be dADL with a lump of cADL in the middle and possibly some
assertions; this will enable the archetype as a whole to be parsed as a
dADL document, and sub-parsers invoked for the non-dADL parts. I have
already tested some of this in Eiffel.
- thomas