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,814 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema version="1.3.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
+ targetNamespace="https://ptb.de/si"
4
+ xmlns:si="https://ptb.de/si"
5
+ elementFormDefault="qualified">
6
+
7
+ <xs:annotation>
8
+ <xs:documentation xml:lang="en">
9
+ Copyright (c) 2019 - EMPIR project 17IND02 (title: SmartCom) consortium and Physikalisch-Technische Bundesanstalt (PTB),
10
+ alle Rechte vorbehalten - all rights reserved. This XML scheme is provided attributed to the CC-BY-ND 4.0 license.
11
+ Please, refer to https://creativecommons.org/licenses/by-nd/4.0/legalcode for the full license.
12
+ </xs:documentation>
13
+ <xs:documentation xml:lang="en">
14
+ This XML scheme implements the Digital-SI (D-SI) data model for a transmission of metrological data in digital
15
+ applications.
16
+ AUTHORS
17
+ Physikalisch-Technische Bundesanstalt (DE): Daniel Hutzschenreuter, Frank Härtig, Thomas Wiedenhöfer,
18
+ Siegfried Gustav Hackel, Alexander Scheibner, Wiebke Heeren;
19
+ National Physical Laboratory (UK): Ian Smith, Clifford Brown
20
+ CONTACT
21
+ smartcom@ptb.de
22
+ WEBPAGE
23
+ https://www.ptb.de/empir2018/smartcom/home/
24
+ VERSION
25
+ 1.3.0
26
+ DATE
27
+ 2019-10-16
28
+ DOI:
29
+ 10.5281/zenodo.3366902
30
+ </xs:documentation>
31
+ <xs:documentation xml:lang="en">
32
+ DISCLAIMER:
33
+ This XML scheme was developed by the EMPIR project 17IND02 (title: SmartCom) consortium under the lead of
34
+ Physikalisch-Technische Bundesanstalt (PTB). The XML scheme is made available “as is“
35
+ free of cost at your own risk. Members of the EMPIR project 17IND02 (SmartCom) consortium and the Physikalisch-Technische
36
+ Bundesanstalt assume no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or
37
+ implied, about its quality, reliability, safety, suitability or any other characteristic. As far as legally permitted,
38
+ the members of the EMPIR project 17IND02 (SmartCom) consortium and the Physikalisch-Technische Bundesanstalt refuse
39
+ any liability for any direct, indirect or consequential damage arising in connection with the use of this XML scheme.
40
+ </xs:documentation>
41
+ <xs:documentation xml:lang="en">
42
+ ACKNOWLEDGEMENT:
43
+ The development of the XML scheme is part of the research project EMPIR 17IND02 (title: SmartCom).
44
+ This project (17IND02) has received funding from the EMPIR programme, co-financed by the Participating States and
45
+ from the European Union's Horizon 2020 research and innovation programme.
46
+ </xs:documentation>
47
+ </xs:annotation>
48
+
49
+
50
+
51
+ <!--
52
+ ##############################################################################################
53
+ First part of the XML-schema: Elements for the SI-based exchange of measured quantities.
54
+ ##############################################################################################
55
+ -->
56
+
57
+ <xs:element name="real">
58
+ <xs:annotation>
59
+ <xs:documentation xml:lang="en">
60
+ Meta data element definition for a real measurement quantity.
61
+ </xs:documentation>
62
+ <xs:documentation xml:lang="en">
63
+ <![CDATA[
64
+ The following statements of a real quantity are possible.
65
+ [(m)-mandatory, (o)-optional]
66
+
67
+ 1. Basic measured quantity
68
+ (o) - element label (string)
69
+ (m) - element value (decimal value type)
70
+ (m) - element unit (string - SI format)
71
+ (o) - element dateTime (xs:dateTime)
72
+
73
+
74
+ 2. Measured quantity with expanded measurement uncertainty
75
+ (o) - element label (string)
76
+ (m) - element value (decimal value type)
77
+ (m) - element unit (string - SI format)
78
+ (o) - element dateTime (xs:dateTime)
79
+ (m) - element expandedUnc (element type expandedUnc - sub structure)
80
+
81
+
82
+ 3. Measured quantity with uncertainty coverage interval (probabilistic-symmetric)
83
+ (o) - element label (string)
84
+ (m) - element value (decimal value type)
85
+ (m) - element unit (string - SI format)
86
+ (o) - element dateTime (xs:dateTime)
87
+ (m) - element coverageInterval (element type coverageInterval - sub structure)
88
+ ]]>
89
+ </xs:documentation>
90
+ <xs:documentation xml:lang="en">
91
+ <![CDATA[
92
+ Integration into external XML:
93
+ <myXML xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:si="https://ptb.de/si">
94
+ <xs:element name="individualElement">
95
+ <xs:complexType>
96
+ <xs:sequence>
97
+ <xs:element ref="si:real"/>
98
+ </xs:sequence>
99
+ </xs:complexType>
100
+ </xs:element>
101
+ </mxXML>
102
+ ]]>
103
+ </xs:documentation>
104
+ </xs:annotation>
105
+ <xs:complexType>
106
+ <xs:sequence>
107
+ <!-- optional label -->
108
+ <xs:element name="label" type="xs:string" minOccurs="0"/>
109
+
110
+ <!-- mandatory information -->
111
+ <xs:element name="value" type="si:decimalType"/>
112
+ <xs:element name="unit" type="si:unitType"/>
113
+
114
+ <!-- optional time stamp -->
115
+ <xs:element name="dateTime" type="xs:dateTime" minOccurs="0"/>
116
+
117
+ <!-- optional choice of uncertainty statements -->
118
+ <xs:choice minOccurs="0">
119
+ <xs:element ref="si:expandedUnc"/>
120
+ <xs:element ref="si:coverageInterval"/>
121
+ </xs:choice>
122
+
123
+ </xs:sequence>
124
+
125
+ </xs:complexType>
126
+ </xs:element>
127
+
128
+
129
+ <xs:element name="expandedUnc">
130
+ <xs:annotation>
131
+ <xs:documentation xml:lang="en">
132
+ Definition of the structure, that gives the necessary components for stating
133
+ an expanded measurement uncertainty. This element must always be used in the
134
+ context of a real quantity, which is an application within si:real and/or
135
+ si:globalUnivaraiteUnc.
136
+ </xs:documentation>
137
+ <xs:documentation xml:lang="en">
138
+ <![CDATA[
139
+ The element has the following components [(m)-mandatory, (o)-optional]:
140
+
141
+ (m) - element uncertainty (decimal value >= 0)
142
+ (m) - element coverageFactor (decimal value >= 1)
143
+ (m) - element coverageProbability (decimal value in [0,1])
144
+ (o) - element distribution (string)
145
+
146
+ The unit of component uncertainty is the unit used in the context of
147
+ si:real and/or si:globalUnivaraiteUnc.
148
+ ]]>
149
+ </xs:documentation>
150
+ </xs:annotation>
151
+ <xs:complexType>
152
+ <xs:sequence>
153
+ <xs:element name="uncertainty" type="si:uncertaintyValueType"/>
154
+ <xs:element name="coverageFactor" type="si:kValueType"/>
155
+ <xs:element name="coverageProbability" type="si:probabilityValueType"/>
156
+ <xs:element name="distribution" type="xs:string" minOccurs="0"/>
157
+ </xs:sequence>
158
+ </xs:complexType>
159
+ </xs:element>
160
+
161
+
162
+ <xs:element name="coverageInterval">
163
+ <xs:annotation>
164
+ <xs:documentation xml:lang="en">
165
+ Definition of the structure, that gives the necessary components for stating
166
+ a probabilistic-symmetric coverage interval for a real uncertainty. This element
167
+ must always be used in the context of a real quantity, which is an application
168
+ within si:real and/or si:globalUnivaraiteUnc.
169
+ </xs:documentation>
170
+ <xs:documentation xml:lang="en">
171
+ <![CDATA[
172
+ The element has the following components [(m)-mandatory, (o)-optional]:
173
+
174
+ (m) - element stdUncertainty (decimal value >= 0)
175
+ (m) - element intervalMin (decimal value type)
176
+ (m) - element intervalMax (decimal value type)
177
+ (m) - element coverageProbability (decimal value in [0,1])
178
+ (o) - element distribution (string)
179
+
180
+ The unit of components stdUncertainty, intervalMin and intervalMax is the unit
181
+ used in the context of si:real and/or si:globalUnivaraiteUnc.
182
+ ]]>
183
+ </xs:documentation>
184
+ </xs:annotation>
185
+ <xs:complexType>
186
+ <xs:sequence>
187
+ <xs:element name="standardUnc" type="si:uncertaintyValueType"/>
188
+ <xs:element name="intervalMin" type="si:decimalType"/>
189
+ <xs:element name="intervalMax" type="si:decimalType"/>
190
+ <xs:element name="coverageProbability" type="si:probabilityValueType"/>
191
+ <xs:element name="distribution" type="xs:string" minOccurs="0"/>
192
+ </xs:sequence>
193
+ </xs:complexType>
194
+ </xs:element>
195
+
196
+
197
+ <xs:element name="constant">
198
+ <xs:annotation>
199
+ <xs:documentation xml:lang="en">
200
+ Definition of a structure for real numbers, that represent for fundamental
201
+ physical constants and mathematical constants.
202
+ </xs:documentation>
203
+ <xs:documentation xml:lang="en">
204
+ <![CDATA[
205
+ The element has the following components [(m)-mandatory, (o)-optional]:
206
+
207
+ (o) - element label (string)
208
+ (m) - element value (decimal value type)
209
+ (m) - element unit (string - SI unit)
210
+ (o) - element dateTime (xs:dateTime)
211
+ (o) - element uncertainty (decimal value >= 0)
212
+ (o) - element distribution (string)
213
+
214
+ The value and the uncertaintny have the unit specified by the element unit.
215
+ For fundamental physical constants, that are defined experimentally, the
216
+ uncertainty is the standard deviation.
217
+
218
+ For rounded mathematical constants, the uncertainty is the standard deviation
219
+ of a rectangular distribution (element value defines center point), that
220
+ containes the exact value of the constant with 100 percent probability.
221
+ ]]>
222
+ </xs:documentation>
223
+ </xs:annotation>
224
+ <xs:complexType>
225
+ <xs:sequence>
226
+ <!-- optional label -->
227
+ <xs:element name="label" type="xs:string" minOccurs="0"/>
228
+
229
+ <!-- mandatory information -->
230
+ <xs:element name="value" type="si:decimalType"/>
231
+ <xs:element name="unit" type="si:unitType"/>
232
+
233
+ <!-- optional time stamp -->
234
+ <xs:element name="dateTime" type="xs:dateTime" minOccurs="0"/>
235
+
236
+ <!-- optional uncertainty -->
237
+ <xs:element name="uncertainty" type="si:uncertaintyValueType" minOccurs="0"/>
238
+
239
+ <!-- optional distribution -->
240
+ <xs:element name="distribution" type="xs:string" minOccurs="0"/>
241
+ </xs:sequence>
242
+ </xs:complexType>
243
+ </xs:element>
244
+
245
+
246
+
247
+ <xs:element name="complex">
248
+ <xs:annotation>
249
+ <xs:documentation xml:lang="en">
250
+ The definition of complex quantities in the D-SI meta data model.
251
+ Complex quantities allow two representations of complex numerical values:
252
+ One is the Cartesian coordinate form, the other representation is the
253
+ polar coordinate form.
254
+ </xs:documentation>
255
+ <xs:documentation xml:lang="en">
256
+ <![CDATA[
257
+ The following statements of a complex quantity are possible.
258
+ [(m)-mandatory, (o)-optional]
259
+
260
+ 1. Basic measured quantity in Cartesian form
261
+ (o) - element label (string)
262
+ (m) - element valueReal (decimal value type)
263
+ (m) - element valueImag (decimal value type)
264
+ (m) - element unit (string - SI unit)
265
+ (o) - element dateTime (xs:dateTime)
266
+
267
+
268
+ 2. Basic measured quantity in polar form
269
+ (o) - element label (string)
270
+ (m) - element valueMagnitude (decimal value type)
271
+ (m) - element valuePhase (decimal value type)
272
+ (m) - element unit (string - SI unit)
273
+ (m) - element unitPhase (string - SI unit for an angular quantity)
274
+ (o) - element dateTime (xs:dateTime)
275
+
276
+
277
+ 3. Basic measured quantity in Cartesian form with ellipsoidal coverage region
278
+ (o) - element label (string)
279
+ (m) - element valueReal (decimal value type)
280
+ (m) - element valueImag (decimal value type)
281
+ (m) - element unit (string - SI unit)
282
+ (o) - element dateTime (xs:dateTime)
283
+ (m) - element ellipsoidalRegion (element type ellipsoidalRegion - sub structure)
284
+
285
+
286
+ 4. Basic measured quantity in polar form with ellipsoidal coverage region
287
+ (o) - element label (string)
288
+ (m) - element valueMagnitude (decimal value type)
289
+ (m) - element valuePhase (decimal value type)
290
+ (m) - element unit (string - SI unit)
291
+ (m) - element unitPhase (string - SI unit for an angular quantity)
292
+ (o) - element dateTime (xs:dateTime)
293
+ (m) - element ellipsoidalRegion (element type ellipsoidalRegion - sub structure)
294
+
295
+
296
+ 5. Basic measured quantity in Cartesian form with rectangular coverage region
297
+ (o) - element label (string)
298
+ (m) - element valueReal (decimal value type)
299
+ (m) - element valueImag (decimal value type)
300
+ (m) - element unit (string - SI unit)
301
+ (o) - element dateTime (xs:dateTime)
302
+ (m) - element rectangularRegion (element type rectangularRegion - sub structure)
303
+
304
+
305
+ 6. Basic measured quantity in polar form with rectangular coverage region
306
+ (o) - element label (string)
307
+ (m) - element valueMagnitude (decimal value type)
308
+ (m) - element valuePhase (decimal value type)
309
+ (m) - element unit (string - SI unit)
310
+ (m) - element unitPhase (string - SI unit for an angular quantity)
311
+ (o) - element dateTime (xs:dateTime)
312
+ (m) - element rectangularRegion (element type rectangularRegion - sub structure)
313
+ ]]>
314
+ </xs:documentation>
315
+ </xs:annotation>
316
+ <xs:complexType>
317
+ <xs:sequence>
318
+ <!-- optional label -->
319
+ <xs:element name="label" type="xs:string" minOccurs="0"/>
320
+ <!-- choice of Cartesian coordinate form or polar coordinate form -->
321
+ <xs:choice>
322
+ <xs:sequence>
323
+ <!-- mandatory components of Cartesian coordinate form -->
324
+ <xs:element name="valueReal" type="si:decimalType"/>
325
+ <xs:element name="valueImag" type="si:decimalType"/>
326
+ <xs:element name="unit" type="si:unitType"/>
327
+ </xs:sequence>
328
+ <xs:sequence>
329
+ <!-- mandatory components of polar coordinate form -->
330
+ <xs:element name="valueMagnitude" type="si:decimalType"/>
331
+ <xs:element name="valuePhase" type="si:decimalType"/>
332
+ <xs:element name="unit" type="si:unitType"/>
333
+ <xs:element name="unitPhase" type="si:unitPhaseType"/>
334
+ </xs:sequence>
335
+ </xs:choice>
336
+ <!-- optional time stamp -->
337
+ <xs:element name="dateTime" type="xs:dateTime" minOccurs="0"/>
338
+ <!-- optional uncertainty statement: either ellipsoidal or rectangular coverage region -->
339
+ <xs:choice minOccurs="0">
340
+ <xs:element ref="si:ellipsoidalRegion"/>
341
+ <xs:element ref="si:rectangularRegion"/>
342
+ </xs:choice>
343
+ </xs:sequence>
344
+ </xs:complexType>
345
+ </xs:element>
346
+
347
+
348
+ <!-- -->
349
+ <xs:element name="covarianceMatrix">
350
+ <xs:annotation>
351
+ <xs:documentation xml:lang="en">
352
+ Definition of a covariance matrix element that is used for
353
+ multidimensional uncertainty statements in the D-SI format.
354
+ </xs:documentation>
355
+ <xs:documentation xml:lang="en">
356
+ <![CDATA[
357
+ A covariance matrix has n column elements.
358
+ The dimension of the covariance matrix is the amount of columns.
359
+ Each column contains the covariance values of one column of the
360
+ covaraince matrix.
361
+ The order of the columns is from left to right column in the
362
+ covaliance matrix.
363
+ ]]>
364
+ </xs:documentation>
365
+ </xs:annotation>
366
+ <xs:complexType>
367
+ <xs:sequence>
368
+ <xs:element name="column" minOccurs="1" maxOccurs="unbounded">
369
+ <xs:annotation>
370
+ <xs:documentation xml:lang="en">
371
+ Definition of a column in the covariance matrix.
372
+ </xs:documentation>
373
+ <xs:documentation xml:lang="en">
374
+ <![CDATA[
375
+ The column has n covariance elements, where
376
+ n is the amount of columns in the covariance matrix.
377
+
378
+ The covariance elements are ordered as in the covariance matrix, started
379
+ at the element in the first row of the matrix and going to the
380
+ last row of the matrix.
381
+ ]]>
382
+ </xs:documentation>
383
+ </xs:annotation>
384
+ <xs:complexType>
385
+ <xs:sequence>
386
+ <xs:element name="covariance" minOccurs="1" maxOccurs="unbounded">
387
+ <xs:annotation>
388
+ <xs:documentation xml:lang="en">
389
+ Each covariance component is defined by
390
+ - element value (decimal value type)
391
+ - element unit (string - SI format)
392
+ </xs:documentation>
393
+ </xs:annotation>
394
+ <xs:complexType>
395
+ <xs:sequence>
396
+ <xs:element name="value" type="si:decimalType"/>
397
+ <xs:element name="unit" type="si:unitType"/>
398
+ </xs:sequence>
399
+ </xs:complexType>
400
+ </xs:element>
401
+ </xs:sequence>
402
+ </xs:complexType>
403
+ </xs:element>
404
+ </xs:sequence>
405
+ </xs:complexType>
406
+ </xs:element>
407
+
408
+
409
+
410
+ <xs:element name="ellipsoidalRegion">
411
+ <xs:annotation>
412
+ <xs:documentation xml:lang="en">
413
+ Definition of the structure, that provides a hyper-ellipsoidal coverage
414
+ region for stating the uncertainty of multivariate quantities. It is
415
+ used in the context of uncertainty for complex quantities and
416
+ lists of real or complex quantities.
417
+ </xs:documentation>
418
+ <xs:documentation xml:lang="en">
419
+ <![CDATA[
420
+ The element has the following components [(m)-mandatory, (o)-optional]:
421
+
422
+ (m) - element covarianceMatrix (sub structure covarianceMatrix)
423
+ (m) - element coverageFactor (decimal value >= 1)
424
+ (m) - element coverageProbability (decimal value in [0,1])
425
+ (o) - element distribution (string)
426
+ ]]>
427
+ </xs:documentation>
428
+ </xs:annotation>
429
+ <xs:complexType>
430
+ <xs:sequence>
431
+ <!-- covariance matrix data -->
432
+ <xs:element ref="si:covarianceMatrix"/>
433
+ <!-- coverage properties of region -->
434
+ <xs:element name="coverageFactor" type="si:kValueType"/>
435
+ <xs:element name="coverageProbability" type="si:probabilityValueType"/>
436
+ <!-- optional information about distribution -->
437
+ <xs:element name="distribution" type="xs:string" minOccurs="0"/>
438
+ </xs:sequence>
439
+ </xs:complexType>
440
+ </xs:element>
441
+
442
+
443
+ <!-- Structure under development by NPL and PTB -->
444
+ <xs:element name="rectangularRegion">
445
+ <xs:annotation>
446
+ <xs:documentation xml:lang="en">
447
+ Definition of the structure that provides a hyper-rectangular coverage
448
+ region for stating the uncertainty of multivariate quantities. It is
449
+ used in the context of uncertainty for complex quantities and
450
+ lists of real or complex quantities.
451
+ </xs:documentation>
452
+ <xs:documentation xml:lang="en">
453
+ <![CDATA[
454
+ The element has the following components [(m)-mandatory, (o)-optional]:
455
+
456
+ (m) - element covarianceMatrix (sub structure covarianceMatrix)
457
+ (m) - element coverageFactor (decimal value >= 1)
458
+ (m) - element coverageProbability (decimal value in [0,1])
459
+ (o) - element distribution (string)
460
+ ]]>
461
+ </xs:documentation>
462
+ </xs:annotation>
463
+ <xs:complexType>
464
+ <xs:sequence>
465
+ <!-- covariance matrix data -->
466
+ <xs:element ref="si:covarianceMatrix"/>
467
+ <!-- coverage properties of region -->
468
+ <xs:element name="coverageFactor" type="si:kValueType"/>
469
+ <xs:element name="coverageProbability" type="si:probabilityValueType"/>
470
+ <!-- optional information about distribution -->
471
+ <xs:element name="distribution" type="xs:string" minOccurs="0"/>
472
+ </xs:sequence>
473
+ </xs:complexType>
474
+ </xs:element>
475
+
476
+
477
+
478
+ <xs:element name="list">
479
+ <xs:annotation>
480
+ <xs:documentation xml:lang="en">
481
+ Meta data element definition for a list of basic measurement quantities.
482
+ The list can represent independent measurement or multivariate vector quantities.
483
+ </xs:documentation>
484
+ <xs:documentation xml:lang="en">
485
+ <![CDATA[
486
+ A list can provide the following structures:
487
+
488
+ 1: A list of si:real quantities
489
+ - optional list timestamp, list label and/or list unit
490
+ - optional list univaraite uncertainty statement with list unit
491
+ - optional multivariate hyper-elliptical or hyper-rectangular coverage region
492
+
493
+ 2: A list of si:complex quantities
494
+ - optional list timestamp, list label and/or list unit(s)
495
+ - optional list bivariate uncertainty statement with list unit(s)
496
+ - optional multivariate hyper-elliptical or hyper-rectangular coverage region
497
+
498
+ 3: A recursive list of si:list elements
499
+ - optional global timestamp and/or global label
500
+ ]]>
501
+ </xs:documentation>
502
+ </xs:annotation>
503
+ <xs:complexType>
504
+ <xs:sequence>
505
+ <!-- optional label of the list -->
506
+ <xs:element name="label" type="xs:string" minOccurs="0"/>
507
+ <!-- optional list time stamp -->
508
+ <xs:element name="dateTime" type="xs:dateTime" minOccurs="0"/>
509
+
510
+ <!-- selection between list of lists and list of real or complex -->
511
+ <xs:choice>
512
+
513
+ <!-- list of real or complex -->
514
+ <xs:sequence>
515
+ <!-- optional list unit -->
516
+ <xs:element name="listUnit" type="si:unitType" minOccurs="0"/>
517
+
518
+ <!-- selection of real or complex type -->
519
+ <xs:choice>
520
+
521
+ <!-- list of real elements -->
522
+ <xs:sequence>
523
+ <!-- optional list uncertainty -->
524
+ <xs:element ref="si:listUnivariateUnc" minOccurs="0"/>
525
+ <!-- mandatory list of real elements -->
526
+ <xs:element name="real" maxOccurs="unbounded">
527
+ <xs:annotation>
528
+ <xs:documentation xml:lang="en">
529
+ Meta data element definition for a real measurement quantity in list.
530
+ This implementation differs from the pure real quantity in the way that
531
+ the unit component is optional in order to allow a combination with
532
+ a global unit in the list of real quantities.
533
+ </xs:documentation>
534
+ </xs:annotation>
535
+ <xs:complexType>
536
+ <xs:sequence>
537
+ <!-- optional local label -->
538
+ <xs:element name="label" type="xs:string" minOccurs="0"/>
539
+ <!-- mandatory information -->
540
+ <xs:element name="value" type="si:decimalType"/>
541
+ <!-- if list unit, then do not write this local unit -->
542
+ <xs:element name="unit" type="si:unitType" minOccurs="0"/>
543
+ <!-- optional local time stamp -->
544
+ <xs:element name="dateTime" type="xs:dateTime" minOccurs="0"/>
545
+ <!-- optional choice of local uncertainty statements -->
546
+ <xs:choice minOccurs="0">
547
+ <xs:element ref="si:expandedUnc"/>
548
+ <xs:element ref="si:coverageInterval"/>
549
+ </xs:choice>
550
+ </xs:sequence>
551
+ </xs:complexType>
552
+ </xs:element>
553
+ </xs:sequence>
554
+
555
+
556
+ <!-- list of complex elements -->
557
+ <xs:sequence>
558
+ <xs:element name="listUnitPhase" type="xs:string" minOccurs="0"/>
559
+ <!-- optional list bivariate uncertainty -->
560
+ <xs:element ref="si:listBivariateUnc" minOccurs="0"/>
561
+ <!-- mandatory list of complex elements -->
562
+ <xs:element name="complex" maxOccurs="unbounded">
563
+ <xs:annotation>
564
+ <xs:documentation xml:lang="en">
565
+ Meta data element definition for a complex measurement quantity in list.
566
+ This implementation differs from the pure complex quantity, in the way that
567
+ the unit components are optional in order to allow a combination with
568
+ a global unit in the list of complex quantities.
569
+ </xs:documentation>
570
+ </xs:annotation>
571
+ <xs:complexType>
572
+ <xs:sequence>
573
+ <!-- optional local label -->
574
+ <xs:element name="label" type="xs:string" minOccurs="0"/>
575
+ <!-- choice of Cartesian coordinate form or polar coordinate form -->
576
+ <xs:choice>
577
+ <xs:sequence>
578
+ <!-- mandatory components of Cartesian coordinate form -->
579
+ <xs:element name="valueReal" type="si:decimalType"/>
580
+ <xs:element name="valueImag" type="si:decimalType"/>
581
+ <!-- if list unit, then do not write this local unit -->
582
+ <xs:element name="unit" type="si:unitType" minOccurs="0"/>
583
+ </xs:sequence>
584
+ <xs:sequence>
585
+ <!-- mandatory components of polar coordinate form -->
586
+ <xs:element name="valueMagnitude" type="si:decimalType"/>
587
+ <xs:element name="valuePhase" type="si:decimalType"/>
588
+ <!-- if list unit, then do not write this local unit -->
589
+ <xs:element name="unit" type="si:unitType" minOccurs="0"/>
590
+ <!-- if list unit, then do not write this local unit -->
591
+ <xs:element name="unitPhase" type="si:unitPhaseType" minOccurs="0"/>
592
+ </xs:sequence>
593
+ </xs:choice>
594
+ <!-- optional local time stamp -->
595
+ <xs:element name="dateTime" type="xs:dateTime" minOccurs="0"/>
596
+ <!-- optional choice of local uncertainty statements -->
597
+ <xs:choice minOccurs="0">
598
+ <xs:element ref="si:ellipsoidalRegion"/>
599
+ <xs:element ref="si:rectangularRegion"/>
600
+ </xs:choice>
601
+ </xs:sequence>
602
+ </xs:complexType>
603
+ </xs:element>
604
+ </xs:sequence>
605
+
606
+ </xs:choice>
607
+
608
+ <!-- optional multivariate uncertainty statement -->
609
+ <xs:choice minOccurs="0">
610
+ <xs:element ref="si:ellipsoidalRegion"/>
611
+ <xs:element ref="si:rectangularRegion"/>
612
+ </xs:choice>
613
+ </xs:sequence>
614
+ <!-- end of list of real or complex quantities -->
615
+
616
+
617
+
618
+ <!-- list of lists -->
619
+ <xs:sequence>
620
+ <!-- mandatory list of complex elements -->
621
+ <xs:element ref="si:list" maxOccurs="unbounded"/>
622
+ </xs:sequence>
623
+
624
+ </xs:choice>
625
+ </xs:sequence>
626
+ </xs:complexType>
627
+ </xs:element>
628
+
629
+
630
+ <!-- -->
631
+ <xs:element name="listUnivariateUnc">
632
+ <xs:annotation>
633
+ <xs:documentation xml:lang="en">
634
+ Definition of a structure, for a global univariate uncertainty, that
635
+ is used within the list structure with a list of real quantities.
636
+ The global univariate uncertainty can either be given as an expanded
637
+ measurement uncertainty or as a coverage interval.
638
+ </xs:documentation>
639
+ </xs:annotation>
640
+ <xs:complexType>
641
+ <xs:sequence>
642
+ <xs:choice>
643
+ <xs:element ref="si:expandedUnc"/>
644
+ <xs:element ref="si:coverageInterval"/>
645
+ </xs:choice>
646
+ </xs:sequence>
647
+ </xs:complexType>
648
+ </xs:element>
649
+
650
+
651
+ <!-- -->
652
+ <xs:element name="listBivariateUnc">
653
+ <xs:annotation>
654
+ <xs:documentation xml:lang="en">
655
+ Definition of a structure, for a global bivariate uncertainty, that
656
+ is used within the list structure with a list of complex quantities.
657
+ The global bivariate uncertainty can either be given as a hyper-ellipsoidal
658
+ coverage region or a hyper-rectangular coverage region. Both
659
+ coverage regions must provide a covariance matrix of dimension 2.
660
+ </xs:documentation>
661
+ </xs:annotation>
662
+ <xs:complexType>
663
+ <xs:sequence>
664
+ <xs:choice>
665
+ <xs:element ref="si:ellipsoidalRegion"/>
666
+ <xs:element ref="si:rectangularRegion"/>
667
+ </xs:choice>
668
+ </xs:sequence>
669
+ </xs:complexType>
670
+ </xs:element>
671
+
672
+
673
+
674
+
675
+
676
+
677
+ <!-- -->
678
+ <xs:element name="hybrid">
679
+ <xs:annotation>
680
+ <xs:documentation xml:lang="en">
681
+ The hybrid elements allows to add quantities to the
682
+ machine readable D-SI format, with other units, than those allowed
683
+ to be used with the SI by means of the BIPM SI brochure.
684
+ </xs:documentation>
685
+ <xs:documentation xml:lang="en">
686
+ <![CDATA[
687
+ The hybrid element can contain the following information
688
+
689
+ 1. A set of real quantities
690
+ - all real elementes provide a quantity value for one and the same measured quantity
691
+ - each real element provides this quantity with a different unit
692
+ - at least one real element provides the quantity with a machine readable SI unit
693
+ - the other real quantities can use any SI or non-SI unit
694
+
695
+ 2. A set of complex quantities
696
+ - all complex elementes provide a quantity value for one and the same measured quantity
697
+ - each complex element provides this quantity with a different unit(s)
698
+ - at least one complex element provides the quantity with a machine readable SI unit(s)
699
+ - the other complex quantities can use any SI or non-SI unit
700
+
701
+ 3. A set of list element
702
+ - all list elementes must provide the same quantity informations and hence, must have
703
+ an identical structure.
704
+ - the lists do only differ by using different units for each of the quantities
705
+ - at least one list provides all quantities only with machine readable SI units
706
+ - the other lists can use any oterh units for the quantities
707
+
708
+ 4. A set of constant quantities
709
+ - all constant elementes provide a quantity value for one and the same quantity
710
+ - each constant element provides this quantity with a different unit
711
+ - at least one constant element provides the quantity with a machine readable SI unit
712
+ - the other constant quantities can use any SI or non-SI unit
713
+ ]]>
714
+ </xs:documentation>
715
+ </xs:annotation>
716
+ <xs:complexType>
717
+ <xs:sequence>
718
+ <!-- mandatory adapter for at least one SI quantity and additional (non-) SI quantities -->
719
+ <xs:choice>
720
+ <xs:element ref="si:real" minOccurs="1" maxOccurs="unbounded" />
721
+ <xs:element ref="si:complex" minOccurs="1" maxOccurs="unbounded"/>
722
+ <xs:element ref="si:list" minOccurs="1" maxOccurs="unbounded"/>
723
+ <xs:element ref="si:constant" minOccurs="1" maxOccurs="unbounded"/>
724
+ </xs:choice>
725
+ </xs:sequence>
726
+ </xs:complexType>
727
+ </xs:element>
728
+
729
+
730
+
731
+
732
+
733
+ <!--
734
+ ##############################################################################################
735
+ Second part of the XML-schema: internally used simple data types.
736
+ ##############################################################################################
737
+ -->
738
+
739
+ <xs:simpleType name="unitType">
740
+ <xs:annotation>
741
+ <xs:documentation xml:lang="en">
742
+ BIPM SI brochure unit (9th edition).
743
+ Based on xs:string.
744
+ </xs:documentation>
745
+ </xs:annotation>
746
+ <xs:restriction base="xs:string">
747
+ </xs:restriction>
748
+ </xs:simpleType>
749
+
750
+ <xs:simpleType name="unitPhaseType">
751
+ <xs:annotation>
752
+ <xs:documentation xml:lang="en">
753
+ Unit of angular quantity in SI.
754
+ Based on xs:string.
755
+ </xs:documentation>
756
+ </xs:annotation>
757
+ <xs:restriction base="xs:string">
758
+ </xs:restriction>
759
+ </xs:simpleType>
760
+
761
+ <xs:simpleType name="decimalType">
762
+ <xs:annotation>
763
+ <xs:documentation xml:lang="en">
764
+ Scientific decimal format for numerical values.
765
+ Based on type xs:double.
766
+ </xs:documentation>
767
+ </xs:annotation>
768
+ <xs:restriction base="xs:double">
769
+ <xs:pattern value="[-+]?((\d*\.\d+)|(\d+\.\d*)|(\d+\.?))([Ee][-+]?\d+)?"/>
770
+ </xs:restriction>
771
+ </xs:simpleType>
772
+
773
+ <xs:simpleType name="uncertaintyValueType">
774
+ <xs:annotation>
775
+ <xs:documentation xml:lang="en">
776
+ Scientific decimal format for numerical values of uncertainties
777
+ that must be positive (greater than zero or equal to zero).
778
+ Based on type xs:double.
779
+ </xs:documentation>
780
+ </xs:annotation>
781
+
782
+ <xs:restriction base="xs:double">
783
+ <xs:pattern value="\+?((\d*\.\d+)|(\d+\.\d*)|(\d+\.?))([Ee][-+]?\d+)?"/>
784
+ </xs:restriction>
785
+ </xs:simpleType>
786
+
787
+ <xs:simpleType name="kValueType">
788
+ <xs:annotation>
789
+ <xs:documentation xml:lang="en">
790
+ Scientific decimal format for coverage factor values for uncertainties
791
+ that must be greater than one or equal to one.
792
+ Based on type xs:double.
793
+ </xs:documentation>
794
+ </xs:annotation>
795
+ <xs:restriction base="xs:double">
796
+ <xs:pattern value="\+?(([1-9]\d*\.\d*)|([1-9]\d*))"/>
797
+ </xs:restriction>
798
+ </xs:simpleType>
799
+
800
+ <xs:simpleType name="probabilityValueType">
801
+ <xs:annotation>
802
+ <xs:documentation xml:lang="en">
803
+ Decimal format for coverage probability values for uncertainties.
804
+ The value must be within the interval [0,1]. The scientific exponent
805
+ "e" (or "E") is not allowed.
806
+ Based on type xs:double.
807
+ </xs:documentation>
808
+ </xs:annotation>
809
+ <xs:restriction base="xs:double">
810
+ <xs:pattern value="\+?((0\.\d*[1-9]\d*)|(\.\d*[1-9]\d*)|(1\.0*)|(1))"/>
811
+ </xs:restriction>
812
+ </xs:simpleType>
813
+
814
+ </xs:schema>