genericode 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +27 -1
  3. data/.rubocop_todo.yml +51 -0
  4. data/README.adoc +282 -0
  5. data/exe/genericode +7 -0
  6. data/lib/genericode/agency.rb +25 -5
  7. data/lib/genericode/annotation.rb +10 -4
  8. data/lib/genericode/any_other_content.rb +2 -2
  9. data/lib/genericode/any_other_language_content.rb +3 -3
  10. data/lib/genericode/canonical_uri.rb +32 -0
  11. data/lib/genericode/cli/code_lister.rb +67 -0
  12. data/lib/genericode/cli/code_lookup.rb +22 -0
  13. data/lib/genericode/cli/commands.rb +76 -0
  14. data/lib/genericode/cli/converter.rb +35 -0
  15. data/lib/genericode/cli/validator.rb +21 -0
  16. data/lib/genericode/cli.rb +8 -0
  17. data/lib/genericode/code_list.rb +257 -9
  18. data/lib/genericode/code_list_ref.rb +9 -6
  19. data/lib/genericode/code_list_set.rb +39 -2
  20. data/lib/genericode/code_list_set_ref.rb +9 -6
  21. data/lib/genericode/column.rb +37 -11
  22. data/lib/genericode/column_ref.rb +7 -7
  23. data/lib/genericode/column_set.rb +3 -3
  24. data/lib/genericode/column_set_ref.rb +4 -4
  25. data/lib/genericode/data.rb +5 -5
  26. data/lib/genericode/data_restrictions.rb +3 -3
  27. data/lib/genericode/datatype_facet.rb +10 -7
  28. data/lib/genericode/general_identifier.rb +6 -6
  29. data/lib/genericode/identification.rb +53 -11
  30. data/lib/genericode/json/canonical_uri_mixin.rb +17 -0
  31. data/lib/genericode/json/short_name_mixin.rb +17 -0
  32. data/lib/genericode/key.rb +34 -9
  33. data/lib/genericode/key_column_ref.rb +3 -3
  34. data/lib/genericode/key_ref.rb +6 -6
  35. data/lib/genericode/long_name.rb +17 -7
  36. data/lib/genericode/mime_typed_uri.rb +5 -5
  37. data/lib/genericode/row.rb +2 -2
  38. data/lib/genericode/short_name.rb +10 -5
  39. data/lib/genericode/simple_code_list.rb +2 -2
  40. data/lib/genericode/simple_value.rb +3 -3
  41. data/lib/genericode/utils.rb +50 -0
  42. data/lib/genericode/value.rb +5 -4
  43. data/lib/genericode/version.rb +1 -1
  44. data/lib/genericode.rb +12 -0
  45. data/oasis-reqs-implemented.md +31 -0
  46. data/oasis-requirements-1.0.md +56 -0
  47. metadata +70 -12
@@ -0,0 +1,56 @@
1
+ | Element Rule Applies To | Rule Identifier | Rule Content |
2
+ |--------------------------|-----------------|--------------|
3
+ | complexType CodeListDocument | Rule 1 [document] | A code list must have at least one key, unless it is a metadata-only definition without a 'SimpleCodeList' element. |
4
+ | attribute xml:base in complexType CodeListDocument | Rule 2 [application] | xml:base does not apply to canonical URIs. |
5
+ | complexType CodeListRef | Rule 3 [application] | The code list reference must be valid. An application may use the CanonicalVersionUri to select a local copy of the code list. If there is no CanonicalVersionUri, the CanonicalUri may be used to select a local copy of the code list. Otherwise the LocationUri value(s) may be tried in order, until a valid code list document is retrieved. An application must signal an error to the user if it is not able to retrieve a code list document to match the code list reference. |
6
+ | element CanonicalUri in complexType CodeListRef | Rule 4 [document] | Must be an absolute URI, must not be relative. |
7
+ | element CanonicalUri in complexType CodeListRef | Rule 5 [application] | Must not be used as a de facto location URI. |
8
+ | element CanonicalVersionUri in complexType CodeListRef | Rule 6 [document] | Must be an absolute URI, must not be relative. |
9
+ | element CanonicalVersionUri in complexType CodeListRef | Rule 7 [application] | Must not be used as a de facto location URI. |
10
+ | element LocationUri in complexType CodeListRef | Rule 8 [application] | If the CanonicalVersionUri has been defined, the LocationUri must reference a genericode CodeList document. If the CanonicalVersionUri is undefined, the LocationUri must reference a genericode CodeList Metadata document. An application must signal an error to the user if a LocationUri does not reference the appropriate type of genericode document. |
11
+ | element LocationUri in complexType CodeListRef | Rule 9 [application] | An application must signal an error to the user if a document retrieved using a LocationUri is not in genericode format. |
12
+ | attribute xml:base in complexType CodeListRef | Rule 10 [application] | xml:base does not apply to canonical URIs. |
13
+ | attribute xml:base in complexType CodeListSetDocument | Rule 11 [application] | xml:base does not apply to canonical URIs. |
14
+ | complexType ColumnRef | Rule 12 [application] | The column reference must be valid. An application may use the CanonicalVersionUri to select a local copy of the code list or column set which contains the column definition. Otherwise the LocationUri value(s) may be tried in order, until a valid code list or column set document (containing the necessary column definition) is retrieved. An application must signal an error to the user if it is not able to retrieve a code list or column set document which contains the necessary column definition. |
15
+ | attribute Use in complexType ColumnRef | Rule 13 [application] | If specified, this overrides the usage specified in the external column set or code list document. |
16
+ | attribute xml:base in complexType ColumnRef | Rule 14 [application] | xml:base does not apply to canonical URIs. |
17
+ | attribute xml:base in complexType ColumnSet | Rule 15 [application] | xml:base does not apply to canonical URIs. |
18
+ | attribute xml:base in complexType ColumnSetDocument | Rule 16 [application] | xml:base does not apply to canonical URIs. |
19
+ | complexType ColumnSetRef | Rule 17 [application] | The column set reference must be valid. An application may use the CanonicalVersionUri to select a local copy of the column set or code list. Otherwise the LocationUri value(s) may be tried in order, until a valid column set or code list document is retrieved. An application must signal an error to the user if it is not able to retrieve a column set or code list document to match the column set reference. |
20
+ | attribute xml:base in complexType ColumnSetRef | Rule 18 [application] | xml:base does not apply to canonical URIs. |
21
+ | attribute Type in complexType Data | Rule 19 [document] | The datatype ID must not include a namespace prefix. For the W3C XML Schema datatypes, possible datatype IDs are 'string', 'token', 'boolean', 'decimal', etc. |
22
+ | attribute Type in complexType Data | Rule 20 [document] | If the data is complex (i.e. XML), this value is set to the root element name for the XML value, or '*' if the root element name is not restricted. |
23
+ | attribute DatatypeLibrary in complexType Data | Rule 21 [application] | If this URI not explicitly provided, the datatype library for the enclosing column set is used. |
24
+ | attribute DatatypeLibrary in complexType Data | Rule 22 [document] | If the data is complex (i.e. XML), this value is set to the namespace URI for the XML, or '*' if the namespace URI is not restricted. |
25
+ | complexType DataRestrictions | Rule 23 [document] | The 'gc:lang' attribute may be specified only if no language is already set for the data type that is being restricted. |
26
+ | attribute ExternalRef in attributeGroup ExternalReference | Rule 24 [document] | The external reference must not be prefixed with a '#' symbol. |
27
+ | element CanonicalUri in complexType Identification | Rule 25 [document] | Must be an absolute URI, must not be relative. |
28
+ | element CanonicalUri in complexType Identification | Rule 26 [application] | Must not be used as a de facto location URI. |
29
+ | element CanonicalVersionUri in modelGroup IdentificationRefUriSet | Rule 27 [document] | Must be an absolute URI, must not be relative. |
30
+ | element CanonicalVersionUri in modelGroup IdentificationRefUriSet | Rule 28 [application] | Must not be used as a de facto location URI. |
31
+ | element LocationUri in modelGroup IdentificationRefUriSet | Rule 29 [application] | An application must signal an error to the user if a document retrieved using a LocationUri is not in genericode format. |
32
+ | element CanonicalUri in modelGroup IdentificationVersionUriSet | Rule 30 [document] | Must be an absolute URI, must not be relative. |
33
+ | element CanonicalUri in modelGroup IdentificationVersionUriSet | Rule 31 [application] | Must not be used as a de facto location URI. |
34
+ | element CanonicalVersionUri in modelGroup IdentificationVersionUriSet | Rule 32 [document] | Must be an absolute URI, must not be relative. |
35
+ | element CanonicalVersionUri in modelGroup IdentificationVersionUriSet | Rule 33 [application] | Must not be used as a de facto location URI. |
36
+ | complexType Key | Rule 34 [document] | Only required columns can be used for keys. |
37
+ | complexType KeyRef | Rule 35 [application] | The key reference must be valid. An application may use the CanonicalVersionUri to select a local copy of the code list or column set which contains the key definition. Otherwise the LocationUri value(s) may be tried in order, until a valid code list or column set document (containing the necessary key definition) is retrieved. An application must signal an error to the user if it is not able to retrieve a code list or column set document which contains the necessary key definition. |
38
+ | attribute xml:base in complexType KeyRef | Rule 36 [application] | xml:base does not apply to canonical URIs. |
39
+ | element Value in complexType Row | Rule 37 [document] | A value must be provided for each required column. A value does not need to be provided for a column if the column is optional. |
40
+ | element Value in complexType Row | Rule 38 [document] | If a value does not have an explicit column reference, the column is taken to be the column following the column of the preceding value in the row, or the first column if the value is the first value of the row. |
41
+ | complexType ShortName | Rule 39 [document] | Must not contain whitespace characters. |
42
+ | complexType SimpleCodeList | Rule 40 [application] | Applications must not have any dependency on the ordering of the rows. |
43
+ | element SimpleValue in modelGroup ValueChoice | Rule 41 [document] | The value must be valid with respect to the datatype and restrictions of the matching column. |
44
+ | element ComplexValue in modelGroup ValueChoice | Rule 42 [document] | The names of all direct child elements of the 'ComplexValue' element must match the datatype ID for the matching column, unless that ID is set to '*'. |
45
+ | element ComplexValue in modelGroup ValueChoice | Rule 43 [document] | The namespace URIs of all direct child elements of the 'ComplexValue' element must match the datatype library URI for the matching column, unless that URI is set to '*'. |
46
+ | element CanonicalVersionUri in modelGroup VersionLocationUriSet | Rule 44 [document] | Must be an absolute URI, must not be relative. |
47
+ | element CanonicalVersionUri in modelGroup VersionLocationUriSet | Rule 45 [application] | Must not be used as a de facto location URI. |
48
+ | element LocationUri in modelGroup VersionLocationUriSet | Rule 46 [application] | An application must signal an error to the user if a document retrieved using a LocationUri is not in genericode format. |
49
+ | complexType CodeListSetRef | Rule 47 [application] | The code list set reference must be valid. An application may use the CanonicalVersionUri to select a local copy of the code list set. If there is no CanonicalVersionUri, the CanonicalUri may be used to select a local copy of the code list set. Otherwise the LocationUri value(s) may be tried in order, until a valid code list set document is retrieved. An application must signal an error to the user if it is not able to retrieve a code list set document to match the code list set reference. |
50
+ | element CanonicalUri in complexType CodeListSetRef | Rule 48 [document] | Must be an absolute URI, must not be relative. |
51
+ | element CanonicalUri in complexType CodeListSetRef | Rule 49 [application] | Must not be used as a de facto location URI. |
52
+ | element CanonicalVersionUri in complexType CodeListSetRef | Rule 50 [document] | Must be an absolute URI, must not be relative. |
53
+ | element CanonicalVersionUri in complexType CodeListSetRef | Rule 51 [application] | Must not be used as a de facto location URI. |
54
+ | element LocationUri in complexType CodeListSetRef | Rule 52 [application] | If the CanonicalVersionUri has been defined, the LocationUri must reference a genericode CodeListSet document. If the CanonicalVersionUri is undefined, the LocationUri must reference a genericode CodeListSet Metadata document. An application must signal an error to the user if a LocationUri does not reference the appropriate type of genericode document. |
55
+ | element LocationUri in complexType CodeListSetRef | Rule 53 [application] | An application must signal an error to the user if a document retrieved using a LocationUri is not in genericode format. |
56
+ | attribute xml:base in complexType CodeListSetRef | Rule 54 [application] | xml:base does not apply to canonical URIs. |
metadata CHANGED
@@ -1,29 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genericode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-17 00:00:00.000000000 Z
11
+ date: 2025-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: shale
14
+ name: csv
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: lutaml-model
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
18
32
  - !ruby/object:Gem::Version
19
- version: '1.0'
33
+ version: '0'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - "~>"
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: tabulo
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
25
46
  - !ruby/object:Gem::Version
26
- version: '1.0'
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: thor
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
27
69
  - !ruby/object:Gem::Dependency
28
70
  name: nokogiri
29
71
  requirement: !ruby/object:Gem::Requirement
@@ -111,19 +153,30 @@ dependencies:
111
153
  description: Parser and generator for OASIS Genericode
112
154
  email:
113
155
  - open.source@ribose.com'
114
- executables: []
156
+ executables:
157
+ - genericode
115
158
  extensions: []
116
159
  extra_rdoc_files: []
117
160
  files:
118
161
  - ".rspec"
119
162
  - ".rubocop.yml"
163
+ - ".rubocop_todo.yml"
120
164
  - CODE_OF_CONDUCT.md
165
+ - README.adoc
121
166
  - Rakefile
167
+ - exe/genericode
122
168
  - lib/genericode.rb
123
169
  - lib/genericode/agency.rb
124
170
  - lib/genericode/annotation.rb
125
171
  - lib/genericode/any_other_content.rb
126
172
  - lib/genericode/any_other_language_content.rb
173
+ - lib/genericode/canonical_uri.rb
174
+ - lib/genericode/cli.rb
175
+ - lib/genericode/cli/code_lister.rb
176
+ - lib/genericode/cli/code_lookup.rb
177
+ - lib/genericode/cli/commands.rb
178
+ - lib/genericode/cli/converter.rb
179
+ - lib/genericode/cli/validator.rb
127
180
  - lib/genericode/code_list.rb
128
181
  - lib/genericode/code_list_ref.rb
129
182
  - lib/genericode/code_list_set.rb
@@ -137,6 +190,8 @@ files:
137
190
  - lib/genericode/datatype_facet.rb
138
191
  - lib/genericode/general_identifier.rb
139
192
  - lib/genericode/identification.rb
193
+ - lib/genericode/json/canonical_uri_mixin.rb
194
+ - lib/genericode/json/short_name_mixin.rb
140
195
  - lib/genericode/key.rb
141
196
  - lib/genericode/key_column_ref.rb
142
197
  - lib/genericode/key_ref.rb
@@ -146,8 +201,11 @@ files:
146
201
  - lib/genericode/short_name.rb
147
202
  - lib/genericode/simple_code_list.rb
148
203
  - lib/genericode/simple_value.rb
204
+ - lib/genericode/utils.rb
149
205
  - lib/genericode/value.rb
150
206
  - lib/genericode/version.rb
207
+ - oasis-reqs-implemented.md
208
+ - oasis-requirements-1.0.md
151
209
  - sig/genericode.rbs
152
210
  homepage: https://github.com/lutaml/genericode
153
211
  licenses: []
@@ -155,7 +213,7 @@ metadata:
155
213
  homepage_uri: https://github.com/lutaml/genericode
156
214
  source_code_uri: https://github.com/lutaml/genericode
157
215
  changelog_uri: https://github.com/lutaml/genericode/releases
158
- post_install_message:
216
+ post_install_message:
159
217
  rdoc_options: []
160
218
  require_paths:
161
219
  - lib
@@ -170,8 +228,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
228
  - !ruby/object:Gem::Version
171
229
  version: '0'
172
230
  requirements: []
173
- rubygems_version: 3.5.11
174
- signing_key:
231
+ rubygems_version: 3.3.27
232
+ signing_key:
175
233
  specification_version: 4
176
234
  summary: Parser and generator for OASIS Genericode
177
235
  test_files: []