dcc 0.2.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 (336) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +16 -0
  5. data/.rubocop_todo.yml +10 -0
  6. data/CHANGELOG.adoc +54 -0
  7. data/CONTRIBUTING.adoc +64 -0
  8. data/Gemfile +25 -0
  9. data/LICENSE +21 -0
  10. data/README.adoc +69 -0
  11. data/Rakefile +13 -0
  12. data/dcc.gemspec +41 -0
  13. data/docs/cli-reference.adoc +67 -0
  14. data/docs/getting-started.adoc +117 -0
  15. data/docs/schema-versions.adoc +65 -0
  16. data/examples/build_minimal_dcc.rb +23 -0
  17. data/examples/convert_all_formats.rb +19 -0
  18. data/examples/parse_and_inspect.rb +19 -0
  19. data/examples/quantity_math_demo.rb +32 -0
  20. data/examples/validate_full.rb +27 -0
  21. data/exe/dcc +7 -0
  22. data/lib/dcc/base/administrative_data.rb +43 -0
  23. data/lib/dcc/base/byte_data.rb +36 -0
  24. data/lib/dcc/base/calibration_laboratory.rb +29 -0
  25. data/lib/dcc/base/comment.rb +23 -0
  26. data/lib/dcc/base/condition.rb +34 -0
  27. data/lib/dcc/base/contact.rb +38 -0
  28. data/lib/dcc/base/contact_not_strict.rb +38 -0
  29. data/lib/dcc/base/core_data.rb +44 -0
  30. data/lib/dcc/base/data.rb +42 -0
  31. data/lib/dcc/base/digital_calibration_certificate.rb +32 -0
  32. data/lib/dcc/base/equipment_class.rb +24 -0
  33. data/lib/dcc/base/formula.rb +33 -0
  34. data/lib/dcc/base/hash_type.rb +34 -0
  35. data/lib/dcc/base/identification.rb +27 -0
  36. data/lib/dcc/base/identifications.rb +27 -0
  37. data/lib/dcc/base/influence_condition.rb +16 -0
  38. data/lib/dcc/base/influence_condition_list.rb +40 -0
  39. data/lib/dcc/base/item.rb +38 -0
  40. data/lib/dcc/base/item_list.rb +38 -0
  41. data/lib/dcc/base/list.rb +44 -0
  42. data/lib/dcc/base/location.rb +36 -0
  43. data/lib/dcc/base/measurement_meta_data.rb +15 -0
  44. data/lib/dcc/base/measurement_meta_data_list.rb +27 -0
  45. data/lib/dcc/base/measurement_result.rb +41 -0
  46. data/lib/dcc/base/measurement_result_list.rb +28 -0
  47. data/lib/dcc/base/measuring_equipment.rb +41 -0
  48. data/lib/dcc/base/measuring_equipment_list.rb +38 -0
  49. data/lib/dcc/base/quantity.rb +61 -0
  50. data/lib/dcc/base/ref_type_definition.rb +36 -0
  51. data/lib/dcc/base/ref_type_definition_list.rb +21 -0
  52. data/lib/dcc/base/resp_person.rb +38 -0
  53. data/lib/dcc/base/resp_person_list.rb +27 -0
  54. data/lib/dcc/base/result.rb +31 -0
  55. data/lib/dcc/base/result_list.rb +27 -0
  56. data/lib/dcc/base/rich_content.rb +34 -0
  57. data/lib/dcc/base/software.rb +35 -0
  58. data/lib/dcc/base/software_list.rb +27 -0
  59. data/lib/dcc/base/statement.rb +50 -0
  60. data/lib/dcc/base/statement_list.rb +27 -0
  61. data/lib/dcc/base/string_with_lang.rb +24 -0
  62. data/lib/dcc/base/text.rb +33 -0
  63. data/lib/dcc/base/used_method.rb +31 -0
  64. data/lib/dcc/base/used_method_list.rb +27 -0
  65. data/lib/dcc/base/xml_blob.rb +20 -0
  66. data/lib/dcc/base.rb +58 -0
  67. data/lib/dcc/builder/dsl.rb +10 -0
  68. data/lib/dcc/builder/session.rb +170 -0
  69. data/lib/dcc/builder.rb +34 -0
  70. data/lib/dcc/cli/cli.rb +149 -0
  71. data/lib/dcc/cli/formatters.rb +77 -0
  72. data/lib/dcc/cli.rb +7 -0
  73. data/lib/dcc/common_elements.rb +20 -0
  74. data/lib/dcc/context_configuration.rb +167 -0
  75. data/lib/dcc/context_options.rb +47 -0
  76. data/lib/dcc/convert/csv.rb +129 -0
  77. data/lib/dcc/convert/html.rb +127 -0
  78. data/lib/dcc/convert/json.rb +62 -0
  79. data/lib/dcc/convert/result.rb +51 -0
  80. data/lib/dcc/convert/yaml.rb +21 -0
  81. data/lib/dcc/convert.rb +14 -0
  82. data/lib/dcc/diff/change.rb +21 -0
  83. data/lib/dcc/diff/result.rb +58 -0
  84. data/lib/dcc/diff.rb +83 -0
  85. data/lib/dcc/error.rb +54 -0
  86. data/lib/dcc/extract/file.rb +143 -0
  87. data/lib/dcc/extract/ring.rb +28 -0
  88. data/lib/dcc/extract.rb +9 -0
  89. data/lib/dcc/i18n/text_lookup.rb +67 -0
  90. data/lib/dcc/i18n.rb +12 -0
  91. data/lib/dcc/inspect/report.rb +139 -0
  92. data/lib/dcc/inspect.rb +9 -0
  93. data/lib/dcc/migrate.rb +41 -0
  94. data/lib/dcc/namespace/dcc.rb +30 -0
  95. data/lib/dcc/namespace/dsig.rb +15 -0
  96. data/lib/dcc/namespace/math_ml.rb +14 -0
  97. data/lib/dcc/namespace/qudt.rb +15 -0
  98. data/lib/dcc/namespace/si.rb +26 -0
  99. data/lib/dcc/namespace.rb +18 -0
  100. data/lib/dcc/plugin/registry.rb +45 -0
  101. data/lib/dcc/plugin.rb +42 -0
  102. data/lib/dcc/quantity_format/formatter.rb +90 -0
  103. data/lib/dcc/quantity_format.rb +10 -0
  104. data/lib/dcc/quantity_math/quantity.rb +46 -0
  105. data/lib/dcc/quantity_math/real.rb +116 -0
  106. data/lib/dcc/quantity_math.rb +14 -0
  107. data/lib/dcc/schema/resources/dcc/dsi/v1.0.1.xsd +415 -0
  108. data/lib/dcc/schema/resources/dcc/dsi/v1.3.0.xsd +814 -0
  109. data/lib/dcc/schema/resources/dcc/dsi/v1.3.1.xsd +814 -0
  110. data/lib/dcc/schema/resources/dcc/dsi/v2.0.0.xsd +869 -0
  111. data/lib/dcc/schema/resources/dcc/dsi/v2.1.0.xsd +1031 -0
  112. data/lib/dcc/schema/resources/dcc/dsi/v2.2.1.xsd +1574 -0
  113. data/lib/dcc/schema/resources/dcc/qudt/v2.2.1.xsd +44 -0
  114. data/lib/dcc/schema/resources/dcc/v2.1.0/dcc.xsd +650 -0
  115. data/lib/dcc/schema/resources/dcc/v2.1.1/dcc.xsd +669 -0
  116. data/lib/dcc/schema/resources/dcc/v2.2.0/dcc.xsd +730 -0
  117. data/lib/dcc/schema/resources/dcc/v2.3.0/dcc.xsd +708 -0
  118. data/lib/dcc/schema/resources/dcc/v2.4.0/dcc.xsd +725 -0
  119. data/lib/dcc/schema/resources/dcc/v3.0.0/dcc.xsd +749 -0
  120. data/lib/dcc/schema/resources/dcc/v3.1.0/dcc.xsd +843 -0
  121. data/lib/dcc/schema/resources/dcc/v3.1.1/dcc.xsd +843 -0
  122. data/lib/dcc/schema/resources/dcc/v3.1.2/dcc.xsd +844 -0
  123. data/lib/dcc/schema/resources/dcc/v3.2.0/dcc.xsd +940 -0
  124. data/lib/dcc/schema/resources/dcc/v3.2.1/dcc.xsd +963 -0
  125. data/lib/dcc/schema/resources/dcc/v3.3.0/dcc.xsd +1008 -0
  126. data/lib/dcc/schema/resources/dcc/xmldsig-core-schema.xsd +312 -0
  127. data/lib/dcc/schema/resources/dsi/qudt/v2.2.1.xsd +44 -0
  128. data/lib/dcc/schema/resources/dsi/v1.0.1/SI_Format.xsd +415 -0
  129. data/lib/dcc/schema/resources/dsi/v1.3.0/SI_Format.xsd +814 -0
  130. data/lib/dcc/schema/resources/dsi/v1.3.1/SI_Format.xsd +814 -0
  131. data/lib/dcc/schema/resources/dsi/v2.0.0/SI_Format.xsd +869 -0
  132. data/lib/dcc/schema/resources/dsi/v2.1.0/SI_Format.xsd +1031 -0
  133. data/lib/dcc/schema/resources/dsi/v2.2.1/SI_Format.xsd +1574 -0
  134. data/lib/dcc/schema/resources/qudt/qudt.xsd +44 -0
  135. data/lib/dcc/schema/resources/schematron/dcc.sch +523 -0
  136. data/lib/dcc/schema/resources/schematron/dcc.svrl +2302 -0
  137. data/lib/dcc/schema/resources/xmldsig/xmldsig-core-schema.xsd +312 -0
  138. data/lib/dcc/schema/version.rb +94 -0
  139. data/lib/dcc/schema.rb +35 -0
  140. data/lib/dcc/server/app.rb +133 -0
  141. data/lib/dcc/server/storage/entry.rb +15 -0
  142. data/lib/dcc/server/storage/memory.rb +57 -0
  143. data/lib/dcc/server/storage.rb +13 -0
  144. data/lib/dcc/server.rb +33 -0
  145. data/lib/dcc/si/base/complex.rb +43 -0
  146. data/lib/dcc/si/base/complex_list_xml_list.rb +39 -0
  147. data/lib/dcc/si/base/constant.rb +39 -0
  148. data/lib/dcc/si/base/coverage_interval_mu.rb +31 -0
  149. data/lib/dcc/si/base/expanded_mu.rb +29 -0
  150. data/lib/dcc/si/base/expanded_unc_xml_list.rb +30 -0
  151. data/lib/dcc/si/base/hybrid.rb +42 -0
  152. data/lib/dcc/si/base/measurement_uncertainty_univariate.rb +28 -0
  153. data/lib/dcc/si/base/real.rb +48 -0
  154. data/lib/dcc/si/base/real_list_xml_list.rb +45 -0
  155. data/lib/dcc/si/base/si_list.rb +37 -0
  156. data/lib/dcc/si/base/standard_mu.rb +25 -0
  157. data/lib/dcc/si/base.rb +24 -0
  158. data/lib/dcc/si/common_elements.rb +13 -0
  159. data/lib/dcc/si/namespace.rb +7 -0
  160. data/lib/dcc/si/v1/common_elements.rb +13 -0
  161. data/lib/dcc/si/v1/complex.rb +8 -0
  162. data/lib/dcc/si/v1/complex_list_xml_list.rb +8 -0
  163. data/lib/dcc/si/v1/configuration.rb +13 -0
  164. data/lib/dcc/si/v1/constant.rb +8 -0
  165. data/lib/dcc/si/v1/coverage_interval_mu.rb +8 -0
  166. data/lib/dcc/si/v1/expanded_mu.rb +8 -0
  167. data/lib/dcc/si/v1/expanded_unc.rb +23 -0
  168. data/lib/dcc/si/v1/expanded_unc_xml_list.rb +8 -0
  169. data/lib/dcc/si/v1/hybrid.rb +8 -0
  170. data/lib/dcc/si/v1/measurement_uncertainty_univariate.rb +8 -0
  171. data/lib/dcc/si/v1/namespace.rb +9 -0
  172. data/lib/dcc/si/v1/real.rb +8 -0
  173. data/lib/dcc/si/v1/real_list_xml_list.rb +8 -0
  174. data/lib/dcc/si/v1/si_list.rb +8 -0
  175. data/lib/dcc/si/v1/standard_mu.rb +8 -0
  176. data/lib/dcc/si/v1.rb +46 -0
  177. data/lib/dcc/si/v2/common_elements.rb +13 -0
  178. data/lib/dcc/si/v2/complex.rb +8 -0
  179. data/lib/dcc/si/v2/complex_list_xml_list.rb +8 -0
  180. data/lib/dcc/si/v2/configuration.rb +13 -0
  181. data/lib/dcc/si/v2/constant.rb +8 -0
  182. data/lib/dcc/si/v2/coverage_interval_mu.rb +8 -0
  183. data/lib/dcc/si/v2/coverage_interval_mu_xml_list.rb +24 -0
  184. data/lib/dcc/si/v2/expanded_mu.rb +8 -0
  185. data/lib/dcc/si/v2/expanded_mu_xml_list.rb +22 -0
  186. data/lib/dcc/si/v2/expanded_unc_xml_list.rb +8 -0
  187. data/lib/dcc/si/v2/hybrid.rb +8 -0
  188. data/lib/dcc/si/v2/measurement_uncertainty_univariate.rb +8 -0
  189. data/lib/dcc/si/v2/namespace.rb +9 -0
  190. data/lib/dcc/si/v2/real.rb +8 -0
  191. data/lib/dcc/si/v2/real_list_xml_list.rb +8 -0
  192. data/lib/dcc/si/v2/si_list.rb +8 -0
  193. data/lib/dcc/si/v2/standard_mu.rb +8 -0
  194. data/lib/dcc/si/v2/standard_mu_xml_list.rb +18 -0
  195. data/lib/dcc/si/v2.rb +49 -0
  196. data/lib/dcc/si.rb +34 -0
  197. data/lib/dcc/signature/result.rb +43 -0
  198. data/lib/dcc/signature/signer.rb +36 -0
  199. data/lib/dcc/signature/verifier.rb +41 -0
  200. data/lib/dcc/signature.rb +13 -0
  201. data/lib/dcc/transform/result.rb +24 -0
  202. data/lib/dcc/transform/xslt.rb +72 -0
  203. data/lib/dcc/transform.rb +12 -0
  204. data/lib/dcc/type/base64_binary.rb +55 -0
  205. data/lib/dcc/type/decimal_xml_list.rb +47 -0
  206. data/lib/dcc/type/iso_country_code.rb +23 -0
  207. data/lib/dcc/type/iso_language_code.rb +23 -0
  208. data/lib/dcc/type/schema_version.rb +37 -0
  209. data/lib/dcc/type/si_unit.rb +26 -0
  210. data/lib/dcc/type.rb +16 -0
  211. data/lib/dcc/type_guards.rb +140 -0
  212. data/lib/dcc/v2/administrative_data.rb +8 -0
  213. data/lib/dcc/v2/byte_data.rb +8 -0
  214. data/lib/dcc/v2/calibration_laboratory.rb +8 -0
  215. data/lib/dcc/v2/comment.rb +8 -0
  216. data/lib/dcc/v2/common_elements.rb +13 -0
  217. data/lib/dcc/v2/condition.rb +8 -0
  218. data/lib/dcc/v2/configuration.rb +17 -0
  219. data/lib/dcc/v2/contact.rb +8 -0
  220. data/lib/dcc/v2/contact_not_strict.rb +8 -0
  221. data/lib/dcc/v2/core_data.rb +8 -0
  222. data/lib/dcc/v2/data.rb +8 -0
  223. data/lib/dcc/v2/digital_calibration_certificate.rb +8 -0
  224. data/lib/dcc/v2/equipment_class.rb +8 -0
  225. data/lib/dcc/v2/formula.rb +8 -0
  226. data/lib/dcc/v2/hash_type.rb +8 -0
  227. data/lib/dcc/v2/identification.rb +8 -0
  228. data/lib/dcc/v2/identifications.rb +8 -0
  229. data/lib/dcc/v2/influence_condition.rb +7 -0
  230. data/lib/dcc/v2/influence_condition_list.rb +8 -0
  231. data/lib/dcc/v2/item.rb +8 -0
  232. data/lib/dcc/v2/item_list.rb +8 -0
  233. data/lib/dcc/v2/list.rb +8 -0
  234. data/lib/dcc/v2/location.rb +8 -0
  235. data/lib/dcc/v2/measurement_meta_data.rb +8 -0
  236. data/lib/dcc/v2/measurement_meta_data_list.rb +8 -0
  237. data/lib/dcc/v2/measurement_result.rb +8 -0
  238. data/lib/dcc/v2/measurement_result_list.rb +8 -0
  239. data/lib/dcc/v2/measuring_equipment.rb +8 -0
  240. data/lib/dcc/v2/measuring_equipment_list.rb +8 -0
  241. data/lib/dcc/v2/namespace.rb +8 -0
  242. data/lib/dcc/v2/quantity.rb +49 -0
  243. data/lib/dcc/v2/ref_type_definition.rb +11 -0
  244. data/lib/dcc/v2/ref_type_definition_list.rb +15 -0
  245. data/lib/dcc/v2/resp_person.rb +8 -0
  246. data/lib/dcc/v2/resp_person_list.rb +8 -0
  247. data/lib/dcc/v2/result.rb +8 -0
  248. data/lib/dcc/v2/result_list.rb +8 -0
  249. data/lib/dcc/v2/rich_content.rb +12 -0
  250. data/lib/dcc/v2/software.rb +8 -0
  251. data/lib/dcc/v2/software_list.rb +8 -0
  252. data/lib/dcc/v2/statement.rb +8 -0
  253. data/lib/dcc/v2/statement_list.rb +8 -0
  254. data/lib/dcc/v2/string_with_lang.rb +8 -0
  255. data/lib/dcc/v2/text.rb +8 -0
  256. data/lib/dcc/v2/used_method.rb +8 -0
  257. data/lib/dcc/v2/used_method_list.rb +8 -0
  258. data/lib/dcc/v2/xml_blob.rb +8 -0
  259. data/lib/dcc/v2.rb +84 -0
  260. data/lib/dcc/v3/administrative_data.rb +8 -0
  261. data/lib/dcc/v3/byte_data.rb +8 -0
  262. data/lib/dcc/v3/calibration_laboratory.rb +8 -0
  263. data/lib/dcc/v3/comment.rb +8 -0
  264. data/lib/dcc/v3/common_elements.rb +11 -0
  265. data/lib/dcc/v3/condition.rb +8 -0
  266. data/lib/dcc/v3/configuration.rb +17 -0
  267. data/lib/dcc/v3/contact.rb +8 -0
  268. data/lib/dcc/v3/contact_not_strict.rb +8 -0
  269. data/lib/dcc/v3/core_data.rb +8 -0
  270. data/lib/dcc/v3/data.rb +8 -0
  271. data/lib/dcc/v3/digital_calibration_certificate.rb +8 -0
  272. data/lib/dcc/v3/equipment_class.rb +8 -0
  273. data/lib/dcc/v3/formula.rb +8 -0
  274. data/lib/dcc/v3/hash_type.rb +8 -0
  275. data/lib/dcc/v3/identification.rb +8 -0
  276. data/lib/dcc/v3/identifications.rb +8 -0
  277. data/lib/dcc/v3/influence_condition.rb +7 -0
  278. data/lib/dcc/v3/influence_condition_list.rb +8 -0
  279. data/lib/dcc/v3/item.rb +8 -0
  280. data/lib/dcc/v3/item_list.rb +8 -0
  281. data/lib/dcc/v3/list.rb +8 -0
  282. data/lib/dcc/v3/location.rb +8 -0
  283. data/lib/dcc/v3/measurement_meta_data.rb +8 -0
  284. data/lib/dcc/v3/measurement_meta_data_list.rb +8 -0
  285. data/lib/dcc/v3/measurement_result.rb +8 -0
  286. data/lib/dcc/v3/measurement_result_list.rb +8 -0
  287. data/lib/dcc/v3/measuring_equipment.rb +8 -0
  288. data/lib/dcc/v3/measuring_equipment_list.rb +8 -0
  289. data/lib/dcc/v3/namespace.rb +7 -0
  290. data/lib/dcc/v3/quantity.rb +49 -0
  291. data/lib/dcc/v3/ref_type_definition.rb +8 -0
  292. data/lib/dcc/v3/ref_type_definition_list.rb +8 -0
  293. data/lib/dcc/v3/resp_person.rb +8 -0
  294. data/lib/dcc/v3/resp_person_list.rb +8 -0
  295. data/lib/dcc/v3/result.rb +8 -0
  296. data/lib/dcc/v3/result_list.rb +8 -0
  297. data/lib/dcc/v3/rich_content.rb +8 -0
  298. data/lib/dcc/v3/software.rb +8 -0
  299. data/lib/dcc/v3/software_list.rb +8 -0
  300. data/lib/dcc/v3/statement.rb +8 -0
  301. data/lib/dcc/v3/statement_list.rb +8 -0
  302. data/lib/dcc/v3/string_with_lang.rb +8 -0
  303. data/lib/dcc/v3/text.rb +8 -0
  304. data/lib/dcc/v3/used_method.rb +8 -0
  305. data/lib/dcc/v3/used_method_list.rb +8 -0
  306. data/lib/dcc/v3/xml_blob.rb +8 -0
  307. data/lib/dcc/v3.rb +111 -0
  308. data/lib/dcc/validate/business_rules.rb +121 -0
  309. data/lib/dcc/validate/issue.rb +56 -0
  310. data/lib/dcc/validate/result.rb +105 -0
  311. data/lib/dcc/validate/schematron/profile.rb +64 -0
  312. data/lib/dcc/validate/schematron/rule.rb +49 -0
  313. data/lib/dcc/validate/schematron/rules/administrative_data_completeness.rb +42 -0
  314. data/lib/dcc/validate/schematron/rules/base.rb +15 -0
  315. data/lib/dcc/validate/schematron/rules/date_range_check.rb +41 -0
  316. data/lib/dcc/validate/schematron/rules/id_refid_linking.rb +61 -0
  317. data/lib/dcc/validate/schematron/rules/influence_conditions_placement.rb +58 -0
  318. data/lib/dcc/validate/schematron/rules/iso_code_validation.rb +53 -0
  319. data/lib/dcc/validate/schematron/rules/language_code_dedup.rb +39 -0
  320. data/lib/dcc/validate/schematron/rules/non_si_declaration.rb +82 -0
  321. data/lib/dcc/validate/schematron/rules/release_format_check.rb +44 -0
  322. data/lib/dcc/validate/schematron/rules/schema_version_check.rb +31 -0
  323. data/lib/dcc/validate/schematron/rules/uncertainty_consistency.rb +58 -0
  324. data/lib/dcc/validate/schematron/rules/unit_format_check.rb +74 -0
  325. data/lib/dcc/validate/schematron/rules/used_methods_placement.rb +65 -0
  326. data/lib/dcc/validate/schematron/rules/used_software_placement.rb +43 -0
  327. data/lib/dcc/validate/schematron/rules/xml_list_spacing.rb +42 -0
  328. data/lib/dcc/validate/schematron/rules.rb +30 -0
  329. data/lib/dcc/validate/schematron.rb +22 -0
  330. data/lib/dcc/validate/severity.rb +39 -0
  331. data/lib/dcc/validate/xsd.rb +97 -0
  332. data/lib/dcc/validate.rb +15 -0
  333. data/lib/dcc/version.rb +5 -0
  334. data/lib/dcc/versioned_parser.rb +48 -0
  335. data/lib/dcc.rb +141 -0
  336. metadata +425 -0
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:itemType` — single calibrated item: name, equipmentClass,
6
+ # description, manufacturer, model, identifications.
7
+ module Item
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attribute :id, :string
11
+ attribute :ref_id, :string
12
+ attribute :ref_type, :string
13
+ attribute :name, :text
14
+ attribute :equipment_class, :equipmentClass, collection: true
15
+ attribute :description, :richContent
16
+ attribute :manufacturer, :contactNotStrict
17
+ attribute :model, :string
18
+ attribute :identifications, :identifications
19
+
20
+ xml do
21
+ namespace ::Dcc::Namespace::Dcc
22
+ element "item"
23
+ ordered
24
+ map_attribute "id", to: :id
25
+ map_attribute "refId", to: :ref_id
26
+ map_attribute "refType", to: :ref_type
27
+ map_element "name", to: :name
28
+ map_element "equipmentClass", to: :equipment_class
29
+ map_element "description", to: :description
30
+ map_element "manufacturer", to: :manufacturer
31
+ map_element "model", to: :model
32
+ map_element "identifications", to: :identifications
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:itemListType` — container of `dcc:item`. Also has its own name,
6
+ # equipmentClass, description, owner, identifications.
7
+ module ItemList
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attribute :id, :string
11
+ attribute :ref_id, :string
12
+ attribute :ref_type, :string
13
+ attribute :name, :text
14
+ attribute :equipment_class, :equipmentClass, collection: true
15
+ attribute :description, :richContent
16
+ attribute :owner, :contact
17
+ attribute :identifications, :identifications
18
+ attribute :item, :item, collection: true
19
+
20
+ xml do
21
+ namespace ::Dcc::Namespace::Dcc
22
+ element "items"
23
+ ordered
24
+ map_attribute "id", to: :id
25
+ map_attribute "refId", to: :ref_id
26
+ map_attribute "refType", to: :ref_type
27
+ map_element "name", to: :name
28
+ map_element "equipmentClass", to: :equipment_class
29
+ map_element "description", to: :description
30
+ map_element "owner", to: :owner
31
+ map_element "identifications", to: :identifications
32
+ map_element "item", to: :item
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:listType` — recursive list of quantities or sub-lists. Same
6
+ # ancillary sections as Quantity (usedMethods, usedSoftware, etc.).
7
+ module List
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attribute :id, :string
11
+ attribute :ref_id, :string
12
+ attribute :ref_type, :string
13
+ attribute :table_dimension, :integer
14
+ attribute :name, :text
15
+ attribute :date_time, :date_time
16
+ attribute :quantity, :quantity, collection: true
17
+ attribute :list, :list, collection: true
18
+ attribute :used_methods, :usedMethods
19
+ attribute :used_software, :softwareList
20
+ attribute :influence_conditions, :influenceConditions
21
+ attribute :measurement_meta_data, :measurementMetaData
22
+
23
+ xml do
24
+ namespace ::Dcc::Namespace::Dcc
25
+ element "list"
26
+ ordered
27
+ map_attribute "id", to: :id
28
+ map_attribute "refId", to: :ref_id
29
+ map_attribute "refType", to: :ref_type
30
+ map_attribute "tableDimension", to: :table_dimension
31
+ map_element "name", to: :name
32
+ map_element "dateTime", to: :date_time
33
+ map_element "quantity", to: :quantity
34
+ map_element "list", to: :list
35
+ map_element "usedMethods", to: :used_methods
36
+ map_element "usedSoftware", to: :used_software
37
+ map_element "influenceConditions", to: :influence_conditions
38
+ map_element "measurementMetaData", to: :measurement_meta_data
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:locationType` — physical address. Choice of `city`, `countryCode`,
6
+ # `postCode`, `postOfficeBox`, `state`, `street`, `streetNo`, `further`.
7
+ module Location
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attribute :city, :string
11
+ attribute :country_code, :string
12
+ attribute :post_code, :string
13
+ attribute :post_office_box, :string
14
+ attribute :state, :string
15
+ attribute :street, :string
16
+ attribute :street_no, :string
17
+ attribute :further, :string
18
+
19
+ xml do
20
+ namespace ::Dcc::Namespace::Dcc
21
+ element "location"
22
+ ordered
23
+ map_element "city", to: :city
24
+ map_element "countryCode", to: :country_code
25
+ map_element "postCode", to: :post_code
26
+ map_element "postOfficeBox", to: :post_office_box
27
+ map_element "state", to: :state
28
+ map_element "street", to: :street
29
+ map_element "streetNo", to: :street_no
30
+ map_element "further", to: :further
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:measurementMetaDataType` — single metadata statement block (a
6
+ # specialized statement for measurement-level metadata).
7
+ module MeasurementMetaData
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ include ::Dcc::Base::Statement
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:measurementMetaDataListType` — collection of `dcc:metaData`.
6
+ module MeasurementMetaDataList
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ attribute :id, :string
10
+ attribute :ref_id, :string
11
+ attribute :ref_type, :string
12
+ attribute :meta_data, :metaData, collection: true
13
+
14
+ xml do
15
+ namespace ::Dcc::Namespace::Dcc
16
+ element "measurementMetaData"
17
+ ordered
18
+ map_attribute "id", to: :id
19
+ map_attribute "refId", to: :ref_id
20
+ map_attribute "refType", to: :ref_type
21
+ map_element "metaData", to: :meta_data
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:measurementResultType` — single result block containing name,
6
+ # usedMethods, usedSoftware, measuringEquipments, influenceConditions,
7
+ # results.
8
+ module MeasurementResult
9
+ def self.included(klass)
10
+ klass.class_eval do
11
+ attribute :id, :string
12
+ attribute :ref_id, :string
13
+ attribute :ref_type, :string
14
+ attribute :name, :text
15
+ attribute :description, :text
16
+ attribute :used_methods, :usedMethods
17
+ attribute :used_software, :softwareList
18
+ attribute :measuring_equipments, :measuringEquipments
19
+ attribute :influence_conditions, :influenceConditions
20
+ attribute :results, :results
21
+
22
+ xml do
23
+ namespace ::Dcc::Namespace::Dcc
24
+ element "measurementResult"
25
+ ordered
26
+ map_attribute "id", to: :id
27
+ map_attribute "refId", to: :ref_id
28
+ map_attribute "refType", to: :ref_type
29
+ map_element "name", to: :name
30
+ map_element "description", to: :description
31
+ map_element "usedMethods", to: :used_methods
32
+ map_element "usedSoftware", to: :used_software
33
+ map_element "measuringEquipments", to: :measuring_equipments
34
+ map_element "influenceConditions", to: :influence_conditions
35
+ map_element "results", to: :results
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:measurementResultListType` — collection of `dcc:measurementResult`.
6
+ # Also serves as the root element under `digitalCalibrationCertificate`.
7
+ module MeasurementResultList
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attribute :id, :string
11
+ attribute :ref_id, :string
12
+ attribute :ref_type, :string
13
+ attribute :measurement_result, :measurementResult, collection: true
14
+
15
+ xml do
16
+ namespace ::Dcc::Namespace::Dcc
17
+ element "measurementResults"
18
+ ordered
19
+ map_attribute "id", to: :id
20
+ map_attribute "refId", to: :ref_id
21
+ map_attribute "refType", to: :ref_type
22
+ map_element "measurementResult", to: :measurement_result
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:measuringEquipmentType` — single instrument used during calibration.
6
+ module MeasuringEquipment
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ attribute :id, :string
10
+ attribute :ref_id, :string
11
+ attribute :ref_type, :string
12
+ attribute :name, :text
13
+ attribute :equipment_class, :equipmentClass, collection: true
14
+ attribute :description, :richContent
15
+ attribute :certificate, :previousReport
16
+ attribute :manufacturer, :contactNotStrict
17
+ attribute :model, :string
18
+ attribute :identifications, :identifications
19
+ attribute :installed_software, :softwareList
20
+
21
+ xml do
22
+ namespace ::Dcc::Namespace::Dcc
23
+ element "measuringEquipment"
24
+ ordered
25
+ map_attribute "id", to: :id
26
+ map_attribute "refId", to: :ref_id
27
+ map_attribute "refType", to: :ref_type
28
+ map_element "name", to: :name
29
+ map_element "equipmentClass", to: :equipment_class
30
+ map_element "description", to: :description
31
+ map_element "certificate", to: :certificate
32
+ map_element "manufacturer", to: :manufacturer
33
+ map_element "model", to: :model
34
+ map_element "identifications", to: :identifications
35
+ map_element "installedSoftware", to: :installed_software
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:measuringEquipmentListType` — container of measuring equipment
6
+ # plus shared name/equipmentClass/description/owner/identifications.
7
+ module MeasuringEquipmentList
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attribute :id, :string
11
+ attribute :ref_id, :string
12
+ attribute :ref_type, :string
13
+ attribute :name, :text
14
+ attribute :equipment_class, :equipmentClass, collection: true
15
+ attribute :description, :richContent
16
+ attribute :owner, :contact
17
+ attribute :identifications, :identifications
18
+ attribute :measuring_equipment, :measuringEquipment, collection: true
19
+
20
+ xml do
21
+ namespace ::Dcc::Namespace::Dcc
22
+ element "measuringEquipments"
23
+ ordered
24
+ map_attribute "id", to: :id
25
+ map_attribute "refId", to: :ref_id
26
+ map_attribute "refType", to: :ref_type
27
+ map_element "name", to: :name
28
+ map_element "equipmentClass", to: :equipment_class
29
+ map_element "description", to: :description
30
+ map_element "owner", to: :owner
31
+ map_element "identifications", to: :identifications
32
+ map_element "measuringEquipment", to: :measuring_equipment
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:quantityType` — DCC quantity wrapper around a D-SI quantity element.
6
+ # The XSD allows any of: si:real, si:complex, si:constant, si:hybrid,
7
+ # si:list, si:realListXMLList, si:complexListXMLList, or noQuantity.
8
+ #
9
+ # We use Option B (one attribute per substitution element) — the most
10
+ # reliable pattern in current lutaml-model. Each si:* element resolves
11
+ # via the active type registry to the version-appropriate D-SI class
12
+ # (`Dcc::Si::V2::Real` under `:dcc_v3`, `Dcc::Si::V1::Real` under
13
+ # `:dcc_v2`, etc.).
14
+ module Quantity
15
+ def self.included(klass)
16
+ klass.class_eval do
17
+ attribute :id, :string
18
+ attribute :ref_id, :string
19
+ attribute :ref_type, :string
20
+ attribute :name, :text
21
+ attribute :no_quantity, :string
22
+ # D-SI quantity substitutions (Option B)
23
+ attribute :real, :real, collection: true
24
+ attribute :complex, :complex, collection: true
25
+ attribute :constant, :constant, collection: true
26
+ attribute :hybrid, :hybrid, collection: true
27
+ attribute :real_list_xml_list, :realListXMLList, collection: true
28
+ attribute :complex_list_xml_list, :complexListXMLList, collection: true
29
+ attribute :list, :list, collection: true
30
+ # Ancillary DCC sections
31
+ attribute :used_methods, :usedMethods
32
+ attribute :used_software, :softwareList
33
+ attribute :influence_conditions, :influenceConditions
34
+ attribute :measurement_meta_data, :measurementMetaData
35
+
36
+ xml do
37
+ namespace ::Dcc::Namespace::Dcc
38
+ element "quantity"
39
+ ordered
40
+ map_attribute "id", to: :id
41
+ map_attribute "refId", to: :ref_id
42
+ map_attribute "refType", to: :ref_type
43
+ map_element "name", to: :name
44
+ map_element "noQuantity", to: :no_quantity
45
+ map_element "real", to: :real
46
+ map_element "complex", to: :complex
47
+ map_element "constant", to: :constant
48
+ map_element "hybrid", to: :hybrid
49
+ map_element "realListXMLList", to: :real_list_xml_list
50
+ map_element "complexListXMLList", to: :complex_list_xml_list
51
+ map_element "list", to: :list
52
+ map_element "usedMethods", to: :used_methods
53
+ map_element "usedSoftware", to: :used_software
54
+ map_element "influenceConditions", to: :influence_conditions
55
+ map_element "measurementMetaData", to: :measurement_meta_data
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:refTypeDefinitionType` (v3.4+) — declares a refType namespace and
6
+ # source link. Used in `administrativeData/refTypeDefinitions`.
7
+ module RefTypeDefinition
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attribute :ref_type, :string
11
+ attribute :name, :text
12
+ attribute :description, :richContent
13
+ attribute :namespace, :string
14
+ attribute :link, :string
15
+ attribute :release, :string
16
+ attribute :value, :string
17
+ attribute :procedure, :string
18
+
19
+ xml do
20
+ namespace ::Dcc::Namespace::Dcc
21
+ element "refTypeDefinition"
22
+ ordered
23
+ map_attribute "refType", to: :ref_type
24
+ map_element "name", to: :name
25
+ map_element "description", to: :description
26
+ map_element "namespace", to: :namespace
27
+ map_element "link", to: :link
28
+ map_element "release", to: :release
29
+ map_element "value", to: :value
30
+ map_element "procedure", to: :procedure
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:refTypeDefinitionListType` — collection of `dcc:refTypeDefinition`.
6
+ module RefTypeDefinitionList
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ attribute :ref_type_definition, :refTypeDefinition, collection: true
10
+
11
+ xml do
12
+ namespace ::Dcc::Namespace::Dcc
13
+ element "refTypeDefinitions"
14
+ ordered
15
+ map_element "refTypeDefinition", to: :ref_type_definition
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:respPersonType` — responsible person with role flags for digital
6
+ # sealing and signing.
7
+ module RespPerson
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attribute :id, :string
11
+ attribute :ref_id, :string
12
+ attribute :ref_type, :string
13
+ attribute :person, :contact
14
+ attribute :description, :text
15
+ attribute :main_signer, :boolean
16
+ attribute :crypt_electronic_seal, :string
17
+ attribute :crypt_electronic_signature, :string
18
+ attribute :crypt_electronic_time_stamp, :string
19
+
20
+ xml do
21
+ namespace ::Dcc::Namespace::Dcc
22
+ element "respPerson"
23
+ ordered
24
+ map_attribute "id", to: :id
25
+ map_attribute "refId", to: :ref_id
26
+ map_attribute "refType", to: :ref_type
27
+ map_element "person", to: :person
28
+ map_element "description", to: :description
29
+ map_element "mainSigner", to: :main_signer
30
+ map_element "cryptElectronicSeal", to: :crypt_electronic_seal
31
+ map_element "cryptElectronicSignature", to: :crypt_electronic_signature
32
+ map_element "cryptElectronicTimeStamp", to: :crypt_electronic_time_stamp
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:respPersonListType` — collection of `dcc:respPerson`.
6
+ module RespPersonList
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ attribute :id, :string
10
+ attribute :ref_id, :string
11
+ attribute :ref_type, :string
12
+ attribute :resp_person, :respPerson, collection: true
13
+
14
+ xml do
15
+ namespace ::Dcc::Namespace::Dcc
16
+ element "respPersons"
17
+ ordered
18
+ map_attribute "id", to: :id
19
+ map_attribute "refId", to: :ref_id
20
+ map_attribute "refType", to: :ref_type
21
+ map_element "respPerson", to: :resp_person
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:resultType` — single named result carrying a `dcc:data` block.
6
+ module Result
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ attribute :id, :string
10
+ attribute :ref_id, :string
11
+ attribute :ref_type, :string
12
+ attribute :name, :text
13
+ attribute :description, :text
14
+ attribute :data, :data, collection: true
15
+
16
+ xml do
17
+ namespace ::Dcc::Namespace::Dcc
18
+ element "result"
19
+ ordered
20
+ map_attribute "id", to: :id
21
+ map_attribute "refId", to: :ref_id
22
+ map_attribute "refType", to: :ref_type
23
+ map_element "name", to: :name
24
+ map_element "description", to: :description
25
+ map_element "data", to: :data
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:resultListType` — collection of `dcc:result`.
6
+ module ResultList
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ attribute :id, :string
10
+ attribute :ref_id, :string
11
+ attribute :ref_type, :string
12
+ attribute :result, :result, collection: true
13
+
14
+ xml do
15
+ namespace ::Dcc::Namespace::Dcc
16
+ element "results"
17
+ ordered
18
+ map_attribute "id", to: :id
19
+ map_attribute "refId", to: :ref_id
20
+ map_attribute "refType", to: :ref_type
21
+ map_element "result", to: :result
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:richContentType` (v3.4+) — combines text, files, and formulae into
6
+ # one content block. We model it as an ordered collection of variants.
7
+ module RichContent
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attribute :id, :string
11
+ attribute :ref_id, :string
12
+ attribute :ref_type, :string
13
+ attribute :text, :text, collection: true
14
+ attribute :formula, :formula, collection: true
15
+ attribute :byte_data, :byteData, collection: true
16
+ attribute :file, :byteData, collection: true
17
+
18
+ xml do
19
+ namespace ::Dcc::Namespace::Dcc
20
+ element "richContent"
21
+ ordered
22
+ map_attribute "id", to: :id
23
+ map_attribute "refId", to: :ref_id
24
+ map_attribute "refType", to: :ref_type
25
+ map_element "text", to: :text
26
+ map_element "formula", to: :formula
27
+ map_element "byteData", to: :byte_data
28
+ map_element "file", to: :file
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dcc
4
+ module Base
5
+ # `dcc:softwareType` — name + release + optional type enum + description.
6
+ # v3.4 adds the `type` enum (application/bios/driver/editor/firmware/
7
+ # library/os/other).
8
+ module Software
9
+ def self.included(klass)
10
+ klass.class_eval do
11
+ attribute :id, :string
12
+ attribute :ref_id, :string
13
+ attribute :ref_type, :string
14
+ attribute :name, :text
15
+ attribute :release, :string
16
+ attribute :type, :string
17
+ attribute :description, :richContent
18
+
19
+ xml do
20
+ namespace ::Dcc::Namespace::Dcc
21
+ element "software"
22
+ ordered
23
+ map_attribute "id", to: :id
24
+ map_attribute "refId", to: :ref_id
25
+ map_attribute "refType", to: :ref_type
26
+ map_element "name", to: :name
27
+ map_element "release", to: :release
28
+ map_element "type", to: :type
29
+ map_element "description", to: :description
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end