glossarist 2.6.6 → 2.6.7
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/README.adoc +90 -29
- data/glossarist.gemspec +2 -0
- data/lib/glossarist/citation.rb +26 -123
- data/lib/glossarist/cli/compare_command.rb +106 -0
- data/lib/glossarist/cli/export_command.rb +11 -14
- data/lib/glossarist/cli/validate_command.rb +111 -20
- data/lib/glossarist/cli.rb +18 -0
- data/lib/glossarist/collections/bibliography_collection.rb +4 -2
- data/lib/glossarist/collections/localization_collection.rb +2 -0
- data/lib/glossarist/comparison_result.rb +35 -0
- data/lib/glossarist/concept_collector.rb +44 -0
- data/lib/glossarist/concept_comparator.rb +72 -0
- data/lib/glossarist/concept_data.rb +16 -0
- data/lib/glossarist/concept_diff.rb +15 -0
- data/lib/glossarist/concept_document.rb +11 -0
- data/lib/glossarist/concept_manager.rb +19 -5
- data/lib/glossarist/concept_ref.rb +13 -0
- data/lib/glossarist/concept_validator.rb +6 -1
- data/lib/glossarist/context_configuration.rb +90 -0
- data/lib/glossarist/dataset_validator.rb +8 -4
- data/lib/glossarist/designation/prefix.rb +17 -0
- data/lib/glossarist/designation/suffix.rb +17 -0
- data/lib/glossarist/gcr_metadata.rb +7 -14
- data/lib/glossarist/gcr_package.rb +35 -23
- data/lib/glossarist/gcr_validator.rb +38 -17
- data/lib/glossarist/localized_concept.rb +8 -0
- data/lib/glossarist/managed_concept.rb +39 -6
- data/lib/glossarist/managed_concept_data.rb +2 -1
- data/lib/glossarist/rdf/ext/jsonld_transform_ext.rb +208 -0
- data/lib/glossarist/rdf/ext/mapping_ext.rb +37 -0
- data/lib/glossarist/rdf/ext/mapping_rule_ext.rb +27 -0
- data/lib/glossarist/rdf/ext/member_rule_ext.rb +34 -0
- data/lib/glossarist/rdf/ext/turtle_transform_ext.rb +222 -0
- data/lib/glossarist/rdf/ext.rb +39 -0
- data/lib/glossarist/rdf/gloss_citation.rb +36 -0
- data/lib/glossarist/rdf/gloss_concept.rb +58 -0
- data/lib/glossarist/rdf/gloss_concept_date.rb +24 -0
- data/lib/glossarist/rdf/gloss_concept_reference.rb +29 -0
- data/lib/glossarist/rdf/gloss_concept_source.rb +37 -0
- data/lib/glossarist/rdf/gloss_designation.rb +146 -0
- data/lib/glossarist/rdf/gloss_detailed_definition.rb +24 -0
- data/lib/glossarist/rdf/gloss_grammar_info.rb +57 -0
- data/lib/glossarist/rdf/gloss_locality.rb +25 -0
- data/lib/glossarist/rdf/gloss_localized_concept.rb +67 -0
- data/lib/glossarist/rdf/gloss_non_verbal_rep.rb +31 -0
- data/lib/glossarist/rdf/gloss_pronunciation.rb +32 -0
- data/lib/glossarist/rdf/gloss_reference.rb +55 -0
- data/lib/glossarist/rdf/namespaces/glossarist_namespace.rb +12 -0
- data/lib/glossarist/rdf/namespaces/iso_thes_namespace.rb +12 -0
- data/lib/glossarist/rdf/namespaces/owl_namespace.rb +12 -0
- data/lib/glossarist/rdf/namespaces/prov_namespace.rb +12 -0
- data/lib/glossarist/rdf/namespaces/rdf_namespace.rb +12 -0
- data/lib/glossarist/rdf/namespaces/skosxl_namespace.rb +12 -0
- data/lib/glossarist/rdf/namespaces.rb +8 -2
- data/lib/glossarist/rdf/relationships.rb +19 -0
- data/lib/glossarist/rdf/v3/configuration.rb +15 -0
- data/lib/glossarist/rdf/v3.rb +79 -0
- data/lib/glossarist/rdf.rb +22 -2
- data/lib/glossarist/reference_extractor.rb +12 -19
- data/lib/glossarist/reference_resolver.rb +3 -3
- data/lib/glossarist/related_concept.rb +2 -10
- data/lib/glossarist/schema_migration.rb +39 -0
- data/lib/glossarist/sts/term_mapper.rb +2 -2
- data/lib/glossarist/transforms/concept_to_gloss_transform.rb +355 -0
- data/lib/glossarist/transforms.rb +2 -2
- data/lib/glossarist/v1/concept.rb +17 -17
- data/lib/glossarist/v2/citation.rb +36 -0
- data/lib/glossarist/v2/concept_data.rb +46 -0
- data/lib/glossarist/v2/concept_document.rb +18 -0
- data/lib/glossarist/v2/concept_ref.rb +8 -0
- data/lib/glossarist/v2/concept_source.rb +16 -0
- data/lib/glossarist/v2/configuration.rb +13 -0
- data/lib/glossarist/v2/detailed_definition.rb +14 -0
- data/lib/glossarist/v2/localized_concept.rb +9 -0
- data/lib/glossarist/v2/managed_concept.rb +25 -0
- data/lib/glossarist/v2/managed_concept_data.rb +49 -0
- data/lib/glossarist/v2/related_concept.rb +15 -0
- data/lib/glossarist/v2.rb +28 -0
- data/lib/glossarist/v3/bibliography_entry.rb +19 -0
- data/lib/glossarist/v3/bibliography_file.rb +27 -0
- data/lib/glossarist/v3/citation.rb +30 -0
- data/lib/glossarist/v3/concept_data.rb +46 -0
- data/lib/glossarist/v3/concept_document.rb +18 -0
- data/lib/glossarist/v3/concept_ref.rb +8 -0
- data/lib/glossarist/v3/concept_source.rb +16 -0
- data/lib/glossarist/v3/configuration.rb +13 -0
- data/lib/glossarist/v3/detailed_definition.rb +14 -0
- data/lib/glossarist/v3/image_entry.rb +21 -0
- data/lib/glossarist/v3/image_file.rb +31 -0
- data/lib/glossarist/v3/localized_concept.rb +9 -0
- data/lib/glossarist/v3/managed_concept.rb +26 -0
- data/lib/glossarist/v3/managed_concept_data.rb +34 -0
- data/lib/glossarist/v3/related_concept.rb +15 -0
- data/lib/glossarist/v3.rb +36 -0
- data/lib/glossarist/validation/bibliography_index.rb +61 -30
- data/lib/glossarist/validation/rules/asciidoc_xref_rule.rb +2 -15
- data/lib/glossarist/validation/rules/authoritative_source_rule.rb +2 -15
- data/lib/glossarist/validation/rules/base.rb +5 -0
- data/lib/glossarist/validation/rules/bibliography_yaml_rule.rb +2 -3
- data/lib/glossarist/validation/rules/citation_completeness_rule.rb +5 -27
- data/lib/glossarist/validation/rules/dataset_context.rb +8 -3
- data/lib/glossarist/validation/rules/date_validity_rule.rb +1 -1
- data/lib/glossarist/validation/rules/designation_status_rule.rb +0 -1
- data/lib/glossarist/validation/rules/designation_type_rule.rb +1 -5
- data/lib/glossarist/validation/rules/domain_ref_rule.rb +37 -0
- data/lib/glossarist/validation/rules/domain_target_rule.rb +56 -0
- data/lib/glossarist/validation/rules/gcr_context.rb +12 -13
- data/lib/glossarist/validation/rules/image_reference_rule.rb +2 -17
- data/lib/glossarist/validation/rules/locality_completeness_rule.rb +58 -0
- data/lib/glossarist/validation/rules/localization_consistency_rule.rb +72 -0
- data/lib/glossarist/validation/rules/localization_presence_rule.rb +1 -1
- data/lib/glossarist/validation/rules/model_validity_rule.rb +71 -0
- data/lib/glossarist/validation/rules/orphaned_bibliography_rule.rb +1 -13
- data/lib/glossarist/validation/rules/orphaned_images_rule.rb +16 -11
- data/lib/glossarist/validation/rules/ref_shape_rule.rb +68 -0
- data/lib/glossarist/validation/rules/related_concept_cycle_rule.rb +1 -3
- data/lib/glossarist/validation/rules/related_concept_symmetry_rule.rb +1 -3
- data/lib/glossarist/validation/rules/related_concept_target_rule.rb +64 -0
- data/lib/glossarist/validation/rules/schema_version_rule.rb +41 -0
- data/lib/glossarist/validation/rules/source_type_rule.rb +1 -15
- data/lib/glossarist/validation/rules/source_urn_format_rule.rb +65 -0
- data/lib/glossarist/validation/rules/uuid_format_rule.rb +33 -0
- data/lib/glossarist/validation/rules.rb +10 -43
- data/lib/glossarist/validation/validation_issue.rb +14 -11
- data/lib/glossarist/validation_result.rb +12 -22
- data/lib/glossarist/version.rb +1 -1
- data/lib/glossarist.rb +9 -0
- data/memory/project-status.md +43 -0
- data/scripts/migrate_dataset.rb +180 -0
- data/scripts/migrate_isotc204_to_v3.rb +134 -0
- data/scripts/migrate_isotc211_to_v3.rb +153 -0
- data/scripts/migrate_osgeo_to_v3.rb +155 -0
- data/scripts/upgrade_dataset_to_v3.rb +47 -0
- metadata +111 -6
- data/TODO.integration/01-gcr-package-cli.md +0 -180
- data/lib/glossarist/rdf/skos_concept.rb +0 -43
- data/lib/glossarist/rdf/skos_vocabulary.rb +0 -25
- data/lib/glossarist/transforms/concept_to_skos_transform.rb +0 -131
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.6.
|
|
4
|
+
version: 2.6.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: 0.8.5
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: paint
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '2.3'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '2.3'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: relaton
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -78,6 +92,20 @@ dependencies:
|
|
|
78
92
|
- - "~>"
|
|
79
93
|
- !ruby/object:Gem::Version
|
|
80
94
|
version: 0.5.6
|
|
95
|
+
- !ruby/object:Gem::Dependency
|
|
96
|
+
name: table_tennis
|
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
|
98
|
+
requirements:
|
|
99
|
+
- - "~>"
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: '0.0'
|
|
102
|
+
type: :runtime
|
|
103
|
+
prerelease: false
|
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
105
|
+
requirements:
|
|
106
|
+
- - "~>"
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
version: '0.0'
|
|
81
109
|
- !ruby/object:Gem::Dependency
|
|
82
110
|
name: tbx
|
|
83
111
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -127,7 +155,6 @@ files:
|
|
|
127
155
|
- LICENSE.txt
|
|
128
156
|
- README.adoc
|
|
129
157
|
- Rakefile
|
|
130
|
-
- TODO.integration/01-gcr-package-cli.md
|
|
131
158
|
- config.yml
|
|
132
159
|
- exe/glossarist
|
|
133
160
|
- glossarist.gemspec
|
|
@@ -137,6 +164,7 @@ files:
|
|
|
137
164
|
- lib/glossarist/bibliographic_reference.rb
|
|
138
165
|
- lib/glossarist/citation.rb
|
|
139
166
|
- lib/glossarist/cli.rb
|
|
167
|
+
- lib/glossarist/cli/compare_command.rb
|
|
140
168
|
- lib/glossarist/cli/export_command.rb
|
|
141
169
|
- lib/glossarist/cli/import_command.rb
|
|
142
170
|
- lib/glossarist/cli/package_command.rb
|
|
@@ -153,18 +181,23 @@ files:
|
|
|
153
181
|
- lib/glossarist/collections/detailed_definition_collection.rb
|
|
154
182
|
- lib/glossarist/collections/localization_collection.rb
|
|
155
183
|
- lib/glossarist/collections/typed_collection.rb
|
|
184
|
+
- lib/glossarist/comparison_result.rb
|
|
156
185
|
- lib/glossarist/concept.rb
|
|
157
186
|
- lib/glossarist/concept_collector.rb
|
|
187
|
+
- lib/glossarist/concept_comparator.rb
|
|
158
188
|
- lib/glossarist/concept_data.rb
|
|
159
189
|
- lib/glossarist/concept_date.rb
|
|
190
|
+
- lib/glossarist/concept_diff.rb
|
|
160
191
|
- lib/glossarist/concept_document.rb
|
|
161
192
|
- lib/glossarist/concept_enricher.rb
|
|
162
193
|
- lib/glossarist/concept_manager.rb
|
|
194
|
+
- lib/glossarist/concept_ref.rb
|
|
163
195
|
- lib/glossarist/concept_reference.rb
|
|
164
196
|
- lib/glossarist/concept_set.rb
|
|
165
197
|
- lib/glossarist/concept_source.rb
|
|
166
198
|
- lib/glossarist/concept_validator.rb
|
|
167
199
|
- lib/glossarist/config.rb
|
|
200
|
+
- lib/glossarist/context_configuration.rb
|
|
168
201
|
- lib/glossarist/custom_locality.rb
|
|
169
202
|
- lib/glossarist/dataset_validator.rb
|
|
170
203
|
- lib/glossarist/designation.rb
|
|
@@ -174,6 +207,8 @@ files:
|
|
|
174
207
|
- lib/glossarist/designation/grammar_info.rb
|
|
175
208
|
- lib/glossarist/designation/graphical_symbol.rb
|
|
176
209
|
- lib/glossarist/designation/letter_symbol.rb
|
|
210
|
+
- lib/glossarist/designation/prefix.rb
|
|
211
|
+
- lib/glossarist/designation/suffix.rb
|
|
177
212
|
- lib/glossarist/designation/symbol.rb
|
|
178
213
|
- lib/glossarist/detailed_definition.rb
|
|
179
214
|
- lib/glossarist/error.rb
|
|
@@ -194,12 +229,38 @@ files:
|
|
|
194
229
|
- lib/glossarist/non_verb_rep.rb
|
|
195
230
|
- lib/glossarist/pronunciation.rb
|
|
196
231
|
- lib/glossarist/rdf.rb
|
|
232
|
+
- lib/glossarist/rdf/ext.rb
|
|
233
|
+
- lib/glossarist/rdf/ext/jsonld_transform_ext.rb
|
|
234
|
+
- lib/glossarist/rdf/ext/mapping_ext.rb
|
|
235
|
+
- lib/glossarist/rdf/ext/mapping_rule_ext.rb
|
|
236
|
+
- lib/glossarist/rdf/ext/member_rule_ext.rb
|
|
237
|
+
- lib/glossarist/rdf/ext/turtle_transform_ext.rb
|
|
238
|
+
- lib/glossarist/rdf/gloss_citation.rb
|
|
239
|
+
- lib/glossarist/rdf/gloss_concept.rb
|
|
240
|
+
- lib/glossarist/rdf/gloss_concept_date.rb
|
|
241
|
+
- lib/glossarist/rdf/gloss_concept_reference.rb
|
|
242
|
+
- lib/glossarist/rdf/gloss_concept_source.rb
|
|
243
|
+
- lib/glossarist/rdf/gloss_designation.rb
|
|
244
|
+
- lib/glossarist/rdf/gloss_detailed_definition.rb
|
|
245
|
+
- lib/glossarist/rdf/gloss_grammar_info.rb
|
|
246
|
+
- lib/glossarist/rdf/gloss_locality.rb
|
|
247
|
+
- lib/glossarist/rdf/gloss_localized_concept.rb
|
|
248
|
+
- lib/glossarist/rdf/gloss_non_verbal_rep.rb
|
|
249
|
+
- lib/glossarist/rdf/gloss_pronunciation.rb
|
|
250
|
+
- lib/glossarist/rdf/gloss_reference.rb
|
|
197
251
|
- lib/glossarist/rdf/localized_literal.rb
|
|
198
252
|
- lib/glossarist/rdf/namespaces.rb
|
|
199
253
|
- lib/glossarist/rdf/namespaces/dcterms_namespace.rb
|
|
254
|
+
- lib/glossarist/rdf/namespaces/glossarist_namespace.rb
|
|
255
|
+
- lib/glossarist/rdf/namespaces/iso_thes_namespace.rb
|
|
256
|
+
- lib/glossarist/rdf/namespaces/owl_namespace.rb
|
|
257
|
+
- lib/glossarist/rdf/namespaces/prov_namespace.rb
|
|
258
|
+
- lib/glossarist/rdf/namespaces/rdf_namespace.rb
|
|
200
259
|
- lib/glossarist/rdf/namespaces/skos_namespace.rb
|
|
201
|
-
- lib/glossarist/rdf/
|
|
202
|
-
- lib/glossarist/rdf/
|
|
260
|
+
- lib/glossarist/rdf/namespaces/skosxl_namespace.rb
|
|
261
|
+
- lib/glossarist/rdf/relationships.rb
|
|
262
|
+
- lib/glossarist/rdf/v3.rb
|
|
263
|
+
- lib/glossarist/rdf/v3/configuration.rb
|
|
203
264
|
- lib/glossarist/reference_extractor.rb
|
|
204
265
|
- lib/glossarist/reference_resolver.rb
|
|
205
266
|
- lib/glossarist/register_data.rb
|
|
@@ -219,7 +280,7 @@ files:
|
|
|
219
280
|
- lib/glossarist/sts/term_extractor.rb
|
|
220
281
|
- lib/glossarist/sts/term_mapper.rb
|
|
221
282
|
- lib/glossarist/transforms.rb
|
|
222
|
-
- lib/glossarist/transforms/
|
|
283
|
+
- lib/glossarist/transforms/concept_to_gloss_transform.rb
|
|
223
284
|
- lib/glossarist/transforms/concept_to_tbx_transform.rb
|
|
224
285
|
- lib/glossarist/urn_resolver.rb
|
|
225
286
|
- lib/glossarist/utilities.rb
|
|
@@ -229,6 +290,34 @@ files:
|
|
|
229
290
|
- lib/glossarist/v1/concept.rb
|
|
230
291
|
- lib/glossarist/v1/cross_references.rb
|
|
231
292
|
- lib/glossarist/v1/register.rb
|
|
293
|
+
- lib/glossarist/v2.rb
|
|
294
|
+
- lib/glossarist/v2/citation.rb
|
|
295
|
+
- lib/glossarist/v2/concept_data.rb
|
|
296
|
+
- lib/glossarist/v2/concept_document.rb
|
|
297
|
+
- lib/glossarist/v2/concept_ref.rb
|
|
298
|
+
- lib/glossarist/v2/concept_source.rb
|
|
299
|
+
- lib/glossarist/v2/configuration.rb
|
|
300
|
+
- lib/glossarist/v2/detailed_definition.rb
|
|
301
|
+
- lib/glossarist/v2/localized_concept.rb
|
|
302
|
+
- lib/glossarist/v2/managed_concept.rb
|
|
303
|
+
- lib/glossarist/v2/managed_concept_data.rb
|
|
304
|
+
- lib/glossarist/v2/related_concept.rb
|
|
305
|
+
- lib/glossarist/v3.rb
|
|
306
|
+
- lib/glossarist/v3/bibliography_entry.rb
|
|
307
|
+
- lib/glossarist/v3/bibliography_file.rb
|
|
308
|
+
- lib/glossarist/v3/citation.rb
|
|
309
|
+
- lib/glossarist/v3/concept_data.rb
|
|
310
|
+
- lib/glossarist/v3/concept_document.rb
|
|
311
|
+
- lib/glossarist/v3/concept_ref.rb
|
|
312
|
+
- lib/glossarist/v3/concept_source.rb
|
|
313
|
+
- lib/glossarist/v3/configuration.rb
|
|
314
|
+
- lib/glossarist/v3/detailed_definition.rb
|
|
315
|
+
- lib/glossarist/v3/image_entry.rb
|
|
316
|
+
- lib/glossarist/v3/image_file.rb
|
|
317
|
+
- lib/glossarist/v3/localized_concept.rb
|
|
318
|
+
- lib/glossarist/v3/managed_concept.rb
|
|
319
|
+
- lib/glossarist/v3/managed_concept_data.rb
|
|
320
|
+
- lib/glossarist/v3/related_concept.rb
|
|
232
321
|
- lib/glossarist/validation.rb
|
|
233
322
|
- lib/glossarist/validation/asset_index.rb
|
|
234
323
|
- lib/glossarist/validation/bibliography_index.rb
|
|
@@ -251,6 +340,8 @@ files:
|
|
|
251
340
|
- lib/glossarist/validation/rules/definition_content_rule.rb
|
|
252
341
|
- lib/glossarist/validation/rules/designation_status_rule.rb
|
|
253
342
|
- lib/glossarist/validation/rules/designation_type_rule.rb
|
|
343
|
+
- lib/glossarist/validation/rules/domain_ref_rule.rb
|
|
344
|
+
- lib/glossarist/validation/rules/domain_target_rule.rb
|
|
254
345
|
- lib/glossarist/validation/rules/duplicate_term_rule.rb
|
|
255
346
|
- lib/glossarist/validation/rules/entry_status_rule.rb
|
|
256
347
|
- lib/glossarist/validation/rules/filename_id_rule.rb
|
|
@@ -260,26 +351,40 @@ files:
|
|
|
260
351
|
- lib/glossarist/validation/rules/language_code_format_rule.rb
|
|
261
352
|
- lib/glossarist/validation/rules/language_coverage_rule.rb
|
|
262
353
|
- lib/glossarist/validation/rules/language_list_rule.rb
|
|
354
|
+
- lib/glossarist/validation/rules/locality_completeness_rule.rb
|
|
355
|
+
- lib/glossarist/validation/rules/localization_consistency_rule.rb
|
|
263
356
|
- lib/glossarist/validation/rules/localization_presence_rule.rb
|
|
357
|
+
- lib/glossarist/validation/rules/model_validity_rule.rb
|
|
264
358
|
- lib/glossarist/validation/rules/orphaned_bibliography_rule.rb
|
|
265
359
|
- lib/glossarist/validation/rules/orphaned_images_rule.rb
|
|
266
360
|
- lib/glossarist/validation/rules/orphaned_l10n_files_rule.rb
|
|
267
361
|
- lib/glossarist/validation/rules/preferred_term_rule.rb
|
|
362
|
+
- lib/glossarist/validation/rules/ref_shape_rule.rb
|
|
268
363
|
- lib/glossarist/validation/rules/registry.rb
|
|
269
364
|
- lib/glossarist/validation/rules/related_concept_cycle_rule.rb
|
|
270
365
|
- lib/glossarist/validation/rules/related_concept_rule.rb
|
|
271
366
|
- lib/glossarist/validation/rules/related_concept_symmetry_rule.rb
|
|
367
|
+
- lib/glossarist/validation/rules/related_concept_target_rule.rb
|
|
368
|
+
- lib/glossarist/validation/rules/schema_version_rule.rb
|
|
272
369
|
- lib/glossarist/validation/rules/source_type_rule.rb
|
|
370
|
+
- lib/glossarist/validation/rules/source_urn_format_rule.rb
|
|
273
371
|
- lib/glossarist/validation/rules/terms_presence_rule.rb
|
|
372
|
+
- lib/glossarist/validation/rules/uuid_format_rule.rb
|
|
274
373
|
- lib/glossarist/validation/validation_issue.rb
|
|
275
374
|
- lib/glossarist/validation_result.rb
|
|
276
375
|
- lib/glossarist/version.rb
|
|
376
|
+
- memory/project-status.md
|
|
277
377
|
- relaton-bib-2.0.0.gem
|
|
278
378
|
- relaton-bib-2.1.0.gem
|
|
279
379
|
- relaton-cen-2.0.0.gem
|
|
280
380
|
- relaton-iec-2.0.0.gem
|
|
281
381
|
- relaton-iso-2.0.0.gem
|
|
282
382
|
- relaton-itu-2.0.0.gem
|
|
383
|
+
- scripts/migrate_dataset.rb
|
|
384
|
+
- scripts/migrate_isotc204_to_v3.rb
|
|
385
|
+
- scripts/migrate_isotc211_to_v3.rb
|
|
386
|
+
- scripts/migrate_osgeo_to_v3.rb
|
|
387
|
+
- scripts/upgrade_dataset_to_v3.rb
|
|
283
388
|
homepage: https://github.com/glossarist/glossarist-ruby
|
|
284
389
|
licenses:
|
|
285
390
|
- BSD-2-Clause
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
# 01 — GCR Packaging CLI with Versioning
|
|
2
|
-
|
|
3
|
-
## Goal
|
|
4
|
-
|
|
5
|
-
The `glossarist` Ruby gem provides the canonical way to build versioned GCR packages from concept datasets. Each glossary repo uses `glossarist package` in CI to publish GCR releases.
|
|
6
|
-
|
|
7
|
-
## Current State
|
|
8
|
-
|
|
9
|
-
- CLI has `package`, `upgrade`, `validate` commands (via Thor)
|
|
10
|
-
- `GcrPackage.create` / `GcrPackage.load` handle ZIP I/O
|
|
11
|
-
- `GcrMetadata` generates metadata with statistics
|
|
12
|
-
- `SchemaMigration` handles v0→v1 harmonization
|
|
13
|
-
- Missing: `shortname` and `version` fields in GcrMetadata
|
|
14
|
-
- Missing: v2 format support in `PackageCommand`
|
|
15
|
-
|
|
16
|
-
## Status
|
|
17
|
-
|
|
18
|
-
Tasks 1–5 are **implemented** on branch `fix/gemfile-lutaml-model-substring`. Remaining: task 6 (publish gem to RubyGems).
|
|
19
|
-
|
|
20
|
-
## Tasks
|
|
21
|
-
|
|
22
|
-
### 1. Add `shortname` and `version` to `GcrMetadata`
|
|
23
|
-
|
|
24
|
-
Edit `lib/glossarist/gcr_metadata.rb`:
|
|
25
|
-
|
|
26
|
-
```ruby
|
|
27
|
-
attr_accessor :shortname, :version, :title, :description, :owner, :tags,
|
|
28
|
-
:concept_count, :languages,
|
|
29
|
-
:created_at, :glossarist_version, :schema_version,
|
|
30
|
-
:statistics, :homepage, :repository, :license
|
|
31
|
-
|
|
32
|
-
def initialize(attrs = {})
|
|
33
|
-
@shortname = attrs[:shortname]
|
|
34
|
-
@version = attrs[:version]
|
|
35
|
-
# ... existing fields ...
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def self.from_concepts(concepts, register_data: nil, options: {})
|
|
39
|
-
stats = GcrStatistics.from_concepts(concepts)
|
|
40
|
-
new(
|
|
41
|
-
shortname: options[:shortname],
|
|
42
|
-
version: options[:version],
|
|
43
|
-
title: options[:title] || register_data&.dig("name"),
|
|
44
|
-
# ... existing fields ...
|
|
45
|
-
)
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def to_h
|
|
49
|
-
h = {
|
|
50
|
-
"shortname" => shortname,
|
|
51
|
-
"version" => version,
|
|
52
|
-
"title" => title,
|
|
53
|
-
# ... existing fields ...
|
|
54
|
-
}
|
|
55
|
-
h.compact
|
|
56
|
-
end
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### 2. Add `--shortname` and `--version` CLI options
|
|
60
|
-
|
|
61
|
-
Edit `lib/glossarist/cli.rb`:
|
|
62
|
-
|
|
63
|
-
```ruby
|
|
64
|
-
desc "package DIR", "Create a .gcr ZIP archive from a dataset"
|
|
65
|
-
option :output, aliases: :o, required: true, desc: "Output .gcr file path"
|
|
66
|
-
option :shortname, type: :string, required: true, desc: "Machine-readable dataset ID"
|
|
67
|
-
option :version, type: :string, required: true, desc: "Semantic version (e.g. 1.0.0)"
|
|
68
|
-
option :title, type: :string, desc: "Dataset title"
|
|
69
|
-
option :description, type: :string, desc: "Dataset description"
|
|
70
|
-
option :owner, type: :string, desc: "Dataset owner"
|
|
71
|
-
option :register_yaml, type: :string, desc: "Path to register.yaml"
|
|
72
|
-
option :tags, type: :array, desc: "Tags for the dataset"
|
|
73
|
-
def package(dir)
|
|
74
|
-
# ...
|
|
75
|
-
end
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### 3. Add v2 format support to `PackageCommand`
|
|
79
|
-
|
|
80
|
-
Edit `lib/glossarist/cli/package_command.rb`:
|
|
81
|
-
|
|
82
|
-
```ruby
|
|
83
|
-
def collect_concepts
|
|
84
|
-
if v1_concepts?
|
|
85
|
-
collect_v1_concepts
|
|
86
|
-
elsif v2_concepts?
|
|
87
|
-
collect_v2_concepts
|
|
88
|
-
else
|
|
89
|
-
[]
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def v1_concepts?
|
|
94
|
-
concepts_dir = File.join(@dir, "concepts")
|
|
95
|
-
File.directory?(concepts_dir) && Dir.glob(File.join(concepts_dir, "*.yaml")).any?
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def v2_concepts?
|
|
99
|
-
File.directory?(File.join(@dir, "geolexica-v2"))
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def collect_v2_concepts
|
|
103
|
-
collection = Glossarist::ManagedConceptCollection.new
|
|
104
|
-
manager = Glossarist::ConceptManager.new(path: File.join(@dir, "geolexica-v2"))
|
|
105
|
-
manager.load_from_files(collection: collection)
|
|
106
|
-
|
|
107
|
-
collection.map { |concept| concept_to_v1_hash(concept) }
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
def concept_to_v1_hash(concept)
|
|
111
|
-
hash = { "termid" => concept.data.id.to_s }
|
|
112
|
-
concept.localizations.each do |lang, l10n|
|
|
113
|
-
hash[lang] = localized_to_hash(l10n)
|
|
114
|
-
end
|
|
115
|
-
hash["term"] = preferred_designation(hash["eng"]&.dig("terms")) || ""
|
|
116
|
-
hash
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
def localized_to_hash(l10n)
|
|
120
|
-
h = {}
|
|
121
|
-
h["terms"] = l10n.designations.map(&:to_h) if l10n.designations.any?
|
|
122
|
-
h["definition"] = l10n.definition.map { |d| { "content" => d.content } } if l10n.definition.any?
|
|
123
|
-
h["notes"] = l10n.notes.map { |n| { "content" => n.content } } if l10n.notes.any?
|
|
124
|
-
h["examples"] = l10n.examples.map { |e| { "content" => e.content } } if l10n.examples.any?
|
|
125
|
-
h["sources"] = l10n.sources.map(&:to_h) if l10n.sources.any?
|
|
126
|
-
h["language_code"] = l10n.language_code if l10n.language_code
|
|
127
|
-
h["entry_status"] = l10n.entry_status if l10n.entry_status
|
|
128
|
-
h["dates"] = l10n.dates.map(&:to_h) if l10n.dates.any?
|
|
129
|
-
h
|
|
130
|
-
end
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### 4. Auto-derive shortname from directory name
|
|
134
|
-
|
|
135
|
-
If `--shortname` is not provided, derive from:
|
|
136
|
-
1. `register.yaml` → `register["shortname"]` or `register["id"]`
|
|
137
|
-
2. Directory basename
|
|
138
|
-
3. Raise error if none available
|
|
139
|
-
|
|
140
|
-
### 5. Validate filename matches metadata
|
|
141
|
-
|
|
142
|
-
In `GcrPackage.validate`, check that the filename pattern `{shortname}-{version}.gcr` matches the `shortname` and `version` in metadata.yaml.
|
|
143
|
-
|
|
144
|
-
### 6. Publish gem
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
gem build glossarist.gemspec
|
|
148
|
-
gem push glossarist-2.6.0.gem
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## CLI Usage
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
# Install
|
|
155
|
-
gem install glossarist
|
|
156
|
-
|
|
157
|
-
# Package (v1 format)
|
|
158
|
-
glossarist package ./isotc204-glossary \
|
|
159
|
-
--shortname isotc204 --version 1.0.0 \
|
|
160
|
-
-o isotc204-1.0.0.gcr \
|
|
161
|
-
--title "ISO/TC 204 ITS Vocabulary" --owner "ISO/TC 204"
|
|
162
|
-
|
|
163
|
-
# Package (v2 format, auto-detected)
|
|
164
|
-
glossarist package ./isotc211-glossary \
|
|
165
|
-
--shortname isotc211 --version 2.3.0 \
|
|
166
|
-
-o isotc211-2.3.0.gcr \
|
|
167
|
-
--title "ISO/TC 211 Multi-Lingual Glossary" --owner "ISO/TC 211"
|
|
168
|
-
|
|
169
|
-
# Validate
|
|
170
|
-
glossarist validate isotc204-1.0.0.gcr
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
## Acceptance Criteria
|
|
174
|
-
|
|
175
|
-
- [x] `GcrMetadata` includes `shortname` and `version` fields
|
|
176
|
-
- [x] `glossarist package --shortname X --version Y` produces `{X}-{Y}.gcr`
|
|
177
|
-
- [x] `metadata.yaml` contains `shortname` and `version`
|
|
178
|
-
- [x] `glossarist validate` checks metadata has required fields
|
|
179
|
-
- [x] Works with both v1 (`concepts/*.yaml`) and v2 (`geolexica-v2/*.yaml`) datasets
|
|
180
|
-
- [ ] Gem published to RubyGems
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "lutaml/turtle"
|
|
4
|
-
require "lutaml/jsonld"
|
|
5
|
-
|
|
6
|
-
module Glossarist
|
|
7
|
-
module Rdf
|
|
8
|
-
class SkosConcept < Lutaml::Model::Serializable
|
|
9
|
-
attribute :code, :string
|
|
10
|
-
attribute :labels, LocalizedLiteral, collection: true
|
|
11
|
-
attribute :definitions, LocalizedLiteral, collection: true
|
|
12
|
-
attribute :alt_labels, LocalizedLiteral, collection: true
|
|
13
|
-
attribute :scope_notes, LocalizedLiteral, collection: true
|
|
14
|
-
attribute :sources, :string, collection: true
|
|
15
|
-
attribute :domain, :string
|
|
16
|
-
attribute :date_accepted, :string
|
|
17
|
-
|
|
18
|
-
rdf do
|
|
19
|
-
namespace Namespaces::SkosNamespace, Namespaces::DctermsNamespace
|
|
20
|
-
|
|
21
|
-
subject { |c| "https://glossarist.org/concept/#{c.code}" }
|
|
22
|
-
type "skos:Concept"
|
|
23
|
-
|
|
24
|
-
predicate :notation, namespace: Namespaces::SkosNamespace,
|
|
25
|
-
to: :code
|
|
26
|
-
predicate :prefLabel, namespace: Namespaces::SkosNamespace,
|
|
27
|
-
to: :labels, lang_tagged: true
|
|
28
|
-
predicate :definition, namespace: Namespaces::SkosNamespace,
|
|
29
|
-
to: :definitions, lang_tagged: true
|
|
30
|
-
predicate :altLabel, namespace: Namespaces::SkosNamespace,
|
|
31
|
-
to: :alt_labels, lang_tagged: true
|
|
32
|
-
predicate :scopeNote, namespace: Namespaces::SkosNamespace,
|
|
33
|
-
to: :scope_notes, lang_tagged: true
|
|
34
|
-
predicate :subject, namespace: Namespaces::DctermsNamespace,
|
|
35
|
-
to: :domain
|
|
36
|
-
predicate :source, namespace: Namespaces::DctermsNamespace,
|
|
37
|
-
to: :sources
|
|
38
|
-
predicate :dateAccepted, namespace: Namespaces::DctermsNamespace,
|
|
39
|
-
to: :date_accepted
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "lutaml/turtle"
|
|
4
|
-
require "lutaml/jsonld"
|
|
5
|
-
|
|
6
|
-
module Glossarist
|
|
7
|
-
module Rdf
|
|
8
|
-
class SkosVocabulary < Lutaml::Model::Serializable
|
|
9
|
-
attribute :id, :string
|
|
10
|
-
attribute :title, :string
|
|
11
|
-
attribute :concepts, SkosConcept, collection: true
|
|
12
|
-
|
|
13
|
-
rdf do
|
|
14
|
-
namespace Namespaces::SkosNamespace, Namespaces::DctermsNamespace
|
|
15
|
-
|
|
16
|
-
subject { |v| "https://glossarist.org/vocab/#{v.id}" }
|
|
17
|
-
type "skos:ConceptScheme"
|
|
18
|
-
|
|
19
|
-
predicate :prefLabel, namespace: Namespaces::SkosNamespace, to: :title
|
|
20
|
-
|
|
21
|
-
members :concepts
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Glossarist
|
|
4
|
-
module Transforms
|
|
5
|
-
class ConceptToSkosTransform
|
|
6
|
-
def self.transform(managed_concept, options = {})
|
|
7
|
-
new(managed_concept, options).build
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def self.transform_document(concepts, options = {})
|
|
11
|
-
Rdf::SkosVocabulary.new(
|
|
12
|
-
id: options[:shortname] || "glossary",
|
|
13
|
-
title: options[:title],
|
|
14
|
-
concepts: concepts.map { |c| transform(c, options) },
|
|
15
|
-
)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def initialize(managed_concept, options = {})
|
|
19
|
-
@concept = managed_concept
|
|
20
|
-
@options = options
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def build
|
|
24
|
-
Rdf::SkosConcept.new(
|
|
25
|
-
code: concept_code,
|
|
26
|
-
labels: build_labels,
|
|
27
|
-
definitions: build_definitions,
|
|
28
|
-
alt_labels: build_alt_labels,
|
|
29
|
-
scope_notes: build_scope_notes,
|
|
30
|
-
domain: build_domain,
|
|
31
|
-
sources: build_sources,
|
|
32
|
-
date_accepted: build_date_accepted,
|
|
33
|
-
)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
private
|
|
37
|
-
|
|
38
|
-
attr_reader :concept, :options
|
|
39
|
-
|
|
40
|
-
def concept_code
|
|
41
|
-
concept.data&.id || concept.identifier
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def build_labels
|
|
45
|
-
each_localization.filter_map do |lang, l10n|
|
|
46
|
-
term = l10n.preferred_terms&.first || l10n.terms&.first
|
|
47
|
-
next unless term
|
|
48
|
-
|
|
49
|
-
Rdf::LocalizedLiteral.new(
|
|
50
|
-
value: term.designation.to_s,
|
|
51
|
-
language_code: lang,
|
|
52
|
-
)
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def build_alt_labels
|
|
57
|
-
each_localization.flat_map do |lang, l10n|
|
|
58
|
-
preferred_term = l10n.preferred_terms&.first || l10n.terms&.first
|
|
59
|
-
(l10n.terms || []).reject do |t|
|
|
60
|
-
t == preferred_term
|
|
61
|
-
end.filter_map do |term|
|
|
62
|
-
next unless term.designation
|
|
63
|
-
|
|
64
|
-
Rdf::LocalizedLiteral.new(
|
|
65
|
-
value: term.designation.to_s,
|
|
66
|
-
language_code: lang,
|
|
67
|
-
)
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
def build_definitions
|
|
73
|
-
each_localization.filter_map do |lang, l10n|
|
|
74
|
-
content = l10n.data&.definition&.first&.content
|
|
75
|
-
next unless content
|
|
76
|
-
|
|
77
|
-
Rdf::LocalizedLiteral.new(
|
|
78
|
-
value: content.to_s,
|
|
79
|
-
language_code: lang,
|
|
80
|
-
)
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def build_scope_notes
|
|
85
|
-
each_localization.filter_map do |lang, l10n|
|
|
86
|
-
note = l10n.data&.notes&.first&.content
|
|
87
|
-
next unless note
|
|
88
|
-
|
|
89
|
-
Rdf::LocalizedLiteral.new(
|
|
90
|
-
value: note.to_s,
|
|
91
|
-
language_code: lang,
|
|
92
|
-
)
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
def build_domain
|
|
97
|
-
l10n = concept.localizations.first
|
|
98
|
-
l10n&.data&.domain
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
def build_sources
|
|
102
|
-
each_localization.flat_map do |_lang, l10n|
|
|
103
|
-
Array(l10n.data&.sources).select(&:authoritative?).filter_map do |src|
|
|
104
|
-
origin = src.origin
|
|
105
|
-
next unless origin
|
|
106
|
-
|
|
107
|
-
origin.ref || origin.text
|
|
108
|
-
end
|
|
109
|
-
end.uniq
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def build_date_accepted
|
|
113
|
-
date = concept.date_accepted
|
|
114
|
-
return unless date
|
|
115
|
-
|
|
116
|
-
date.date&.iso8601
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
def each_localization
|
|
120
|
-
return enum_for(:each_localization) unless block_given?
|
|
121
|
-
|
|
122
|
-
concept.localizations.each do |l10n|
|
|
123
|
-
lang = l10n.language_code || l10n.data&.language_code
|
|
124
|
-
next unless lang
|
|
125
|
-
|
|
126
|
-
yield lang, l10n
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
end
|
|
131
|
-
end
|