chemicalml 0.1.0

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.
Files changed (248) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rubocop.yml +20 -0
  4. data/CHANGELOG.md +21 -0
  5. data/CLAUDE.md +198 -0
  6. data/Gemfile +14 -0
  7. data/LICENSE +24 -0
  8. data/NOTICES.adoc +115 -0
  9. data/README.adoc +87 -0
  10. data/Rakefile +8 -0
  11. data/TODO.align/01-cml-base-mixins.md +122 -0
  12. data/TODO.align/02-real-schema-hierarchies.md +88 -0
  13. data/TODO.align/03-configuration.md +50 -0
  14. data/TODO.align/04-parse-entry-points.md +59 -0
  15. data/TODO.align/05-schema-aware-translator.md +33 -0
  16. data/TODO.align/06-no-respond-to.md +44 -0
  17. data/TODO.align/07-canon-xml-comparison.md +43 -0
  18. data/TODO.align/08-expand-fixtures.md +37 -0
  19. data/TODO.align/09-final-spec-lint.md +29 -0
  20. data/TODO.align/10-role-marker-modules.md +54 -0
  21. data/TODO.align/11-dry-configuration.md +63 -0
  22. data/TODO.align/12-wire-class-macro.md +51 -0
  23. data/TODO.align/13-wire-namespace.md +44 -0
  24. data/TODO.align/14-schema24-correctness.md +37 -0
  25. data/TODO.align/15-canon-fixture-roundtrip.md +38 -0
  26. data/TODO.align/16-schema24-convention-coverage.md +33 -0
  27. data/TODO.align/17-final-spec-lint.md +28 -0
  28. data/TODO.align/README.md +27 -0
  29. data/TODO.align/README.round2.md +24 -0
  30. data/TODO.cml-full/01-reference-docs.md +43 -0
  31. data/TODO.cml-full/02-schema-versioned-model.md +70 -0
  32. data/TODO.cml-full/03-fixtures-scrape.md +52 -0
  33. data/TODO.cml-full/04-convention-framework.md +69 -0
  34. data/TODO.cml-full/05-dictionary-layer.md +77 -0
  35. data/TODO.cml-full/06-extend-canonical-translator.md +60 -0
  36. data/TODO.cml-full/07-attribution-notices.md +42 -0
  37. data/TODO.cml-full/08-autoload-only.md +48 -0
  38. data/TODO.cml-full/09-spec-coverage.md +38 -0
  39. data/TODO.cml-full/README.md +23 -0
  40. data/chemicalml.gemspec +35 -0
  41. data/data/dictionaries/_index.yaml +14 -0
  42. data/data/dictionaries/compchem.yaml +481 -0
  43. data/data/dictionaries/unit_non_si.yaml +53 -0
  44. data/data/dictionaries/unit_si.yaml +87 -0
  45. data/data/dictionaries/unit_type.yaml +113 -0
  46. data/lib/chemicalml/cml/array.rb +10 -0
  47. data/lib/chemicalml/cml/atom.rb +10 -0
  48. data/lib/chemicalml/cml/atom_array.rb +10 -0
  49. data/lib/chemicalml/cml/atom_parity.rb +10 -0
  50. data/lib/chemicalml/cml/base/array.rb +36 -0
  51. data/lib/chemicalml/cml/base/atom.rb +38 -0
  52. data/lib/chemicalml/cml/base/atom_array.rb +22 -0
  53. data/lib/chemicalml/cml/base/atom_parity.rb +24 -0
  54. data/lib/chemicalml/cml/base/bond.rb +28 -0
  55. data/lib/chemicalml/cml/base/bond_array.rb +22 -0
  56. data/lib/chemicalml/cml/base/bond_stereo.rb +28 -0
  57. data/lib/chemicalml/cml/base/cml_module.rb +40 -0
  58. data/lib/chemicalml/cml/base/dictionary.rb +32 -0
  59. data/lib/chemicalml/cml/base/dictionary_entry.rb +34 -0
  60. data/lib/chemicalml/cml/base/document.rb +26 -0
  61. data/lib/chemicalml/cml/base/formula.rb +38 -0
  62. data/lib/chemicalml/cml/base/identifier.rb +26 -0
  63. data/lib/chemicalml/cml/base/label.rb +28 -0
  64. data/lib/chemicalml/cml/base/list.rb +36 -0
  65. data/lib/chemicalml/cml/base/matrix.rb +38 -0
  66. data/lib/chemicalml/cml/base/metadata.rb +30 -0
  67. data/lib/chemicalml/cml/base/metadata_list.rb +28 -0
  68. data/lib/chemicalml/cml/base/molecule.rb +40 -0
  69. data/lib/chemicalml/cml/base/name.rb +26 -0
  70. data/lib/chemicalml/cml/base/parameter.rb +34 -0
  71. data/lib/chemicalml/cml/base/parameter_list.rb +28 -0
  72. data/lib/chemicalml/cml/base/product.rb +22 -0
  73. data/lib/chemicalml/cml/base/product_list.rb +22 -0
  74. data/lib/chemicalml/cml/base/property.rb +34 -0
  75. data/lib/chemicalml/cml/base/property_list.rb +28 -0
  76. data/lib/chemicalml/cml/base/reactant.rb +22 -0
  77. data/lib/chemicalml/cml/base/reactant_list.rb +22 -0
  78. data/lib/chemicalml/cml/base/reaction.rb +32 -0
  79. data/lib/chemicalml/cml/base/reaction_list.rb +22 -0
  80. data/lib/chemicalml/cml/base/scalar.rb +32 -0
  81. data/lib/chemicalml/cml/base/substance.rb +30 -0
  82. data/lib/chemicalml/cml/base/unit.rb +38 -0
  83. data/lib/chemicalml/cml/base/unit_list.rb +30 -0
  84. data/lib/chemicalml/cml/base/unit_type.rb +28 -0
  85. data/lib/chemicalml/cml/base/unit_type_list.rb +30 -0
  86. data/lib/chemicalml/cml/base.rb +51 -0
  87. data/lib/chemicalml/cml/bond.rb +10 -0
  88. data/lib/chemicalml/cml/bond_array.rb +10 -0
  89. data/lib/chemicalml/cml/bond_stereo.rb +10 -0
  90. data/lib/chemicalml/cml/cml_module.rb +10 -0
  91. data/lib/chemicalml/cml/dictionary.rb +10 -0
  92. data/lib/chemicalml/cml/dictionary_entry.rb +10 -0
  93. data/lib/chemicalml/cml/document.rb +10 -0
  94. data/lib/chemicalml/cml/elements.rb +58 -0
  95. data/lib/chemicalml/cml/formula.rb +10 -0
  96. data/lib/chemicalml/cml/identifier.rb +10 -0
  97. data/lib/chemicalml/cml/label.rb +10 -0
  98. data/lib/chemicalml/cml/list.rb +10 -0
  99. data/lib/chemicalml/cml/matrix.rb +10 -0
  100. data/lib/chemicalml/cml/metadata.rb +10 -0
  101. data/lib/chemicalml/cml/metadata_list.rb +10 -0
  102. data/lib/chemicalml/cml/molecule.rb +10 -0
  103. data/lib/chemicalml/cml/name.rb +10 -0
  104. data/lib/chemicalml/cml/namespace.rb +17 -0
  105. data/lib/chemicalml/cml/parameter.rb +10 -0
  106. data/lib/chemicalml/cml/parameter_list.rb +10 -0
  107. data/lib/chemicalml/cml/product.rb +10 -0
  108. data/lib/chemicalml/cml/product_list.rb +10 -0
  109. data/lib/chemicalml/cml/property.rb +10 -0
  110. data/lib/chemicalml/cml/property_list.rb +10 -0
  111. data/lib/chemicalml/cml/reactant.rb +10 -0
  112. data/lib/chemicalml/cml/reactant_list.rb +10 -0
  113. data/lib/chemicalml/cml/reaction.rb +10 -0
  114. data/lib/chemicalml/cml/reaction_list.rb +10 -0
  115. data/lib/chemicalml/cml/role/array.rb +13 -0
  116. data/lib/chemicalml/cml/role/atom.rb +13 -0
  117. data/lib/chemicalml/cml/role/atom_array.rb +13 -0
  118. data/lib/chemicalml/cml/role/atom_parity.rb +13 -0
  119. data/lib/chemicalml/cml/role/bond.rb +13 -0
  120. data/lib/chemicalml/cml/role/bond_array.rb +13 -0
  121. data/lib/chemicalml/cml/role/bond_stereo.rb +13 -0
  122. data/lib/chemicalml/cml/role/cml_module.rb +14 -0
  123. data/lib/chemicalml/cml/role/dictionary.rb +13 -0
  124. data/lib/chemicalml/cml/role/dictionary_entry.rb +13 -0
  125. data/lib/chemicalml/cml/role/document.rb +13 -0
  126. data/lib/chemicalml/cml/role/formula.rb +13 -0
  127. data/lib/chemicalml/cml/role/identifier.rb +13 -0
  128. data/lib/chemicalml/cml/role/label.rb +13 -0
  129. data/lib/chemicalml/cml/role/list.rb +13 -0
  130. data/lib/chemicalml/cml/role/matrix.rb +13 -0
  131. data/lib/chemicalml/cml/role/metadata.rb +13 -0
  132. data/lib/chemicalml/cml/role/metadata_list.rb +13 -0
  133. data/lib/chemicalml/cml/role/molecule.rb +13 -0
  134. data/lib/chemicalml/cml/role/name.rb +13 -0
  135. data/lib/chemicalml/cml/role/parameter.rb +13 -0
  136. data/lib/chemicalml/cml/role/parameter_list.rb +13 -0
  137. data/lib/chemicalml/cml/role/product.rb +13 -0
  138. data/lib/chemicalml/cml/role/product_list.rb +13 -0
  139. data/lib/chemicalml/cml/role/property.rb +13 -0
  140. data/lib/chemicalml/cml/role/property_list.rb +13 -0
  141. data/lib/chemicalml/cml/role/reactant.rb +13 -0
  142. data/lib/chemicalml/cml/role/reactant_list.rb +13 -0
  143. data/lib/chemicalml/cml/role/reaction.rb +13 -0
  144. data/lib/chemicalml/cml/role/reaction_list.rb +13 -0
  145. data/lib/chemicalml/cml/role/scalar.rb +13 -0
  146. data/lib/chemicalml/cml/role/substance.rb +13 -0
  147. data/lib/chemicalml/cml/role/unit.rb +13 -0
  148. data/lib/chemicalml/cml/role/unit_list.rb +13 -0
  149. data/lib/chemicalml/cml/role/unit_type.rb +13 -0
  150. data/lib/chemicalml/cml/role/unit_type_list.rb +13 -0
  151. data/lib/chemicalml/cml/role.rb +54 -0
  152. data/lib/chemicalml/cml/scalar.rb +10 -0
  153. data/lib/chemicalml/cml/schema24/configuration.rb +19 -0
  154. data/lib/chemicalml/cml/schema24.rb +40 -0
  155. data/lib/chemicalml/cml/schema3/configuration.rb +17 -0
  156. data/lib/chemicalml/cml/schema3.rb +40 -0
  157. data/lib/chemicalml/cml/substance.rb +10 -0
  158. data/lib/chemicalml/cml/translator/value_translations.rb +265 -0
  159. data/lib/chemicalml/cml/translator.rb +233 -0
  160. data/lib/chemicalml/cml/unit.rb +10 -0
  161. data/lib/chemicalml/cml/unit_list.rb +10 -0
  162. data/lib/chemicalml/cml/unit_type.rb +10 -0
  163. data/lib/chemicalml/cml/unit_type_list.rb +10 -0
  164. data/lib/chemicalml/cml/visitable.rb +65 -0
  165. data/lib/chemicalml/cml/wire_class_macro.rb +45 -0
  166. data/lib/chemicalml/cml.rb +55 -0
  167. data/lib/chemicalml/context_configuration.rb +127 -0
  168. data/lib/chemicalml/convention/base.rb +48 -0
  169. data/lib/chemicalml/convention/compchem/constraints/compchem_module_must_contain_job_list.rb +33 -0
  170. data/lib/chemicalml/convention/compchem/constraints/job_must_contain_initialization.rb +38 -0
  171. data/lib/chemicalml/convention/compchem/constraints.rb +14 -0
  172. data/lib/chemicalml/convention/compchem.rb +28 -0
  173. data/lib/chemicalml/convention/constraint.rb +79 -0
  174. data/lib/chemicalml/convention/dictionary/constraints/entry_ids_unique_within_dictionary.rb +33 -0
  175. data/lib/chemicalml/convention/dictionary/constraints/entry_must_have_id_and_term.rb +34 -0
  176. data/lib/chemicalml/convention/dictionary/constraints.rb +14 -0
  177. data/lib/chemicalml/convention/dictionary.rb +28 -0
  178. data/lib/chemicalml/convention/molecular/constraints/atom_array_must_contain_atoms.rb +30 -0
  179. data/lib/chemicalml/convention/molecular/constraints/atom_ids_unique_within_molecule.rb +42 -0
  180. data/lib/chemicalml/convention/molecular/constraints/bond_must_reference_atoms_in_same_molecule.rb +54 -0
  181. data/lib/chemicalml/convention/molecular/constraints.rb +19 -0
  182. data/lib/chemicalml/convention/molecular.rb +29 -0
  183. data/lib/chemicalml/convention/registry.rb +50 -0
  184. data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_symbol_and_unit_type.rb +46 -0
  185. data/lib/chemicalml/convention/unit_dictionary/constraints.rb +12 -0
  186. data/lib/chemicalml/convention/unit_dictionary.rb +27 -0
  187. data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_must_have_id_and_name.rb +34 -0
  188. data/lib/chemicalml/convention/unit_type_dictionary/constraints.rb +12 -0
  189. data/lib/chemicalml/convention/unit_type_dictionary.rb +27 -0
  190. data/lib/chemicalml/convention/violation.rb +36 -0
  191. data/lib/chemicalml/convention.rb +39 -0
  192. data/lib/chemicalml/dictionary/entry.rb +59 -0
  193. data/lib/chemicalml/dictionary/enum.rb +51 -0
  194. data/lib/chemicalml/dictionary/link.rb +32 -0
  195. data/lib/chemicalml/dictionary/loader.rb +60 -0
  196. data/lib/chemicalml/dictionary/model.rb +64 -0
  197. data/lib/chemicalml/dictionary/registry.rb +75 -0
  198. data/lib/chemicalml/dictionary.rb +26 -0
  199. data/lib/chemicalml/errors.rb +7 -0
  200. data/lib/chemicalml/model/atom.rb +40 -0
  201. data/lib/chemicalml/model/bond.rb +33 -0
  202. data/lib/chemicalml/model/cml_array.rb +27 -0
  203. data/lib/chemicalml/model/cml_module.rb +45 -0
  204. data/lib/chemicalml/model/document.rb +29 -0
  205. data/lib/chemicalml/model/formula.rb +34 -0
  206. data/lib/chemicalml/model/identifier.rb +21 -0
  207. data/lib/chemicalml/model/label.rb +21 -0
  208. data/lib/chemicalml/model/matrix.rb +29 -0
  209. data/lib/chemicalml/model/metadata.rb +23 -0
  210. data/lib/chemicalml/model/metadata_list.rb +25 -0
  211. data/lib/chemicalml/model/molecule.rb +38 -0
  212. data/lib/chemicalml/model/name.rb +21 -0
  213. data/lib/chemicalml/model/node.rb +45 -0
  214. data/lib/chemicalml/model/parameter.rb +27 -0
  215. data/lib/chemicalml/model/parameter_list.rb +25 -0
  216. data/lib/chemicalml/model/product.rb +21 -0
  217. data/lib/chemicalml/model/product_list.rb +21 -0
  218. data/lib/chemicalml/model/property.rb +28 -0
  219. data/lib/chemicalml/model/property_list.rb +25 -0
  220. data/lib/chemicalml/model/reactant.rb +21 -0
  221. data/lib/chemicalml/model/reactant_list.rb +21 -0
  222. data/lib/chemicalml/model/reaction.rb +41 -0
  223. data/lib/chemicalml/model/reaction_list.rb +23 -0
  224. data/lib/chemicalml/model/scalar.rb +25 -0
  225. data/lib/chemicalml/model/substance.rb +25 -0
  226. data/lib/chemicalml/model.rb +38 -0
  227. data/lib/chemicalml/schema/definition.rb +41 -0
  228. data/lib/chemicalml/schema/registry.rb +30 -0
  229. data/lib/chemicalml/schema.rb +35 -0
  230. data/lib/chemicalml/version.rb +5 -0
  231. data/lib/chemicalml/versioned_parser.rb +43 -0
  232. data/lib/chemicalml.rb +47 -0
  233. data/lib/tasks/reference_fetch.rake +105 -0
  234. data/lib/tasks/scrape_fixtures.rake +133 -0
  235. data/reference-docs/conventions/compchem.md +141 -0
  236. data/reference-docs/conventions/dictionary.md +119 -0
  237. data/reference-docs/conventions/index.md +56 -0
  238. data/reference-docs/conventions/molecular.md +115 -0
  239. data/reference-docs/conventions/unit-dictionary.md +92 -0
  240. data/reference-docs/conventions/unitType-dictionary.md +51 -0
  241. data/reference-docs/dictionaries/compchem.md +335 -0
  242. data/reference-docs/dictionaries/index.md +52 -0
  243. data/reference-docs/examples/schema24-index.md +50 -0
  244. data/reference-docs/examples/schema3-compchem-index.md +14 -0
  245. data/reference-docs/examples/schema3-molecular-index.md +28 -0
  246. data/reference-docs/schemas/schema24/schema.xsd +10624 -0
  247. data/reference-docs/schemas/schema3/schema.xsd +11459 -0
  248. metadata +306 -0
@@ -0,0 +1,113 @@
1
+ # Unit Types Dictionary
2
+ #
3
+ # Source: http://www.xml-cml.org/unit/unitType/
4
+ # License: CC-BY-3.0 (http://creativecommons.org/licenses/by/3.0/)
5
+
6
+ ---
7
+ namespace: http://www.xml-cml.org/unit/unitType/
8
+ prefix: unitType
9
+ title: CML Unit Types
10
+ description: |
11
+ Unit types abstract over units: e.g. the units metre, angstrom and
12
+ picometre are all of type *length*; Kelvin is of type *temperature*.
13
+
14
+ entries:
15
+ - id: length
16
+ term: Length
17
+ definition: A measure of one-dimensional distance.
18
+ - id: mass
19
+ term: Mass
20
+ definition: A measure of the amount of matter in an object.
21
+ - id: time
22
+ term: Time
23
+ definition: A measure of duration.
24
+ - id: temperature
25
+ term: Temperature
26
+ definition: A measure of thermal energy.
27
+ - id: electricCurrent
28
+ term: Electric Current
29
+ definition: A measure of the flow of electric charge.
30
+ - id: amountOfSubstance
31
+ term: Amount of Substance
32
+ definition: A measure of the number of particles in a sample.
33
+ - id: luminousIntensity
34
+ term: Luminous Intensity
35
+ definition: A measure of the wavelength-weighted power emitted by a light source.
36
+ - id: angle
37
+ term: Angle
38
+ definition: A measure of a plane angle.
39
+ - id: solidAngle
40
+ term: Solid Angle
41
+ definition: A measure of a two-dimensional angle in three-dimensional space.
42
+ - id: area
43
+ term: Area
44
+ definition: A measure of two-dimensional extent.
45
+ - id: volume
46
+ term: Volume
47
+ definition: A measure of three-dimensional extent.
48
+ - id: velocity
49
+ term: Velocity
50
+ definition: A measure of the rate of change of position.
51
+ - id: acceleration
52
+ term: Acceleration
53
+ definition: A measure of the rate of change of velocity.
54
+ - id: force
55
+ term: Force
56
+ definition: A measure of an influence that changes the motion of an object.
57
+ - id: pressure
58
+ term: Pressure
59
+ definition: A measure of force per unit area.
60
+ - id: energy
61
+ term: Energy
62
+ definition: A measure of the capacity to do work.
63
+ - id: power
64
+ term: Power
65
+ definition: A measure of the rate of doing work.
66
+ - id: electricCharge
67
+ term: Electric Charge
68
+ definition: A measure of the quantity of electricity.
69
+ - id: electricPotential
70
+ term: Electric Potential
71
+ definition: A measure of the electric potential energy per unit charge.
72
+ - id: electricCapacitance
73
+ term: Electric Capacitance
74
+ definition: A measure of the ability to store electric charge.
75
+ - id: electricResistance
76
+ term: Electric Resistance
77
+ definition: A measure of opposition to the flow of electric current.
78
+ - id: electricConductance
79
+ term: Electric Conductance
80
+ definition: A measure of how easily electric current flows.
81
+ - id: magneticFlux
82
+ term: Magnetic Flux
83
+ definition: A measure of the quantity of magnetism.
84
+ - id: magneticFluxDensity
85
+ term: Magnetic Flux Density
86
+ definition: A measure of the magnetic field strength.
87
+ - id: inductance
88
+ term: Inductance
89
+ definition: A measure of the property of an electric conductor to oppose changes in current.
90
+ - id: frequency
91
+ term: Frequency
92
+ definition: A measure of the number of occurrences of a repeating event per unit time.
93
+ - id: wavenumber
94
+ term: Wavenumber
95
+ definition: A measure of the spatial frequency of a wave.
96
+ - id: molarMass
97
+ term: Molar Mass
98
+ definition: A measure of the mass per amount of substance.
99
+ - id: molarEnergy
100
+ term: Molar Energy
101
+ definition: A measure of energy per amount of substance.
102
+ - id: dipoleMoment
103
+ term: Dipole Moment
104
+ definition: A measure of the separation of positive and negative charges.
105
+ - id: polarizability
106
+ term: Polarizability
107
+ definition: A measure of the tendency of a charge distribution to be distorted by an external electric field.
108
+ - id: dimensionless
109
+ term: Dimensionless
110
+ definition: A quantity with no physical dimensions.
111
+ - id: none
112
+ term: None
113
+ definition: Used for entries that conceptually have no units.
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Backward-compatible alias. New code should reference the versioned
4
+ # class directly: Chemicalml::Cml::Schema3::Array.
5
+ module Chemicalml
6
+ module Cml
7
+ remove_const(:Array) if const_defined?(:Array, false)
8
+ const_set(:Array, Chemicalml::Cml::Schema3::Array)
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Backward-compatible alias. New code should reference the versioned
4
+ # class directly: Chemicalml::Cml::Schema3::Atom.
5
+ module Chemicalml
6
+ module Cml
7
+ remove_const(:Atom) if const_defined?(:Atom, false)
8
+ const_set(:Atom, Chemicalml::Cml::Schema3::Atom)
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Backward-compatible alias. New code should reference the versioned
4
+ # class directly: Chemicalml::Cml::Schema3::AtomArray.
5
+ module Chemicalml
6
+ module Cml
7
+ remove_const(:AtomArray) if const_defined?(:AtomArray, false)
8
+ const_set(:AtomArray, Chemicalml::Cml::Schema3::AtomArray)
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Backward-compatible alias. New code should reference the versioned
4
+ # class directly: Chemicalml::Cml::Schema3::AtomParity.
5
+ module Chemicalml
6
+ module Cml
7
+ remove_const(:AtomParity) if const_defined?(:AtomParity, false)
8
+ const_set(:AtomParity, Chemicalml::Cml::Schema3::AtomParity)
9
+ end
10
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module Array
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::Array
10
+ attribute :id, :string
11
+ attribute :title, :string
12
+ attribute :dict_ref, :string
13
+ attribute :data_type, :string
14
+ attribute :units, :string
15
+ attribute :size, :string
16
+ attribute :delimiter, :string
17
+ attribute :content, :string
18
+
19
+ xml do
20
+ namespace Chemicalml::Cml::Namespace
21
+ root "array"
22
+ map_attribute "id", to: :id
23
+ map_attribute "title", to: :title
24
+ map_attribute "dictRef", to: :dict_ref
25
+ map_attribute "dataType", to: :data_type
26
+ map_attribute "units", to: :units
27
+ map_attribute "size", to: :size
28
+ map_attribute "delimiter", to: :delimiter
29
+ map_content to: :content
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module Atom
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::Atom
10
+ attribute :id, :string
11
+ attribute :element_type, :string
12
+ attribute :count, :string
13
+ attribute :formal_charge, :string
14
+ attribute :hydrogen_count, :string
15
+ attribute :isotope, :string
16
+ attribute :isotope_number, :string
17
+ attribute :spin_multiplicity, :string
18
+ attribute :title, :string
19
+
20
+ xml do
21
+ namespace Chemicalml::Cml::Namespace
22
+ root "atom"
23
+ map_attribute "id", to: :id
24
+ map_attribute "elementType", to: :element_type
25
+ map_attribute "count", to: :count
26
+ map_attribute "formalCharge", to: :formal_charge
27
+ map_attribute "hydrogenCount", to: :hydrogen_count
28
+ map_attribute "isotope", to: :isotope
29
+ map_attribute "isotopeNumber", to: :isotope_number
30
+ map_attribute "spinMultiplicity", to: :spin_multiplicity
31
+ map_attribute "title", to: :title
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module AtomArray
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::AtomArray
10
+ attribute :atoms, :atom, collection: true
11
+
12
+ xml do
13
+ namespace Chemicalml::Cml::Namespace
14
+ root "atomArray"
15
+ map_element "atom", to: :atoms
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module AtomParity
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::AtomParity
10
+ attribute :atom_refs4, :string
11
+ attribute :content, :string
12
+
13
+ xml do
14
+ namespace Chemicalml::Cml::Namespace
15
+ root "atomParity"
16
+ map_attribute "atomRefs4", to: :atom_refs4
17
+ map_content to: :content
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module Bond
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::Bond
10
+ attribute :id, :string
11
+ attribute :atom_refs2, :string
12
+ attribute :order, :string
13
+ attribute :title, :string
14
+
15
+ xml do
16
+ namespace Chemicalml::Cml::Namespace
17
+ root "bond"
18
+ map_attribute "id", to: :id
19
+ map_attribute "atomRefs2", to: :atom_refs2
20
+ map_attribute "order", to: :order
21
+ map_attribute "title", to: :title
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module BondArray
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::BondArray
10
+ attribute :bonds, :bond, collection: true
11
+
12
+ xml do
13
+ namespace Chemicalml::Cml::Namespace
14
+ root "bondArray"
15
+ map_element "bond", to: :bonds
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module BondStereo
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::BondStereo
10
+ attribute :atom_refs2, :string
11
+ attribute :atom_refs4, :string
12
+ attribute :dict_ref, :string
13
+ attribute :content, :string
14
+
15
+ xml do
16
+ namespace Chemicalml::Cml::Namespace
17
+ root "bondStereo"
18
+ map_attribute "atomRefs2", to: :atom_refs2
19
+ map_attribute "atomRefs4", to: :atom_refs4
20
+ map_attribute "dictRef", to: :dict_ref
21
+ map_content to: :content
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module Module
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::Module
10
+ attribute :id, :string
11
+ attribute :title, :string
12
+ attribute :dict_ref, :string
13
+ attribute :convention, :string
14
+ attribute :molecules, :molecule, collection: true
15
+ attribute :modules, :module, collection: true
16
+ attribute :parameter_lists, :parameterList, collection: true
17
+ attribute :property_lists, :propertyList, collection: true
18
+ attribute :metadata_lists, :metadataList, collection: true
19
+ attribute :lists, :list, collection: true
20
+
21
+ xml do
22
+ namespace Chemicalml::Cml::Namespace
23
+ root "module"
24
+ map_attribute "id", to: :id
25
+ map_attribute "title", to: :title
26
+ map_attribute "dictRef", to: :dict_ref
27
+ map_attribute "convention", to: :convention
28
+ map_element "molecule", to: :molecules
29
+ map_element "module", to: :modules
30
+ map_element "parameterList", to: :parameter_lists
31
+ map_element "propertyList", to: :property_lists
32
+ map_element "metadataList", to: :metadata_lists
33
+ map_element "list", to: :lists
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module Dictionary
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::Dictionary
10
+ attribute :title, :string
11
+ attribute :namespace, :string
12
+ attribute :dictionary_prefix, :string
13
+ attribute :convention, :string
14
+ attribute :description, :string
15
+ attribute :entries, :entry, collection: true
16
+
17
+ xml do
18
+ namespace Chemicalml::Cml::Namespace
19
+ root "dictionary"
20
+ map_attribute "title", to: :title
21
+ map_attribute "namespace", to: :namespace
22
+ map_attribute "dictionaryPrefix", to: :dictionary_prefix
23
+ map_attribute "convention", to: :convention
24
+ map_element "description", to: :description
25
+ map_element "entry", to: :entries
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module DictionaryEntry
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::DictionaryEntry
10
+ attribute :id, :string
11
+ attribute :term, :string
12
+ attribute :data_type, :string
13
+ attribute :unit_type, :string
14
+ attribute :units, :string
15
+ attribute :definition, :string
16
+ attribute :description, :string
17
+
18
+ xml do
19
+ namespace Chemicalml::Cml::Namespace
20
+ root "entry"
21
+ map_attribute "id", to: :id
22
+ map_attribute "term", to: :term
23
+ map_attribute "dataType", to: :data_type
24
+ map_attribute "unitType", to: :unit_type
25
+ map_attribute "units", to: :units
26
+ map_element "definition", to: :definition
27
+ map_element "description", to: :description
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module Document
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::Document
10
+ attribute :molecules, :molecule, collection: true
11
+ attribute :reaction_lists, :reactionList, collection: true
12
+ attribute :reactions, :reaction, collection: true
13
+
14
+ xml do
15
+ namespace Chemicalml::Cml::Namespace
16
+ root "cml"
17
+ map_element "molecule", to: :molecules
18
+ map_element "reactionList", to: :reaction_lists
19
+ map_element "reaction", to: :reactions
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module Formula
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::Formula
10
+ attribute :id, :string
11
+ attribute :title, :string
12
+ attribute :concise, :string
13
+ attribute :inline, :string
14
+ attribute :formal_charge, :string
15
+ attribute :count, :string
16
+ attribute :convention, :string
17
+ attribute :dict_ref, :string
18
+ attribute :atom_array, :atomArray
19
+
20
+ xml do
21
+ namespace Chemicalml::Cml::Namespace
22
+ root "formula"
23
+ map_attribute "id", to: :id
24
+ map_attribute "title", to: :title
25
+ map_attribute "concise", to: :concise
26
+ map_attribute "inline", to: :inline
27
+ map_attribute "formalCharge", to: :formal_charge
28
+ map_attribute "count", to: :count
29
+ map_attribute "convention", to: :convention
30
+ map_attribute "dictRef", to: :dict_ref
31
+ map_element "atomArray", to: :atom_array
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module Identifier
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::Identifier
10
+ attribute :value, :string
11
+ attribute :convention, :string
12
+ attribute :dict_ref, :string
13
+
14
+ xml do
15
+ namespace Chemicalml::Cml::Namespace
16
+ root "identifier"
17
+ map_attribute "value", to: :value
18
+ map_attribute "convention", to: :convention
19
+ map_attribute "dictRef", to: :dict_ref
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module Label
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::Label
10
+ attribute :id, :string
11
+ attribute :value, :string
12
+ attribute :dict_ref, :string
13
+ attribute :convention, :string
14
+
15
+ xml do
16
+ namespace Chemicalml::Cml::Namespace
17
+ root "label"
18
+ map_attribute "id", to: :id
19
+ map_attribute "value", to: :value
20
+ map_attribute "dictRef", to: :dict_ref
21
+ map_attribute "convention", to: :convention
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module List
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::List
10
+ attribute :id, :string
11
+ attribute :title, :string
12
+ attribute :dict_ref, :string
13
+ attribute :convention, :string
14
+ attribute :scalars, :scalar, collection: true
15
+ attribute :arrays, :array, collection: true
16
+ attribute :matrices, :matrix, collection: true
17
+ attribute :lists, :list, collection: true
18
+
19
+ xml do
20
+ namespace Chemicalml::Cml::Namespace
21
+ root "list"
22
+ map_attribute "id", to: :id
23
+ map_attribute "title", to: :title
24
+ map_attribute "dictRef", to: :dict_ref
25
+ map_attribute "convention", to: :convention
26
+ map_element "scalar", to: :scalars
27
+ map_element "array", to: :arrays
28
+ map_element "matrix", to: :matrices
29
+ map_element "list", to: :lists
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chemicalml
4
+ module Cml
5
+ module Base
6
+ module Matrix
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ include Chemicalml::Cml::Role::Matrix
10
+ attribute :id, :string
11
+ attribute :title, :string
12
+ attribute :dict_ref, :string
13
+ attribute :data_type, :string
14
+ attribute :units, :string
15
+ attribute :rows, :string
16
+ attribute :columns, :string
17
+ attribute :delimiter, :string
18
+ attribute :content, :string
19
+
20
+ xml do
21
+ namespace Chemicalml::Cml::Namespace
22
+ root "matrix"
23
+ map_attribute "id", to: :id
24
+ map_attribute "title", to: :title
25
+ map_attribute "dictRef", to: :dict_ref
26
+ map_attribute "dataType", to: :data_type
27
+ map_attribute "units", to: :units
28
+ map_attribute "rows", to: :rows
29
+ map_attribute "columns", to: :columns
30
+ map_attribute "delimiter", to: :delimiter
31
+ map_content to: :content
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end