tbx 0.1.1 → 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.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +1 -1
- data/CHANGELOG.md +32 -0
- data/CLAUDE.md +21 -1
- data/README.adoc +365 -19
- data/lib/tbx/admin.rb +24 -11
- data/lib/tbx/admin_grp.rb +5 -0
- data/lib/tbx/admin_note.rb +14 -6
- data/lib/tbx/back.rb +5 -0
- data/lib/tbx/body.rb +3 -0
- data/lib/tbx/change.rb +6 -0
- data/lib/tbx/concept_entry.rb +10 -0
- data/lib/tbx/data_element.rb +50 -0
- data/lib/tbx/date.rb +6 -0
- data/lib/tbx/descrip.rb +23 -11
- data/lib/tbx/descrip_grp.rb +7 -0
- data/lib/tbx/descrip_note.rb +6 -6
- data/lib/tbx/document.rb +12 -0
- data/lib/tbx/ec.rb +16 -0
- data/lib/tbx/encoding_desc.rb +3 -0
- data/lib/tbx/file_desc.rb +6 -0
- data/lib/tbx/foreign.rb +6 -0
- data/lib/tbx/hi.rb +18 -0
- data/lib/tbx/item.rb +6 -0
- data/lib/tbx/item_grp.rb +6 -0
- data/lib/tbx/item_set.rb +6 -0
- data/lib/tbx/lang_sec.rb +6 -0
- data/lib/tbx/modules/basic.rb +92 -0
- data/lib/tbx/modules/core_types.rb +23 -0
- data/lib/tbx/modules/linguist.rb +46 -0
- data/lib/tbx/modules/min.rb +46 -0
- data/lib/tbx/namespace.rb +5 -0
- data/lib/tbx/note.rb +9 -0
- data/lib/tbx/p.rb +9 -0
- data/lib/tbx/ph.rb +6 -0
- data/lib/tbx/publication_stmt.rb +3 -0
- data/lib/tbx/ref.rb +17 -6
- data/lib/tbx/ref_object.rb +6 -0
- data/lib/tbx/ref_object_sec.rb +6 -0
- data/lib/tbx/revision_desc.rb +3 -0
- data/lib/tbx/sc.rb +9 -6
- data/lib/tbx/source_desc.rb +3 -0
- data/lib/tbx/tbx_header.rb +7 -0
- data/lib/tbx/term.rb +6 -0
- data/lib/tbx/term_comp.rb +26 -0
- data/lib/tbx/term_comp_grp.rb +24 -0
- data/lib/tbx/term_comp_sec.rb +45 -0
- data/lib/tbx/term_note.rb +44 -11
- data/lib/tbx/term_note_grp.rb +7 -0
- data/lib/tbx/term_sec.rb +8 -0
- data/lib/tbx/text_element.rb +5 -0
- data/lib/tbx/title.rb +6 -0
- data/lib/tbx/title_stmt.rb +3 -0
- data/lib/tbx/transac.rb +17 -6
- data/lib/tbx/transac_grp.rb +6 -0
- data/lib/tbx/transac_note.rb +17 -6
- data/lib/tbx/version.rb +1 -1
- data/lib/tbx/xref.rb +16 -0
- data/lib/tbx.rb +13 -0
- data/reference-docs/README.adoc +109 -0
- data/reference-docs/schemas/Basic_Module_Definition.pdf +0 -0
- data/reference-docs/schemas/Min_Module_Definition.pdf +0 -0
- data/reference-docs/schemas/TBX-Basic_ImplementationGuide/TBX-Basic_ImplementationGuide.pdf +0 -0
- data/reference-docs/schemas/TBX-Core_dialect/Schemas/Example_Astronomy_DCA_VALID.tbx +710 -0
- data/reference-docs/schemas/TBX-Core_dialect/Schemas/TBX-Core.sch +47 -0
- data/reference-docs/schemas/TBX-Core_dialect/Schemas/TBXcoreStructV03_TBX-Core_integrated.rng +1171 -0
- data/reference-docs/schemas/TBX-Core_dialect/TBX-Core Definition.pdf +0 -0
- data/reference-docs/schemas/TBX-Linguist_dialect/DCA/Example_Astronomy_DCA_VALID.tbx +4028 -0
- data/reference-docs/schemas/TBX-Linguist_dialect/DCA/TBX-Linguist_DCA.sch +146 -0
- data/reference-docs/schemas/TBX-Linguist_dialect/DCA/TBXcoreStructV03_TBX-Linguist_integrated.rng +1198 -0
- data/reference-docs/schemas/TBX-Linguist_dialect/DCT/Example_Astronomy_DCT_VALID.tbx +4019 -0
- data/reference-docs/schemas/TBX-Linguist_dialect/DCT/TBX-Linguist.nvdl +41 -0
- data/reference-docs/schemas/TBX-Linguist_dialect/DCT/TBX-Linguist_DCT.sch +48 -0
- data/reference-docs/schemas/TBX-Linguist_dialect/TBX-Linguist Definition.pdf +0 -0
- data/reference-docs/schemas/TBX-Min_dialect/DCA/TBX-Min_DCA.sch +82 -0
- data/reference-docs/schemas/TBX-Min_dialect/DCT/TBX-Min.nvdl +25 -0
- data/reference-docs/schemas/TBX-Min_dialect/DCT/TBX-Min_DCT.sch +48 -0
- data/reference-docs/schemas/TBX-Min_dialect/TBX-Min Definition.pdf +0 -0
- data/reference-docs/schemas/TBX_linguist_module/Linguist Module Definition.pdf +0 -0
- data/reference-docs/schemas/TBX_linguist_module/Linguist.rng +93 -0
- data/reference-docs/schemas/TBX_linguist_module/Linguist.sch +33 -0
- data/reference-docs/schemas/TBX_linguist_module/Linguist.tbxmd +47 -0
- data/reference-docs/schemas/TBX_module_description_xml/TBX Module Description.pdf +0 -0
- data/reference-docs/schemas/TBX_module_description_xml/tbxmd.rng +192 -0
- data/reference-docs/schemas/TBX_termComp_module/TermComp-namespace.rng +156 -0
- metadata +36 -2
|
@@ -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,6 +1,12 @@
|
|
|
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
|
data/lib/tbx/descrip.rb
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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"
|
data/lib/tbx/descrip_grp.rb
CHANGED
|
@@ -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
|
data/lib/tbx/descrip_note.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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
|
-
|
|
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"
|
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
|
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
|
data/lib/tbx/encoding_desc.rb
CHANGED
|
@@ -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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
|
@@ -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
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Tbx
|
|
4
|
+
module Modules
|
|
5
|
+
# Data category definitions for the TBX-Min module.
|
|
6
|
+
#
|
|
7
|
+
# TBX-Min provides a minimal set of data categories for simple
|
|
8
|
+
# terminology exchange.
|
|
9
|
+
#
|
|
10
|
+
# Source: Min.tbxmd, Min.rng, Min.sch
|
|
11
|
+
module Min
|
|
12
|
+
ADMIN_TYPES = {
|
|
13
|
+
customer_subset: "customerSubset",
|
|
14
|
+
}.freeze
|
|
15
|
+
|
|
16
|
+
DESCRIP_TYPES = {
|
|
17
|
+
subject_field: "subjectField",
|
|
18
|
+
}.freeze
|
|
19
|
+
|
|
20
|
+
TERM_NOTE_TYPES = {
|
|
21
|
+
administrative_status: "administrativeStatus",
|
|
22
|
+
part_of_speech: "partOfSpeech",
|
|
23
|
+
}.freeze
|
|
24
|
+
|
|
25
|
+
TERM_NOTE_VALUES = {
|
|
26
|
+
administrative_status: {
|
|
27
|
+
admitted_term: "admittedTerm-admn-sts",
|
|
28
|
+
deprecated_term: "deprecatedTerm-admn-sts",
|
|
29
|
+
superseded_term: "supersededTerm-admn-sts",
|
|
30
|
+
preferred_term: "preferredTerm-admn-sts",
|
|
31
|
+
}.freeze,
|
|
32
|
+
part_of_speech: {
|
|
33
|
+
adjective: "adjective",
|
|
34
|
+
noun: "noun",
|
|
35
|
+
other: "other",
|
|
36
|
+
verb: "verb",
|
|
37
|
+
adverb: "adverb",
|
|
38
|
+
}.freeze,
|
|
39
|
+
}.freeze
|
|
40
|
+
|
|
41
|
+
XREF_TYPES = {
|
|
42
|
+
external_cross_reference: "externalCrossReference",
|
|
43
|
+
}.freeze
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
data/lib/tbx/namespace.rb
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Tbx
|
|
4
|
+
# XML namespace for TBX elements per ISO 30042:2019.
|
|
5
|
+
#
|
|
6
|
+
# URI: `urn:iso:std:iso:30042:ed-2`
|
|
7
|
+
#
|
|
8
|
+
# All TBX structural elements use this namespace.
|
|
4
9
|
class Namespace < Lutaml::Xml::Namespace
|
|
5
10
|
uri "urn:iso:std:iso:30042:ed-2"
|
|
6
11
|
end
|
data/lib/tbx/note.rb
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Tbx
|
|
4
|
+
# Generic note element `<note>`.
|
|
5
|
+
#
|
|
6
|
+
# Provides supplementary information at conceptEntry, langSec, termSec,
|
|
7
|
+
# and various group levels.
|
|
8
|
+
#
|
|
9
|
+
# Content model: `entity.noteText` (mixed text + inline elements hi, ec,
|
|
10
|
+
# foreign, ph, sc).
|
|
11
|
+
#
|
|
12
|
+
# Schema source: TBXcoreStructV03.rng `<define name="note">`
|
|
4
13
|
class Note < Lutaml::Model::Serializable
|
|
5
14
|
attribute :id, :string
|
|
6
15
|
attribute :lang, Lutaml::Xml::W3c::XmlLangType
|
data/lib/tbx/p.rb
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Tbx
|
|
4
|
+
# Paragraph element `<p>`.
|
|
5
|
+
#
|
|
6
|
+
# Used for prose text in header contexts (publicationStmt, sourceDesc,
|
|
7
|
+
# encodingDesc, change).
|
|
8
|
+
#
|
|
9
|
+
# Content model: `entity.noteText` (mixed text + inline elements hi, ec,
|
|
10
|
+
# foreign, ph, sc).
|
|
11
|
+
#
|
|
12
|
+
# Schema source: TBXcoreStructV03.rng `<define name="p">`
|
|
4
13
|
class P < Lutaml::Model::Serializable
|
|
5
14
|
attribute :id, :string
|
|
6
15
|
attribute :lang, Lutaml::Xml::W3c::XmlLangType
|
data/lib/tbx/ph.rb
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Tbx
|
|
4
|
+
# XLIFF inline placeholder `<ph>`.
|
|
5
|
+
#
|
|
6
|
+
# Represents a code that does not have a distinct start and end.
|
|
7
|
+
# Empty element with optional `type` attribute.
|
|
8
|
+
#
|
|
9
|
+
# Schema source: TBXcoreStructV03.rng `<define name="ph">`
|
|
4
10
|
class Ph < Lutaml::Model::Serializable
|
|
5
11
|
attribute :type, :string
|
|
6
12
|
|
data/lib/tbx/publication_stmt.rb
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Tbx
|
|
4
|
+
# Publication statement `<publicationStmt>`.
|
|
5
|
+
#
|
|
6
|
+
# Schema source: TBXcoreStructV03.rng `<define name="publicationStmt">`
|
|
4
7
|
class PublicationStmt < Lutaml::Model::Serializable
|
|
5
8
|
attribute :id, :string
|
|
6
9
|
attribute :p, ::Tbx::P, collection: true
|
data/lib/tbx/ref.rb
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Tbx
|
|
4
|
+
# Internal reference element `<ref>`.
|
|
5
|
+
#
|
|
6
|
+
# Used for cross-references within the same termbase. The `target`
|
|
7
|
+
# attribute holds an IDREF pointing to another element's `id`.
|
|
8
|
+
#
|
|
9
|
+
# Permitted `type` values:
|
|
10
|
+
#
|
|
11
|
+
# * Basic module: `crossReference` — reference to another concept entry
|
|
12
|
+
# in the same termbase (DC-164), level: conceptEntry/termSec
|
|
13
|
+
#
|
|
14
|
+
# Content is plain text only (no inline elements per the core RNG).
|
|
15
|
+
#
|
|
16
|
+
# Schema source: TBXcoreStructV03.rng `<define name="ref">`;
|
|
17
|
+
# data category: Basic.tbxmd.
|
|
4
18
|
class Ref < Lutaml::Model::Serializable
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attribute :datatype, :string
|
|
9
|
-
attribute :type, :string
|
|
10
|
-
attribute :content, :string, collection: true
|
|
19
|
+
include Tbx::DataElement
|
|
20
|
+
|
|
21
|
+
TYPES = Modules::Basic::REF_TYPES.freeze
|
|
11
22
|
|
|
12
23
|
xml do
|
|
13
24
|
root "ref"
|
data/lib/tbx/ref_object.rb
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Tbx
|
|
4
|
+
# A reference object `<refObject>` defining a picklist or value set.
|
|
5
|
+
#
|
|
6
|
+
# Contains `itemSet`, `itemGrp`, or `item` children that enumerate the
|
|
7
|
+
# permitted values for a data category's picklist.
|
|
8
|
+
#
|
|
9
|
+
# Schema source: TBXcoreStructV03.rng `<define name="refObject">`
|
|
4
10
|
class RefObject < Lutaml::Model::Serializable
|
|
5
11
|
attribute :id, :string
|
|
6
12
|
attribute :item_set, ::Tbx::ItemSet, collection: true
|
data/lib/tbx/ref_object_sec.rb
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Tbx
|
|
4
|
+
# Reference object section `<refObjectSec>` in back matter.
|
|
5
|
+
#
|
|
6
|
+
# Contains reference objects that define picklists and value sets used
|
|
7
|
+
# by data category elements throughout the termbase.
|
|
8
|
+
#
|
|
9
|
+
# Schema source: TBXcoreStructV03.rng `<define name="refObjectSec">`
|
|
4
10
|
class RefObjectSec < Lutaml::Model::Serializable
|
|
5
11
|
attribute :id, :string
|
|
6
12
|
attribute :type, :string
|
data/lib/tbx/revision_desc.rb
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Tbx
|
|
4
|
+
# Revision description `<revisionDesc>`.
|
|
5
|
+
#
|
|
6
|
+
# Schema source: TBXcoreStructV03.rng `<define name="revisionDesc">`
|
|
4
7
|
class RevisionDesc < Lutaml::Model::Serializable
|
|
5
8
|
attribute :id, :string
|
|
6
9
|
attribute :lang, Lutaml::Xml::W3c::XmlLangType
|