genericode 0.1.0 → 0.1.2

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 +66 -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 +28 -54
@@ -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,65 +1,23 @@
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-17 00:00:00.000000000 Z
11
+ date: 2025-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: shale
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.0'
27
- - !ruby/object:Gem::Dependency
28
- name: nokogiri
14
+ name: csv
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - ">="
32
18
  - !ruby/object:Gem::Version
33
19
  version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
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: rspec
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
20
+ type: :runtime
63
21
  prerelease: false
64
22
  version_requirements: !ruby/object:Gem::Requirement
65
23
  requirements:
@@ -67,13 +25,13 @@ dependencies:
67
25
  - !ruby/object:Gem::Version
68
26
  version: '0'
69
27
  - !ruby/object:Gem::Dependency
70
- name: rubocop
28
+ name: lutaml-model
71
29
  requirement: !ruby/object:Gem::Requirement
72
30
  requirements:
73
31
  - - ">="
74
32
  - !ruby/object:Gem::Version
75
33
  version: '0'
76
- type: :development
34
+ type: :runtime
77
35
  prerelease: false
78
36
  version_requirements: !ruby/object:Gem::Requirement
79
37
  requirements:
@@ -81,13 +39,13 @@ dependencies:
81
39
  - !ruby/object:Gem::Version
82
40
  version: '0'
83
41
  - !ruby/object:Gem::Dependency
84
- name: rubocop-performance
42
+ name: tabulo
85
43
  requirement: !ruby/object:Gem::Requirement
86
44
  requirements:
87
45
  - - ">="
88
46
  - !ruby/object:Gem::Version
89
47
  version: '0'
90
- type: :development
48
+ type: :runtime
91
49
  prerelease: false
92
50
  version_requirements: !ruby/object:Gem::Requirement
93
51
  requirements:
@@ -95,13 +53,13 @@ dependencies:
95
53
  - !ruby/object:Gem::Version
96
54
  version: '0'
97
55
  - !ruby/object:Gem::Dependency
98
- name: xml-c14n
56
+ name: thor
99
57
  requirement: !ruby/object:Gem::Requirement
100
58
  requirements:
101
59
  - - ">="
102
60
  - !ruby/object:Gem::Version
103
61
  version: '0'
104
- type: :development
62
+ type: :runtime
105
63
  prerelease: false
106
64
  version_requirements: !ruby/object:Gem::Requirement
107
65
  requirements:
@@ -111,19 +69,30 @@ dependencies:
111
69
  description: Parser and generator for OASIS Genericode
112
70
  email:
113
71
  - open.source@ribose.com'
114
- executables: []
72
+ executables:
73
+ - genericode
115
74
  extensions: []
116
75
  extra_rdoc_files: []
117
76
  files:
118
77
  - ".rspec"
119
78
  - ".rubocop.yml"
79
+ - ".rubocop_todo.yml"
120
80
  - CODE_OF_CONDUCT.md
81
+ - README.adoc
121
82
  - Rakefile
83
+ - exe/genericode
122
84
  - lib/genericode.rb
123
85
  - lib/genericode/agency.rb
124
86
  - lib/genericode/annotation.rb
125
87
  - lib/genericode/any_other_content.rb
126
88
  - lib/genericode/any_other_language_content.rb
89
+ - lib/genericode/canonical_uri.rb
90
+ - lib/genericode/cli.rb
91
+ - lib/genericode/cli/code_lister.rb
92
+ - lib/genericode/cli/code_lookup.rb
93
+ - lib/genericode/cli/commands.rb
94
+ - lib/genericode/cli/converter.rb
95
+ - lib/genericode/cli/validator.rb
127
96
  - lib/genericode/code_list.rb
128
97
  - lib/genericode/code_list_ref.rb
129
98
  - lib/genericode/code_list_set.rb
@@ -137,6 +106,8 @@ files:
137
106
  - lib/genericode/datatype_facet.rb
138
107
  - lib/genericode/general_identifier.rb
139
108
  - lib/genericode/identification.rb
109
+ - lib/genericode/json/canonical_uri_mixin.rb
110
+ - lib/genericode/json/short_name_mixin.rb
140
111
  - lib/genericode/key.rb
141
112
  - lib/genericode/key_column_ref.rb
142
113
  - lib/genericode/key_ref.rb
@@ -146,8 +117,11 @@ files:
146
117
  - lib/genericode/short_name.rb
147
118
  - lib/genericode/simple_code_list.rb
148
119
  - lib/genericode/simple_value.rb
120
+ - lib/genericode/utils.rb
149
121
  - lib/genericode/value.rb
150
122
  - lib/genericode/version.rb
123
+ - oasis-reqs-implemented.md
124
+ - oasis-requirements-1.0.md
151
125
  - sig/genericode.rbs
152
126
  homepage: https://github.com/lutaml/genericode
153
127
  licenses: []
@@ -170,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
144
  - !ruby/object:Gem::Version
171
145
  version: '0'
172
146
  requirements: []
173
- rubygems_version: 3.5.11
147
+ rubygems_version: 3.3.27
174
148
  signing_key:
175
149
  specification_version: 4
176
150
  summary: Parser and generator for OASIS Genericode