chemicalml 0.2.0 → 0.2.1
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 +4 -4
- data/.github/workflows/release.yml +7 -1
- data/CLAUDE.md +48 -41
- data/TODO.align/36-molecular-convention-coverage.md +46 -0
- data/TODO.align/37-compchem-convention-coverage.md +55 -0
- data/TODO.align/38-dictionary-convention-coverage.md +34 -0
- data/TODO.align/39-unit-dictionary-convention-coverage.md +33 -0
- data/TODO.align/40-unit-type-dictionary-convention-coverage.md +28 -0
- data/TODO.align/41-expand-canonical-model-layer.md +43 -0
- data/TODO.align/42-translator-wire-new-models.md +31 -0
- data/TODO.align/43-dictionary-model-no-to-h.md +39 -0
- data/TODO.align/44-schema3-only-and-schema24-module.md +44 -0
- data/TODO.align/45-documentation-and-final-verification.md +23 -0
- data/TODO.align/46-lattice-vector-content.md +24 -0
- data/TODO.align/47-molecule-crystal-spectra-property-lists.md +23 -0
- data/TODO.align/48-model-list-and-module-lists.md +21 -0
- data/TODO.align/49-more-chemistry-models.md +34 -0
- data/TODO.align/50-validation-report.md +29 -0
- data/TODO.align/51-convention-auto-detection.md +30 -0
- data/TODO.align/52-schema24-legacy-elements.md +28 -0
- data/TODO.align/53-round-trip-integration-specs.md +30 -0
- data/TODO.align/54-document-versioned-parser-shim.md +38 -0
- data/TODO.align/55-molecule-missing-attributes.md +20 -0
- data/TODO.align/56-geometry-models.md +24 -0
- data/TODO.align/57-compchem-models.md +26 -0
- data/TODO.align/58-remaining-models.md +24 -0
- data/TODO.align/59-wire-new-models-translator.md +18 -0
- data/TODO.align/60-docs-and-final-verification.md +19 -0
- data/lib/chemicalml/cml/base/abundance.rb +6 -0
- data/lib/chemicalml/cml/base/action.rb +20 -0
- data/lib/chemicalml/cml/base/action_list.rb +18 -0
- data/lib/chemicalml/cml/base/alternative.rb +28 -0
- data/lib/chemicalml/cml/base/amount.rb +2 -0
- data/lib/chemicalml/cml/base/angle.rb +12 -0
- data/lib/chemicalml/cml/base/annotation.rb +30 -0
- data/lib/chemicalml/cml/base/appinfo.rb +32 -0
- data/lib/chemicalml/cml/base/arg.rb +46 -0
- data/lib/chemicalml/cml/base/array.rb +22 -0
- data/lib/chemicalml/cml/base/array_list.rb +2 -0
- data/lib/chemicalml/cml/base/atom.rb +18 -0
- data/lib/chemicalml/cml/base/atom_array.rb +38 -0
- data/lib/chemicalml/cml/base/atom_parity.rb +8 -0
- data/lib/chemicalml/cml/base/atom_set.rb +2 -0
- data/lib/chemicalml/cml/base/atom_type.rb +4 -0
- data/lib/chemicalml/cml/base/atom_type_list.rb +2 -0
- data/lib/chemicalml/cml/base/atomic_basis_function.rb +4 -0
- data/lib/chemicalml/cml/base/band.rb +2 -0
- data/lib/chemicalml/cml/base/basis_set.rb +4 -0
- data/lib/chemicalml/cml/base/bond.rb +6 -0
- data/lib/chemicalml/cml/base/bond_array.rb +16 -0
- data/lib/chemicalml/cml/base/bond_set.rb +2 -0
- data/lib/chemicalml/cml/base/bond_stereo.rb +10 -0
- data/lib/chemicalml/cml/base/bond_type.rb +2 -0
- data/lib/chemicalml/cml/base/bond_type_list.rb +2 -0
- data/lib/chemicalml/cml/base/cell_parameter.rb +4 -0
- data/lib/chemicalml/cml/base/complex_object.rb +30 -0
- data/lib/chemicalml/cml/base/condition_list.rb +4 -0
- data/lib/chemicalml/cml/base/crystal.rb +2 -0
- data/lib/chemicalml/cml/base/description.rb +2 -0
- data/lib/chemicalml/cml/base/dictionary.rb +6 -0
- data/lib/chemicalml/cml/base/dimension.rb +10 -0
- data/lib/chemicalml/cml/base/eigen.rb +2 -0
- data/lib/chemicalml/cml/base/electron.rb +6 -0
- data/lib/chemicalml/cml/base/enumeration.rb +32 -0
- data/lib/chemicalml/cml/base/expression.rb +32 -0
- data/lib/chemicalml/cml/base/float.rb +40 -0
- data/lib/chemicalml/cml/base/float_array.rb +42 -0
- data/lib/chemicalml/cml/base/fragment.rb +6 -0
- data/lib/chemicalml/cml/base/fragment_list.rb +4 -0
- data/lib/chemicalml/cml/base/identifier.rb +8 -0
- data/lib/chemicalml/cml/base/integer.rb +40 -0
- data/lib/chemicalml/cml/base/integer_array.rb +42 -0
- data/lib/chemicalml/cml/base/isotope.rb +2 -0
- data/lib/chemicalml/cml/base/isotope_list.rb +2 -0
- data/lib/chemicalml/cml/base/join.rb +6 -0
- data/lib/chemicalml/cml/base/kpoint.rb +2 -0
- data/lib/chemicalml/cml/base/label.rb +2 -0
- data/lib/chemicalml/cml/base/lattice.rb +2 -0
- data/lib/chemicalml/cml/base/lattice_vector.rb +2 -0
- data/lib/chemicalml/cml/base/length.rb +10 -0
- data/lib/chemicalml/cml/base/line3.rb +6 -0
- data/lib/chemicalml/cml/base/link.rb +20 -0
- data/lib/chemicalml/cml/base/list.rb +2 -0
- data/lib/chemicalml/cml/base/map.rb +12 -0
- data/lib/chemicalml/cml/base/matrix.rb +12 -0
- data/lib/chemicalml/cml/base/metadata.rb +4 -0
- data/lib/chemicalml/cml/base/metadata_list.rb +6 -0
- data/lib/chemicalml/cml/base/molecule.rb +10 -0
- data/lib/chemicalml/cml/base/molecule_list.rb +2 -0
- data/lib/chemicalml/cml/base/name.rb +2 -0
- data/lib/chemicalml/cml/base/object.rb +4 -0
- data/lib/chemicalml/cml/base/observation.rb +4 -0
- data/lib/chemicalml/cml/base/operator.rb +32 -0
- data/lib/chemicalml/cml/base/parameter.rb +10 -0
- data/lib/chemicalml/cml/base/parameter_list.rb +6 -0
- data/lib/chemicalml/cml/base/particle.rb +6 -0
- data/lib/chemicalml/cml/base/peak.rb +30 -0
- data/lib/chemicalml/cml/base/peak_group.rb +38 -0
- data/lib/chemicalml/cml/base/peak_list.rb +2 -0
- data/lib/chemicalml/cml/base/peak_structure.rb +14 -0
- data/lib/chemicalml/cml/base/plane3.rb +2 -0
- data/lib/chemicalml/cml/base/point3.rb +2 -0
- data/lib/chemicalml/cml/base/potential_form.rb +2 -0
- data/lib/chemicalml/cml/base/product.rb +16 -0
- data/lib/chemicalml/cml/base/product_list.rb +14 -0
- data/lib/chemicalml/cml/base/property.rb +6 -0
- data/lib/chemicalml/cml/base/property_list.rb +6 -0
- data/lib/chemicalml/cml/base/reactant.rb +16 -0
- data/lib/chemicalml/cml/base/reactant_list.rb +14 -0
- data/lib/chemicalml/cml/base/reaction.rb +16 -0
- data/lib/chemicalml/cml/base/reaction_list.rb +12 -0
- data/lib/chemicalml/cml/base/reaction_scheme.rb +10 -0
- data/lib/chemicalml/cml/base/reaction_step.rb +6 -0
- data/lib/chemicalml/cml/base/reaction_step_list.rb +8 -0
- data/lib/chemicalml/cml/base/region.rb +8 -0
- data/lib/chemicalml/cml/base/related_entry.rb +26 -0
- data/lib/chemicalml/cml/base/sample.rb +4 -0
- data/lib/chemicalml/cml/base/scalar.rb +18 -0
- data/lib/chemicalml/cml/base/spectator.rb +2 -0
- data/lib/chemicalml/cml/base/spectrum.rb +12 -0
- data/lib/chemicalml/cml/base/spectrum_data.rb +2 -0
- data/lib/chemicalml/cml/base/spectrum_list.rb +4 -0
- data/lib/chemicalml/cml/base/sphere3.rb +2 -0
- data/lib/chemicalml/cml/base/string.rb +32 -0
- data/lib/chemicalml/cml/base/string_array.rb +40 -0
- data/lib/chemicalml/cml/base/substance.rb +12 -0
- data/lib/chemicalml/cml/base/substance_list.rb +6 -0
- data/lib/chemicalml/cml/base/symmetry.rb +4 -0
- data/lib/chemicalml/cml/base/system.rb +4 -0
- data/lib/chemicalml/cml/base/table.rb +10 -0
- data/lib/chemicalml/cml/base/table_content.rb +2 -0
- data/lib/chemicalml/cml/base/table_header_cell.rb +10 -0
- data/lib/chemicalml/cml/base/tcell.rb +34 -0
- data/lib/chemicalml/cml/base/torsion.rb +12 -0
- data/lib/chemicalml/cml/base/trow.rb +32 -0
- data/lib/chemicalml/cml/base/unit.rb +12 -0
- data/lib/chemicalml/cml/base/unit_list.rb +12 -0
- data/lib/chemicalml/cml/base/unit_type.rb +10 -0
- data/lib/chemicalml/cml/base/unit_type_list.rb +10 -0
- data/lib/chemicalml/cml/base/vector3.rb +2 -0
- data/lib/chemicalml/cml/base/xaxis.rb +6 -0
- data/lib/chemicalml/cml/base/yaxis.rb +6 -0
- data/lib/chemicalml/cml/base.rb +17 -0
- data/lib/chemicalml/cml/elements.rb +39 -4
- data/lib/chemicalml/cml/role/alternative.rb +10 -0
- data/lib/chemicalml/cml/role/annotation.rb +10 -0
- data/lib/chemicalml/cml/role/appinfo.rb +10 -0
- data/lib/chemicalml/cml/role/arg.rb +10 -0
- data/lib/chemicalml/cml/role/cml_module.rb +2 -3
- data/lib/chemicalml/cml/role/complex_object.rb +10 -0
- data/lib/chemicalml/cml/role/enumeration.rb +10 -0
- data/lib/chemicalml/cml/role/expression.rb +10 -0
- data/lib/chemicalml/cml/role/float.rb +10 -0
- data/lib/chemicalml/cml/role/float_array.rb +10 -0
- data/lib/chemicalml/cml/role/integer.rb +10 -0
- data/lib/chemicalml/cml/role/integer_array.rb +10 -0
- data/lib/chemicalml/cml/role/operator.rb +10 -0
- data/lib/chemicalml/cml/role/related_entry.rb +10 -0
- data/lib/chemicalml/cml/role/string.rb +10 -0
- data/lib/chemicalml/cml/role/string_array.rb +10 -0
- data/lib/chemicalml/cml/role/tcell.rb +10 -0
- data/lib/chemicalml/cml/role/trow.rb +10 -0
- data/lib/chemicalml/cml/role.rb +17 -0
- data/lib/chemicalml/cml/schema24/alternative.rb +14 -0
- data/lib/chemicalml/cml/schema24/annotation.rb +15 -0
- data/lib/chemicalml/cml/schema24/appinfo.rb +15 -0
- data/lib/chemicalml/cml/schema24/arg.rb +14 -0
- data/lib/chemicalml/cml/schema24/cml_module.rb +18 -0
- data/lib/chemicalml/cml/schema24/complex_object.rb +14 -0
- data/lib/chemicalml/cml/schema24/configuration.rb +5 -2
- data/lib/chemicalml/cml/schema24/enumeration.rb +16 -0
- data/lib/chemicalml/cml/schema24/expression.rb +14 -0
- data/lib/chemicalml/cml/schema24/float.rb +14 -0
- data/lib/chemicalml/cml/schema24/float_array.rb +14 -0
- data/lib/chemicalml/cml/schema24/integer.rb +14 -0
- data/lib/chemicalml/cml/schema24/integer_array.rb +14 -0
- data/lib/chemicalml/cml/schema24/operator.rb +14 -0
- data/lib/chemicalml/cml/schema24/related_entry.rb +14 -0
- data/lib/chemicalml/cml/schema24/string.rb +14 -0
- data/lib/chemicalml/cml/schema24/string_array.rb +14 -0
- data/lib/chemicalml/cml/schema24/tcell.rb +14 -0
- data/lib/chemicalml/cml/schema24/trow.rb +14 -0
- data/lib/chemicalml/cml/schema24.rb +33 -5
- data/lib/chemicalml/cml.rb +1 -3
- data/lib/chemicalml/context_configuration.rb +8 -2
- data/lib/chemicalml/convention/base.rb +17 -3
- data/lib/chemicalml/convention/compchem/constraints/array_rules.rb +44 -0
- data/lib/chemicalml/convention/compchem/constraints/calculation_requires_finalization.rb +28 -0
- data/lib/chemicalml/convention/compchem/constraints/compchem_module_must_contain_job_list.rb +4 -4
- data/lib/chemicalml/convention/compchem/constraints/environment_at_most_one_property_list.rb +26 -0
- data/lib/chemicalml/convention/compchem/constraints/environment_must_not_contain_parameter.rb +28 -0
- data/lib/chemicalml/convention/compchem/constraints/finalization_at_most_one_molecule.rb +26 -0
- data/lib/chemicalml/convention/compchem/constraints/finalization_at_most_one_property_list.rb +26 -0
- data/lib/chemicalml/convention/compchem/constraints/finalization_must_not_contain_parameter.rb +27 -0
- data/lib/chemicalml/convention/compchem/constraints/initialization_at_most_one_molecule.rb +26 -0
- data/lib/chemicalml/convention/compchem/constraints/initialization_at_most_one_parameter_list.rb +26 -0
- data/lib/chemicalml/convention/compchem/constraints/initialization_must_not_contain_property.rb +28 -0
- data/lib/chemicalml/convention/compchem/constraints/job_list_module_must_have_id.rb +24 -0
- data/lib/chemicalml/convention/compchem/constraints/job_module_at_most_one_environment.rb +25 -0
- data/lib/chemicalml/convention/compchem/constraints/job_module_at_most_one_finalization.rb +25 -0
- data/lib/chemicalml/convention/compchem/constraints/job_module_must_have_id.rb +24 -0
- data/lib/chemicalml/convention/compchem/constraints/job_must_contain_initialization.rb +6 -9
- data/lib/chemicalml/convention/compchem/constraints/matrix_rules.rb +48 -0
- data/lib/chemicalml/convention/compchem/constraints/module_predicates.rb +50 -0
- data/lib/chemicalml/convention/compchem/constraints/scalar_units.rb +42 -0
- data/lib/chemicalml/convention/compchem/constraints.rb +36 -2
- data/lib/chemicalml/convention/compchem.rb +16 -0
- data/lib/chemicalml/convention/constraint.rb +31 -18
- data/lib/chemicalml/convention/coordinator.rb +89 -0
- data/lib/chemicalml/convention/detection.rb +33 -0
- data/lib/chemicalml/convention/dictionary/constraints/dictionary_must_have_namespace.rb +28 -0
- data/lib/chemicalml/convention/dictionary/constraints/dictionary_namespace_should_end_with_slash_or_hash.rb +32 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_id_must_match_pattern.rb +33 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_ids_unique_within_dictionary.rb +3 -3
- data/lib/chemicalml/convention/dictionary/constraints/entry_must_contain_definition.rb +28 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_must_have_id_and_term.rb +5 -5
- data/lib/chemicalml/convention/dictionary/constraints/entry_must_have_unit_type.rb +30 -0
- data/lib/chemicalml/convention/dictionary/constraints/entry_units_co_constraints.rb +44 -0
- data/lib/chemicalml/convention/dictionary/constraints.rb +12 -0
- data/lib/chemicalml/convention/dictionary.rb +6 -0
- data/lib/chemicalml/convention/molecular/constraints/atom_array_must_be_child_of_molecule_or_formula.rb +40 -0
- data/lib/chemicalml/convention/molecular/constraints/atom_array_must_contain_atoms.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/atom_coordinates_must_be_paired.rb +5 -5
- data/lib/chemicalml/convention/molecular/constraints/atom_id_must_match_pattern.rb +4 -4
- data/lib/chemicalml/convention/molecular/constraints/atom_ids_unique_within_molecule.rb +2 -2
- data/lib/chemicalml/convention/molecular/constraints/atom_must_have_element_type.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/atom_must_have_id.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/bond_array_must_be_child_of_molecule.rb +36 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_ids_unique_within_molecule.rb +43 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_must_have_atom_refs2.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/bond_must_have_order.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/bond_must_reference_atoms_in_same_molecule.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/bond_order_other_must_have_dict_ref.rb +33 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_order_should_not_be_numeric.rb +2 -2
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_cis_trans_must_have_atom_refs4.rb +45 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_other_must_have_dict_ref.rb +32 -0
- data/lib/chemicalml/convention/molecular/constraints/bond_stereo_wedge_hash_must_have_atom_refs2.rb +45 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_atom_array_mutually_exclusive_with_children.rb +32 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_bond_array_mutually_exclusive_with_children.rb +31 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_count_must_not_appear_on_top_level.rb +34 -0
- data/lib/chemicalml/convention/molecular/constraints/molecule_must_have_id.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/property_must_have_dict_ref.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints/scalar_must_have_data_type.rb +3 -3
- data/lib/chemicalml/convention/molecular/constraints.rb +20 -0
- data/lib/chemicalml/convention/molecular.rb +10 -0
- data/lib/chemicalml/convention/registry.rb +17 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_list_must_contain_at_least_one_unit.rb +28 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_list_must_have_namespace.rb +36 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_contain_definition.rb +27 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_id.rb +27 -0
- data/lib/chemicalml/convention/unit_dictionary/constraints/unit_must_have_symbol_and_unit_type.rb +3 -3
- data/lib/chemicalml/convention/unit_dictionary/constraints.rb +9 -1
- data/lib/chemicalml/convention/unit_dictionary.rb +4 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_id_must_match_pattern.rb +31 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_list_must_contain_at_least_one_unit_type.rb +27 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_list_must_have_namespace.rb +35 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_must_contain_definition.rb +27 -0
- data/lib/chemicalml/convention/unit_type_dictionary/constraints/unit_type_must_have_id_and_name.rb +5 -5
- data/lib/chemicalml/convention/unit_type_dictionary/constraints.rb +9 -1
- data/lib/chemicalml/convention/unit_type_dictionary.rb +4 -0
- data/lib/chemicalml/convention/validation_report.rb +63 -0
- data/lib/chemicalml/convention.rb +11 -0
- data/lib/chemicalml/dictionary/entry.rb +6 -6
- data/lib/chemicalml/dictionary/enum.rb +1 -1
- data/lib/chemicalml/dictionary/link.rb +3 -3
- data/lib/chemicalml/dictionary/loader.rb +19 -19
- data/lib/chemicalml/dictionary/model.rb +5 -5
- data/lib/chemicalml/dictionary/registry.rb +9 -9
- data/lib/chemicalml/version.rb +1 -1
- data/lib/chemicalml/versioned_parser.rb +18 -0
- data/lib/chemicalml.rb +1 -2
- metadata +123 -34
- data/lib/chemicalml/cml/child_mappings.rb +0 -168
- data/lib/chemicalml/cml/translator/value_translations.rb +0 -270
- data/lib/chemicalml/cml/translator.rb +0 -484
- data/lib/chemicalml/model/atom.rb +0 -64
- data/lib/chemicalml/model/atom_parity.rb +0 -21
- data/lib/chemicalml/model/bond.rb +0 -39
- data/lib/chemicalml/model/bond_stereo.rb +0 -29
- data/lib/chemicalml/model/cml_array.rb +0 -27
- data/lib/chemicalml/model/cml_module.rb +0 -45
- data/lib/chemicalml/model/document.rb +0 -29
- data/lib/chemicalml/model/formula.rb +0 -34
- data/lib/chemicalml/model/identifier.rb +0 -21
- data/lib/chemicalml/model/label.rb +0 -21
- data/lib/chemicalml/model/matrix.rb +0 -29
- data/lib/chemicalml/model/metadata.rb +0 -23
- data/lib/chemicalml/model/metadata_list.rb +0 -25
- data/lib/chemicalml/model/molecule.rb +0 -45
- data/lib/chemicalml/model/name.rb +0 -21
- data/lib/chemicalml/model/node.rb +0 -45
- data/lib/chemicalml/model/parameter.rb +0 -27
- data/lib/chemicalml/model/parameter_list.rb +0 -25
- data/lib/chemicalml/model/product.rb +0 -21
- data/lib/chemicalml/model/product_list.rb +0 -21
- data/lib/chemicalml/model/property.rb +0 -28
- data/lib/chemicalml/model/property_list.rb +0 -25
- data/lib/chemicalml/model/reactant.rb +0 -21
- data/lib/chemicalml/model/reactant_list.rb +0 -21
- data/lib/chemicalml/model/reaction.rb +0 -41
- data/lib/chemicalml/model/reaction_list.rb +0 -23
- data/lib/chemicalml/model/scalar.rb +0 -25
- data/lib/chemicalml/model/substance.rb +0 -25
- data/lib/chemicalml/model.rb +0 -40
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module StringArray
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::StringArray
|
|
10
|
+
attribute :builtin, :string
|
|
11
|
+
attribute :convention, :string
|
|
12
|
+
attribute :dict_ref, :string
|
|
13
|
+
attribute :id, :string
|
|
14
|
+
attribute :title, :string
|
|
15
|
+
attribute :min, :string
|
|
16
|
+
attribute :max, :string
|
|
17
|
+
attribute :size, :string
|
|
18
|
+
attribute :delimiter, :string
|
|
19
|
+
attribute :content, :string
|
|
20
|
+
|
|
21
|
+
xml do
|
|
22
|
+
namespace Chemicalml::Cml::Namespace
|
|
23
|
+
root "stringArray"
|
|
24
|
+
map_attribute "builtin", to: :builtin
|
|
25
|
+
map_attribute "convention", to: :convention
|
|
26
|
+
map_attribute "dictRef", to: :dict_ref
|
|
27
|
+
map_attribute "id", to: :id
|
|
28
|
+
map_attribute "title", to: :title
|
|
29
|
+
map_attribute "min", to: :min
|
|
30
|
+
map_attribute "max", to: :max
|
|
31
|
+
map_attribute "size", to: :size
|
|
32
|
+
map_attribute "delimiter", to: :delimiter
|
|
33
|
+
map_content to: :content
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -13,6 +13,12 @@ module Chemicalml
|
|
|
13
13
|
attribute :names, :name, collection: true
|
|
14
14
|
attribute :identifiers, :identifier, collection: true
|
|
15
15
|
|
|
16
|
+
attribute :dict_ref, :string
|
|
17
|
+
attribute :convention, :string
|
|
18
|
+
attribute :type, :string
|
|
19
|
+
attribute :ref, :string
|
|
20
|
+
attribute :count, :string
|
|
21
|
+
attribute :state, :string
|
|
16
22
|
xml do
|
|
17
23
|
namespace Chemicalml::Cml::Namespace
|
|
18
24
|
root "substance"
|
|
@@ -21,6 +27,12 @@ module Chemicalml
|
|
|
21
27
|
map_element "molecule", to: :molecule
|
|
22
28
|
map_element "name", to: :names
|
|
23
29
|
map_element "identifier", to: :identifiers
|
|
30
|
+
map_attribute "dictRef", to: :dict_ref
|
|
31
|
+
map_attribute "convention", to: :convention
|
|
32
|
+
map_attribute "type", to: :type
|
|
33
|
+
map_attribute "ref", to: :ref
|
|
34
|
+
map_attribute "count", to: :count
|
|
35
|
+
map_attribute "state", to: :state
|
|
24
36
|
end
|
|
25
37
|
end
|
|
26
38
|
end
|
|
@@ -14,6 +14,9 @@ module Chemicalml
|
|
|
14
14
|
|
|
15
15
|
attribute :substances, :substance, collection: true
|
|
16
16
|
|
|
17
|
+
attribute :substance_list_type, :string
|
|
18
|
+
attribute :role, :string
|
|
19
|
+
attribute :ref, :string
|
|
17
20
|
xml do
|
|
18
21
|
namespace Chemicalml::Cml::Namespace
|
|
19
22
|
map_element "substance", to: :substances
|
|
@@ -22,6 +25,9 @@ module Chemicalml
|
|
|
22
25
|
map_attribute "title", to: :title
|
|
23
26
|
map_attribute "dictRef", to: :dict_ref
|
|
24
27
|
map_attribute "convention", to: :convention
|
|
28
|
+
map_attribute "substanceListType", to: :substance_list_type
|
|
29
|
+
map_attribute "role", to: :role
|
|
30
|
+
map_attribute "ref", to: :ref
|
|
25
31
|
end
|
|
26
32
|
end
|
|
27
33
|
end
|
|
@@ -14,6 +14,8 @@ module Chemicalml
|
|
|
14
14
|
attribute :pointGroup, :string
|
|
15
15
|
attribute :spaceGroup, :string
|
|
16
16
|
|
|
17
|
+
attribute :irreducible_representation, :string
|
|
18
|
+
attribute :number, :string
|
|
17
19
|
xml do
|
|
18
20
|
namespace Chemicalml::Cml::Namespace
|
|
19
21
|
root "symmetry"
|
|
@@ -23,6 +25,8 @@ module Chemicalml
|
|
|
23
25
|
map_attribute "convention", to: :convention
|
|
24
26
|
map_attribute "pointGroup", to: :pointGroup
|
|
25
27
|
map_attribute "spaceGroup", to: :spaceGroup
|
|
28
|
+
map_attribute "irreducibleRepresentation", to: :irreducible_representation
|
|
29
|
+
map_attribute "number", to: :number
|
|
26
30
|
end
|
|
27
31
|
end
|
|
28
32
|
end
|
|
@@ -15,6 +15,8 @@ module Chemicalml
|
|
|
15
15
|
attribute :atom_array, :atomArray
|
|
16
16
|
attribute :molecules, :molecule, collection: true
|
|
17
17
|
|
|
18
|
+
attribute :dimensionality, :string
|
|
19
|
+
attribute :periodicity, :string
|
|
18
20
|
xml do
|
|
19
21
|
namespace Chemicalml::Cml::Namespace
|
|
20
22
|
map_element "atomArray", to: :atom_array
|
|
@@ -24,6 +26,8 @@ module Chemicalml
|
|
|
24
26
|
map_attribute "title", to: :title
|
|
25
27
|
map_attribute "dictRef", to: :dict_ref
|
|
26
28
|
map_attribute "convention", to: :convention
|
|
29
|
+
map_attribute "dimensionality", to: :dimensionality
|
|
30
|
+
map_attribute "periodicity", to: :periodicity
|
|
27
31
|
end
|
|
28
32
|
end
|
|
29
33
|
end
|
|
@@ -15,6 +15,11 @@ module Chemicalml
|
|
|
15
15
|
attribute :table_content, :tableContent
|
|
16
16
|
attribute :table_header, :tableHeader
|
|
17
17
|
|
|
18
|
+
attribute :rows, :string
|
|
19
|
+
attribute :columns, :string
|
|
20
|
+
attribute :units, :string
|
|
21
|
+
attribute :table_type, :string
|
|
22
|
+
attribute :data_type, :string
|
|
18
23
|
xml do
|
|
19
24
|
namespace Chemicalml::Cml::Namespace
|
|
20
25
|
map_element "tableContent", to: :table_content
|
|
@@ -24,6 +29,11 @@ module Chemicalml
|
|
|
24
29
|
map_attribute "title", to: :title
|
|
25
30
|
map_attribute "dictRef", to: :dict_ref
|
|
26
31
|
map_attribute "convention", to: :convention
|
|
32
|
+
map_attribute "rows", to: :rows
|
|
33
|
+
map_attribute "columns", to: :columns
|
|
34
|
+
map_attribute "units", to: :units
|
|
35
|
+
map_attribute "tableType", to: :table_type
|
|
36
|
+
map_attribute "dataType", to: :data_type
|
|
27
37
|
end
|
|
28
38
|
end
|
|
29
39
|
end
|
|
@@ -15,6 +15,7 @@ module Chemicalml
|
|
|
15
15
|
attribute :table_rows, :tableRow, collection: true
|
|
16
16
|
attribute :table_row_lists, :tableRowList, collection: true
|
|
17
17
|
|
|
18
|
+
attribute :delimiter, :string
|
|
18
19
|
xml do
|
|
19
20
|
namespace Chemicalml::Cml::Namespace
|
|
20
21
|
map_element "tableRow", to: :table_rows
|
|
@@ -24,6 +25,7 @@ module Chemicalml
|
|
|
24
25
|
map_attribute "title", to: :title
|
|
25
26
|
map_attribute "dictRef", to: :dict_ref
|
|
26
27
|
map_attribute "convention", to: :convention
|
|
28
|
+
map_attribute "delimiter", to: :delimiter
|
|
27
29
|
end
|
|
28
30
|
end
|
|
29
31
|
end
|
|
@@ -13,6 +13,11 @@ module Chemicalml
|
|
|
13
13
|
attribute :convention, :string
|
|
14
14
|
attribute :content, :string
|
|
15
15
|
|
|
16
|
+
attribute :data_type, :string
|
|
17
|
+
attribute :units, :string
|
|
18
|
+
attribute :constant_to_s_i, :string
|
|
19
|
+
attribute :multiplier_to_s_i, :string
|
|
20
|
+
attribute :unit_type, :string
|
|
16
21
|
xml do
|
|
17
22
|
namespace Chemicalml::Cml::Namespace
|
|
18
23
|
root "tableHeaderCell"
|
|
@@ -21,6 +26,11 @@ module Chemicalml
|
|
|
21
26
|
map_attribute "dictRef", to: :dict_ref
|
|
22
27
|
map_attribute "convention", to: :convention
|
|
23
28
|
map_content to: :content
|
|
29
|
+
map_attribute "dataType", to: :data_type
|
|
30
|
+
map_attribute "units", to: :units
|
|
31
|
+
map_attribute "constantToSI", to: :constant_to_s_i
|
|
32
|
+
map_attribute "multiplierToSI", to: :multiplier_to_s_i
|
|
33
|
+
map_attribute "unitType", to: :unit_type
|
|
24
34
|
end
|
|
25
35
|
end
|
|
26
36
|
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Tcell
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Tcell
|
|
10
|
+
attribute :units, :string
|
|
11
|
+
attribute :data_type, :string
|
|
12
|
+
attribute :title, :string
|
|
13
|
+
attribute :id, :string
|
|
14
|
+
attribute :convention, :string
|
|
15
|
+
attribute :dict_ref, :string
|
|
16
|
+
attribute :content, :string
|
|
17
|
+
|
|
18
|
+
xml do
|
|
19
|
+
namespace Chemicalml::Cml::Namespace
|
|
20
|
+
root "tcell"
|
|
21
|
+
map_attribute "units", to: :units
|
|
22
|
+
map_attribute "dataType", to: :data_type
|
|
23
|
+
map_attribute "title", to: :title
|
|
24
|
+
map_attribute "id", to: :id
|
|
25
|
+
map_attribute "convention", to: :convention
|
|
26
|
+
map_attribute "dictRef", to: :dict_ref
|
|
27
|
+
map_content to: :content
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -14,6 +14,12 @@ module Chemicalml
|
|
|
14
14
|
attribute :atomRefs4, :string
|
|
15
15
|
attribute :units, :string
|
|
16
16
|
|
|
17
|
+
attribute :angle_units, :string
|
|
18
|
+
attribute :error_value, :string
|
|
19
|
+
attribute :error_basis, :string
|
|
20
|
+
attribute :min, :string
|
|
21
|
+
attribute :max, :string
|
|
22
|
+
attribute :ref, :string
|
|
17
23
|
xml do
|
|
18
24
|
namespace Chemicalml::Cml::Namespace
|
|
19
25
|
root "torsion"
|
|
@@ -23,6 +29,12 @@ module Chemicalml
|
|
|
23
29
|
map_attribute "convention", to: :convention
|
|
24
30
|
map_attribute "atomRefs4", to: :atomRefs4
|
|
25
31
|
map_attribute "units", to: :units
|
|
32
|
+
map_attribute "angleUnits", to: :angle_units
|
|
33
|
+
map_attribute "errorValue", to: :error_value
|
|
34
|
+
map_attribute "errorBasis", to: :error_basis
|
|
35
|
+
map_attribute "min", to: :min
|
|
36
|
+
map_attribute "max", to: :max
|
|
37
|
+
map_attribute "ref", to: :ref
|
|
26
38
|
end
|
|
27
39
|
end
|
|
28
40
|
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Chemicalml
|
|
4
|
+
module Cml
|
|
5
|
+
module Base
|
|
6
|
+
module Trow
|
|
7
|
+
def self.included(klass)
|
|
8
|
+
klass.class_eval do
|
|
9
|
+
include Chemicalml::Cml::Role::Trow
|
|
10
|
+
attribute :data_type, :string
|
|
11
|
+
attribute :title, :string
|
|
12
|
+
attribute :id, :string
|
|
13
|
+
attribute :convention, :string
|
|
14
|
+
attribute :dict_ref, :string
|
|
15
|
+
attribute :content, :string
|
|
16
|
+
|
|
17
|
+
xml do
|
|
18
|
+
namespace Chemicalml::Cml::Namespace
|
|
19
|
+
root "trow"
|
|
20
|
+
map_attribute "dataType", to: :data_type
|
|
21
|
+
map_attribute "title", to: :title
|
|
22
|
+
map_attribute "id", to: :id
|
|
23
|
+
map_attribute "convention", to: :convention
|
|
24
|
+
map_attribute "dictRef", to: :dict_ref
|
|
25
|
+
map_content to: :content
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -17,6 +17,12 @@ module Chemicalml
|
|
|
17
17
|
attribute :definition, :string
|
|
18
18
|
attribute :description, :string
|
|
19
19
|
|
|
20
|
+
attribute :units, :string
|
|
21
|
+
attribute :name, :string
|
|
22
|
+
attribute :is_s_i, :string
|
|
23
|
+
attribute :multiplier_to_data, :string
|
|
24
|
+
attribute :power, :string
|
|
25
|
+
attribute :abbreviation, :string
|
|
20
26
|
xml do
|
|
21
27
|
namespace Chemicalml::Cml::Namespace
|
|
22
28
|
root "unit"
|
|
@@ -29,6 +35,12 @@ module Chemicalml
|
|
|
29
35
|
map_attribute "unitType", to: :unit_type
|
|
30
36
|
map_element "definition", to: :definition
|
|
31
37
|
map_element "description", to: :description
|
|
38
|
+
map_attribute "units", to: :units
|
|
39
|
+
map_attribute "name", to: :name
|
|
40
|
+
map_attribute "isSI", to: :is_s_i
|
|
41
|
+
map_attribute "multiplierToData", to: :multiplier_to_data
|
|
42
|
+
map_attribute "power", to: :power
|
|
43
|
+
map_attribute "abbreviation", to: :abbreviation
|
|
32
44
|
end
|
|
33
45
|
end
|
|
34
46
|
end
|
|
@@ -13,6 +13,12 @@ module Chemicalml
|
|
|
13
13
|
attribute :description, :string
|
|
14
14
|
attribute :units, :unit, collection: true
|
|
15
15
|
|
|
16
|
+
attribute :id, :string
|
|
17
|
+
attribute :dict_ref, :string
|
|
18
|
+
attribute :si_namespace, :string
|
|
19
|
+
attribute :dictionary_prefix, :string
|
|
20
|
+
attribute :href, :string
|
|
21
|
+
attribute :unit_list_type, :string
|
|
16
22
|
xml do
|
|
17
23
|
namespace Chemicalml::Cml::Namespace
|
|
18
24
|
root "unitList"
|
|
@@ -21,6 +27,12 @@ module Chemicalml
|
|
|
21
27
|
map_attribute "convention", to: :convention
|
|
22
28
|
map_element "description", to: :description
|
|
23
29
|
map_element "unit", to: :units
|
|
30
|
+
map_attribute "id", to: :id
|
|
31
|
+
map_attribute "dictRef", to: :dict_ref
|
|
32
|
+
map_attribute "siNamespace", to: :si_namespace
|
|
33
|
+
map_attribute "dictionaryPrefix", to: :dictionary_prefix
|
|
34
|
+
map_attribute "href", to: :href
|
|
35
|
+
map_attribute "unitListType", to: :unit_list_type
|
|
24
36
|
end
|
|
25
37
|
end
|
|
26
38
|
end
|
|
@@ -12,6 +12,11 @@ module Chemicalml
|
|
|
12
12
|
attribute :definition, :string
|
|
13
13
|
attribute :description, :string
|
|
14
14
|
|
|
15
|
+
attribute :title, :string
|
|
16
|
+
attribute :parent_s_i, :string
|
|
17
|
+
attribute :abbreviation, :string
|
|
18
|
+
attribute :preserve, :string
|
|
19
|
+
attribute :symbol, :string
|
|
15
20
|
xml do
|
|
16
21
|
namespace Chemicalml::Cml::Namespace
|
|
17
22
|
root "unitType"
|
|
@@ -19,6 +24,11 @@ module Chemicalml
|
|
|
19
24
|
map_attribute "name", to: :name
|
|
20
25
|
map_element "definition", to: :definition
|
|
21
26
|
map_element "description", to: :description
|
|
27
|
+
map_attribute "title", to: :title
|
|
28
|
+
map_attribute "parentSI", to: :parent_s_i
|
|
29
|
+
map_attribute "abbreviation", to: :abbreviation
|
|
30
|
+
map_attribute "preserve", to: :preserve
|
|
31
|
+
map_attribute "symbol", to: :symbol
|
|
22
32
|
end
|
|
23
33
|
end
|
|
24
34
|
end
|
|
@@ -13,6 +13,11 @@ module Chemicalml
|
|
|
13
13
|
attribute :description, :string
|
|
14
14
|
attribute :unit_types, :unitType, collection: true
|
|
15
15
|
|
|
16
|
+
attribute :id, :string
|
|
17
|
+
attribute :dict_ref, :string
|
|
18
|
+
attribute :si_namespace, :string
|
|
19
|
+
attribute :dictionary_prefix, :string
|
|
20
|
+
attribute :href, :string
|
|
16
21
|
xml do
|
|
17
22
|
namespace Chemicalml::Cml::Namespace
|
|
18
23
|
root "unitTypeList"
|
|
@@ -21,6 +26,11 @@ module Chemicalml
|
|
|
21
26
|
map_attribute "convention", to: :convention
|
|
22
27
|
map_element "description", to: :description
|
|
23
28
|
map_element "unitType", to: :unit_types
|
|
29
|
+
map_attribute "id", to: :id
|
|
30
|
+
map_attribute "dictRef", to: :dict_ref
|
|
31
|
+
map_attribute "siNamespace", to: :si_namespace
|
|
32
|
+
map_attribute "dictionaryPrefix", to: :dictionary_prefix
|
|
33
|
+
map_attribute "href", to: :href
|
|
24
34
|
end
|
|
25
35
|
end
|
|
26
36
|
end
|
|
@@ -13,6 +13,7 @@ module Chemicalml
|
|
|
13
13
|
attribute :convention, :string
|
|
14
14
|
attribute :content, :string
|
|
15
15
|
|
|
16
|
+
attribute :units, :string
|
|
16
17
|
xml do
|
|
17
18
|
namespace Chemicalml::Cml::Namespace
|
|
18
19
|
root "vector3"
|
|
@@ -21,6 +22,7 @@ module Chemicalml
|
|
|
21
22
|
map_attribute "dictRef", to: :dict_ref
|
|
22
23
|
map_attribute "convention", to: :convention
|
|
23
24
|
map_content to: :content
|
|
25
|
+
map_attribute "units", to: :units
|
|
24
26
|
end
|
|
25
27
|
end
|
|
26
28
|
end
|
|
@@ -14,6 +14,9 @@ module Chemicalml
|
|
|
14
14
|
attribute :units, :string
|
|
15
15
|
attribute :multiplier, :string
|
|
16
16
|
|
|
17
|
+
attribute :ref, :string
|
|
18
|
+
attribute :multiplier_to_data, :string
|
|
19
|
+
attribute :constant_to_data, :string
|
|
17
20
|
xml do
|
|
18
21
|
namespace Chemicalml::Cml::Namespace
|
|
19
22
|
root "xaxis"
|
|
@@ -23,6 +26,9 @@ module Chemicalml
|
|
|
23
26
|
map_attribute "convention", to: :convention
|
|
24
27
|
map_attribute "units", to: :units
|
|
25
28
|
map_attribute "multiplier", to: :multiplier
|
|
29
|
+
map_attribute "ref", to: :ref
|
|
30
|
+
map_attribute "multiplierToData", to: :multiplier_to_data
|
|
31
|
+
map_attribute "constantToData", to: :constant_to_data
|
|
26
32
|
end
|
|
27
33
|
end
|
|
28
34
|
end
|
|
@@ -14,6 +14,9 @@ module Chemicalml
|
|
|
14
14
|
attribute :units, :string
|
|
15
15
|
attribute :multiplier, :string
|
|
16
16
|
|
|
17
|
+
attribute :ref, :string
|
|
18
|
+
attribute :multiplier_to_data, :string
|
|
19
|
+
attribute :constant_to_data, :string
|
|
17
20
|
xml do
|
|
18
21
|
namespace Chemicalml::Cml::Namespace
|
|
19
22
|
root "yaxis"
|
|
@@ -23,6 +26,9 @@ module Chemicalml
|
|
|
23
26
|
map_attribute "convention", to: :convention
|
|
24
27
|
map_attribute "units", to: :units
|
|
25
28
|
map_attribute "multiplier", to: :multiplier
|
|
29
|
+
map_attribute "ref", to: :ref
|
|
30
|
+
map_attribute "multiplierToData", to: :multiplier_to_data
|
|
31
|
+
map_attribute "constantToData", to: :constant_to_data
|
|
26
32
|
end
|
|
27
33
|
end
|
|
28
34
|
end
|
data/lib/chemicalml/cml/base.rb
CHANGED
|
@@ -131,6 +131,23 @@ module Chemicalml
|
|
|
131
131
|
autoload :Xaxis, "chemicalml/cml/base/xaxis"
|
|
132
132
|
autoload :Yaxis, "chemicalml/cml/base/yaxis"
|
|
133
133
|
autoload :ZMatrix, "chemicalml/cml/base/z_matrix"
|
|
134
|
+
autoload :Alternative, "chemicalml/cml/base/alternative"
|
|
135
|
+
autoload :Arg, "chemicalml/cml/base/arg"
|
|
136
|
+
autoload :ComplexObject, "chemicalml/cml/base/complex_object"
|
|
137
|
+
autoload :Expression, "chemicalml/cml/base/expression"
|
|
138
|
+
autoload :Float, "chemicalml/cml/base/float"
|
|
139
|
+
autoload :FloatArray, "chemicalml/cml/base/float_array"
|
|
140
|
+
autoload :Integer, "chemicalml/cml/base/integer"
|
|
141
|
+
autoload :IntegerArray, "chemicalml/cml/base/integer_array"
|
|
142
|
+
autoload :Operator, "chemicalml/cml/base/operator"
|
|
143
|
+
autoload :RelatedEntry, "chemicalml/cml/base/related_entry"
|
|
144
|
+
autoload :String, "chemicalml/cml/base/string"
|
|
145
|
+
autoload :StringArray, "chemicalml/cml/base/string_array"
|
|
146
|
+
autoload :Tcell, "chemicalml/cml/base/tcell"
|
|
147
|
+
autoload :Trow, "chemicalml/cml/base/trow"
|
|
148
|
+
autoload :Annotation, "chemicalml/cml/base/annotation"
|
|
149
|
+
autoload :Appinfo, "chemicalml/cml/base/appinfo"
|
|
150
|
+
autoload :Enumeration, "chemicalml/cml/base/enumeration"
|
|
134
151
|
end
|
|
135
152
|
end
|
|
136
153
|
end
|
|
@@ -133,13 +133,48 @@ module Chemicalml
|
|
|
133
133
|
ZMatrix: :zMatrix,
|
|
134
134
|
}.freeze
|
|
135
135
|
|
|
136
|
-
# Elements
|
|
137
|
-
|
|
136
|
+
# Elements declared in the Schema 3 XSD but absent from the
|
|
137
|
+
# Schema 2.4 XSD. Verified by diffing the actual XSDs in
|
|
138
|
+
# `reference-docs/schemas/`: Schema 3 declares `<anyCml>` while
|
|
139
|
+
# Schema 2.4 does not. Conversely, Schema 2.4 declares 17 legacy
|
|
140
|
+
# elements (`alternative`, `annotation`, `appinfo`, `arg`,
|
|
141
|
+
# `complexObject`, `enumeration`, `expression`, `float`,
|
|
142
|
+
# `floatArray`, `integer`, `integerArray`, `operator`,
|
|
143
|
+
# `relatedEntry`, `string`, `stringArray`, `tcell`, `trow`) that
|
|
144
|
+
# are either redundant with Schema 3's unified types or outside
|
|
145
|
+
# the gem's scope.
|
|
146
|
+
SCHEMA3_ONLY = %i[AnyCml].freeze
|
|
147
|
+
|
|
148
|
+
# Subset of the Schema-2.4-only legacy elements that the gem
|
|
149
|
+
# explicitly models. Maps Ruby class name → XML element id so
|
|
150
|
+
# `Schema24::Configuration` can register them without polluting
|
|
151
|
+
# `Elements::ALL` (which mirrors Schema 3's element set).
|
|
152
|
+
SCHEMA24_ONLY = {
|
|
153
|
+
Alternative: :alternative,
|
|
154
|
+
Annotation: :annotation,
|
|
155
|
+
Appinfo: :appinfo,
|
|
156
|
+
Arg: :arg,
|
|
157
|
+
ComplexObject: :complexObject,
|
|
158
|
+
Enumeration: :enumeration,
|
|
159
|
+
Expression: :expression,
|
|
160
|
+
Float: :float,
|
|
161
|
+
FloatArray: :floatArray,
|
|
162
|
+
Integer: :integer,
|
|
163
|
+
IntegerArray: :integerArray,
|
|
164
|
+
Operator: :operator,
|
|
165
|
+
RelatedEntry: :relatedEntry,
|
|
166
|
+
String: :string,
|
|
167
|
+
StringArray: :stringArray,
|
|
168
|
+
Tcell: :tcell,
|
|
169
|
+
Trow: :trow
|
|
170
|
+
}.freeze
|
|
138
171
|
|
|
139
172
|
# Reverse index: XML element name (String) → Ruby class name
|
|
140
173
|
# (Symbol). O(1) lookup for VersionedParser root detection.
|
|
141
|
-
|
|
142
|
-
|
|
174
|
+
# Includes both Schema 3 elements and the modeled Schema 2.4
|
|
175
|
+
# legacy elements.
|
|
176
|
+
XML_TO_CLASS = [ALL, SCHEMA24_ONLY].each_with_object({}) do |src, h|
|
|
177
|
+
src.each { |cls, xml_id| h[xml_id.to_s] = cls }
|
|
143
178
|
end.freeze
|
|
144
179
|
end
|
|
145
180
|
end
|
|
@@ -4,9 +4,8 @@ module Chemicalml
|
|
|
4
4
|
module Cml
|
|
5
5
|
module Role
|
|
6
6
|
# Type marker for any wire class implementing the CML
|
|
7
|
-
# <module> element. Included by Schema3::Module
|
|
8
|
-
#
|
|
9
|
-
# generic <module> element.)
|
|
7
|
+
# <module> element. Included by both Schema3::Module and
|
|
8
|
+
# Schema24::Module.
|
|
10
9
|
module Module
|
|
11
10
|
end
|
|
12
11
|
end
|