glossarist 2.4.0 → 2.5.1
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/.gitignore +1 -0
- data/.rubocop_todo.yml +50 -146
- data/CLAUDE.md +85 -0
- data/Gemfile +26 -5
- data/README.adoc +383 -7
- data/TODO.integration/01-gcr-package-cli.md +180 -0
- data/exe/glossarist +1 -53
- data/glossarist.gemspec +3 -2
- data/lib/glossarist/asset.rb +1 -1
- data/lib/glossarist/citation.rb +1 -1
- data/lib/glossarist/cli/package_command.rb +32 -0
- data/lib/glossarist/cli/upgrade_command.rb +34 -0
- data/lib/glossarist/cli/validate_command.rb +56 -0
- data/lib/glossarist/cli.rb +105 -0
- data/lib/glossarist/collection_config.rb +23 -0
- data/lib/glossarist/collections/concept_source_collection.rb +9 -0
- data/lib/glossarist/collections/detailed_definition_collection.rb +18 -0
- data/lib/glossarist/collections/localization_collection.rb +37 -0
- data/lib/glossarist/collections/typed_collection.rb +26 -0
- data/lib/glossarist/collections.rb +21 -4
- data/lib/glossarist/concept.rb +1 -1
- data/lib/glossarist/concept_collector.rb +153 -0
- data/lib/glossarist/concept_data.rb +15 -8
- data/lib/glossarist/concept_date.rb +1 -1
- data/lib/glossarist/concept_document.rb +29 -0
- data/lib/glossarist/concept_enricher.rb +34 -0
- data/lib/glossarist/concept_manager.rb +31 -49
- data/lib/glossarist/concept_reference.rb +45 -0
- data/lib/glossarist/concept_source.rb +1 -1
- data/lib/glossarist/concept_validator.rb +114 -0
- data/lib/glossarist/custom_locality.rb +1 -1
- data/lib/glossarist/dataset_validator.rb +69 -0
- data/lib/glossarist/designation/abbreviation.rb +1 -1
- data/lib/glossarist/designation/base.rb +11 -4
- data/lib/glossarist/designation/expression.rb +1 -1
- data/lib/glossarist/designation/grammar_info.rb +1 -1
- data/lib/glossarist/designation/graphical_symbol.rb +1 -1
- data/lib/glossarist/designation/letter_symbol.rb +1 -1
- data/lib/glossarist/designation/symbol.rb +2 -2
- data/lib/glossarist/designation.rb +8 -11
- data/lib/glossarist/detailed_definition.rb +1 -1
- data/lib/glossarist/error.rb +2 -5
- data/lib/glossarist/gcr_metadata.rb +87 -0
- data/lib/glossarist/gcr_package.rb +223 -0
- data/lib/glossarist/gcr_statistics.rb +35 -0
- data/lib/glossarist/gcr_validator.rb +98 -0
- data/lib/glossarist/locality.rb +1 -1
- data/lib/glossarist/localized_concept.rb +12 -1
- data/lib/glossarist/managed_concept.rb +1 -1
- data/lib/glossarist/managed_concept_data.rb +8 -5
- data/lib/glossarist/non_verb_rep.rb +1 -1
- data/lib/glossarist/reference_extractor.rb +227 -0
- data/lib/glossarist/reference_resolver.rb +169 -0
- data/lib/glossarist/register_data.rb +39 -0
- data/lib/glossarist/related_concept.rb +1 -1
- data/lib/glossarist/resolution_adapter/local.rb +73 -0
- data/lib/glossarist/resolution_adapter/package.rb +22 -0
- data/lib/glossarist/resolution_adapter/remote.rb +60 -0
- data/lib/glossarist/resolution_adapter/route.rb +34 -0
- data/lib/glossarist/resolution_adapter.rb +14 -0
- data/lib/glossarist/schema_migration.rb +334 -0
- data/lib/glossarist/urn_resolver.rb +71 -0
- data/lib/glossarist/utilities.rb +6 -2
- data/lib/glossarist/v1/concept.rb +81 -0
- data/lib/glossarist/v1/cross_references.rb +41 -0
- data/lib/glossarist/v1/register.rb +50 -0
- data/lib/glossarist/v1.rb +9 -0
- data/lib/glossarist/validation_result.rb +38 -0
- data/lib/glossarist/version.rb +1 -1
- data/lib/glossarist.rb +54 -24
- metadata +62 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37d088868a3cacb2d02ec05fb6498cc3b053e8663e3e23e20f8b5ac0f5687dd2
|
|
4
|
+
data.tar.gz: bb1a08101aaaa0400332b9d4bb4c10383386a30e2b5624a612c5abbc1d23ca12
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df4af9ceee95f45084e27d38d4430040f1f9620b7a71f6a669c1db508b6bb99a14440238289c81dc273d2de792fed42fb3615960b1f831c9bae0722245d5ef03
|
|
7
|
+
data.tar.gz: edf63cb34ed349a15870412f078bf576326cdb62614d730650779f782452fa24c6de682b156e0ad1a9b7fce5a9a76b6fd803c41a5f092af0e8c84a430c78d10f
|
data/.gitignore
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,125 +1,23 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2026-
|
|
3
|
+
# on 2026-05-04 09:39:17 UTC using RuboCop version 1.86.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count: 1
|
|
10
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
-
Gemspec/RequireMFA:
|
|
12
|
-
Exclude:
|
|
13
|
-
- 'glossarist.gemspec'
|
|
14
|
-
|
|
15
9
|
# Offense count: 1
|
|
16
10
|
Gemspec/RequiredRubyVersion:
|
|
17
11
|
Exclude:
|
|
18
12
|
- 'glossarist.gemspec'
|
|
19
13
|
|
|
20
|
-
# Offense count:
|
|
21
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
22
|
-
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
23
|
-
# SupportedStyles: with_first_argument, with_fixed_indentation
|
|
24
|
-
Layout/ArgumentAlignment:
|
|
25
|
-
Exclude:
|
|
26
|
-
- 'lib/glossarist/concept.rb'
|
|
27
|
-
- 'lib/glossarist/concept_data.rb'
|
|
28
|
-
- 'lib/glossarist/concept_manager.rb'
|
|
29
|
-
- 'lib/glossarist/designation/grammar_info.rb'
|
|
30
|
-
- 'lib/glossarist/managed_concept.rb'
|
|
31
|
-
- 'spec/features/v2_serialization_spec.rb'
|
|
32
|
-
- 'spec/unit/locality_spec.rb'
|
|
33
|
-
|
|
34
|
-
# Offense count: 2
|
|
35
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
36
|
-
# Configuration parameters: EnforcedStyleAlignWith.
|
|
37
|
-
# SupportedStylesAlignWith: either, start_of_block, start_of_line
|
|
38
|
-
Layout/BlockAlignment:
|
|
39
|
-
Exclude:
|
|
40
|
-
- 'spec/features/v2_serialization_spec.rb'
|
|
41
|
-
|
|
42
|
-
# Offense count: 2
|
|
43
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
44
|
-
Layout/BlockEndNewline:
|
|
45
|
-
Exclude:
|
|
46
|
-
- 'spec/features/v2_serialization_spec.rb'
|
|
47
|
-
|
|
48
|
-
# Offense count: 2
|
|
49
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
50
|
-
Layout/ClosingParenthesisIndentation:
|
|
51
|
-
Exclude:
|
|
52
|
-
- 'spec/features/multi_content_yaml_serialization_spec.rb'
|
|
53
|
-
- 'spec/features/v2_serialization_spec.rb'
|
|
54
|
-
|
|
55
|
-
# Offense count: 2
|
|
56
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
57
|
-
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
58
|
-
# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
|
|
59
|
-
Layout/FirstArgumentIndentation:
|
|
60
|
-
Exclude:
|
|
61
|
-
- 'spec/features/multi_content_yaml_serialization_spec.rb'
|
|
62
|
-
- 'spec/features/v2_serialization_spec.rb'
|
|
63
|
-
|
|
64
|
-
# Offense count: 10
|
|
65
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
66
|
-
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
|
67
|
-
# SupportedHashRocketStyles: key, separator, table
|
|
68
|
-
# SupportedColonStyles: key, separator, table
|
|
69
|
-
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
|
70
|
-
Layout/HashAlignment:
|
|
71
|
-
Exclude:
|
|
72
|
-
- 'exe/glossarist'
|
|
73
|
-
- 'lib/glossarist/concept_data.rb'
|
|
74
|
-
- 'lib/glossarist/designation/grammar_info.rb'
|
|
75
|
-
- 'spec/unit/locality_spec.rb'
|
|
76
|
-
|
|
77
|
-
# Offense count: 1
|
|
78
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
79
|
-
# Configuration parameters: EnforcedStyle.
|
|
80
|
-
# SupportedStyles: normal, indented_internal_methods
|
|
81
|
-
Layout/IndentationConsistency:
|
|
82
|
-
Exclude:
|
|
83
|
-
- 'glossarist.gemspec'
|
|
84
|
-
|
|
85
|
-
# Offense count: 4
|
|
86
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
87
|
-
# Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
|
|
88
|
-
# SupportedStylesAlignWith: start_of_line, relative_to_receiver
|
|
89
|
-
Layout/IndentationWidth:
|
|
90
|
-
Exclude:
|
|
91
|
-
- 'spec/features/v2_serialization_spec.rb'
|
|
92
|
-
|
|
93
|
-
# Offense count: 90
|
|
14
|
+
# Offense count: 196
|
|
94
15
|
# This cop supports safe autocorrection (--autocorrect).
|
|
95
16
|
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
|
|
96
17
|
# URISchemes: http, https
|
|
97
18
|
Layout/LineLength:
|
|
98
19
|
Enabled: false
|
|
99
20
|
|
|
100
|
-
# Offense count: 2
|
|
101
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
102
|
-
# Configuration parameters: EnforcedStyle.
|
|
103
|
-
# SupportedStyles: symmetrical, new_line, same_line
|
|
104
|
-
Layout/MultilineMethodCallBraceLayout:
|
|
105
|
-
Exclude:
|
|
106
|
-
- 'spec/features/multi_content_yaml_serialization_spec.rb'
|
|
107
|
-
- 'spec/features/v2_serialization_spec.rb'
|
|
108
|
-
|
|
109
|
-
# Offense count: 20
|
|
110
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
111
|
-
# Configuration parameters: AllowInHeredoc.
|
|
112
|
-
Layout/TrailingWhitespace:
|
|
113
|
-
Exclude:
|
|
114
|
-
- 'exe/glossarist'
|
|
115
|
-
- 'lib/glossarist/concept.rb'
|
|
116
|
-
- 'lib/glossarist/concept_data.rb'
|
|
117
|
-
- 'lib/glossarist/concept_manager.rb'
|
|
118
|
-
- 'lib/glossarist/designation/grammar_info.rb'
|
|
119
|
-
- 'lib/glossarist/managed_concept.rb'
|
|
120
|
-
- 'spec/features/v2_serialization_spec.rb'
|
|
121
|
-
- 'spec/unit/locality_spec.rb'
|
|
122
|
-
|
|
123
21
|
# Offense count: 1
|
|
124
22
|
# Configuration parameters: AllowedMethods.
|
|
125
23
|
# AllowedMethods: enums
|
|
@@ -132,53 +30,72 @@ Lint/DuplicateMethods:
|
|
|
132
30
|
Exclude:
|
|
133
31
|
- 'lib/glossarist/managed_concept.rb'
|
|
134
32
|
|
|
135
|
-
# Offense count:
|
|
136
|
-
# This cop supports
|
|
137
|
-
|
|
33
|
+
# Offense count: 1
|
|
34
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
35
|
+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
|
|
36
|
+
# NotImplementedExceptions: NotImplementedError
|
|
37
|
+
Lint/UnusedMethodArgument:
|
|
138
38
|
Exclude:
|
|
139
|
-
- 'lib/glossarist/
|
|
39
|
+
- 'lib/glossarist/dataset_validator.rb'
|
|
140
40
|
|
|
141
|
-
# Offense count:
|
|
41
|
+
# Offense count: 18
|
|
142
42
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
|
143
43
|
Metrics/AbcSize:
|
|
144
44
|
Exclude:
|
|
45
|
+
- 'lib/glossarist/cli/package_command.rb'
|
|
46
|
+
- 'lib/glossarist/cli/validate_command.rb'
|
|
145
47
|
- 'lib/glossarist/concept_manager.rb'
|
|
48
|
+
- 'lib/glossarist/gcr_metadata.rb'
|
|
49
|
+
- 'lib/glossarist/gcr_package.rb'
|
|
50
|
+
- 'lib/glossarist/reference_extractor.rb'
|
|
51
|
+
- 'lib/glossarist/reference_resolver.rb'
|
|
52
|
+
- 'lib/glossarist/resolution_adapter/local.rb'
|
|
53
|
+
- 'lib/glossarist/schema_migration.rb'
|
|
146
54
|
- 'lib/glossarist/utilities/uuid.rb'
|
|
55
|
+
- 'spec/unit/concept_collector_spec.rb'
|
|
147
56
|
|
|
148
|
-
# Offense count:
|
|
57
|
+
# Offense count: 1
|
|
58
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
59
|
+
# AllowedMethods: refine
|
|
60
|
+
Metrics/BlockLength:
|
|
61
|
+
Max: 28
|
|
62
|
+
|
|
63
|
+
# Offense count: 15
|
|
149
64
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
150
65
|
Metrics/CyclomaticComplexity:
|
|
151
66
|
Exclude:
|
|
67
|
+
- 'lib/glossarist/concept_validator.rb'
|
|
152
68
|
- 'lib/glossarist/designation/expression.rb'
|
|
69
|
+
- 'lib/glossarist/gcr_metadata.rb'
|
|
153
70
|
- 'lib/glossarist/managed_concept.rb'
|
|
71
|
+
- 'lib/glossarist/reference_extractor.rb'
|
|
72
|
+
- 'lib/glossarist/reference_resolver.rb'
|
|
73
|
+
- 'lib/glossarist/resolution_adapter/local.rb'
|
|
74
|
+
- 'lib/glossarist/schema_migration.rb'
|
|
154
75
|
|
|
155
|
-
# Offense count:
|
|
76
|
+
# Offense count: 31
|
|
156
77
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
157
78
|
Metrics/MethodLength:
|
|
158
|
-
Max:
|
|
79
|
+
Max: 42
|
|
159
80
|
|
|
160
|
-
# Offense count:
|
|
81
|
+
# Offense count: 12
|
|
161
82
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
162
83
|
Metrics/PerceivedComplexity:
|
|
163
84
|
Exclude:
|
|
85
|
+
- 'lib/glossarist/concept_validator.rb'
|
|
164
86
|
- 'lib/glossarist/designation/expression.rb'
|
|
87
|
+
- 'lib/glossarist/gcr_metadata.rb'
|
|
88
|
+
- 'lib/glossarist/reference_extractor.rb'
|
|
89
|
+
- 'lib/glossarist/reference_resolver.rb'
|
|
90
|
+
- 'lib/glossarist/resolution_adapter/local.rb'
|
|
91
|
+
- 'lib/glossarist/schema_migration.rb'
|
|
165
92
|
|
|
166
|
-
# Offense count:
|
|
167
|
-
#
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
- 'spec/unit/collection_spec.rb'
|
|
171
|
-
|
|
172
|
-
# Offense count: 3
|
|
173
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
174
|
-
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
|
|
175
|
-
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
|
|
176
|
-
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
|
177
|
-
# FunctionalMethods: let, let!, subject, watch
|
|
178
|
-
# AllowedMethods: lambda, proc, it
|
|
179
|
-
Style/BlockDelimiters:
|
|
93
|
+
# Offense count: 6
|
|
94
|
+
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
|
95
|
+
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
|
|
96
|
+
Naming/MethodParameterName:
|
|
180
97
|
Exclude:
|
|
181
|
-
- '
|
|
98
|
+
- 'lib/glossarist/schema_migration.rb'
|
|
182
99
|
|
|
183
100
|
# Offense count: 6
|
|
184
101
|
# This cop supports safe autocorrection (--autocorrect).
|
|
@@ -188,28 +105,15 @@ Style/FormatStringToken:
|
|
|
188
105
|
EnforcedStyle: unannotated
|
|
189
106
|
|
|
190
107
|
# Offense count: 1
|
|
191
|
-
#
|
|
192
|
-
Style/
|
|
108
|
+
# Configuration parameters: AllowedClasses.
|
|
109
|
+
Style/OneClassPerFile:
|
|
193
110
|
Exclude:
|
|
194
|
-
- 'spec
|
|
111
|
+
- 'spec/**/*'
|
|
112
|
+
- 'test/**/*'
|
|
113
|
+
- 'lib/glossarist.rb'
|
|
195
114
|
|
|
196
115
|
# Offense count: 1
|
|
197
116
|
# Configuration parameters: Max.
|
|
198
117
|
Style/SafeNavigationChainLength:
|
|
199
118
|
Exclude:
|
|
200
119
|
- 'lib/glossarist/managed_concept.rb'
|
|
201
|
-
|
|
202
|
-
# Offense count: 2
|
|
203
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
204
|
-
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
|
205
|
-
# SupportedStyles: single_quotes, double_quotes
|
|
206
|
-
Style/StringLiterals:
|
|
207
|
-
Exclude:
|
|
208
|
-
- 'glossarist.gemspec'
|
|
209
|
-
|
|
210
|
-
# Offense count: 2
|
|
211
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
212
|
-
Style/SuperArguments:
|
|
213
|
-
Exclude:
|
|
214
|
-
- 'lib/glossarist/designation/base.rb'
|
|
215
|
-
- 'lib/glossarist/designation/expression.rb'
|
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Build & Test Commands
|
|
6
|
+
|
|
7
|
+
- `bundle install` — install dependencies
|
|
8
|
+
- `bundle exec rspec` — run all tests
|
|
9
|
+
- `bundle exec rspec spec/unit/citation_spec.rb` — run a single test file
|
|
10
|
+
- `bundle exec rspec spec/unit/citation_spec.rb:12` — run a single test by line number
|
|
11
|
+
- `bundle exec rake` — runs `bundle exec rspec` (default rake task)
|
|
12
|
+
- `bundle exec rubocop` — lint
|
|
13
|
+
|
|
14
|
+
## Architecture
|
|
15
|
+
|
|
16
|
+
Glossarist is a Ruby gem implementing the [Glossarist concept model](https://github.com/glossarist/concept-model) (ISO 10241-1). It provides classes for managing terminology glossaries with multi-language support, serialization to/from YAML, and bibliography integration via Relaton.
|
|
17
|
+
|
|
18
|
+
All model classes use `Lutaml::Model::Serializable` for serialization.
|
|
19
|
+
|
|
20
|
+
### Core Model Hierarchy
|
|
21
|
+
|
|
22
|
+
- **`ManagedConceptCollection`** (`managed_concept_collection.rb`) — top-level enumerable collection of ManagedConcepts. Entry point for loading/saving glossaries via `ConceptManager`.
|
|
23
|
+
- **`ManagedConcept`** (`managed_concept.rb`) — a managed concept with `ManagedConceptData` (groups, localized_concepts map, sources), related concepts, dates, and status. Delegates localization via `add_l10n`/`localization(lang)`.
|
|
24
|
+
- **`Concept`** (`concept.rb`) — base concept with `ConceptData` (definition, terms/designations, notes, examples, sources, dates, language_code). Parent of `LocalizedConcept`.
|
|
25
|
+
- **`LocalizedConcept`** (`localized_concept.rb`) — extends `Concept` with `classification`, `entry_status`, `review_type`.
|
|
26
|
+
- **`ConceptData`** (`concept_data.rb`) — the data payload inside `Concept`: definition, terms, examples, notes, sources, language_code. Uses `DetailedDefinition` collections for definition/examples/notes.
|
|
27
|
+
- **`ManagedConceptData`** (`managed_concept_data.rb`) — the data payload inside `ManagedConcept`: id, localized_concepts hash (lang_code => uuid), groups, sources.
|
|
28
|
+
|
|
29
|
+
### UUID Generation
|
|
30
|
+
|
|
31
|
+
Concepts use deterministic UUID v5 (SHA-1) derived from their serialized YAML content and the OID namespace (`Utilities::UUID`). This means a concept's UUID is stable across sessions as long as its data doesn't change.
|
|
32
|
+
|
|
33
|
+
### Designation (STI-like pattern)
|
|
34
|
+
|
|
35
|
+
`Designation::Base` (`designation/base.rb`) uses a self-referencing factory pattern (`of_yaml`) that dispatches to subclasses based on `type` field: `Expression`, `Symbol`, `Abbreviation`, `GraphicalSymbol`, `LetterSymbol`. The bi-directional mapping is in `SERIALIZED_TYPES` (`designation.rb`).
|
|
36
|
+
|
|
37
|
+
### YAML Serialization
|
|
38
|
+
|
|
39
|
+
- **`ConceptManager`** (`concept_manager.rb`) — handles file I/O. Supports two storage formats:
|
|
40
|
+
1. Separate `concept/` and `localized_concept/` directories (or `localized-concept/` with dashes)
|
|
41
|
+
2. Grouped: concept + localized concepts in a single YAML stream file
|
|
42
|
+
- Supports both camelCase and snake_case keys in YAML (e.g., `localizedConcepts` / `localized_concepts`) using `%i[key1 key2]` mapping syntax.
|
|
43
|
+
- Also supports V1 format (`concept-*.yaml` files at root level).
|
|
44
|
+
|
|
45
|
+
### Configuration & Extensibility
|
|
46
|
+
|
|
47
|
+
- **`Config`** (`config.rb`) — singleton that holds registered classes for `:localized_concept` and `:managed_concept`. Allows swapping implementations via `register_class`.
|
|
48
|
+
- **`GlossaryDefinition`** (`glossary_definition.rb`) — loads enum values (concept statuses, source types, etc.) from `config.yml`.
|
|
49
|
+
- A `glossarist.yaml` file in the working directory can register extension attributes.
|
|
50
|
+
|
|
51
|
+
### Collections
|
|
52
|
+
|
|
53
|
+
Custom collection classes in `collections/` extend `Lutaml::Model::Collection`:
|
|
54
|
+
- **`LocalizationCollection`** — keyed by `language_code`, used for `ManagedConceptData#localizations`.
|
|
55
|
+
- **`DetailedDefinitionCollection`**, **`ConceptSourceCollection`** — typed collections for ConceptData fields.
|
|
56
|
+
- **`BibliographyCollection`** — extends `Relaton::Db` for bibliography caching with cache version checking.
|
|
57
|
+
- **`AssetCollection`**, **`Collection`** (base enumerable), **`DesignationCollection`**.
|
|
58
|
+
|
|
59
|
+
### GCR Packaging
|
|
60
|
+
|
|
61
|
+
Three classes handle glossary concept registry (GCR) ZIP packages:
|
|
62
|
+
- **`GcrPackage`** (`gcr_package.rb`) — creates/loads/validates ZIP archives containing `metadata.yaml`, `register.yaml`, and `concepts/*.yaml` entries.
|
|
63
|
+
- **`GcrMetadata`** (`gcr_metadata.rb`) — package metadata (shortname, version, languages, statistics). Built from concepts via `GcrMetadata.from_concepts`.
|
|
64
|
+
- **`GcrStatistics`** (`gcr_statistics.rb`) — computes stats (total concepts, languages, concepts by status) from concept data.
|
|
65
|
+
- **`SchemaMigration`** (`schema_migration.rb`) — migrates concepts from v0 (legacy IEV format) to v1, normalizing definitions, dates, entry statuses, and extracting inline references.
|
|
66
|
+
- **`ValidationResult`** (`validation_result.rb`) — simple errors/warnings container for package validation.
|
|
67
|
+
|
|
68
|
+
### CLI
|
|
69
|
+
|
|
70
|
+
The `exe/glossarist` executable uses Thor. Currently provides `generate_latex` which converts concepts to LaTeX glossary entries via `ConceptSet`.
|
|
71
|
+
|
|
72
|
+
### Dependencies
|
|
73
|
+
|
|
74
|
+
- `lutaml-model` (~> 0.8) — serialization framework (YAML/XML)
|
|
75
|
+
- `relaton` (>= 2.0.0, < 3) — bibliography database integration
|
|
76
|
+
- `thor` — CLI commands
|
|
77
|
+
|
|
78
|
+
## Gemfile Notes
|
|
79
|
+
|
|
80
|
+
The Gemfile overrides relaton gems from git branches for lutaml-model 0.8 compatibility:
|
|
81
|
+
- 5 repos use `fix/lutaml-model-0.8` branches (relaton-bib, relaton-iso, relaton-3gpp, relaton-bipm, relaton-bsi)
|
|
82
|
+
- 5 repos use `lutaml-integration` branches (relaton-calconnect, relaton-ccsds, relaton-cen, relaton-iec, relaton-itu)
|
|
83
|
+
- Released 2.0.0 gems have untyped lutaml-model attributes that fail with 0.8+
|
|
84
|
+
- relaton-bib 2.1.0 is released but sub-gems pin `~> 2.0.0`, blocking 2.1.0 adoption until upstream updates constraints
|
|
85
|
+
- Remove git overrides once relaton gems release versions with lutaml-model 0.8 support
|
data/Gemfile
CHANGED
|
@@ -2,12 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
source "https://rubygems.org"
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
gem "
|
|
8
|
-
gem "
|
|
5
|
+
gemspec
|
|
6
|
+
|
|
7
|
+
gem "canon"
|
|
8
|
+
gem "lutaml-model", "~> 0.8.0"
|
|
9
|
+
gem "rake", "~> 13.0"
|
|
10
|
+
gem "rspec", "~> 3.0"
|
|
11
|
+
gem "rubocop"
|
|
9
12
|
gem "rubocop-performance"
|
|
10
13
|
gem "rubocop-rake"
|
|
11
14
|
gem "rubocop-rspec"
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
# Override relaton gems with lutaml-model 0.8 compatible versions.
|
|
17
|
+
# Released 2.0.0 gems have untyped lutaml-model attributes that fail with 0.8+.
|
|
18
|
+
# fix/lutaml-model-0.8 branches keep version 2.0.0 (compatible) + lutaml-model ~> 0.8.
|
|
19
|
+
# lutaml-integration branches also have typed attributes and work with relaton-bib ~> 2.0.0.
|
|
20
|
+
# TODO: Remove once relaton gems release versions with lutaml-model 0.8 support.
|
|
21
|
+
gem "relaton-3gpp", github: "relaton/relaton-3gpp",
|
|
22
|
+
branch: "fix/lutaml-model-0.8"
|
|
23
|
+
gem "relaton-bib", github: "relaton/relaton-bib", branch: "fix/lutaml-model-0.8"
|
|
24
|
+
gem "relaton-bipm", github: "relaton/relaton-bipm",
|
|
25
|
+
branch: "fix/lutaml-model-0.8"
|
|
26
|
+
gem "relaton-bsi", github: "relaton/relaton-bsi", branch: "fix/lutaml-model-0.8"
|
|
27
|
+
gem "relaton-calconnect", github: "relaton/relaton-calconnect",
|
|
28
|
+
branch: "lutaml-integration"
|
|
29
|
+
gem "relaton-ccsds", github: "relaton/relaton-ccsds",
|
|
30
|
+
branch: "lutaml-integration"
|
|
31
|
+
gem "relaton-cen", github: "relaton/relaton-cen", branch: "lutaml-integration"
|
|
32
|
+
gem "relaton-iec", github: "relaton/relaton-iec", branch: "lutaml-integration"
|
|
33
|
+
gem "relaton-iso", github: "relaton/relaton-iso", branch: "fix/lutaml-model-0.8"
|
|
34
|
+
gem "relaton-itu", github: "relaton/relaton-itu", branch: "lutaml-integration"
|