glossarist 2.14.15 → 2.14.17

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +7 -0
  3. data/docs/data-format.adoc +22 -8
  4. data/glossarist.gemspec +3 -0
  5. data/lib/glossarist/cli/proposal_command.rb +131 -0
  6. data/lib/glossarist/cli/units_import_command.rb +40 -0
  7. data/lib/glossarist/cli.rb +40 -0
  8. data/lib/glossarist/concept.rb +4 -0
  9. data/lib/glossarist/default_materialization.rb +62 -0
  10. data/lib/glossarist/errors/invalid_proposal_error.rb +10 -0
  11. data/lib/glossarist/errors.rb +1 -0
  12. data/lib/glossarist/gcr_metadata.rb +5 -0
  13. data/lib/glossarist/managed_concept.rb +4 -0
  14. data/lib/glossarist/managed_concept_collection.rb +5 -0
  15. data/lib/glossarist/proposals/change.rb +44 -0
  16. data/lib/glossarist/proposals/git_bridge.rb +78 -0
  17. data/lib/glossarist/proposals/github_bridge.rb +76 -0
  18. data/lib/glossarist/proposals/payload.rb +25 -0
  19. data/lib/glossarist/proposals/pr_description.rb +51 -0
  20. data/lib/glossarist/proposals.rb +15 -0
  21. data/lib/glossarist/register_data.rb +7 -1
  22. data/lib/glossarist/resolution_adapter/bibliography.rb +6 -1
  23. data/lib/glossarist/sts/importer.rb +9 -9
  24. data/lib/glossarist/units/ingestor.rb +428 -0
  25. data/lib/glossarist/units/quantity_kind.rb +49 -0
  26. data/lib/glossarist/units/unit.rb +58 -0
  27. data/lib/glossarist/units/unit_prefix.rb +42 -0
  28. data/lib/glossarist/units.rb +21 -0
  29. data/lib/glossarist/v1/concept.rb +3 -0
  30. data/lib/glossarist/v1/cross_references.rb +3 -0
  31. data/lib/glossarist/v2/localized_concept.rb +5 -0
  32. data/lib/glossarist/v2/managed_concept.rb +5 -0
  33. data/lib/glossarist/v3/localized_concept.rb +5 -0
  34. data/lib/glossarist/v3/managed_concept.rb +5 -0
  35. data/lib/glossarist/version.rb +1 -1
  36. data/lib/glossarist.rb +3 -0
  37. metadata +31 -2
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Glossarist
4
+ module Units
5
+ # A unit of measurement as dataset content.
6
+ #
7
+ # Aligned with concept-model models/units/Unit.lutaml (concept-model#104):
8
+ # +id+ is the UnitsML code (unitsdb identifiers[type=unitsml], e.g.
9
+ # "u:ampere"), +notations+ carry the remaining external scheme codes
10
+ # (NIST id, UCUM), +exact_matches+ hold the IRI counterparts (QUDT, SI
11
+ # Digital Framework), +quantity_kinds+ reference the quantity kinds this
12
+ # unit measures.
13
+ #
14
+ # Two pragmatic glossarist-side additions beyond the concept-model
15
+ # field set: +short+ (the unitsdb short name — the dataset concept
16
+ # identifier convention), +systems+ (unitsdb unit_system_reference
17
+ # ids, deferred by concept-model as an orthogonal classification
18
+ # dimension but required here because the dataset entry convention
19
+ # maps unit systems to concept domains/groups), and +alt_names+
20
+ # (remaining names per language — the tenant prefLabel/altLabel
21
+ # split; +name+ holds the first unitsdb name per language).
22
+ # Localized names use the glossarist LocalizedString hash convention
23
+ # ({ "eng" => "ampere" }). +prefixes+ carries the
24
+ # UnitsML codes of prefixes applicable to this unit; unitsdb ingest
25
+ # leaves it empty (unitsdb states applicability only implicitly).
26
+ class Unit < Lutaml::Model::Serializable
27
+ attribute :id, :string
28
+ attribute :short, :string
29
+ attribute :name, :hash
30
+ attribute :alt_names, :hash
31
+ attribute :symbol, :string
32
+ attribute :notations, :string, collection: true
33
+ attribute :exact_matches, :string, collection: true
34
+ attribute :systems, :string, collection: true
35
+ attribute :quantity_kinds, Glossarist::ConceptRef, collection: true
36
+ attribute :prefixes, :string, collection: true
37
+ attribute :dimension, :string
38
+ attribute :root, :boolean
39
+ attribute :references, Glossarist::ConceptSource, collection: true
40
+
41
+ key_value do
42
+ map :id, to: :id
43
+ map :short, to: :short
44
+ map :name, to: :name
45
+ map %i[alt_names altNames], to: :alt_names
46
+ map :symbol, to: :symbol
47
+ map :notations, to: :notations
48
+ map %i[exact_matches exactMatches], to: :exact_matches
49
+ map :systems, to: :systems
50
+ map %i[quantity_kinds quantityKinds], to: :quantity_kinds
51
+ map :prefixes, to: :prefixes
52
+ map :dimension, to: :dimension
53
+ map :root, to: :root
54
+ map :references, to: :references
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Glossarist
4
+ module Units
5
+ # A unit prefix — a multiplier prepended to a unit to form multiples
6
+ # and submultiples (SI Brochure chapter 3; binary prefixes per
7
+ # IEC 80000-13).
8
+ #
9
+ # Aligned with concept-model models/units/UnitPrefix.lutaml
10
+ # (concept-model#104): +base+ (10 decimal, 2 binary) and +power+ give
11
+ # the multiplier base**power, which is derived, never stored. The
12
+ # class is named UnitPrefix (not Prefix) after the concept-model
13
+ # rename — gloss:Prefix is the designation-type class.
14
+ # +short+ and +alt_names+ are glossarist-side additions: the dataset
15
+ # concept identifier convention and the remaining names per language.
16
+ # Localized names use the glossarist LocalizedString hash convention
17
+ # ({ "eng" => "kilo" }).
18
+ class UnitPrefix < Lutaml::Model::Serializable
19
+ attribute :id, :string
20
+ attribute :short, :string
21
+ attribute :name, :hash
22
+ attribute :alt_names, :hash
23
+ attribute :symbol, :string
24
+ attribute :notations, :string, collection: true
25
+ attribute :base, :integer
26
+ attribute :power, :integer
27
+ attribute :references, Glossarist::ConceptSource, collection: true
28
+
29
+ key_value do
30
+ map :id, to: :id
31
+ map :short, to: :short
32
+ map :name, to: :name
33
+ map %i[alt_names altNames], to: :alt_names
34
+ map :symbol, to: :symbol
35
+ map :notations, to: :notations
36
+ map :base, to: :base
37
+ map :power, to: :power
38
+ map :references, to: :references
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Glossarist
4
+ # Units/quantities ingest helpers (roadmap 2.5 P3, glossarist/glossarist-server#32).
5
+ #
6
+ # Gives unitsdb-sourced unit/quantity/prefix data first-class glossarist
7
+ # dataset content: {Units::Ingestor} converts a unitsdb data directory
8
+ # (https://github.com/unitsml/unitsdb, parsed via the unitsdb gem) into
9
+ # {Glossarist::ManagedConcept} entries a {Glossarist::GlossaryStore} can
10
+ # ingest like any other dataset.
11
+ #
12
+ # The models mirror the concept-model units module
13
+ # (concept-model#104, models/units/*.lutaml) scoped to the fields the
14
+ # ingest needs; field-level alignment notes live on each model class.
15
+ module Units
16
+ autoload :Unit, "glossarist/units/unit"
17
+ autoload :QuantityKind, "glossarist/units/quantity_kind"
18
+ autoload :UnitPrefix, "glossarist/units/unit_prefix"
19
+ autoload :Ingestor, "glossarist/units/ingestor"
20
+ end
21
+ end
@@ -9,6 +9,9 @@ module Glossarist
9
9
  attribute :term, :string
10
10
  attribute :groups, :string, collection: true
11
11
  attribute :references, :hash, collection: true
12
+ # Plain-Hash default; not exposed to lutaml-model#1272 silent
13
+ # serialization loss because every assignment goes through the
14
+ # `lang_blocks_from` handler's writer (see DefaultMaterialization).
12
15
  attribute :language_blocks, :hash, default: -> { {} }
13
16
 
14
17
  key_value do
@@ -3,6 +3,9 @@
3
3
  module Glossarist
4
4
  module V1
5
5
  class CrossReferences < Lutaml::Model::Serializable
6
+ # Plain-Hash defaults; not exposed to lutaml-model#1272 silent
7
+ # serialization loss because every assignment goes through the
8
+ # `xref_from_yaml` handler's writers (see DefaultMaterialization).
6
9
  attribute :ref_prefix_map, :hash, default: -> { {} }
7
10
  attribute :urn_standard_map, :hash, default: -> { {} }
8
11
 
@@ -4,6 +4,11 @@ module Glossarist
4
4
  module V2
5
5
  class LocalizedConcept < Glossarist::LocalizedConcept
6
6
  attribute :data, V2::ConceptData, default: -> { V2::ConceptData.new }
7
+
8
+ # lutaml-model#1272 hardening — the `attribute :data` re-declaration
9
+ # above regenerates the accessor, shadowing the parent's; re-apply.
10
+ # See DefaultMaterialization.
11
+ prepend DefaultMaterialization
7
12
  end
8
13
  end
9
14
  end
@@ -18,6 +18,11 @@ module Glossarist
18
18
  with: { from: :uuid_from_yaml, to: :uuid_to_yaml }
19
19
  map :sources, to: :sources
20
20
  end
21
+
22
+ # lutaml-model#1272 hardening — the `attribute :data` re-declaration
23
+ # above regenerates the accessor, shadowing the parent's; re-apply.
24
+ # See DefaultMaterialization.
25
+ prepend DefaultMaterialization
21
26
  end
22
27
  end
23
28
  end
@@ -5,6 +5,11 @@ module Glossarist
5
5
  class LocalizedConcept < Glossarist::LocalizedConcept
6
6
  attribute :data, V3::ConceptData, default: -> { V3::ConceptData.new }
7
7
 
8
+ # lutaml-model#1272 hardening — the `attribute :data` re-declaration
9
+ # above regenerates the accessor, shadowing the parent's; re-apply.
10
+ # See DefaultMaterialization.
11
+ prepend DefaultMaterialization
12
+
8
13
  def date_accepted_from_yaml(model, value)
9
14
  return if model.date_accepted
10
15
 
@@ -48,6 +48,11 @@ module Glossarist
48
48
  # relations: intentionally NOT mapped — per-file storage only.
49
49
  end
50
50
 
51
+ # lutaml-model#1272 hardening — the `attribute :data` re-declaration
52
+ # above regenerates the accessor, shadowing the parent's; re-apply.
53
+ # See DefaultMaterialization.
54
+ prepend DefaultMaterialization
55
+
51
56
  def date_accepted_from_yaml(model, value)
52
57
  model.date_accepted = V3::ConceptDate.of_yaml(
53
58
  { "date" => value, "type" => "accepted" },
@@ -4,5 +4,5 @@
4
4
  #
5
5
 
6
6
  module Glossarist
7
- VERSION = "2.14.15"
7
+ VERSION = "2.14.17"
8
8
  end
data/lib/glossarist.rb CHANGED
@@ -53,6 +53,7 @@ module Glossarist
53
53
  autoload :ConceptDocument, "glossarist/concept_document"
54
54
  autoload :ConceptEnricher, "glossarist/concept_enricher"
55
55
  autoload :Config, "glossarist/config"
56
+ autoload :DefaultMaterialization, "glossarist/default_materialization"
56
57
  autoload :LocalizedString, "glossarist/localized_string"
57
58
  autoload :NonConceptEntity, "glossarist/non_concept_entity"
58
59
  autoload :SharedNonConceptEntity, "glossarist/shared_non_concept_entity"
@@ -82,12 +83,14 @@ module Glossarist
82
83
  autoload :Mentions, "glossarist/mentions"
83
84
  autoload :NonVerbRep, "glossarist/non_verb_rep"
84
85
  autoload :Pronunciation, "glossarist/pronunciation"
86
+ autoload :Proposals, "glossarist/proposals"
85
87
  autoload :RelatedConcept, "glossarist/related_concept"
86
88
  autoload :Rdf, "glossarist/rdf"
87
89
  autoload :Sts, "glossarist/sts"
88
90
  autoload :Transforms, "glossarist/transforms"
89
91
  autoload :SchemaMigration, "glossarist/schema_migration"
90
92
  autoload :UrnResolver, "glossarist/urn_resolver"
93
+ autoload :Units, "glossarist/units"
91
94
  autoload :Utilities, "glossarist/utilities"
92
95
  autoload :Validation, "glossarist/validation"
93
96
  autoload :RegisterData, "glossarist/register_data"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glossarist
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.15
4
+ version: 2.14.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-10 00:00:00.000000000 Z
11
+ date: 2026-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: unitsdb
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '2.2'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '2.2'
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: yeptris
169
183
  requirement: !ruby/object:Gem::Requirement
@@ -225,6 +239,8 @@ files:
225
239
  - lib/glossarist/cli/export_command.rb
226
240
  - lib/glossarist/cli/import_command.rb
227
241
  - lib/glossarist/cli/package_command.rb
242
+ - lib/glossarist/cli/proposal_command.rb
243
+ - lib/glossarist/cli/units_import_command.rb
228
244
  - lib/glossarist/cli/upgrade_command.rb
229
245
  - lib/glossarist/cli/validate_command.rb
230
246
  - lib/glossarist/collection.rb
@@ -261,6 +277,7 @@ files:
261
277
  - lib/glossarist/custom_locality.rb
262
278
  - lib/glossarist/dataset_register.rb
263
279
  - lib/glossarist/dataset_validator.rb
280
+ - lib/glossarist/default_materialization.rb
264
281
  - lib/glossarist/designation.rb
265
282
  - lib/glossarist/designation/abbreviation.rb
266
283
  - lib/glossarist/designation/base.rb
@@ -278,6 +295,7 @@ files:
278
295
  - lib/glossarist/errors/cache_version_mismatch_error.rb
279
296
  - lib/glossarist/errors/cli_error.rb
280
297
  - lib/glossarist/errors/invalid_language_code_error.rb
298
+ - lib/glossarist/errors/invalid_proposal_error.rb
281
299
  - lib/glossarist/errors/invalid_type_error.rb
282
300
  - lib/glossarist/errors/load_error.rb
283
301
  - lib/glossarist/errors/parse_error.rb
@@ -308,6 +326,12 @@ files:
308
326
  - lib/glossarist/non_verb_rep.rb
309
327
  - lib/glossarist/non_verbal_reference.rb
310
328
  - lib/glossarist/pronunciation.rb
329
+ - lib/glossarist/proposals.rb
330
+ - lib/glossarist/proposals/change.rb
331
+ - lib/glossarist/proposals/git_bridge.rb
332
+ - lib/glossarist/proposals/github_bridge.rb
333
+ - lib/glossarist/proposals/payload.rb
334
+ - lib/glossarist/proposals/pr_description.rb
311
335
  - lib/glossarist/rdf.rb
312
336
  - lib/glossarist/rdf/deterministic_slug.rb
313
337
  - lib/glossarist/rdf/gloss_citation.rb
@@ -383,6 +407,11 @@ files:
383
407
  - lib/glossarist/transforms.rb
384
408
  - lib/glossarist/transforms/concept_to_gloss_transform.rb
385
409
  - lib/glossarist/transforms/concept_to_tbx_transform.rb
410
+ - lib/glossarist/units.rb
411
+ - lib/glossarist/units/ingestor.rb
412
+ - lib/glossarist/units/quantity_kind.rb
413
+ - lib/glossarist/units/unit.rb
414
+ - lib/glossarist/units/unit_prefix.rb
386
415
  - lib/glossarist/urn_resolver.rb
387
416
  - lib/glossarist/utilities.rb
388
417
  - lib/glossarist/utilities/common_functions.rb