XML FORMAT

CML

Chemical Markup Language (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

File Extensions: .cml v2.4
FeatureChemical Markup Language (CML)
Multiple Graphs per Document supported
Nodes supported
Undirected Edges supported
Directed Edges not supported
Hyperedges not supported
Mixed-directionality Edges not supported
Parallel Edges not supported
Self-loops not supported
Edges on Edges not supported
Nested Graphs in Nodes not supported
Nested Graphs in Edges not supported
Nested Graphs in Graphs supported
Node Labels supported
Edge Labels not supported
Attributes on Nodes supported
Attributes on Edges supported
Attributes on Graphs supported
Typed Edges supported

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.