---
id: "molformula"
kind: "datatype"
status: "stable"
is_pii: false
categories: ["chemistry"]
langs: ["common"]
quality: 73
url: "http://registry.apicrafter.io/datatype/molformula"
---

# Molecular Formula (`molformula`)

Molecular formulae indicate the simple numbers of each type of atom in a molecule of a molecular substance.

- Personal data (PII): no
- Categories: Chemistry (chemistry)
- Countries: global
- Languages: Common to most languages (common)

## Detection

Regular expression (Python `re`):

```
([αβγδφωλμπ]-)?([([]*[A-Z☐][ub]?[a-z]?[₁₂₃₄₅₆₇₈₉₀.]*(\)?[¹²³⁴⁵⁶⁷⁸⁹⁰]*[⁺⁻]?)?[\])|,₁₂₃₄₅₆₇₈₉₀]*(·\(?[-0-9.]*n?\)?)?)+
```

## Examples

- `H₂O` — water

## Mappings

- autotype: `chemical`
- schema_org: `molecularFormula`
- wikidata: `P274`

## Metacrafter rules

1 rules: 1 match the field name, 0 match values.

- `molformulabyfieldname` (field, `common/chemistry.yaml`)

## Supported by tools

- `autotype`
- `metacrafter`

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Chemical_formula>
- bioschemas: <https://bioschemas.org/types/MolecularEntity/0.3-RELEASE-2019_09_02#molecularFormula>
- schema.org: <https://schema.org/molecularFormula>
- wikidata: <https://www.wikidata.org/wiki/Property:P274>

## Quality

Score 73/100. Missing: anchored regexp, second example, negative example, translation.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/molformula.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/chemistry/molformula.yaml>
