tbx 0.1.0 → 0.1.2

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 (90) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +1 -1
  3. data/.github/workflows/release.yml +2 -2
  4. data/.rubocop_todo.yml +1 -1
  5. data/CHANGELOG.md +38 -0
  6. data/CLAUDE.md +23 -4
  7. data/Gemfile +1 -1
  8. data/README.adoc +365 -19
  9. data/lib/tbx/admin.rb +25 -12
  10. data/lib/tbx/admin_grp.rb +6 -1
  11. data/lib/tbx/admin_note.rb +15 -7
  12. data/lib/tbx/back.rb +6 -1
  13. data/lib/tbx/body.rb +4 -1
  14. data/lib/tbx/change.rb +7 -1
  15. data/lib/tbx/concept_entry.rb +11 -1
  16. data/lib/tbx/data_element.rb +50 -0
  17. data/lib/tbx/date.rb +7 -1
  18. data/lib/tbx/descrip.rb +24 -12
  19. data/lib/tbx/descrip_grp.rb +8 -1
  20. data/lib/tbx/descrip_note.rb +7 -7
  21. data/lib/tbx/document.rb +13 -1
  22. data/lib/tbx/ec.rb +17 -1
  23. data/lib/tbx/encoding_desc.rb +4 -1
  24. data/lib/tbx/file_desc.rb +7 -1
  25. data/lib/tbx/foreign.rb +7 -1
  26. data/lib/tbx/hi.rb +19 -1
  27. data/lib/tbx/item.rb +7 -1
  28. data/lib/tbx/item_grp.rb +7 -1
  29. data/lib/tbx/item_set.rb +7 -1
  30. data/lib/tbx/lang_sec.rb +7 -1
  31. data/lib/tbx/modules/basic.rb +92 -0
  32. data/lib/tbx/modules/core_types.rb +23 -0
  33. data/lib/tbx/modules/linguist.rb +46 -0
  34. data/lib/tbx/modules/min.rb +46 -0
  35. data/lib/tbx/namespace.rb +12 -0
  36. data/lib/tbx/note.rb +10 -1
  37. data/lib/tbx/p.rb +10 -1
  38. data/lib/tbx/ph.rb +7 -1
  39. data/lib/tbx/publication_stmt.rb +4 -1
  40. data/lib/tbx/ref.rb +18 -7
  41. data/lib/tbx/ref_object.rb +7 -1
  42. data/lib/tbx/ref_object_sec.rb +7 -1
  43. data/lib/tbx/revision_desc.rb +4 -1
  44. data/lib/tbx/sc.rb +10 -7
  45. data/lib/tbx/source_desc.rb +4 -1
  46. data/lib/tbx/tbx_header.rb +8 -1
  47. data/lib/tbx/term.rb +7 -1
  48. data/lib/tbx/term_comp.rb +26 -0
  49. data/lib/tbx/term_comp_grp.rb +24 -0
  50. data/lib/tbx/term_comp_sec.rb +45 -0
  51. data/lib/tbx/term_note.rb +45 -12
  52. data/lib/tbx/term_note_grp.rb +8 -1
  53. data/lib/tbx/term_sec.rb +9 -1
  54. data/lib/tbx/text_element.rb +6 -1
  55. data/lib/tbx/title.rb +7 -1
  56. data/lib/tbx/title_stmt.rb +4 -1
  57. data/lib/tbx/transac.rb +18 -7
  58. data/lib/tbx/transac_grp.rb +7 -1
  59. data/lib/tbx/transac_note.rb +18 -7
  60. data/lib/tbx/version.rb +1 -1
  61. data/lib/tbx/xref.rb +17 -1
  62. data/lib/tbx.rb +14 -1
  63. data/reference-docs/README.adoc +109 -0
  64. data/reference-docs/schemas/Basic_Module_Definition.pdf +0 -0
  65. data/reference-docs/schemas/Min_Module_Definition.pdf +0 -0
  66. data/reference-docs/schemas/TBX-Basic_ImplementationGuide/TBX-Basic_ImplementationGuide.pdf +0 -0
  67. data/reference-docs/schemas/TBX-Core_dialect/Schemas/Example_Astronomy_DCA_VALID.tbx +710 -0
  68. data/reference-docs/schemas/TBX-Core_dialect/Schemas/TBX-Core.sch +47 -0
  69. data/reference-docs/schemas/TBX-Core_dialect/Schemas/TBXcoreStructV03_TBX-Core_integrated.rng +1171 -0
  70. data/reference-docs/schemas/TBX-Core_dialect/TBX-Core Definition.pdf +0 -0
  71. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/Example_Astronomy_DCA_VALID.tbx +4028 -0
  72. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/TBX-Linguist_DCA.sch +146 -0
  73. data/reference-docs/schemas/TBX-Linguist_dialect/DCA/TBXcoreStructV03_TBX-Linguist_integrated.rng +1198 -0
  74. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/Example_Astronomy_DCT_VALID.tbx +4019 -0
  75. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/TBX-Linguist.nvdl +41 -0
  76. data/reference-docs/schemas/TBX-Linguist_dialect/DCT/TBX-Linguist_DCT.sch +48 -0
  77. data/reference-docs/schemas/TBX-Linguist_dialect/TBX-Linguist Definition.pdf +0 -0
  78. data/reference-docs/schemas/TBX-Min_dialect/DCA/TBX-Min_DCA.sch +82 -0
  79. data/reference-docs/schemas/TBX-Min_dialect/DCT/TBX-Min.nvdl +25 -0
  80. data/reference-docs/schemas/TBX-Min_dialect/DCT/TBX-Min_DCT.sch +48 -0
  81. data/reference-docs/schemas/TBX-Min_dialect/TBX-Min Definition.pdf +0 -0
  82. data/reference-docs/schemas/TBX_linguist_module/Linguist Module Definition.pdf +0 -0
  83. data/reference-docs/schemas/TBX_linguist_module/Linguist.rng +93 -0
  84. data/reference-docs/schemas/TBX_linguist_module/Linguist.sch +33 -0
  85. data/reference-docs/schemas/TBX_linguist_module/Linguist.tbxmd +47 -0
  86. data/reference-docs/schemas/TBX_module_description_xml/TBX Module Description.pdf +0 -0
  87. data/reference-docs/schemas/TBX_module_description_xml/tbxmd.rng +192 -0
  88. data/reference-docs/schemas/TBX_termComp_module/TermComp-namespace.rng +156 -0
  89. metadata +41 -4
  90. data/lib/tbx/namespaces.rb +0 -9
data/lib/tbx/back.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Back matter `<back>` containing reference object sections.
5
+ #
6
+ # Used for managing picklists and external references.
7
+ #
8
+ # Schema source: TBXcoreStructV03.rng `<define name="back">`
4
9
  class Back < Lutaml::Model::Serializable
5
10
  attribute :id, :string
6
11
  attribute :ref_object_sec, ::Tbx::RefObjectSec, collection: true
@@ -8,7 +13,7 @@ module Tbx
8
13
  xml do
9
14
  root "back"
10
15
  mixed_content
11
- namespace ::Tbx::Namespaces::TbxNamespace
16
+ namespace ::Tbx::Namespace
12
17
 
13
18
  map_attribute "id", to: :id
14
19
  map_element "refObjectSec", to: :ref_object_sec
data/lib/tbx/body.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Body element `<body>` containing all concept entries.
5
+ #
6
+ # Schema source: TBXcoreStructV03.rng `<define name="body">`
4
7
  class Body < Lutaml::Model::Serializable
5
8
  attribute :id, :string
6
9
  attribute :concept_entry, ::Tbx::ConceptEntry, collection: true
@@ -8,7 +11,7 @@ module Tbx
8
11
  xml do
9
12
  root "body"
10
13
  mixed_content
11
- namespace ::Tbx::Namespaces::TbxNamespace
14
+ namespace ::Tbx::Namespace
12
15
 
13
16
  map_attribute "id", to: :id
14
17
  map_element "conceptEntry", to: :concept_entry
data/lib/tbx/change.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # A single change record in the revision history `<change>`.
5
+ #
6
+ # Each change record contains one or more paragraph elements describing
7
+ # what changed and when.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="change">`
4
10
  class Change < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
@@ -9,7 +15,7 @@ module Tbx
9
15
  xml do
10
16
  root "change"
11
17
  mixed_content
12
- namespace ::Tbx::Namespaces::TbxNamespace
18
+ namespace ::Tbx::Namespace
13
19
 
14
20
  map_attribute "id", to: :id
15
21
  w3c_attributes :lang
@@ -1,6 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # A single concept entry `<conceptEntry>`.
5
+ #
6
+ # Represents a concept in the terminology collection. The `id` attribute
7
+ # is required and must be unique within the document.
8
+ #
9
+ # Permitted children are defined by the `entity.auxInfo` pattern:
10
+ # admin, adminGrp, descrip, descripGrp, note, ref, transacGrp, xref,
11
+ # followed by one or more langSec elements.
12
+ #
13
+ # Schema source: TBXcoreStructV03.rng `<define name="conceptEntry">`
4
14
  class ConceptEntry < Lutaml::Model::Serializable
5
15
  attribute :id, :string
6
16
  attribute :admin, ::Tbx::Admin, collection: true
@@ -16,7 +26,7 @@ module Tbx
16
26
  xml do
17
27
  root "conceptEntry"
18
28
  mixed_content
19
- namespace ::Tbx::Namespaces::TbxNamespace
29
+ namespace ::Tbx::Namespace
20
30
 
21
31
  map_attribute "id", to: :id
22
32
  map_element "admin", to: :admin
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ # Shared attribute declarations for TBX data-category elements.
5
+ #
6
+ # Injects the common attributes defined by the `IDLangTgtDtyp` attribute
7
+ # class + `type` + text content pattern from TBXcoreStructV03.rng.
8
+ #
9
+ # @example Usage in a data-category element
10
+ # class Admin < Lutaml::Model::Serializable
11
+ # include Tbx::DataElement
12
+ # include Tbx::DataElement::InlineContent
13
+ #
14
+ # xml do
15
+ # root "admin"
16
+ # ...
17
+ # end
18
+ # end
19
+ module DataElement
20
+ def self.included(base)
21
+ base.class_eval do
22
+ attribute :id, :string
23
+ attribute :lang, Lutaml::Xml::W3c::XmlLangType
24
+ attribute :target, :string
25
+ attribute :datatype, :string
26
+ attribute :type, :string
27
+ attribute :content, :string, collection: true
28
+ end
29
+ end
30
+
31
+ # Inline child element attributes for data-category elements that
32
+ # support mixed content per the `entity.noteText` pattern in
33
+ # TBXcoreStructV03.rng.
34
+ #
35
+ # Included by: Admin, Descrip, TermNote (elements with noteText content).
36
+ # NOT included by: AdminNote, DescripNote, TransacNote, Transac, Ref
37
+ # (plain text only per RNG).
38
+ module InlineContent
39
+ def self.included(base)
40
+ base.class_eval do
41
+ attribute :hi, ::Tbx::Hi, collection: true
42
+ attribute :ec, ::Tbx::Ec, collection: true
43
+ attribute :foreign, ::Tbx::Foreign, collection: true
44
+ attribute :ph, ::Tbx::Ph, collection: true
45
+ attribute :sc, ::Tbx::Sc, collection: true
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
data/lib/tbx/date.rb CHANGED
@@ -1,13 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Date element `<date>`.
5
+ #
6
+ # Records when a transaction occurred. Content must be a valid XML Schema
7
+ # `date` (YYYY-MM-DD) or `dateTime` (YYYY-MM-DDThh:mm:ss) value.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="date">`
4
10
  class DateElement < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :content, :string
7
13
 
8
14
  xml do
9
15
  root "date"
10
- namespace ::Tbx::Namespaces::TbxNamespace
16
+ namespace ::Tbx::Namespace
11
17
 
12
18
  map_attribute "id", to: :id
13
19
  map_content to: :content
data/lib/tbx/descrip.rb CHANGED
@@ -1,23 +1,35 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Descriptive data category element `<descrip>`.
5
+ #
6
+ # Carries conceptual and contextual information about a term, including
7
+ # definitions, subject field classifications, and usage contexts.
8
+ #
9
+ # Permitted `type` values (composed from all modules):
10
+ #
11
+ # * Min module: `subjectField` — field of special knowledge (DC-489),
12
+ # level: conceptEntry
13
+ # * Basic module: `context` — text illustrating term usage (DC-149),
14
+ # level: termSec; `definition` — narrative statement of concept (DC-168),
15
+ # level: conceptEntry/langSec
16
+ #
17
+ # Content model: `entity.noteText` (mixed text + inline elements hi, ec,
18
+ # foreign, ph, sc).
19
+ #
20
+ # Schema source: TBXcoreStructV03.rng `<define name="descrip">`;
21
+ # data categories: Min.tbxmd, Basic.tbxmd.
4
22
  class Descrip < Lutaml::Model::Serializable
5
- attribute :id, :string
6
- attribute :lang, Lutaml::Xml::W3c::XmlLangType
7
- attribute :target, :string
8
- attribute :datatype, :string
9
- attribute :type, :string
10
- attribute :content, :string, collection: true
11
- attribute :hi, ::Tbx::Hi, collection: true
12
- attribute :ec, ::Tbx::Ec, collection: true
13
- attribute :foreign, ::Tbx::Foreign, collection: true
14
- attribute :ph, ::Tbx::Ph, collection: true
15
- attribute :sc, ::Tbx::Sc, collection: true
23
+ include Tbx::DataElement
24
+ include Tbx::DataElement::InlineContent
25
+
26
+ TYPES = Modules::Min::DESCRIP_TYPES
27
+ .merge(Modules::Basic::DESCRIP_TYPES).freeze
16
28
 
17
29
  xml do
18
30
  root "descrip"
19
31
  mixed_content
20
- namespace ::Tbx::Namespaces::TbxNamespace
32
+ namespace ::Tbx::Namespace
21
33
 
22
34
  map_attribute "id", to: :id
23
35
  w3c_attributes :lang
@@ -1,6 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Groups a `<descrip>` element with its administrative data, notes, and
5
+ # source references.
6
+ #
7
+ # Commonly used to associate a `source` admin with a `definition` descrip,
8
+ # providing provenance for descriptive data.
9
+ #
10
+ # Schema source: TBXcoreStructV03.rng `<define name="descripGrp">`
4
11
  class DescripGrp < Lutaml::Model::Serializable
5
12
  attribute :id, :string
6
13
  attribute :descrip, ::Tbx::Descrip
@@ -15,7 +22,7 @@ module Tbx
15
22
  xml do
16
23
  root "descripGrp"
17
24
  mixed_content
18
- namespace ::Tbx::Namespaces::TbxNamespace
25
+ namespace ::Tbx::Namespace
19
26
 
20
27
  map_attribute "id", to: :id
21
28
  map_element "descrip", to: :descrip
@@ -1,18 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Note element associated with a `<descrip>` description.
5
+ #
6
+ # Content is plain text only (no inline elements per the core RNG).
7
+ #
8
+ # Schema source: TBXcoreStructV03.rng `<define name="descripNote">`
4
9
  class DescripNote < Lutaml::Model::Serializable
5
- attribute :id, :string
6
- attribute :lang, Lutaml::Xml::W3c::XmlLangType
7
- attribute :target, :string
8
- attribute :datatype, :string
9
- attribute :type, :string
10
- attribute :content, :string, collection: true
10
+ include Tbx::DataElement
11
11
 
12
12
  xml do
13
13
  root "descripNote"
14
14
  mixed_content
15
- namespace ::Tbx::Namespaces::TbxNamespace
15
+ namespace ::Tbx::Namespace
16
16
 
17
17
  map_attribute "id", to: :id
18
18
  w3c_attributes :lang
data/lib/tbx/document.rb CHANGED
@@ -1,6 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Root element of a TBX (Termbase Exchange) document per ISO 30042:2019.
5
+ #
6
+ # The `type` attribute declares the dialect (e.g. "TBX-Basic", "TBX-Min",
7
+ # "TBX-Core", "TBX-Linguist"), and `style` declares the serialization
8
+ # style ("dca" for Data Category Archive or "dct" for Data Category Tagging).
9
+ #
10
+ # @example Parsing a TBX file
11
+ # doc = Tbx::Document.from_xml(File.read("glossary.tbx"))
12
+ # doc.type # => "TBX-Basic"
13
+ # doc.style # => "dca"
14
+ #
15
+ # Schema source: TBXcoreStructV03.rng `<define name="tbx">`
4
16
  class Document < Lutaml::Model::Serializable
5
17
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
6
18
  attribute :type, :string
@@ -11,7 +23,7 @@ module Tbx
11
23
  xml do
12
24
  root "tbx"
13
25
  mixed_content
14
- namespace ::Tbx::Namespaces::TbxNamespace
26
+ namespace ::Tbx::Namespace
15
27
 
16
28
  w3c_attributes :lang
17
29
  map_attribute "type", to: :type
data/lib/tbx/ec.rb CHANGED
@@ -1,6 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # XLIFF inline end-code marker `<ec>`.
5
+ #
6
+ # Used for representing inline formatting codes from source formats.
7
+ # Paired with `<sc>` via the `startRef` attribute.
8
+ #
9
+ # Attributes:
10
+ # * `startRef` (IDREF) — references the id of the corresponding `<sc>`
11
+ # * `isolated` (yes/no) — whether this code is isolated
12
+ # * `disp` — display text
13
+ # * `equiv` — equivalent text
14
+ # * `id` — unique identifier
15
+ # * `type` (fmt, ui, quote, link, image, other) — code type
16
+ # * `subtype` — sub-classification
17
+ # * `target` — target reference
18
+ #
19
+ # Schema source: TBXcoreStructV03.rng `<define name="ec">`
4
20
  class Ec < Lutaml::Model::Serializable
5
21
  attribute :start_ref, :string
6
22
  attribute :isolated, :string
@@ -13,7 +29,7 @@ module Tbx
13
29
 
14
30
  xml do
15
31
  root "ec"
16
- namespace ::Tbx::Namespaces::TbxNamespace
32
+ namespace ::Tbx::Namespace
17
33
 
18
34
  map_attribute "startRef", to: :start_ref
19
35
  map_attribute "isolated", to: :isolated
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Encoding description `<encodingDesc>`.
5
+ #
6
+ # Schema source: TBXcoreStructV03.rng `<define name="encodingDesc">`
4
7
  class EncodingDesc < Lutaml::Model::Serializable
5
8
  attribute :id, :string
6
9
  attribute :p, ::Tbx::P, collection: true
@@ -8,7 +11,7 @@ module Tbx
8
11
  xml do
9
12
  root "encodingDesc"
10
13
  mixed_content
11
- namespace ::Tbx::Namespaces::TbxNamespace
14
+ namespace ::Tbx::Namespace
12
15
 
13
16
  map_attribute "id", to: :id
14
17
  map_element "p", to: :p
data/lib/tbx/file_desc.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # File description `<fileDesc>`.
5
+ #
6
+ # Contains file-level metadata including publication statement, title,
7
+ # and source description.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="fileDesc">`
4
10
  class FileDesc < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :publication_stmt, ::Tbx::PublicationStmt
@@ -10,7 +16,7 @@ module Tbx
10
16
  xml do
11
17
  root "fileDesc"
12
18
  mixed_content
13
- namespace ::Tbx::Namespaces::TbxNamespace
19
+ namespace ::Tbx::Namespace
14
20
 
15
21
  map_attribute "id", to: :id
16
22
  map_element "publicationStmt", to: :publication_stmt
data/lib/tbx/foreign.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Foreign-language text element `<foreign>`.
5
+ #
6
+ # Marks text in a foreign language. The `xml:lang` attribute indicates
7
+ # the language. Content model: `entity.noteText` (mixed text + inline
8
+ # elements).
9
+ # Schema source: TBXcoreStructV03.rng `<define name="foreign">`
4
10
  class Foreign < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
@@ -14,7 +20,7 @@ module Tbx
14
20
  xml do
15
21
  root "foreign"
16
22
  mixed_content
17
- namespace ::Tbx::Namespaces::TbxNamespace
23
+ namespace ::Tbx::Namespace
18
24
 
19
25
  map_attribute "id", to: :id
20
26
  w3c_attributes :lang
data/lib/tbx/hi.rb CHANGED
@@ -1,7 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Inline highlighting element `<hi>`.
5
+ #
6
+ # Used within term, note, and other text content to mark up special text
7
+ # ranges. The `entailedTerm` type with `target` attribute creates inline
8
+ # cross-references to other concepts.
9
+ #
10
+ # Permitted `type` values (from Core RNG):
11
+ #
12
+ # * `entailedTerm` — cross-reference to another concept within term text
13
+ # * `hotkey` — keyboard shortcut designation
14
+ # * `italics` — italic text emphasis
15
+ # * `bold` — bold text emphasis
16
+ # * `superscript` — superscript text
17
+ # * `subscript` — subscript text
18
+ # * `math` — mathematical notation
19
+ #
20
+ # Schema source: TBXcoreStructV03.rng `<define name="hi">`
4
21
  class Hi < Lutaml::Model::Serializable
22
+ TYPES = Modules::CoreTypes::HI_TYPES.freeze
5
23
  attribute :target, :string
6
24
  attribute :type, :string
7
25
  attribute :content, :string, collection: true
@@ -9,7 +27,7 @@ module Tbx
9
27
  xml do
10
28
  root "hi"
11
29
  mixed_content
12
- namespace ::Tbx::Namespaces::TbxNamespace
30
+ namespace ::Tbx::Namespace
13
31
 
14
32
  map_attribute "target", to: :target
15
33
  map_attribute "type", to: :type
data/lib/tbx/item.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # A single picklist value item `<item>`.
5
+ #
6
+ # Content model: `entity.noteText` (mixed text + inline elements:
7
+ # hi, ec, foreign, ph, sc).
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="item">`
4
10
  class Item < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :type, :string
@@ -14,7 +20,7 @@ module Tbx
14
20
  xml do
15
21
  root "item"
16
22
  mixed_content
17
- namespace ::Tbx::Namespaces::TbxNamespace
23
+ namespace ::Tbx::Namespace
18
24
 
19
25
  map_attribute "id", to: :id
20
26
  map_attribute "type", to: :type
data/lib/tbx/item_grp.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Item group `<itemGrp>` associating a picklist item with administrative data.
5
+ #
6
+ # Groups an `item` with its associated administrative data, notes,
7
+ # references, and transaction records.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="itemGrp">`
4
10
  class ItemGrp < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :item, ::Tbx::Item
@@ -14,7 +20,7 @@ module Tbx
14
20
  xml do
15
21
  root "itemGrp"
16
22
  mixed_content
17
- namespace ::Tbx::Namespaces::TbxNamespace
23
+ namespace ::Tbx::Namespace
18
24
 
19
25
  map_attribute "id", to: :id
20
26
  map_element "item", to: :item
data/lib/tbx/item_set.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # A set of items forming a picklist `<itemSet>`.
5
+ #
6
+ # Contains `itemGrp` or `item` children that enumerate individual
7
+ # picklist values.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="itemSet">`
4
10
  class ItemSet < Lutaml::Model::Serializable
5
11
  attribute :id, :string
6
12
  attribute :type, :string
@@ -10,7 +16,7 @@ module Tbx
10
16
  xml do
11
17
  root "itemSet"
12
18
  mixed_content
13
- namespace ::Tbx::Namespaces::TbxNamespace
19
+ namespace ::Tbx::Namespace
14
20
 
15
21
  map_attribute "id", to: :id
16
22
  map_attribute "type", to: :type
data/lib/tbx/lang_sec.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tbx
4
+ # Language section `<langSec>`.
5
+ #
6
+ # Groups all term-level data for a single language within a concept entry.
7
+ # The `xml:lang` attribute is required and specifies the language.
8
+ #
9
+ # Schema source: TBXcoreStructV03.rng `<define name="langSec">`
4
10
  class LangSec < Lutaml::Model::Serializable
5
11
  attribute :lang, Lutaml::Xml::W3c::XmlLangType
6
12
  attribute :admin, ::Tbx::Admin, collection: true
@@ -16,7 +22,7 @@ module Tbx
16
22
  xml do
17
23
  root "langSec"
18
24
  mixed_content
19
- namespace ::Tbx::Namespaces::TbxNamespace
25
+ namespace ::Tbx::Namespace
20
26
 
21
27
  w3c_attributes :lang
22
28
  map_element "admin", to: :admin
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ module Modules
5
+ # Data category definitions for the TBX-Basic module.
6
+ #
7
+ # TBX-Basic extends Min with additional data categories for standard
8
+ # terminology exchange including definitions, context, term types,
9
+ # and transaction tracking.
10
+ #
11
+ # Source: Basic.tbxmd, Basic.rng, Basic.sch
12
+ module Basic
13
+ ADMIN_TYPES = {
14
+ project_subset: "projectSubset",
15
+ source: "source",
16
+ }.freeze
17
+
18
+ DESCRIP_TYPES = {
19
+ context: "context",
20
+ definition: "definition",
21
+ }.freeze
22
+
23
+ TERM_NOTE_TYPES = {
24
+ geographical_usage: "geographicalUsage",
25
+ grammatical_gender: "grammaticalGender",
26
+ term_location: "termLocation",
27
+ term_type: "termType",
28
+ }.freeze
29
+
30
+ TERM_NOTE_VALUES = {
31
+ grammatical_gender: {
32
+ masculine: "masculine",
33
+ feminine: "feminine",
34
+ neuter: "neuter",
35
+ other: "other",
36
+ }.freeze,
37
+ term_location: {
38
+ check_box: "checkBox",
39
+ combo_box: "comboBox",
40
+ combo_box_element: "comboBoxElement",
41
+ dialog_box: "dialogBox",
42
+ group_box: "groupBox",
43
+ informative_message: "informativeMessage",
44
+ interactive_message: "interactiveMessage",
45
+ menu_item: "menuItem",
46
+ progress_bar: "progressBar",
47
+ push_button: "pushButton",
48
+ radio_button: "radioButton",
49
+ slider: "slider",
50
+ spin_box: "spinBox",
51
+ tab: "tab",
52
+ table_text: "tableText",
53
+ text_box: "textBox",
54
+ tool_tip: "toolTip",
55
+ user_defined_type: "user-definedType",
56
+ }.freeze,
57
+ term_type: {
58
+ full_form: "fullForm",
59
+ acronym: "acronym",
60
+ abbreviation: "abbreviation",
61
+ short_form: "shortForm",
62
+ variant: "variant",
63
+ phrase: "phrase",
64
+ }.freeze,
65
+ }.freeze
66
+
67
+ REF_TYPES = {
68
+ cross_reference: "crossReference",
69
+ }.freeze
70
+
71
+ XREF_TYPES = {
72
+ external_cross_reference: "externalCrossReference",
73
+ x_graphic: "xGraphic",
74
+ }.freeze
75
+
76
+ TRANSAC_TYPES = {
77
+ transaction_type: "transactionType",
78
+ }.freeze
79
+
80
+ TRANSAC_VALUES = {
81
+ transaction_type: {
82
+ origination: "origination",
83
+ modification: "modification",
84
+ }.freeze,
85
+ }.freeze
86
+
87
+ TRANSAC_NOTE_TYPES = {
88
+ responsibility: "responsibility",
89
+ }.freeze
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ module Modules
5
+ # Data category definitions from the TBX core RNG schema.
6
+ #
7
+ # These types are not module-specific; they are defined directly in
8
+ # TBXcoreStructV03.rng and apply to all dialects.
9
+ module CoreTypes
10
+ # Permitted `<hi>` element type values per TBXcoreStructV03.rng
11
+ # `<define name="hi">`.
12
+ HI_TYPES = {
13
+ entailed_term: "entailedTerm",
14
+ hotkey: "hotkey",
15
+ italics: "italics",
16
+ bold: "bold",
17
+ superscript: "superscript",
18
+ subscript: "subscript",
19
+ math: "math",
20
+ }.freeze
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tbx
4
+ module Modules
5
+ # Data category definitions for the TBX-Linguist module.
6
+ #
7
+ # TBX-Linguist extends Basic with additional linguistic data categories
8
+ # including grammatical number, register, and transfer comments.
9
+ #
10
+ # Source: Linguist.tbxmd, Linguist.rng, Linguist.sch
11
+ module Linguist
12
+ ADMIN_TYPES = {
13
+ reading: "reading",
14
+ }.freeze
15
+
16
+ ADMIN_NOTE_TYPES = {
17
+ reading_note: "readingNote",
18
+ }.freeze
19
+
20
+ TERM_NOTE_TYPES = {
21
+ grammatical_number: "grammaticalNumber",
22
+ register: "register",
23
+ transfer_comment: "transferComment",
24
+ }.freeze
25
+
26
+ TERM_NOTE_VALUES = {
27
+ grammatical_number: {
28
+ singular: "singular",
29
+ plural: "plural",
30
+ dual: "dual",
31
+ mass: "mass",
32
+ other_number: "otherNumber",
33
+ }.freeze,
34
+ register: {
35
+ colloquial: "colloquialRegister",
36
+ neutral: "neutralRegister",
37
+ technical: "technicalRegister",
38
+ in_house: "in-houseRegister",
39
+ bench_level: "bench-levelRegister",
40
+ slang: "slangRegister",
41
+ vulgar: "vulgarRegister",
42
+ }.freeze,
43
+ }.freeze
44
+ end
45
+ end
46
+ end