Skip to content
AsciiC6hem

Molecule annotations

Molecule annotations attach CML metadata to a molecule using the @key("value") suffix. Multiple annotations can be chained.

Source Rendered
H_2O @name("Water")
H 2 O

Maps to CML <name>Water</name>.

Known identifier types (inchi, smiles, cas, iupac, cid, chebi) map to CML <identifier convention="...">:

Source Rendered
C @inchi("InChI=1/C")
C
C @smiles("C")
C
C @cas("74-82-8")
C
Source Rendered
H_2O @title("water molecule")
H 2 O

Sets the CML title attribute on <molecule>.

Source Rendered
H_2O @formula("H 2 O 1")
H 2 O

Maps to CML <formula concise="H 2 O 1"/>.

Source Rendered
H_2O @label("solvent")
H 2 O

Maps to CML <label value="solvent"/>.

Any annotation key that isn’t a known type (name, title, formula, label, or identifier convention) becomes a CML property:

Source Rendered
H_2O @mw("18.015")
H 2 O
H_2O @density("0.997")
H 2 O
H_2O @logP("-0.5")
Install the asciichem gem to see this rendered.

Maps to CML <property title="mw"><scalar>18.015</scalar></property>.

Key-value metadata pairs using @meta("key","value"):

Source Rendered
H_2O @meta("creator","asciichem")
H 2 O
H_2O @meta("source","NIST")@meta("year","2024")
H 2 O

Chain annotations without spaces between them:

Source Rendered
H_2O @name("Water")@inchi("InChI=1/H2O/h1H2")@cas("7732-18-5")
H 2 O

All annotations survive AsciiChem → CML → AsciiChem round-trip without loss. Names, identifiers, title, formulas, labels, and properties use native CML elements. Metadata and AsciiChem-specific fields ride via the aci: extension namespace.

Play