Subject: xhCML browser in JavaScript/HTML

From: Alk Dransfeld <[email-masked]>
Date: Sat, 9 Nov 2002 13:07:12 +0100

What do chemists want ?
Collect data, conclude and write an article
WITHOUT having to retype all the data.

Some MacOS and Microsoft based publishing tools have recently
included the features of generating diagrams in an article/report
> from raw-data in spreadsheets. Unfortunately - or naturally - when
data and layout are separated once, these programs can not reunite
facts and visualisation.
With the presented "Data-In-Article" (DinA) approach
incorporating raw data in a fluently readable document
is possible (like including images in HTML).

DinA, my first implementation of a CML browser at
http://www.cis.tugraz.at/aoc/sharc/dina/
is written in JavaScript/HTML and is therefore platform independent.
The read and retrieve functions of DinA are general XML tools[1]
while the chemical features are xhCML and xhCMLpath based.
   xhCml     is an eXtensible Hierarchical Chemical MarkupLanguage
             which complies with the rules of XML
   xhCmlPath is an Xpath like pointer, which allows to address
             data in a set of xhCML data.

Please visit the demo site http://www.cis.tugraz.at/aoc/sharc/dina/
and see what DinA can do for you or
simply play with chemical markup or
be inspired to think about CML.

Thanx - alk

+++
In the following you are guided through the demo,
the features of xhCML and DinA are pointed out,
and obstacles and perspectives discussed.

# For a quick start

press the "[re]build article" button and see how the values from
the xhCML documentation of two measurements are inserted into
the 'article' (in HTML). For an example of the xhCML2myvalue
function press the "demo 1" and then the "a" button on its right.
Try to follow the xhCMLpath to find the requested value in the
xhCML documentation and press the "show value of xhCMLpath" button
to see whether your guess was right.

# Why xhCml ?

xhCml is
- eXtensible Hierarchical
= when experts require more detailed descriptions they can extend
   the language in their context (branch in hierarchy) WITHOUT need
   of having everyone else change their documents [note, this is NOT
   the same as using various namespaces]
- Chemical ... oh, since it's for chemistry
- MarkupLanguage ... a child of XML
The hierarchy is essential to use reliable pointers (see Xpath).
The hierarchy reflects chemical understanding [NOT Java-object 
structure].
The hierarchy starts with (CML is root, first branches are):
    MEASURED     = all you can detect
    MODELED      = all you can simulate
    CONJUNCTION  = connecting statements,
                   which lead to abstract knowledge in the end
                   f.i. define the rms-error of a method by linking
                   a set of related measured and modeled values
For differentiation between similar branches in the hierarchy
identifier attributes similar to the SHARCid are required (f.i.
<MEASURED ID="Goodwork@gla,2002-12-24GMT115500"> ). Effective
retrieval, use in publishing respectively, is based on such
identifiers.

# What's DinA

The demo screen comprises three frames (input,navigation,article):
A. (top frame) the input fields for documentation of chemistry "xhCML"
    and the retrieval request "xhCMLpath".
    With the button "show value of xhCMLpath" you can see the 
value/string
    the retrieval lead by xhCMLpath returns.
B. (middle) the button to generate the article considering the xhCML
    { if you change the xhCML the 'article' changes on your click }
    With the buttons on the right you can fill example xhCML_s and
    related example xhCMLpath_s in the input fields above and use them.

C. (bottom frame) the fluently readable document
    generated with JavaScript/HTML from xhCML.
    Additionally the hierarchy/tree of the xhCML
    nodes is shown.

D.rawback: since the XML parser used is fast + free[1] but
            ONLY a parser invalidity of the xhCML, XML respectively,
            is only notified with an error message starting with
            "ERROR may be due to nested tags - sorry.

# Obstacles and Perspective

Since HTML is a slang dialect of XML embedding the xhCml
directly in the HTML is not save nowadays. Embedding with
<data src="_URL_#CML:MEASURED[ID="worker2002-11-09"]:PREASURE">
would be the ultimate way to do  TMHO - in the future.
For now in the frameset the data is in the left input field
of the top frameset and the HTML linking in these data
is in the bottom frame.
This construct offers the possibility to change the demo data
and on the fly see how the 'article' changes. The JavaScript
'program' does not only allow to include a value or string from
the data set but also has derived functions, f.i. the
difference of two values. Note that a computed chemical shift
can also be described as a sum of an experimental and a calculated
values for a reference molecule together with the calcuated
shielding of the 'resonant' nucleus in the target molecule
(the future of NMR-SHARC).

[1] JavaScript package Xparse.91 Feb 21 1998 , Jeremie
     from http://www.jeremie.com

Looking forward to more discussion+development in this field
-A.Dransfeld