asciichem-model 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.adoc +80 -0
- data/docs/adr/0001-language-bindings.adoc +78 -0
- data/exe/generate-types-from-schemas +6 -0
- data/lib/asciichem_model/schema_type_generator.rb +163 -0
- data/lib/asciichem_model/validators.rb +79 -0
- data/lib/asciichem_model/version.rb +5 -0
- data/lib/asciichem_model.rb +18 -0
- data/models/asciichem/Atom.lutaml +49 -0
- data/models/asciichem/Bond.lutaml +24 -0
- data/models/asciichem/Calculation.lutaml +34 -0
- data/models/asciichem/Crystal.lutaml +34 -0
- data/models/asciichem/ElectronConfiguration.lutaml +35 -0
- data/models/asciichem/EmbeddedMath.lutaml +10 -0
- data/models/asciichem/Formula.lutaml +13 -0
- data/models/asciichem/Group.lutaml +22 -0
- data/models/asciichem/Identifier.lutaml +56 -0
- data/models/asciichem/Mechanism.lutaml +22 -0
- data/models/asciichem/Molecule.lutaml +25 -0
- data/models/asciichem/Name.lutaml +15 -0
- data/models/asciichem/Provenance.lutaml +20 -0
- data/models/asciichem/Reaction.lutaml +36 -0
- data/models/asciichem/ReactionCascade.lutaml +6 -0
- data/models/asciichem/Spectrum.lutaml +31 -0
- data/models/asciichem/SubstanceRecord.lutaml +52 -0
- data/models/asciichem/Text.lutaml +9 -0
- data/models/asciichem/ZMatrix.lutaml +34 -0
- data/schemas/v1/atom.yaml +45 -0
- data/schemas/v1/bond.yaml +20 -0
- data/schemas/v1/calculation.yaml +37 -0
- data/schemas/v1/crystal.yaml +30 -0
- data/schemas/v1/electron-configuration.yaml +43 -0
- data/schemas/v1/embedded-math.yaml +18 -0
- data/schemas/v1/examples/01-atom-isotope.yaml +7 -0
- data/schemas/v1/examples/02-molecule-water.yaml +18 -0
- data/schemas/v1/examples/03-group-multiplicity.yaml +11 -0
- data/schemas/v1/examples/04-reaction-conditions.yaml +30 -0
- data/schemas/v1/examples/05-substance-record-aspirin.yaml +40 -0
- data/schemas/v1/examples/06-electron-configuration.yaml +16 -0
- data/schemas/v1/examples/07-spectrum.yaml +18 -0
- data/schemas/v1/examples/99-01-negative-atom-bad-element.yaml +5 -0
- data/schemas/v1/examples/99-02-negative-identifier-bad-convention.yaml +5 -0
- data/schemas/v1/examples/99-03-negative-group-empty.yaml +4 -0
- data/schemas/v1/formula.yaml +30 -0
- data/schemas/v1/group.yaml +29 -0
- data/schemas/v1/identifier.yaml +32 -0
- data/schemas/v1/mechanism.yaml +30 -0
- data/schemas/v1/molecule.yaml +28 -0
- data/schemas/v1/name.yaml +22 -0
- data/schemas/v1/provenance.yaml +28 -0
- data/schemas/v1/reaction-cascade.yaml +17 -0
- data/schemas/v1/reaction.yaml +34 -0
- data/schemas/v1/spectrum.yaml +39 -0
- data/schemas/v1/substance-record.yaml +57 -0
- data/schemas/v1/text.yaml +16 -0
- data/schemas/v1/types/atom.ts +12 -0
- data/schemas/v1/types/bond.ts +5 -0
- data/schemas/v1/types/calculation.ts +13 -0
- data/schemas/v1/types/crystal.ts +13 -0
- data/schemas/v1/types/electron-configuration.ts +13 -0
- data/schemas/v1/types/embedded-math.ts +5 -0
- data/schemas/v1/types/formula.ts +5 -0
- data/schemas/v1/types/group.ts +7 -0
- data/schemas/v1/types/identifier.ts +7 -0
- data/schemas/v1/types/index.ts +21 -0
- data/schemas/v1/types/mechanism.ts +9 -0
- data/schemas/v1/types/molecule.ts +7 -0
- data/schemas/v1/types/name.ts +7 -0
- data/schemas/v1/types/provenance.ts +8 -0
- data/schemas/v1/types/reaction-cascade.ts +5 -0
- data/schemas/v1/types/reaction.ts +11 -0
- data/schemas/v1/types/spectrum.ts +14 -0
- data/schemas/v1/types/substance-record.ts +18 -0
- data/schemas/v1/types/text.ts +5 -0
- data/schemas/v1/types/zmatrix.ts +13 -0
- data/schemas/v1/zmatrix.yaml +41 -0
- metadata +136 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
class Group {
|
|
2
|
+
definition {
|
|
3
|
+
A bracketed sub-formula whose optional multiplier applies to the
|
|
4
|
+
whole group, e.g. (OH)_2.
|
|
5
|
+
}
|
|
6
|
+
+nodes: Node[1..*] {
|
|
7
|
+
definition { Atoms, nested molecules, or nested groups. }
|
|
8
|
+
}
|
|
9
|
+
+multiplicity: String {
|
|
10
|
+
definition { Multiplier applied to the group ("2"). }
|
|
11
|
+
}
|
|
12
|
+
+bracket: BracketKind {
|
|
13
|
+
definition { The bracket style enclosing the group. }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
enum BracketKind {
|
|
18
|
+
definition { Bracket kinds, one per AsciiChem spelling. }
|
|
19
|
+
paren { definition { Round brackets: (OH)_2 — the default. } }
|
|
20
|
+
square { definition { Square brackets: [OH]_2. } }
|
|
21
|
+
brace { definition { Braces: {OH}_2. } }
|
|
22
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
class Identifier {
|
|
2
|
+
definition {
|
|
3
|
+
A substance identifier: a value plus the convention that
|
|
4
|
+
determines its format (CAS RN with check digit, InChI, InChIKey
|
|
5
|
+
14-10-1 blocks, SMILES, IUPAC name, PubChem CID, ChEBI).
|
|
6
|
+
Maps to CML `<identifier convention="...">`. Format constraints
|
|
7
|
+
are enforced offline by the implementations' identifier
|
|
8
|
+
validators; assignment checking is resolution, not modelling.
|
|
9
|
+
}
|
|
10
|
+
+value: String {
|
|
11
|
+
definition {
|
|
12
|
+
The identifier value (e.g. "50-78-2").
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
+convention: IdentifierConvention {
|
|
16
|
+
definition {
|
|
17
|
+
The identifier convention registry value.
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
+dictRef: String {
|
|
21
|
+
definition {
|
|
22
|
+
Optional dictionary reference for CML round-trip.
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
enum IdentifierConvention {
|
|
28
|
+
definition {
|
|
29
|
+
Registry of known identifier conventions. Adding a convention is
|
|
30
|
+
a MINOR model bump; format validators are per-implementation.
|
|
31
|
+
}
|
|
32
|
+
cas {
|
|
33
|
+
definition { CAS Registry Number, DDDDDDD-DD-D with check digit. }
|
|
34
|
+
}
|
|
35
|
+
inchi {
|
|
36
|
+
definition { IUPAC International Chemical Identifier. }
|
|
37
|
+
}
|
|
38
|
+
inchikey {
|
|
39
|
+
definition { Hashed InChI key, 14-10-1 uppercase blocks. }
|
|
40
|
+
}
|
|
41
|
+
smiles {
|
|
42
|
+
definition { SMILES structure string. }
|
|
43
|
+
}
|
|
44
|
+
canonical-smiles {
|
|
45
|
+
definition { Canonical SMILES from a specific toolchain. }
|
|
46
|
+
}
|
|
47
|
+
iupac-name {
|
|
48
|
+
definition { Systematic IUPAC name. }
|
|
49
|
+
}
|
|
50
|
+
pubchem-cid {
|
|
51
|
+
definition { PubChem Compound ID. }
|
|
52
|
+
}
|
|
53
|
+
chebi {
|
|
54
|
+
definition { ChEBI ontology identifier. }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
class Mechanism {
|
|
2
|
+
definition {
|
|
3
|
+
A reaction mechanism: labelled reaction steps plus spectator
|
|
4
|
+
species that are present but not transformed.
|
|
5
|
+
}
|
|
6
|
+
+steps: MechanismStep[0..*] {
|
|
7
|
+
definition { The mechanism steps in order. }
|
|
8
|
+
}
|
|
9
|
+
+spectators: Molecule[0..*] {
|
|
10
|
+
definition { Species present but not transformed. }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
class MechanismStep {
|
|
14
|
+
definition { One labelled step of the mechanism. }
|
|
15
|
+
+label: String {
|
|
16
|
+
definition { Step label, e.g. "initiation". }
|
|
17
|
+
}
|
|
18
|
+
+reaction: Reaction {
|
|
19
|
+
definition { The step's reaction. }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
class Molecule {
|
|
2
|
+
definition {
|
|
3
|
+
An ordered sequence of atoms/groups with optional stoichiometric
|
|
4
|
+
coefficient, optional stereochemistry marker, and optional
|
|
5
|
+
names/identifiers/properties/metadata attached as CML-level
|
|
6
|
+
annotations. Substance identity lives here via Identifier
|
|
7
|
+
instances.
|
|
8
|
+
}
|
|
9
|
+
+nodes: Atom[0..*] {
|
|
10
|
+
definition {
|
|
11
|
+
Ordered child nodes (atoms, groups, nested molecules).
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
+coefficient: String {
|
|
15
|
+
definition {
|
|
16
|
+
Stoichiometric coefficient (e.g. "2" in `2H_2O`).
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
+identifiers: Identifier[0..*] {
|
|
20
|
+
definition {
|
|
21
|
+
Substance identifiers attached to this molecule (CAS RN, InChI,
|
|
22
|
+
SMILES, ...), each with a convention.
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class Name {
|
|
2
|
+
definition {
|
|
3
|
+
A molecule name. Maps to CML name; convention distinguishes
|
|
4
|
+
IUPAC, CAS, trivial, and trade names.
|
|
5
|
+
}
|
|
6
|
+
+content: String {
|
|
7
|
+
definition { The name text. }
|
|
8
|
+
}
|
|
9
|
+
+convention: String {
|
|
10
|
+
definition { Naming convention, e.g. "iupac" or "cas". }
|
|
11
|
+
}
|
|
12
|
+
+dictRef: String {
|
|
13
|
+
definition { Optional dictionary reference for CML round-trip. }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
class Provenance {
|
|
2
|
+
definition {
|
|
3
|
+
Where a piece of identity data came from: the asserting source,
|
|
4
|
+
retrieval timestamp, source version, and the attribution line
|
|
5
|
+
that licence terms (e.g. CAS Common Chemistry CC BY-NC 4.0)
|
|
6
|
+
require on every cached record.
|
|
7
|
+
}
|
|
8
|
+
+source: String {
|
|
9
|
+
definition { Source adapter name, e.g. "pubchem" or "commonchemistry". }
|
|
10
|
+
}
|
|
11
|
+
+retrievedAt: DateTime {
|
|
12
|
+
definition { When the value was retrieved from the source. }
|
|
13
|
+
}
|
|
14
|
+
+sourceVersion: String {
|
|
15
|
+
definition { Source release, or an accessed-date pin when versionless. }
|
|
16
|
+
}
|
|
17
|
+
+attribution: String {
|
|
18
|
+
definition { Attribution string emitted with NC-licensed data. }
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
class Reaction {
|
|
2
|
+
definition {
|
|
3
|
+
A chemical reaction: reactants, an arrow with optional
|
|
4
|
+
conditions above/below it, and products.
|
|
5
|
+
}
|
|
6
|
+
+reactants: Molecule[0..*] {
|
|
7
|
+
definition { The left-hand side molecules. }
|
|
8
|
+
}
|
|
9
|
+
+products: Molecule[0..*] {
|
|
10
|
+
definition { The right-hand side molecules. }
|
|
11
|
+
}
|
|
12
|
+
+arrow: ArrowKind {
|
|
13
|
+
definition { The reaction arrow kind; forward by default. }
|
|
14
|
+
}
|
|
15
|
+
+conditions: ReactionConditions {
|
|
16
|
+
definition { Free text above/below the arrow. }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
enum ArrowKind {
|
|
21
|
+
definition { forward (->), reverse (<-), equilibrium (<=>), resonance (<->). }
|
|
22
|
+
forward {}
|
|
23
|
+
reverse {}
|
|
24
|
+
equilibrium {}
|
|
25
|
+
resonance {}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
class ReactionConditions {
|
|
29
|
+
definition { Text carried over/under the reaction arrow. }
|
|
30
|
+
+above: String {
|
|
31
|
+
definition { Text above the arrow, e.g. the catalyst [Fe]. }
|
|
32
|
+
}
|
|
33
|
+
+below: String {
|
|
34
|
+
definition { Text below the arrow, e.g. the temperature. }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
class Spectrum {
|
|
2
|
+
definition {
|
|
3
|
+
A spectroscopy record: technique, acquisition parameters, and
|
|
4
|
+
peaks.
|
|
5
|
+
}
|
|
6
|
+
+technique: String {
|
|
7
|
+
definition { Technique type, e.g. "nmr", "ir", "mass". }
|
|
8
|
+
}
|
|
9
|
+
+params: String[0..*] {
|
|
10
|
+
definition { Acquisition parameters keyed by name (solvent, frequency, ...). }
|
|
11
|
+
}
|
|
12
|
+
+peaks: Peak[0..*] {
|
|
13
|
+
definition { The spectrum's peaks. }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class Peak {
|
|
17
|
+
definition { One spectroscopic peak. }
|
|
18
|
+
+position: String {
|
|
19
|
+
definition { Peak position (ppm, cm^-1, m/z, ...). }
|
|
20
|
+
}
|
|
21
|
+
+intensity: String {
|
|
22
|
+
definition { Relative intensity. }
|
|
23
|
+
}
|
|
24
|
+
+multiplicity: String {
|
|
25
|
+
definition { Splitting pattern (s, d, t, q, m). }
|
|
26
|
+
}
|
|
27
|
+
+assignment: String {
|
|
28
|
+
definition { Structural assignment of the peak. }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
class SubstanceRecord {
|
|
2
|
+
definition {
|
|
3
|
+
The resolved view of a substance produced by a resolver source,
|
|
4
|
+
shaped after the CAS Common Chemistry detail payload so resolver
|
|
5
|
+
output maps onto it 1:1. Every identifier and property carries
|
|
6
|
+
its own provenance.
|
|
7
|
+
}
|
|
8
|
+
+preferredName: String {
|
|
9
|
+
definition { The source's preferred chemical name. }
|
|
10
|
+
}
|
|
11
|
+
+synonyms: String[0..*] {
|
|
12
|
+
definition { Systematic, common, and trade names. }
|
|
13
|
+
}
|
|
14
|
+
+formula: String {
|
|
15
|
+
definition { Molecular formula as stated by the source. }
|
|
16
|
+
}
|
|
17
|
+
+molecularWeight: Real {
|
|
18
|
+
definition { Molecular weight in g/mol as stated by the source. }
|
|
19
|
+
}
|
|
20
|
+
+identifiers: ProvenancedIdentifier[1..*] {
|
|
21
|
+
definition { The substance's identifiers, each with provenance. }
|
|
22
|
+
}
|
|
23
|
+
+properties: ProvenancedProperty[0..*] {
|
|
24
|
+
definition { Physical properties, each with provenance. }
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
class ProvenancedIdentifier {
|
|
29
|
+
definition { An identifier together with where it came from. }
|
|
30
|
+
+identifier: Identifier {
|
|
31
|
+
definition { The identifier value and convention. }
|
|
32
|
+
}
|
|
33
|
+
+provenance: Provenance {
|
|
34
|
+
definition { The source that asserted this identifier. }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
class ProvenancedProperty {
|
|
39
|
+
definition { A named physical property with units and provenance. }
|
|
40
|
+
+name: String {
|
|
41
|
+
definition { e.g. "boiling point", "melting point", "density". }
|
|
42
|
+
}
|
|
43
|
+
+value: String {
|
|
44
|
+
definition { The property value as stated by the source. }
|
|
45
|
+
}
|
|
46
|
+
+units: String {
|
|
47
|
+
definition { Units of the value, when stated. }
|
|
48
|
+
}
|
|
49
|
+
+provenance: Provenance {
|
|
50
|
+
definition { The source that asserted this property. }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
class ZMatrix {
|
|
2
|
+
definition {
|
|
3
|
+
Internal coordinates: each row places an atom by distance, angle,
|
|
4
|
+
and dihedral relative to previously defined atoms.
|
|
5
|
+
}
|
|
6
|
+
+rows: ZRow[0..*] {
|
|
7
|
+
definition { The z-matrix rows in definition order. }
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class ZRow {
|
|
11
|
+
definition { One atom placement by internal coordinates. }
|
|
12
|
+
+atom: String {
|
|
13
|
+
definition { This row's atom label, e.g. "H1". }
|
|
14
|
+
}
|
|
15
|
+
+ref1: String {
|
|
16
|
+
definition { Label of the bond-length reference atom. }
|
|
17
|
+
}
|
|
18
|
+
+distance: String {
|
|
19
|
+
definition { Bond length to ref1. }
|
|
20
|
+
}
|
|
21
|
+
+ref2: String {
|
|
22
|
+
definition { Label of the angle reference atom. }
|
|
23
|
+
}
|
|
24
|
+
+angle: String {
|
|
25
|
+
definition { Angle atom-ref1-ref2 in degrees. }
|
|
26
|
+
}
|
|
27
|
+
+ref3: String {
|
|
28
|
+
definition { Label of the dihedral reference atom. }
|
|
29
|
+
}
|
|
30
|
+
+dihedral: String {
|
|
31
|
+
definition { Dihedral ref2-ref1-atom in degrees. }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
%YAML 1.2
|
|
2
|
+
---
|
|
3
|
+
$id: "https://github.com/asciichem/asciichem-model/v1/atom"
|
|
4
|
+
title: AsciiChem Atom node
|
|
5
|
+
description: |
|
|
6
|
+
A chemical atom in the canonical wire form. A prefix superscript
|
|
7
|
+
(isotope) binds to the atom — the defining semantic fix over
|
|
8
|
+
AsciiMath's phantom `{}` carrier.
|
|
9
|
+
type: object
|
|
10
|
+
required: [type, element]
|
|
11
|
+
properties:
|
|
12
|
+
type:
|
|
13
|
+
const: atom
|
|
14
|
+
element:
|
|
15
|
+
type: string
|
|
16
|
+
pattern: "^[A-Z][a-z]?$"
|
|
17
|
+
description: Element symbol (e.g. "C", "Cl").
|
|
18
|
+
examples: ["C", "Cl", "Fe"]
|
|
19
|
+
isotope:
|
|
20
|
+
type: string
|
|
21
|
+
pattern: "^\\d+$"
|
|
22
|
+
description: Isotope mass number bound to this atom ("14" in ^14C).
|
|
23
|
+
charge:
|
|
24
|
+
type: string
|
|
25
|
+
description: Charge annotation (e.g. "2+", "-").
|
|
26
|
+
subscript:
|
|
27
|
+
type: string
|
|
28
|
+
pattern: "^\\d+$"
|
|
29
|
+
description: Subscript multiplicity ("2" in H_2O).
|
|
30
|
+
oxidationState:
|
|
31
|
+
type: string
|
|
32
|
+
description: Oxidation state annotation ("II" in Ca^(II)).
|
|
33
|
+
lonePairs:
|
|
34
|
+
type: integer
|
|
35
|
+
minimum: 0
|
|
36
|
+
description: Lewis lone-pair markers ("::O" carries 2).
|
|
37
|
+
radicalElectrons:
|
|
38
|
+
type: integer
|
|
39
|
+
minimum: 0
|
|
40
|
+
description: Radical-electron markers ("N." carries 1).
|
|
41
|
+
ringClosures:
|
|
42
|
+
type: string
|
|
43
|
+
pattern: "^\\d+$|^(\\d)+$"
|
|
44
|
+
description: SMILES-style ring closure digits ("1" in C1...C1).
|
|
45
|
+
additionalProperties: false
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
%YAML 1.2
|
|
2
|
+
---
|
|
3
|
+
$id: "https://github.com/asciichem/asciichem-model/v1/bond"
|
|
4
|
+
title: AsciiChem Bond node
|
|
5
|
+
description: |
|
|
6
|
+
A bond between adjacent atoms in a linear structure. Kind enum is
|
|
7
|
+
the single source of truth shared by every implementation; adding a
|
|
8
|
+
kind is a MINOR model bump.
|
|
9
|
+
type: object
|
|
10
|
+
required: [type]
|
|
11
|
+
properties:
|
|
12
|
+
type:
|
|
13
|
+
const: bond
|
|
14
|
+
kind:
|
|
15
|
+
default: single
|
|
16
|
+
enum: [single, double, triple, quadruple, wedge, hash, dative, wavy]
|
|
17
|
+
description: |
|
|
18
|
+
single (-), double (=), triple (#), quadruple (##), wedge (>-),
|
|
19
|
+
hash (-<), dative (~>), wavy (~~).
|
|
20
|
+
additionalProperties: false
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
%YAML 1.2
|
|
2
|
+
---
|
|
3
|
+
$id: "https://github.com/asciichem/asciichem-model/v1/calculation"
|
|
4
|
+
title: AsciiChem Calculation node
|
|
5
|
+
description: |
|
|
6
|
+
A computational-chemistry result: method, basis set, and computed
|
|
7
|
+
properties.
|
|
8
|
+
type: object
|
|
9
|
+
required: [type]
|
|
10
|
+
properties:
|
|
11
|
+
type:
|
|
12
|
+
const: calculation
|
|
13
|
+
method:
|
|
14
|
+
type: string
|
|
15
|
+
description: e.g. "B3LYP".
|
|
16
|
+
basis:
|
|
17
|
+
type: string
|
|
18
|
+
description: e.g. "6-31G(d)".
|
|
19
|
+
properties:
|
|
20
|
+
type: array
|
|
21
|
+
items:
|
|
22
|
+
type: object
|
|
23
|
+
required: [title, value]
|
|
24
|
+
properties:
|
|
25
|
+
title:
|
|
26
|
+
type: string
|
|
27
|
+
description: Property name, e.g. "dipole".
|
|
28
|
+
value:
|
|
29
|
+
type: string
|
|
30
|
+
units:
|
|
31
|
+
type: string
|
|
32
|
+
dictRef:
|
|
33
|
+
type: string
|
|
34
|
+
convention:
|
|
35
|
+
type: string
|
|
36
|
+
additionalProperties: false
|
|
37
|
+
additionalProperties: false
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
%YAML 1.2
|
|
2
|
+
---
|
|
3
|
+
$id: "https://github.com/asciichem/asciichem-model/v1/crystal"
|
|
4
|
+
title: AsciiChem Crystal node
|
|
5
|
+
description: |
|
|
6
|
+
A crystallographic cell: unit-cell constants, space group, and the
|
|
7
|
+
asymmetric-unit atoms with fractional coordinates.
|
|
8
|
+
type: object
|
|
9
|
+
required: [type]
|
|
10
|
+
properties:
|
|
11
|
+
type:
|
|
12
|
+
const: crystal
|
|
13
|
+
name:
|
|
14
|
+
type: string
|
|
15
|
+
description: Mineral/compound name.
|
|
16
|
+
a: { type: number, description: Cell length a (Angstrom). }
|
|
17
|
+
b: { type: number, description: Cell length b. }
|
|
18
|
+
c: { type: number, description: Cell length c. }
|
|
19
|
+
alpha: { type: number, description: Cell angle alpha (degrees). }
|
|
20
|
+
beta: { type: number, description: Cell angle beta. }
|
|
21
|
+
gamma: { type: number, description: Cell angle gamma. }
|
|
22
|
+
spacegroup:
|
|
23
|
+
type: string
|
|
24
|
+
description: Hermann-Mauguin symbol, e.g. "Fm-3m".
|
|
25
|
+
atoms:
|
|
26
|
+
type: array
|
|
27
|
+
description: Asymmetric-unit atoms (fractional coordinates ride on the atom's coordinate annotations).
|
|
28
|
+
items:
|
|
29
|
+
$ref: "atom.yaml"
|
|
30
|
+
additionalProperties: false
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
%YAML 1.2
|
|
2
|
+
---
|
|
3
|
+
$id: "https://github.com/asciichem/asciichem-model/v1/electron-configuration"
|
|
4
|
+
title: AsciiChem ElectronConfiguration node
|
|
5
|
+
description: |
|
|
6
|
+
Orbital occupancy (`1s^2 2s^2 2p^6`) with an optional term symbol
|
|
7
|
+
(^{multiplicity}L_J).
|
|
8
|
+
type: object
|
|
9
|
+
required: [type, orbitals]
|
|
10
|
+
properties:
|
|
11
|
+
type:
|
|
12
|
+
const: electron-configuration
|
|
13
|
+
orbitals:
|
|
14
|
+
type: array
|
|
15
|
+
description: Ordered orbital occupancies.
|
|
16
|
+
items:
|
|
17
|
+
type: object
|
|
18
|
+
required: [orbital, occupancy]
|
|
19
|
+
properties:
|
|
20
|
+
orbital:
|
|
21
|
+
type: string
|
|
22
|
+
description: Orbital label, e.g. "1s", "2p".
|
|
23
|
+
occupancy:
|
|
24
|
+
type: string
|
|
25
|
+
pattern: "^\\d+$"
|
|
26
|
+
description: Electron count in this orbital.
|
|
27
|
+
additionalProperties: false
|
|
28
|
+
termSymbol:
|
|
29
|
+
type: object
|
|
30
|
+
description: Optional atomic term symbol.
|
|
31
|
+
properties:
|
|
32
|
+
multiplicity:
|
|
33
|
+
type: string
|
|
34
|
+
pattern: "^\\d+$"
|
|
35
|
+
description: Spin multiplicity (2S+1).
|
|
36
|
+
letter:
|
|
37
|
+
type: string
|
|
38
|
+
description: Orbital angular momentum letter (S, P, D, ...).
|
|
39
|
+
jValue:
|
|
40
|
+
type: string
|
|
41
|
+
description: Total angular momentum J.
|
|
42
|
+
additionalProperties: false
|
|
43
|
+
additionalProperties: false
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
%YAML 1.2
|
|
2
|
+
---
|
|
3
|
+
$id: "https://github.com/asciichem/asciichem-model/v1/embedded-math"
|
|
4
|
+
title: AsciiChem EmbeddedMath node
|
|
5
|
+
description: |
|
|
6
|
+
Math embedded in chemistry (backtick syntax, e.g. `K_c = 1`). The
|
|
7
|
+
wire form carries the AsciiMath source; the parsed
|
|
8
|
+
Plurimath::Math::Formula is a Ruby-implementation detail.
|
|
9
|
+
type: object
|
|
10
|
+
required: [type, source]
|
|
11
|
+
properties:
|
|
12
|
+
type:
|
|
13
|
+
const: embedded-math
|
|
14
|
+
source:
|
|
15
|
+
type: string
|
|
16
|
+
minLength: 1
|
|
17
|
+
description: The backticked AsciiMath source text.
|
|
18
|
+
additionalProperties: false
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# 02 — Molecule with coefficient, atoms, and substance identifiers
|
|
2
|
+
|
|
3
|
+
# `2H_2O` annotated with validated identity: water's CAS RN and InChI.
|
|
4
|
+
type: molecule
|
|
5
|
+
coefficient: "2"
|
|
6
|
+
nodes:
|
|
7
|
+
- type: atom
|
|
8
|
+
element: H
|
|
9
|
+
subscript: "2"
|
|
10
|
+
- type: atom
|
|
11
|
+
element: O
|
|
12
|
+
identifiers:
|
|
13
|
+
- type: identifier
|
|
14
|
+
value: "7732-18-5"
|
|
15
|
+
convention: cas
|
|
16
|
+
- type: identifier
|
|
17
|
+
value: "InChI=1S/H2O/h1H2"
|
|
18
|
+
convention: inchi
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 04 — Reaction with equilibrium arrow and conditions
|
|
2
|
+
|
|
3
|
+
# `N_2 + 3H_2 <=>[Fe][400°C] 2NH_3`: catalyst above the arrow,
|
|
4
|
+
# temperature below.
|
|
5
|
+
type: reaction
|
|
6
|
+
arrow: equilibrium
|
|
7
|
+
conditions:
|
|
8
|
+
above: "Fe"
|
|
9
|
+
below: "400°C"
|
|
10
|
+
reactants:
|
|
11
|
+
- type: molecule
|
|
12
|
+
nodes:
|
|
13
|
+
- type: atom
|
|
14
|
+
element: N
|
|
15
|
+
subscript: "2"
|
|
16
|
+
- type: molecule
|
|
17
|
+
coefficient: "3"
|
|
18
|
+
nodes:
|
|
19
|
+
- type: atom
|
|
20
|
+
element: H
|
|
21
|
+
subscript: "2"
|
|
22
|
+
products:
|
|
23
|
+
- type: molecule
|
|
24
|
+
coefficient: "2"
|
|
25
|
+
nodes:
|
|
26
|
+
- type: atom
|
|
27
|
+
element: N
|
|
28
|
+
- type: atom
|
|
29
|
+
element: H
|
|
30
|
+
subscript: "3"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# 05 — SubstanceRecord: aspirin resolved from CAS Common Chemistry
|
|
2
|
+
|
|
3
|
+
# The resolved view a resolver produces for CAS RN 50-78-2. Every
|
|
4
|
+
# identifier and property carries provenance; the attribution line is
|
|
5
|
+
# required because Common Chemistry content is CC BY-NC 4.0.
|
|
6
|
+
type: substance-record
|
|
7
|
+
preferredName: Aspirin
|
|
8
|
+
synonyms:
|
|
9
|
+
- 2-Acetyloxybenzoic acid
|
|
10
|
+
- acetylsalicylic acid
|
|
11
|
+
formula: C9H8O4
|
|
12
|
+
molecularWeight: 180.16
|
|
13
|
+
identifiers:
|
|
14
|
+
- identifier:
|
|
15
|
+
type: identifier
|
|
16
|
+
value: "50-78-2"
|
|
17
|
+
convention: cas
|
|
18
|
+
provenance:
|
|
19
|
+
type: provenance
|
|
20
|
+
source: commonchemistry
|
|
21
|
+
retrievedAt: "2026-09-09T00:00:00Z"
|
|
22
|
+
attribution: "CAS Common Chemistry, CC BY-NC 4.0"
|
|
23
|
+
- identifier:
|
|
24
|
+
type: identifier
|
|
25
|
+
value: "BSYNRYMUTXBXSQ-UHFFFAOYSA-N"
|
|
26
|
+
convention: inchikey
|
|
27
|
+
provenance:
|
|
28
|
+
type: provenance
|
|
29
|
+
source: commonchemistry
|
|
30
|
+
retrievedAt: "2026-09-09T00:00:00Z"
|
|
31
|
+
attribution: "CAS Common Chemistry, CC BY-NC 4.0"
|
|
32
|
+
properties:
|
|
33
|
+
- name: melting point
|
|
34
|
+
value: "135"
|
|
35
|
+
units: "°C"
|
|
36
|
+
provenance:
|
|
37
|
+
type: provenance
|
|
38
|
+
source: commonchemistry
|
|
39
|
+
retrievedAt: "2026-09-09T00:00:00Z"
|
|
40
|
+
attribution: "CAS Common Chemistry, CC BY-NC 4.0"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# 06 — Electron configuration with term symbol
|
|
2
|
+
|
|
3
|
+
# `1s^2 2s^2 2p^6 3d^10 4s^2` style occupancy plus an optional
|
|
4
|
+
# atomic term symbol.
|
|
5
|
+
type: electron-configuration
|
|
6
|
+
orbitals:
|
|
7
|
+
- orbital: 1s
|
|
8
|
+
occupancy: "2"
|
|
9
|
+
- orbital: 2s
|
|
10
|
+
occupancy: "2"
|
|
11
|
+
- orbital: 2p
|
|
12
|
+
occupancy: "6"
|
|
13
|
+
termSymbol:
|
|
14
|
+
multiplicity: "3"
|
|
15
|
+
letter: P
|
|
16
|
+
jValue: "2"
|