Molecule annotations
Molecule annotations attach CML metadata to a molecule using the
@key("value") suffix. Multiple annotations can be chained.
H_2O @name("Water")Maps to CML <name>Water</name>.
Identifiers
Section titled “Identifiers”Known identifier types (inchi, smiles, cas, iupac, cid,
chebi) map to CML <identifier convention="...">:
C @inchi("InChI=1/C")C @smiles("C")C @cas("74-82-8")H_2O @title("water molecule")Sets the CML title attribute on <molecule>.
Formula
Section titled “Formula”H_2O @formula("H 2 O 1")Maps to CML <formula concise="H 2 O 1"/>.
Labels
Section titled “Labels”H_2O @label("solvent")Maps to CML <label value="solvent"/>.
Properties
Section titled “Properties”Any annotation key that isn’t a known type (name, title, formula, label, or identifier convention) becomes a CML property:
H_2O @mw("18.015")H_2O @density("0.997")H_2O @logP("-0.5")asciichem gem to see this rendered.
Maps to CML <property title="mw"><scalar>18.015</scalar></property>.
Metadata
Section titled “Metadata”Key-value metadata pairs using @meta("key","value"):
H_2O @meta("creator","asciichem")H_2O @meta("source","NIST")@meta("year","2024")Multiple annotations
Section titled “Multiple annotations”Chain annotations without spaces between them:
H_2O @name("Water")@inchi("InChI=1/H2O/h1H2")@cas("7732-18-5")Round-trip
Section titled “Round-trip”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.