CML
Chemical Markup Language (CML), also called ChemML, is an open, XML-based markup language for representing chemical information: molecules, atoms and bonds, reactions, spectra, crystal structures, and computational-chemistry results. Developed by Peter Murray-Rust and Henry Rzepa beginning in 1995 following discussions at the first World Wide Web conferences, it is generally regarded as the first domain-specific application of XML. Early versions were defined by a DTD; later work moved to XML Schema (the frozen schema reaching version 2.4), giving validatable, namespaced documents that publishers and open-source toolchains adopted as a de facto XML for chemistry.
The core data model is a graph of atoms and bonds encoded as nested XML. A <molecule> element acts as the container, holding an <atomArray> of <atom> nodes and a <bondArray> of <bond> edges; bonds reference atoms by id via atomRefs2, and per-atom or per-bond information (element symbol, coordinates, charge, order) is carried as attributes or child elements. This makes CML a straightforward molecular graph: atoms are vertices, bonds are edges, and attributes decorate both. Beyond connectivity, CML can attach 2D/3D coordinates, <property> values (energies, spectra), and richer objects such as <reaction>, <spectrum>, and <crystal>.
A distinguishing feature is CML's semantic layer of conventions, dictionaries, and units. Rather than fixing one rigid schema, CML documents declare a convention (for example the Molecular convention) that constrains and gives meaning to the markup, while dictionaries bind terms to controlled definitions and unit dictionaries type numeric quantities. This lets CML span sub-disciplines while remaining machine-checkable.
In the format-conversion world CML overlaps with line notations and connection-table formats: it can round-trip much of what format:molfile, format:sdf, and format:mol2 carry, and structures are commonly generated from or exported to format:smiles, format:inchi, and format:cdxml. Interconversion is widely handled by Open Babel and by cheminformatics libraries such as RDKit, Chem. Structure Conv., and the Chemistry Development Kit, and CML also relates to macromolecular formats like format:pdb.
Strengths are its openness, XML tooling (XPath, XSLT, schema validation), extensibility, and explicit semantics through dictionaries and units, which support archiving and publisher workflows including embedding in feeds and web documents. Limitations follow from the same design: CML files are far more verbose than line notations or connection tables, the flexible convention system means real-world documents vary in what they populate, and broad multi-domain ambition has led to uneven tool support compared with the ubiquitous SMILES/InChI/MOL formats.
Alternative Names: CML
| Feature | Chemical Markup Language (CML) |
|---|---|
| Multiple Graphs per Document | |
| Nodes | |
| Undirected Edges | |
| Directed Edges | |
| Hyperedges | |
| Mixed-directionality Edges | |
| Parallel Edges | |
| Self-loops | |
| Edges on Edges | |
| Nested Graphs in Nodes | |
| Nested Graphs in Edges | |
| Nested Graphs in Graphs | |
| Node Labels | |
| Edge Labels | |
| Attributes on Nodes | |
| Attributes on Edges | |
| Attributes on Graphs | |
| Typed Edges | |
Tools(Read & Write)
Frequently Asked Questions
What is a Chemical Markup Language (CML) file?
A Chemical Markup Language (CML) file stores a graph — its nodes, edges and attributes — in the Chemical Markup Language (CML) format (also: CML). See the feature table above for what it supports.
How do I open a Chemical Markup Language (CML) file?
Open it in a graph tool that supports Chemical Markup Language (CML), or convert it to a format your tool reads. With GraphInOut you can convert Chemical Markup Language (CML) to GraphML, DOT, Connected JSON and more, right in your browser.
How do I convert a Chemical Markup Language (CML) file to another format?
Use the Convert from Chemical Markup Language (CML) link above: upload or paste your Chemical Markup Language (CML) file (input preset to Chemical Markup Language (CML)), choose a target format and download the result — free, no install.