<!-- GENERATED by tap2model.py. Do not edit: change model/model_dctap.csv. -->

# Data model diagrams

Prototype, not an official CIAAW model. Generated from [model_dctap.csv](model_dctap.csv), one diagram per aspect.

## Overview

The main classes and how they connect. Attributes, back-references and history links are in the diagrams for each aspect.

```mermaid
classDiagram
    direction TB
    class Element["chemrof:ChemicalElement"]
    class Isotope["chemrof:Isotope"]
    class StandardAtomicWeightDeclaration["ciaaw:StandardAtomicWeightDeclaration"]
    class ConventionalAtomicWeightDeclaration["ciaaw:ConventionalAtomicWeightDeclaration"]
    class IsotopicAbundanceDeclaration["ciaaw:IsotopicAbundanceDeclaration"]
    class AtomicMassDeclaration["ciaaw:AtomicMassDeclaration"]
    class Declaration["Declaration"] {
        <<abstract>>
    }
    class Footnote["ciaaw:Footnote"]
    class IntervalValue["Interval"]
    class ValueWithUncertainty["Value with uncertainty"]
    class SingleValue["Single value"]
    class MassValue["Mass with uncertainty"]
    Declaration <|-- StandardAtomicWeightDeclaration
    Declaration <|-- ConventionalAtomicWeightDeclaration
    Declaration <|-- IsotopicAbundanceDeclaration
    Declaration <|-- AtomicMassDeclaration
    Element --> "0..*" Isotope : ciaaw#58;hasIsotope
    Element --> "0..1" StandardAtomicWeightDeclaration : ciaaw#58;currentStandardAtomicWeight
    Element --> "0..1" ConventionalAtomicWeightDeclaration : ciaaw#58;currentConventionalAtomicWeight
    Isotope --> "1" IsotopicAbundanceDeclaration : ciaaw#58;currentAbundance
    Isotope --> "0..1" AtomicMassDeclaration : ciaaw#58;currentAtomicMass
    Declaration --> "0..*" Footnote : ciaaw#58;footnote
    StandardAtomicWeightDeclaration --> "1" IntervalValue : ciaaw#58;value (one of)
    StandardAtomicWeightDeclaration --> "1" ValueWithUncertainty : ciaaw#58;value (one of)
    StandardAtomicWeightDeclaration --> "1" SingleValue : ciaaw#58;value (one of)
    ConventionalAtomicWeightDeclaration --> "1" SingleValue : ciaaw#58;value
    IsotopicAbundanceDeclaration --> "1" IntervalValue : ciaaw#58;value (one of)
    IsotopicAbundanceDeclaration --> "1" ValueWithUncertainty : ciaaw#58;value (one of)
    IsotopicAbundanceDeclaration --> "1" SingleValue : ciaaw#58;value (one of)
    AtomicMassDeclaration --> "1" MassValue : ciaaw#58;value
```

## Elements and isotopes

Elements and isotopes keep a stable IRI. They hold identifying facts and pointers, while every published value lives in a separate declaration.

```mermaid
classDiagram
    direction LR
    class Element["chemrof:ChemicalElement"] {
        rdfs:label : langString [1..*]
        chemrof:symbol : string [1]
        chemrof:atomic_number : integer [1]
        skos:closeMatch : IRI [0..*]
        ciaaw:longestLivedMassNumber : integer [0..1]
    }
    class Isotope["chemrof:Isotope"] {
        ciaaw:massNumber : integer [1]
        skos:closeMatch : IRI [0..*]
    }
    Element --> "0..*" Isotope : ciaaw#58;hasIsotope
```

## Atomic weight declarations

A standard atomic weight is either an interval or a value with an uncertainty. The element points to the one current declaration and repeats its numbers as derived shortcuts.

```mermaid
classDiagram
    direction TB
    class Element["chemrof:ChemicalElement"] {
        ciaaw:standardAtomicWeightLower : decimal [0..1]
        ciaaw:standardAtomicWeightUpper : decimal [0..1]
        ciaaw:standardAtomicWeightValue : decimal [0..1]
        ciaaw:standardAtomicWeightUncertainty : decimal [0..1]
    }
    class StandardAtomicWeightDeclaration["ciaaw:StandardAtomicWeightDeclaration"]
    class ConventionalAtomicWeightDeclaration["ciaaw:ConventionalAtomicWeightDeclaration"]
    class IntervalValue["Interval"]
    class ValueWithUncertainty["Value with uncertainty"]
    class SingleValue["Single value"]
    Element --> "0..1" StandardAtomicWeightDeclaration : ciaaw#58;currentStandardAtomicWeight
    Element --> "0..1" ConventionalAtomicWeightDeclaration : ciaaw#58;currentConventionalAtomicWeight
    Element --> "0..*" StandardAtomicWeightDeclaration : ciaaw#58;hasDeclaration (one of)
    Element --> "0..*" ConventionalAtomicWeightDeclaration : ciaaw#58;hasDeclaration (one of)
    StandardAtomicWeightDeclaration --> "1" Element : ciaaw#58;ofElement
    StandardAtomicWeightDeclaration --> "1" IntervalValue : ciaaw#58;value (one of)
    StandardAtomicWeightDeclaration --> "1" ValueWithUncertainty : ciaaw#58;value (one of)
    StandardAtomicWeightDeclaration --> "1" SingleValue : ciaaw#58;value (one of)
    ConventionalAtomicWeightDeclaration --> "1" Element : ciaaw#58;ofElement
    ConventionalAtomicWeightDeclaration --> "1" SingleValue : ciaaw#58;value
```

## Isotopic abundance declarations

The representative isotopic composition of one isotope. It can be an interval, a value with an uncertainty, or a single value such as 1 for monoisotopic elements.

```mermaid
classDiagram
    direction TB
    class Element["chemrof:ChemicalElement"]
    class Isotope["chemrof:Isotope"]
    class IsotopicAbundanceDeclaration["ciaaw:IsotopicAbundanceDeclaration"]
    class AtomicMassDeclaration["ciaaw:AtomicMassDeclaration"]
    class IntervalValue["Interval"]
    class ValueWithUncertainty["Value with uncertainty"]
    class SingleValue["Single value"]
    Element --> "0..*" Isotope : ciaaw#58;hasIsotope
    Isotope --> "1" IsotopicAbundanceDeclaration : ciaaw#58;currentAbundance
    Isotope --> "1..*" IsotopicAbundanceDeclaration : ciaaw#58;hasDeclaration (one of)
    Isotope --> "1..*" AtomicMassDeclaration : ciaaw#58;hasDeclaration (one of)
    IsotopicAbundanceDeclaration --> "1" Isotope : ciaaw#58;ofIsotope
    IsotopicAbundanceDeclaration --> "1" IntervalValue : ciaaw#58;value (one of)
    IsotopicAbundanceDeclaration --> "1" ValueWithUncertainty : ciaaw#58;value (one of)
    IsotopicAbundanceDeclaration --> "1" SingleValue : ciaaw#58;value (one of)
```

## Atomic masses (planned)

Part of the draft vocabulary, but not generated yet because the two source tables do not contain atomic masses.

```mermaid
classDiagram
    direction TB
    class Isotope["chemrof:Isotope"]
    class AtomicMassDeclaration["ciaaw:AtomicMassDeclaration"]
    class IsotopicAbundanceDeclaration["ciaaw:IsotopicAbundanceDeclaration"]
    class MassValue["Mass with uncertainty"]
    Isotope --> "0..1" AtomicMassDeclaration : ciaaw#58;currentAtomicMass
    Isotope --> "1..*" IsotopicAbundanceDeclaration : ciaaw#58;hasDeclaration (one of)
    Isotope --> "1..*" AtomicMassDeclaration : ciaaw#58;hasDeclaration (one of)
    AtomicMassDeclaration --> "1" Isotope : ciaaw#58;ofIsotope
    AtomicMassDeclaration --> "1" MassValue : ciaaw#58;value
```

## Quantity values

Numbers are qudt:QuantityValue nodes in one of a few closed forms. Significant figures are stored separately because xsd:decimal does not preserve trailing zeros.

```mermaid
classDiagram
    direction LR
    class StandardAtomicWeightDeclaration["ciaaw:StandardAtomicWeightDeclaration"]
    class IntervalValue["Interval"] {
        qudt:hasUnit : IRI [1]
        qudt:lowerBound : decimal [1]
        qudt:upperBound : decimal [1]
        ciaaw:significantFiguresLower : integer [0..1]
        ciaaw:significantFiguresUpper : integer [0..1]
    }
    class ValueWithUncertainty["Value with uncertainty"] {
        qudt:hasUnit : IRI [1]
        qudt:numericValue : decimal [1]
        qudt:standardUncertainty : decimal [1]
        ciaaw:significantFigures : integer [1]
        ciaaw:significantFiguresUncertainty : integer [1]
    }
    class SingleValue["Single value"] {
        qudt:hasUnit : IRI [1]
        qudt:numericValue : decimal [1]
        ciaaw:significantFigures : integer [0..1]
    }
    class ConventionalAtomicWeightDeclaration["ciaaw:ConventionalAtomicWeightDeclaration"]
    class IsotopicAbundanceDeclaration["ciaaw:IsotopicAbundanceDeclaration"]
    class AtomicMassDeclaration["ciaaw:AtomicMassDeclaration"]
    class MassValue["Mass with uncertainty"] {
        qudt:hasUnit : IRI [1]
        qudt:numericValue : decimal [1]
        qudt:standardUncertainty : decimal [1]
        ciaaw:significantFigures : integer [1]
        ciaaw:significantFiguresUncertainty : integer [1]
    }
    StandardAtomicWeightDeclaration --> "1" IntervalValue : ciaaw#58;value (one of)
    StandardAtomicWeightDeclaration --> "1" ValueWithUncertainty : ciaaw#58;value (one of)
    StandardAtomicWeightDeclaration --> "1" SingleValue : ciaaw#58;value (one of)
    ConventionalAtomicWeightDeclaration --> "1" SingleValue : ciaaw#58;value
    IsotopicAbundanceDeclaration --> "1" IntervalValue : ciaaw#58;value (one of)
    IsotopicAbundanceDeclaration --> "1" ValueWithUncertainty : ciaaw#58;value (one of)
    IsotopicAbundanceDeclaration --> "1" SingleValue : ciaaw#58;value (one of)
    AtomicMassDeclaration --> "1" MassValue : ciaaw#58;value
```

## Footnotes

The g, m and r notes printed below the CIAAW tables are shared nodes that declarations refer to.

```mermaid
classDiagram
    direction LR
    class Declaration["Declaration"] {
        <<abstract>>
    }
    class Footnote["ciaaw:Footnote"] {
        skos:notation : string [1]
        skos:definition : langString [1]
    }
    Declaration --> "0..*" Footnote : ciaaw#58;footnote
```

## History and provenance

Declarations are never edited. A new value creates a new declaration, and the old one is kept, flagged as deprecated, and linked to its replacement.

```mermaid
classDiagram
    direction LR
    class Element["chemrof:ChemicalElement"]
    class NotDeprecated["Not deprecated"] {
        owl:deprecated : boolean [0..1]
    }
    class StandardAtomicWeightDeclaration["ciaaw:StandardAtomicWeightDeclaration"]
    class ConventionalAtomicWeightDeclaration["ciaaw:ConventionalAtomicWeightDeclaration"]
    class Isotope["chemrof:Isotope"]
    class IsotopicAbundanceDeclaration["ciaaw:IsotopicAbundanceDeclaration"]
    class AtomicMassDeclaration["ciaaw:AtomicMassDeclaration"]
    class Declaration["Declaration"] {
        <<abstract>>
        dcterms:issued : gYear [0..1]
        dcterms:source : IRI [0..*]
        owl:deprecated : boolean [0..1]
        adms:status : IRI [0..1]
    }
    Declaration <|-- StandardAtomicWeightDeclaration
    Declaration <|-- ConventionalAtomicWeightDeclaration
    Declaration <|-- IsotopicAbundanceDeclaration
    Declaration <|-- AtomicMassDeclaration
    Element --> "0..1" NotDeprecated : ciaaw#58;currentStandardAtomicWeight
    Element --> "0..1" NotDeprecated : ciaaw#58;currentConventionalAtomicWeight
    Element --> "0..*" StandardAtomicWeightDeclaration : ciaaw#58;hasDeclaration (one of)
    Element --> "0..*" ConventionalAtomicWeightDeclaration : ciaaw#58;hasDeclaration (one of)
    Isotope --> "1" NotDeprecated : ciaaw#58;currentAbundance
    Isotope --> "0..1" NotDeprecated : ciaaw#58;currentAtomicMass
    Isotope --> "1..*" IsotopicAbundanceDeclaration : ciaaw#58;hasDeclaration (one of)
    Isotope --> "1..*" AtomicMassDeclaration : ciaaw#58;hasDeclaration (one of)
    Declaration --> "0..1" Declaration : dcterms#58;isReplacedBy
    Declaration --> "0..1" Declaration : dcterms#58;replaces
```
