Java XML-Archetype Parser?

Dear all,

Does anybody know of any current initiative and/or interest to develop a
Java-based XML-Archetype Parser?

Cheers
Sebastian

Sebastian Garde schreef:

Dear all,

Does anybody know of any current initiative and/or interest to develop a
Java-based XML-Archetype Parser?
  

If XML will be the archetype-language of the future, I think there will
be a need for such a parser. However, the building of it seems to me
easier than the building of a the ADL-parser. But I must say, I did not
really study into the matter.

Bert

Hi Sebastian,

The XML parser can be generated by published AOM schema so it should be straight forward I think. If the parsed object form should be connected to the current openehr-aom component, we need to make a converter. In fact, I think both parsing and serializing XML archetypes can be facilitated by using AOM schema.

Cheers,
Rong

In fact! I use a XML parser for archetypes, templates, composition and versions, that was automatically generated by the XSD schemes available (Not only a parser, but a serializer too). In a recent talk with Rong, we discussed the possibility of incorporating my parser into ref_impl_java project, and I think that is a great idea :slight_smile: But that integrations is not straightforward because that parser use a different AM/RM (a mutable one), so I have to do a little work before committing it. As soon as I get an extra time, the parser will be public available, so I ask you to have a little patient…
Regards,
Humberto

Sounds great Humberto and Rong,

thanks for confirming this. I suspected it would not be too hard with
the existing schemas.
Do you use Castor for this?

Cheers
Sebastian

Humberto Naves wrote:

Hi!

I tried to use Castor, but since I have both the schemes and the Object Model, Castor wasn’t useful for me… So I had to write my own generator :frowning: The first step is to bind each xs:complexType of the schema with the corresponding class and to bind each attribute/element with the corresponding attribute of the class, and that binding is constructed automatically. The generated parser uses JDOM for XML parsing.

Sample code generated follows:

Sure thing! But first, I have to finish the “turnImmutable()” method :frowning:

So, the XML will be the archetype-language of the future? And what about the ADL?

I don't think that is decided. Personally I see adl as the primary one.

Sebastian

Humberto Naves wrote:

Having been working on both ADL and XML parsers over the past weeks. I
agree with Sebastian.

It is readily apparent to me that ADL is a much richer (semantically)
serialization than the XML. Now, maybe that just means that the tools
need improvement so they can produce better XML representations?

Note that I am not an expert on either of these. It's just my
observations as I am building parsers.

Cheers,
Tim

Tim Cook wrote:

Hi,

Sebastian Garde wrote:

I don't think that is decided. Personally I see adl as the
primary one.

Having been working on both ADL and XML parsers over the past weeks.
I agree with Sebastian.

It is readily apparent to me that ADL is a much richer
(semantically) serialization than the XML. [...]

On the other hand there exists a very large community building tools for
XML, but it is only the relatively small openEHR-community that builds tools
for ADL. I therefore think we in general are able to reuse more tools and
environments for handling archetypes in XML than in ADL.

  Greetings,
  Mikael

Just putting more wood on the fire:

  1. I think ADL is a lot less verbose and more concise… (beautiful to the eye of an human :slight_smile:
  2. But, XML is well-known and more easy to parse(beautiful to the eye of a machine :slight_smile:

I hope that this discussion doesn’t become an endless one…

Humberto

Humberto Naves wrote:

So, the XML will be the archetype-language of the future? And what about the ADL?

ADL will always remain the ‘standard’ language of archetypes, since it is (by definition) the languageof archetypes. XML renditions are just that. As long as they properly express what is in an ADL archetype, they work, which is the case today. Not providing ADL archetypes will mean that the archetypes are unlikely to be hosted on openEHR.org however.

An open source ADL / XML reader/writer should be available soon.

  • thomas

Hi Thomas and Humberto!

Could you please give us info or a short status update on your tools and models that were mentioned below?

In fact! I use a XML parser for archetypes, templates, composition and versions, that was automatically generated by the XSD schemes available (Not only a parser, but a serializer too). In a recent talk with Rong, we discussed the possibility of incorporating my parser into ref_impl_java project, and I think that is a great idea :slight_smile: But that integrations is not straightforward because that parser use a different AM/RM (a mutable one), so I have to do a little work before committing it. As soon as I get an extra time, the parser will be public available, so I ask you to have a little patient…
Regards,
Humberto

Is it possible to have a look at your mutable AM/RM even if it has not been mapped and connected to the current ref-impl-version (initially by Rong et al)? Could the further development of the new (initially schema generated) mutable RM/AM and the mapping/connection work to the current immutable AM/RM be done in a branch in the public repository? We have some master thesis students that probably will have an interest in this or similar approaches.