genericode 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 36468da54f60d5e0013f2e4e16941051f0b09288d48f6560ceafa3f7b1599af1
4
+ data.tar.gz: fceaa075b3b6b994659952046e4ebc92eeada80e67d8a2dcce548460223c8912
5
+ SHA512:
6
+ metadata.gz: aefac994fc63be20cb0c436b5411efb25585bb6013885b0cbc7641f6f79a11c36c93eaf5acd34debd11dc8b42b4f59970e28a1e63ec014196e8927d777996651
7
+ data.tar.gz: 6eb782a0098930abbc8ed164b9a9218506783416ad69deeddfb47a97b6279600784d85f50d7e6ebcc78dfff680469f5f94d915de8a6c10d5646d00974202884a
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.0
3
+
4
+ Style/StringLiterals:
5
+ EnforcedStyle: double_quotes
6
+
7
+ Style/StringLiteralsInInterpolation:
8
+ EnforcedStyle: double_quotes
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "general_identifier"
6
+ require_relative "long_name"
7
+ require_relative "short_name"
8
+
9
+ module Genericode
10
+ class Agency < Shale::Mapper
11
+ attribute :short_name, ShortName
12
+ attribute :long_name, LongName, collection: true
13
+ attribute :identifier, GeneralIdentifier, collection: true
14
+
15
+ json do
16
+ map "ShortName", to: :short_name
17
+ map "LongName", to: :long_name
18
+ map "Identifier", to: :identifier
19
+ end
20
+
21
+ xml do
22
+ root "Agency"
23
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
24
+
25
+ map_element "ShortName", to: :short_name, prefix: nil, namespace: nil
26
+ map_element "LongName", to: :long_name, prefix: nil, namespace: nil
27
+ map_element "Identifier", to: :identifier, prefix: nil, namespace: nil
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "any_other_content"
6
+ require_relative "any_other_language_content"
7
+
8
+ module Genericode
9
+ class Annotation < Shale::Mapper
10
+ attribute :description, AnyOtherLanguageContent, collection: true
11
+ attribute :app_info, AnyOtherContent
12
+
13
+ json do
14
+ map "Description", to: :description
15
+ map "AppInfo", to: :app_info
16
+ end
17
+
18
+ xml do
19
+ root "Annotation"
20
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
21
+
22
+ map_element "Description", to: :description, prefix: nil, namespace: nil
23
+ map_element "AppInfo", to: :app_info, prefix: nil, namespace: nil
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Genericode
6
+ class AnyOtherContent < Shale::Mapper
7
+ xml do
8
+ root "AnyOtherContent"
9
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Genericode
6
+ class AnyOtherLanguageContent < Shale::Mapper
7
+ attribute :lang, Shale::Type::String
8
+
9
+ json do
10
+ map "lang", to: :lang
11
+ end
12
+
13
+ xml do
14
+ root "AnyOtherLanguageContent"
15
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
16
+
17
+ map_attribute "lang", to: :lang, prefix: "xml", namespace: "http://www.w3.org/XML/1998/namespace"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+ require_relative "column_set"
7
+ require_relative "column_set_ref"
8
+ require_relative "identification"
9
+ require_relative "simple_code_list"
10
+
11
+ module Genericode
12
+ class CodeList < Shale::Mapper
13
+ attribute :annotation, Annotation
14
+ attribute :identification, Identification
15
+ attribute :column_set, ColumnSet
16
+ attribute :column_set_ref, ColumnSetRef
17
+ attribute :simple_code_list, SimpleCodeList
18
+ attribute :schema_location, Shale::Type::String
19
+
20
+ json do
21
+ map "Annotation", to: :annotation
22
+ map "Identification", to: :identification
23
+ map "ColumnSet", to: :column_set
24
+ map "ColumnSetRef", to: :column_set_ref
25
+ map "SimpleCodeList", to: :simple_code_list
26
+ end
27
+
28
+ xml do
29
+ root "CodeList"
30
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
31
+
32
+ map_attribute "schemaLocation", to: :schema_location,
33
+ namespace: "http://www.w3.org/2001/XMLSchema-instance",
34
+ prefix: "xsi"
35
+
36
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
37
+ map_element "Identification", to: :identification, prefix: nil, namespace: nil
38
+ map_element "ColumnSet", to: :column_set, prefix: nil, namespace: nil
39
+ map_element "ColumnSetRef", to: :column_set_ref, prefix: nil, namespace: nil
40
+ map_element "SimpleCodeList", to: :simple_code_list, prefix: nil, namespace: nil
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+
7
+ module Genericode
8
+ class CodeListRef < Shale::Mapper
9
+ attribute :annotation, Annotation
10
+ attribute :canonical_uri, Shale::Type::String
11
+ attribute :canonical_version_uri, Shale::Type::String
12
+ attribute :location_uri, Shale::Type::String, collection: true
13
+
14
+ json do
15
+ map "Annotation", to: :annotation
16
+ map "CanonicalUri", to: :canonical_uri
17
+ map "CanonicalVersionUri", to: :canonical_version_uri
18
+ map "LocationUri", to: :location_uri
19
+ end
20
+
21
+ xml do
22
+ root "CodeListRef"
23
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
24
+
25
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
26
+ map_element "CanonicalUri", to: :canonical_uri, prefix: nil, namespace: nil
27
+ map_element "CanonicalVersionUri", to: :canonical_version_uri, prefix: nil, namespace: nil
28
+ map_element "LocationUri", to: :location_uri, prefix: nil, namespace: nil
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+ require_relative "code_list_ref"
7
+ require_relative "code_list_set_ref"
8
+ require_relative "identification"
9
+
10
+ module Genericode
11
+ class CodeListSet < Shale::Mapper
12
+ attribute :annotation, Annotation
13
+ attribute :identification, Identification
14
+ attribute :code_list_ref, CodeListRef, collection: true
15
+ attribute :code_list_set, CodeListSetDocument, collection: true
16
+ attribute :code_list_set_ref, CodeListSetRef, collection: true
17
+
18
+ json do
19
+ map "Annotation", to: :annotation
20
+ map "Identification", to: :identification
21
+ map "CodeListRef", to: :code_list_ref
22
+ map "CodeListSet", to: :code_list_set
23
+ map "CodeListSetRef", to: :code_list_set_ref
24
+ end
25
+
26
+ xml do
27
+ root "CodeListSet"
28
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
29
+
30
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
31
+ map_element "Identification", to: :identification, prefix: nil, namespace: nil
32
+ map_element "CodeListRef", to: :code_list_ref, prefix: nil, namespace: nil
33
+ map_element "CodeListSet", to: :code_list_set, prefix: nil, namespace: nil
34
+ map_element "CodeListSetRef", to: :code_list_set_ref, prefix: nil, namespace: nil
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+
7
+ module Genericode
8
+ class CodeListSetRef < Shale::Mapper
9
+ attribute :annotation, Annotation
10
+ attribute :canonical_uri, Shale::Type::String
11
+ attribute :canonical_version_uri, Shale::Type::String
12
+ attribute :location_uri, Shale::Type::String, collection: true
13
+
14
+ json do
15
+ map "Annotation", to: :annotation
16
+ map "CanonicalUri", to: :canonical_uri
17
+ map "CanonicalVersionUri", to: :canonical_version_uri
18
+ map "LocationUri", to: :location_uri
19
+ end
20
+
21
+ xml do
22
+ root "CodeListSetRef"
23
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
24
+
25
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
26
+ map_element "CanonicalUri", to: :canonical_uri, prefix: nil, namespace: nil
27
+ map_element "CanonicalVersionUri", to: :canonical_version_uri, prefix: nil, namespace: nil
28
+ map_element "LocationUri", to: :location_uri, prefix: nil, namespace: nil
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+ require_relative "data"
7
+ require_relative "long_name"
8
+ require_relative "short_name"
9
+
10
+ module Genericode
11
+ class Column < Shale::Mapper
12
+ attribute :id, Shale::Type::String
13
+ attribute :use, Shale::Type::String
14
+ attribute :annotation, Annotation
15
+ attribute :short_name, ShortName
16
+ attribute :long_name, LongName, collection: true
17
+ attribute :canonical_uri, Shale::Type::String
18
+ attribute :canonical_version_uri, Shale::Type::String
19
+ attribute :data, Data
20
+
21
+ json do
22
+ map "Id", to: :id
23
+ map "Use", to: :use
24
+ map "Annotation", to: :annotation
25
+ map "ShortName", to: :short_name
26
+ map "LongName", to: :long_name
27
+ map "CanonicalUri", to: :canonical_uri
28
+ map "CanonicalVersionUri", to: :canonical_version_uri
29
+ map "Data", to: :data
30
+ end
31
+
32
+ xml do
33
+ root "Column"
34
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
35
+
36
+ map_attribute "Id", to: :id
37
+ map_attribute "Use", to: :use
38
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
39
+ map_element "ShortName", to: :short_name, prefix: nil, namespace: nil
40
+ map_element "LongName", to: :long_name, prefix: nil, namespace: nil
41
+ map_element "CanonicalUri", to: :canonical_uri, prefix: nil, namespace: nil
42
+ map_element "CanonicalVersionUri", to: :canonical_version_uri, prefix: nil, namespace: nil
43
+ map_element "Data", to: :data, prefix: nil, namespace: nil
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+ require_relative "data_restrictions"
7
+
8
+ module Genericode
9
+ class ColumnRef < Shale::Mapper
10
+ attribute :id, Shale::Type::String
11
+ attribute :external_ref, Shale::Type::String
12
+ attribute :use, Shale::Type::String
13
+ attribute :annotation, Annotation
14
+ attribute :canonical_version_uri, Shale::Type::String
15
+ attribute :location_uri, Shale::Type::String, collection: true
16
+ attribute :data, DataRestrictions
17
+
18
+ json do
19
+ map "Id", to: :id
20
+ map "ExternalRef", to: :external_ref
21
+ map "Use", to: :use
22
+ map "Annotation", to: :annotation
23
+ map "CanonicalVersionUri", to: :canonical_version_uri
24
+ map "LocationUri", to: :location_uri
25
+ map "Data", to: :data
26
+ end
27
+
28
+ xml do
29
+ root "ColumnRef"
30
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
31
+
32
+ map_attribute "Id", to: :id
33
+ map_attribute "ExternalRef", to: :external_ref
34
+ map_attribute "Use", to: :use
35
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
36
+ map_element "CanonicalVersionUri", to: :canonical_version_uri, prefix: nil, namespace: nil
37
+ map_element "LocationUri", to: :location_uri, prefix: nil, namespace: nil
38
+ map_element "Data", to: :data, prefix: nil, namespace: nil
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+ require_relative "column"
7
+ require_relative "column_ref"
8
+ require_relative "identification"
9
+ require_relative "key"
10
+ require_relative "key_ref"
11
+
12
+ module Genericode
13
+ class ColumnSet < Shale::Mapper
14
+ attribute :datatype_library, Shale::Type::String
15
+ attribute :annotation, Annotation
16
+ attribute :identification, Identification
17
+ attribute :column, Column, collection: true
18
+ attribute :column_ref, ColumnRef, collection: true
19
+ attribute :key, Key, collection: true
20
+ attribute :key_ref, KeyRef, collection: true
21
+
22
+ json do
23
+ map "DatatypeLibrary", to: :datatype_library
24
+ map "Annotation", to: :annotation
25
+ map "Identification", to: :identification
26
+ map "Column", to: :column
27
+ map "ColumnRef", to: :column_ref
28
+ map "Key", to: :key
29
+ map "KeyRef", to: :key_ref
30
+ end
31
+
32
+ xml do
33
+ root "ColumnSet"
34
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
35
+
36
+ map_attribute "DatatypeLibrary", to: :datatype_library
37
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
38
+ map_element "Identification", to: :identification, prefix: nil, namespace: nil
39
+ map_element "Column", to: :column, prefix: nil, namespace: nil
40
+ map_element "ColumnRef", to: :column_ref, prefix: nil, namespace: nil
41
+ map_element "Key", to: :key, prefix: nil, namespace: nil
42
+ map_element "KeyRef", to: :key_ref, prefix: nil, namespace: nil
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+
7
+ module Genericode
8
+ class ColumnSetRef < Shale::Mapper
9
+ attribute :annotation, Annotation
10
+ attribute :canonical_version_uri, Shale::Type::String
11
+ attribute :location_uri, Shale::Type::String, collection: true
12
+
13
+ json do
14
+ map "Annotation", to: :annotation
15
+ map "CanonicalVersionUri", to: :canonical_version_uri
16
+ map "LocationUri", to: :location_uri
17
+ end
18
+
19
+ xml do
20
+ root "ColumnSetRef"
21
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
22
+
23
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
24
+ map_element "CanonicalVersionUri", to: :canonical_version_uri, prefix: nil, namespace: nil
25
+ map_element "LocationUri", to: :location_uri, prefix: nil, namespace: nil
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+ require_relative "datatype_facet"
7
+
8
+ module Genericode
9
+ class Data < Shale::Mapper
10
+ attribute :type, Shale::Type::String
11
+ attribute :datatype_library, Shale::Type::String
12
+ attribute :lang, Shale::Type::String
13
+ attribute :annotation, Annotation
14
+ attribute :parameter, DatatypeFacet, collection: true
15
+
16
+ json do
17
+ map "Type", to: :type
18
+ map "DatatypeLibrary", to: :datatype_library
19
+ map "Lang", to: :lang
20
+ map "Annotation", to: :annotation
21
+ map "Parameter", to: :parameter
22
+ end
23
+
24
+ xml do
25
+ root "Data"
26
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
27
+
28
+ map_attribute "Type", to: :type
29
+ map_attribute "DatatypeLibrary", to: :datatype_library
30
+ map_attribute "Lang", to: :lang
31
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
32
+ map_element "Parameter", to: :parameter, prefix: nil, namespace: nil
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "datatype_facet"
6
+
7
+ module Genericode
8
+ class DataRestrictions < Shale::Mapper
9
+ attribute :lang, Shale::Type::String
10
+ attribute :parameter, DatatypeFacet, collection: true
11
+
12
+ json do
13
+ map "Lang", to: :lang
14
+ map "Parameter", to: :parameter
15
+ end
16
+
17
+ xml do
18
+ root "DataRestrictions"
19
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
20
+
21
+ map_attribute "Lang", to: :lang
22
+ map_element "Parameter", to: :parameter, prefix: nil, namespace: nil
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Genericode
6
+ class DatatypeFacet < Shale::Mapper
7
+ attribute :content, Shale::Type::String
8
+ attribute :short_name, Shale::Type::String
9
+ attribute :long_name, Shale::Type::String
10
+
11
+ json do
12
+ map "_", to: :content
13
+ map "ShortName", to: :short_name
14
+ map "LongName", to: :long_name
15
+ end
16
+
17
+ xml do
18
+ root "DatatypeFacet"
19
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
20
+
21
+ map_content to: :content
22
+ map_attribute "ShortName", to: :short_name
23
+ map_attribute "LongName", to: :long_name
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Genericode
6
+ class GeneralIdentifier < Shale::Mapper
7
+ attribute :content, Shale::Type::String
8
+ attribute :identifier, Shale::Type::String
9
+ attribute :lang, Shale::Type::String
10
+
11
+ json do
12
+ map "_", to: :content
13
+ map "Identifier", to: :identifier
14
+ map "lang", to: :lang
15
+ end
16
+
17
+ xml do
18
+ root "GeneralIdentifier"
19
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
20
+
21
+ map_content to: :content
22
+ map_attribute "Identifier", to: :identifier
23
+ map_attribute "lang", to: :lang, prefix: "xml", namespace: "http://www.w3.org/XML/1998/namespace"
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "agency"
6
+ require_relative "long_name"
7
+ require_relative "mime_typed_uri"
8
+ require_relative "short_name"
9
+
10
+ module Genericode
11
+ class Identification < Shale::Mapper
12
+ attribute :short_name, ShortName
13
+ attribute :long_name, LongName, collection: true
14
+ attribute :version, Shale::Type::String
15
+ attribute :canonical_uri, Shale::Type::String
16
+ attribute :canonical_version_uri, Shale::Type::String
17
+ attribute :location_uri, Shale::Type::String, collection: true
18
+ attribute :alternate_format_location_uri, MimeTypedUri, collection: true
19
+ attribute :agency, Agency
20
+
21
+ json do
22
+ map "ShortName", to: :short_name
23
+ map "LongName", to: :long_name
24
+ map "Version", to: :version
25
+ map "CanonicalUri", to: :canonical_uri
26
+ map "CanonicalVersionUri", to: :canonical_version_uri
27
+ map "LocationUri", to: :location_uri
28
+ map "AlternateFormatLocationUri", to: :alternate_format_location_uri
29
+ map "Agency", to: :agency
30
+ end
31
+
32
+ xml do
33
+ root "Identification"
34
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
35
+
36
+ map_element "ShortName", to: :short_name, prefix: nil, namespace: nil
37
+ map_element "LongName", to: :long_name, prefix: nil, namespace: nil
38
+ map_element "Version", to: :version, prefix: nil, namespace: nil
39
+ map_element "CanonicalUri", to: :canonical_uri, prefix: nil, namespace: nil
40
+ map_element "CanonicalVersionUri", to: :canonical_version_uri, prefix: nil, namespace: nil
41
+ map_element "LocationUri", to: :location_uri, prefix: nil, namespace: nil
42
+ map_element "AlternateFormatLocationUri", to: :alternate_format_location_uri, prefix: nil, namespace: nil
43
+ map_element "Agency", to: :agency, prefix: nil, namespace: nil
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+ require_relative "key_column_ref"
7
+ require_relative "long_name"
8
+ require_relative "short_name"
9
+
10
+ module Genericode
11
+ class Key < Shale::Mapper
12
+ attribute :id, Shale::Type::String
13
+ attribute :annotation, Annotation
14
+ attribute :short_name, ShortName
15
+ attribute :long_name, LongName, collection: true
16
+ attribute :canonical_uri, Shale::Type::String
17
+ attribute :canonical_version_uri, Shale::Type::String
18
+ attribute :column_ref, KeyColumnRef, collection: true
19
+
20
+ json do
21
+ map "Id", to: :id
22
+ map "Annotation", to: :annotation
23
+ map "ShortName", to: :short_name
24
+ map "LongName", to: :long_name
25
+ map "CanonicalUri", to: :canonical_uri
26
+ map "CanonicalVersionUri", to: :canonical_version_uri
27
+ map "ColumnRef", to: :column_ref
28
+ end
29
+
30
+ xml do
31
+ root "Key"
32
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
33
+
34
+ map_attribute "Id", to: :id
35
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
36
+ map_element "ShortName", to: :short_name, prefix: nil, namespace: nil
37
+ map_element "LongName", to: :long_name, prefix: nil, namespace: nil
38
+ map_element "CanonicalUri", to: :canonical_uri, prefix: nil, namespace: nil
39
+ map_element "CanonicalVersionUri", to: :canonical_version_uri, prefix: nil, namespace: nil
40
+ map_element "ColumnRef", to: :column_ref, prefix: nil, namespace: nil
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+
7
+ module Genericode
8
+ class KeyColumnRef < Shale::Mapper
9
+ attribute :ref, Shale::Type::String
10
+ attribute :annotation, Annotation
11
+
12
+ json do
13
+ map "Ref", to: :ref
14
+ map "Annotation", to: :annotation
15
+ end
16
+
17
+ xml do
18
+ root "KeyColumnRef"
19
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
20
+
21
+ map_attribute "Ref", to: :ref
22
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+
7
+ module Genericode
8
+ class KeyRef < Shale::Mapper
9
+ attribute :id, Shale::Type::String
10
+ attribute :external_ref, Shale::Type::String
11
+ attribute :annotation, Annotation
12
+ attribute :canonical_version_uri, Shale::Type::String
13
+ attribute :location_uri, Shale::Type::String, collection: true
14
+
15
+ json do
16
+ map "Id", to: :id
17
+ map "ExternalRef", to: :external_ref
18
+ map "Annotation", to: :annotation
19
+ map "CanonicalVersionUri", to: :canonical_version_uri
20
+ map "LocationUri", to: :location_uri
21
+ end
22
+
23
+ xml do
24
+ root "KeyRef"
25
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
26
+
27
+ map_attribute "Id", to: :id
28
+ map_attribute "ExternalRef", to: :external_ref
29
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
30
+ map_element "CanonicalVersionUri", to: :canonical_version_uri, prefix: nil, namespace: nil
31
+ map_element "LocationUri", to: :location_uri, prefix: nil, namespace: nil
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Genericode
6
+ class LongName < Shale::Mapper
7
+ attribute :content, Shale::Type::String
8
+ attribute :identifier, Shale::Type::String
9
+ attribute :lang, Shale::Type::String
10
+
11
+ json do
12
+ map "_", to: :content
13
+ map "Identifier", to: :identifier
14
+ map "lang", to: :lang
15
+ end
16
+
17
+ xml do
18
+ root "LongName"
19
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
20
+
21
+ map_content to: :content
22
+ map_attribute "Identifier", to: :identifier
23
+ map_attribute "lang", to: :lang, prefix: "xml", namespace: "http://www.w3.org/XML/1998/namespace"
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Genericode
6
+ class MimeTypedUri < Shale::Mapper
7
+ attribute :content, Shale::Type::String
8
+ attribute :mime_type, Shale::Type::String
9
+
10
+ json do
11
+ map "_", to: :content
12
+ map "MimeType", to: :mime_type
13
+ end
14
+
15
+ xml do
16
+ root "MimeTypedUri"
17
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
18
+
19
+ map_content to: :content
20
+ map_attribute "MimeType", to: :mime_type
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+ require_relative "value"
7
+
8
+ module Genericode
9
+ class Row < Shale::Mapper
10
+ attribute :annotation, Annotation
11
+ attribute :value, Value, collection: true
12
+
13
+ json do
14
+ map "Annotation", to: :annotation
15
+ map "Value", to: :value
16
+ end
17
+
18
+ xml do
19
+ root "Row"
20
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
21
+
22
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
23
+ map_element "Value", to: :value, prefix: nil, namespace: nil
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Genericode
6
+ class ShortName < Shale::Mapper
7
+ attribute :content, Shale::Type::String
8
+ attribute :lang, Shale::Type::String
9
+
10
+ json do
11
+ map "_", to: :content
12
+ map "lang", to: :lang
13
+ end
14
+
15
+ xml do
16
+ root "ShortName"
17
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
18
+
19
+ map_content to: :content
20
+ map_attribute "lang", to: :lang, prefix: "xml", namespace: "http://www.w3.org/XML/1998/namespace"
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+ require_relative "row"
7
+
8
+ module Genericode
9
+ class SimpleCodeList < Shale::Mapper
10
+ attribute :annotation, Annotation
11
+ attribute :row, Row, collection: true
12
+
13
+ json do
14
+ map "Annotation", to: :annotation
15
+ map "Row", to: :row
16
+ end
17
+
18
+ xml do
19
+ root "SimpleCodeList"
20
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
21
+
22
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
23
+ map_element "Row", to: :row, prefix: nil, namespace: nil
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Genericode
6
+ class SimpleValue < Shale::Mapper
7
+ attribute :content, Shale::Type::String
8
+
9
+ json do
10
+ map "_", to: :content
11
+ end
12
+
13
+ xml do
14
+ root "SimpleValue"
15
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
16
+
17
+ map_content to: :content
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "annotation"
6
+ require_relative "any_other_content"
7
+ require_relative "simple_value"
8
+
9
+ module Genericode
10
+ class Value < Shale::Mapper
11
+ attribute :column_ref, Shale::Type::String
12
+ attribute :annotation, Annotation
13
+ attribute :simple_value, SimpleValue
14
+ attribute :complex_value, AnyOtherContent
15
+
16
+ json do
17
+ map "ColumnRef", to: :column_ref
18
+ map "Annotation", to: :annotation
19
+ map "SimpleValue", to: :simple_value
20
+ map "ComplexValue", to: :complex_value
21
+ end
22
+
23
+ xml do
24
+ root "Value"
25
+ namespace "http://docs.oasis-open.org/codelist/ns/genericode/1.0/", "gc"
26
+
27
+ map_attribute "ColumnRef", to: :column_ref
28
+ map_element "Annotation", to: :annotation, prefix: nil, namespace: nil
29
+ map_element "SimpleValue", to: :simple_value, prefix: nil, namespace: nil
30
+ map_element "ComplexValue", to: :complex_value, prefix: nil, namespace: nil
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Genericode
4
+ VERSION = "0.1.0"
5
+ end
data/lib/genericode.rb ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "genericode/version"
4
+ require_relative "genericode/code_list"
5
+
6
+ module Genericode
7
+ class Error < StandardError; end
8
+ end
@@ -0,0 +1,4 @@
1
+ module Genericode
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,177 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: genericode
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ribose Inc.
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-07-17 00:00:00.000000000 Z
12
+ dependencies:
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
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ 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
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-performance
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: xml-c14n
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Parser and generator for OASIS Genericode
112
+ email:
113
+ - open.source@ribose.com'
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".rspec"
119
+ - ".rubocop.yml"
120
+ - CODE_OF_CONDUCT.md
121
+ - Rakefile
122
+ - lib/genericode.rb
123
+ - lib/genericode/agency.rb
124
+ - lib/genericode/annotation.rb
125
+ - lib/genericode/any_other_content.rb
126
+ - lib/genericode/any_other_language_content.rb
127
+ - lib/genericode/code_list.rb
128
+ - lib/genericode/code_list_ref.rb
129
+ - lib/genericode/code_list_set.rb
130
+ - lib/genericode/code_list_set_ref.rb
131
+ - lib/genericode/column.rb
132
+ - lib/genericode/column_ref.rb
133
+ - lib/genericode/column_set.rb
134
+ - lib/genericode/column_set_ref.rb
135
+ - lib/genericode/data.rb
136
+ - lib/genericode/data_restrictions.rb
137
+ - lib/genericode/datatype_facet.rb
138
+ - lib/genericode/general_identifier.rb
139
+ - lib/genericode/identification.rb
140
+ - lib/genericode/key.rb
141
+ - lib/genericode/key_column_ref.rb
142
+ - lib/genericode/key_ref.rb
143
+ - lib/genericode/long_name.rb
144
+ - lib/genericode/mime_typed_uri.rb
145
+ - lib/genericode/row.rb
146
+ - lib/genericode/short_name.rb
147
+ - lib/genericode/simple_code_list.rb
148
+ - lib/genericode/simple_value.rb
149
+ - lib/genericode/value.rb
150
+ - lib/genericode/version.rb
151
+ - sig/genericode.rbs
152
+ homepage: https://github.com/lutaml/genericode
153
+ licenses: []
154
+ metadata:
155
+ homepage_uri: https://github.com/lutaml/genericode
156
+ source_code_uri: https://github.com/lutaml/genericode
157
+ changelog_uri: https://github.com/lutaml/genericode/releases
158
+ post_install_message:
159
+ rdoc_options: []
160
+ require_paths:
161
+ - lib
162
+ required_ruby_version: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: 2.7.0
167
+ required_rubygems_version: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ version: '0'
172
+ requirements: []
173
+ rubygems_version: 3.5.11
174
+ signing_key:
175
+ specification_version: 4
176
+ summary: Parser and generator for OASIS Genericode
177
+ test_files: []