glossarist 2.5.0 → 2.5.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/.gitignore +1 -0
- data/.rubocop_todo.yml +50 -146
- data/CLAUDE.md +33 -7
- data/Gemfile +20 -19
- data/README.adoc +383 -7
- data/TODO.integration/01-gcr-package-cli.md +180 -0
- data/exe/glossarist +1 -53
- data/glossarist.gemspec +1 -0
- 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.rb +15 -8
- data/lib/glossarist/concept.rb +1 -1
- data/lib/glossarist/concept_collector.rb +153 -0
- data/lib/glossarist/concept_data.rb +3 -1
- 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 +101 -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/detailed_definition.rb +1 -1
- 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 +5 -2
- 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/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 +29 -4
- data/relaton-bib-2.0.0.gem +0 -0
- data/relaton-bib-2.1.0.gem +0 -0
- data/relaton-cen-2.0.0.gem +0 -0
- data/relaton-iec-2.0.0.gem +0 -0
- data/relaton-iso-2.0.0.gem +0 -0
- data/relaton-itu-2.0.0.gem +0 -0
- metadata +60 -7
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Glossarist
|
|
4
|
+
module V1
|
|
5
|
+
class Register < Lutaml::Model::Serializable
|
|
6
|
+
attribute :data, :hash, default: -> { {} }
|
|
7
|
+
|
|
8
|
+
key_value do
|
|
9
|
+
map nil, to: :data, with: { from: :data_from, to: :data_to }
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.from_file(path)
|
|
13
|
+
return nil unless File.exist?(path)
|
|
14
|
+
|
|
15
|
+
register = from_yaml(File.read(path))
|
|
16
|
+
return nil unless register.data.is_a?(Hash) && !register.data.empty?
|
|
17
|
+
|
|
18
|
+
register
|
|
19
|
+
rescue Psych::SyntaxError, Lutaml::Model::InvalidFormatError
|
|
20
|
+
nil
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def [](key)
|
|
24
|
+
data[key]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def dig(*keys)
|
|
28
|
+
data.dig(*keys)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def schema_version
|
|
32
|
+
data["schema_version"]&.to_s
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def to_h
|
|
36
|
+
data
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def data_from(model, value)
|
|
40
|
+
model.data = value
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def data_to(model, doc)
|
|
44
|
+
model.data.each do |key, value|
|
|
45
|
+
doc[key] = value
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Glossarist
|
|
4
|
+
class ValidationResult
|
|
5
|
+
attr_reader :errors, :warnings
|
|
6
|
+
|
|
7
|
+
def initialize(errors: [], warnings: [])
|
|
8
|
+
@errors = errors
|
|
9
|
+
@warnings = warnings
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def valid?
|
|
13
|
+
@errors.empty?
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def add_error(message)
|
|
17
|
+
@errors << message
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def add_warning(message)
|
|
21
|
+
@warnings << message
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def merge(other)
|
|
25
|
+
other.errors.each { |e| add_error(e) }
|
|
26
|
+
other.warnings.each { |w| add_warning(w) }
|
|
27
|
+
self
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def to_h
|
|
31
|
+
{
|
|
32
|
+
"valid" => valid?,
|
|
33
|
+
"errors" => errors,
|
|
34
|
+
"warnings" => warnings,
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/glossarist/version.rb
CHANGED
data/lib/glossarist.rb
CHANGED
|
@@ -12,22 +12,39 @@ require_relative "glossarist/glossary_definition"
|
|
|
12
12
|
module Glossarist
|
|
13
13
|
autoload :Asset, "glossarist/asset"
|
|
14
14
|
autoload :Citation, "glossarist/citation"
|
|
15
|
+
autoload :CLI, "glossarist/cli"
|
|
16
|
+
autoload :CollectionConfig, "glossarist/collection_config"
|
|
15
17
|
autoload :Collection, "glossarist/collection"
|
|
16
18
|
autoload :Concept, "glossarist/concept"
|
|
17
19
|
autoload :ConceptData, "glossarist/concept_data"
|
|
20
|
+
autoload :ConceptReference, "glossarist/concept_reference"
|
|
21
|
+
autoload :ReferenceExtractor, "glossarist/reference_extractor"
|
|
22
|
+
autoload :ReferenceResolver, "glossarist/reference_resolver"
|
|
23
|
+
autoload :ResolutionAdapter, "glossarist/resolution_adapter"
|
|
18
24
|
autoload :ConceptDate, "glossarist/concept_date"
|
|
19
25
|
autoload :ConceptManager, "glossarist/concept_manager"
|
|
20
26
|
autoload :ConceptSet, "glossarist/concept_set"
|
|
21
27
|
autoload :ConceptSource, "glossarist/concept_source"
|
|
28
|
+
autoload :ConceptValidator, "glossarist/concept_validator"
|
|
29
|
+
autoload :ConceptCollector, "glossarist/concept_collector"
|
|
30
|
+
autoload :ConceptDocument, "glossarist/concept_document"
|
|
31
|
+
autoload :ConceptEnricher, "glossarist/concept_enricher"
|
|
22
32
|
autoload :Config, "glossarist/config"
|
|
33
|
+
autoload :DatasetValidator, "glossarist/dataset_validator"
|
|
23
34
|
autoload :CustomLocality, "glossarist/custom_locality"
|
|
24
35
|
autoload :DetailedDefinition, "glossarist/detailed_definition"
|
|
25
36
|
autoload :Designation, "glossarist/designation"
|
|
26
37
|
autoload :Error, "glossarist/error"
|
|
27
|
-
autoload :
|
|
28
|
-
autoload :
|
|
29
|
-
autoload :
|
|
30
|
-
autoload :
|
|
38
|
+
autoload :GcrPackage, "glossarist/gcr_package"
|
|
39
|
+
autoload :GcrMetadata, "glossarist/gcr_metadata"
|
|
40
|
+
autoload :GcrStatistics, "glossarist/gcr_statistics"
|
|
41
|
+
autoload :GcrValidator, "glossarist/gcr_validator"
|
|
42
|
+
autoload :InvalidTypeError, "glossarist/error/invalid_type_error"
|
|
43
|
+
autoload :InvalidLanguageCodeError,
|
|
44
|
+
"glossarist/error/invalid_language_code_error"
|
|
45
|
+
autoload :ParseError, "glossarist/error/parse_error"
|
|
46
|
+
autoload :CacheVersionMismatchError,
|
|
47
|
+
"glossarist/error/cache_version_mismatch_error"
|
|
31
48
|
autoload :Locality, "glossarist/locality"
|
|
32
49
|
autoload :LocalizedConcept, "glossarist/localized_concept"
|
|
33
50
|
autoload :ManagedConcept, "glossarist/managed_concept"
|
|
@@ -35,13 +52,21 @@ module Glossarist
|
|
|
35
52
|
autoload :ManagedConceptData, "glossarist/managed_concept_data"
|
|
36
53
|
autoload :NonVerbRep, "glossarist/non_verb_rep"
|
|
37
54
|
autoload :RelatedConcept, "glossarist/related_concept"
|
|
55
|
+
autoload :SchemaMigration, "glossarist/schema_migration"
|
|
56
|
+
autoload :UrnResolver, "glossarist/urn_resolver"
|
|
38
57
|
autoload :Utilities, "glossarist/utilities"
|
|
58
|
+
autoload :RegisterData, "glossarist/register_data"
|
|
59
|
+
autoload :ValidationResult, "glossarist/validation_result"
|
|
60
|
+
autoload :V1, "glossarist/v1"
|
|
39
61
|
end
|
|
40
62
|
|
|
41
63
|
require_relative "glossarist/version"
|
|
42
64
|
require_relative "glossarist/collections"
|
|
43
65
|
|
|
44
66
|
module Glossarist
|
|
67
|
+
LANG_CODES = %w[eng ara deu fra spa ita jpn kor pol por srp swe zho rus fin
|
|
68
|
+
dan nld msa nob nno].freeze
|
|
69
|
+
|
|
45
70
|
def self.configure
|
|
46
71
|
config = Glossarist::Config.instance
|
|
47
72
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: glossarist
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.5.
|
|
4
|
+
version: 2.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: lutaml-model
|
|
@@ -44,6 +43,26 @@ dependencies:
|
|
|
44
43
|
- - "<"
|
|
45
44
|
- !ruby/object:Gem::Version
|
|
46
45
|
version: '3'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: rubyzip
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - ">="
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '2.3'
|
|
53
|
+
- - "<"
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: '3'
|
|
56
|
+
type: :runtime
|
|
57
|
+
prerelease: false
|
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
59
|
+
requirements:
|
|
60
|
+
- - ">="
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: '2.3'
|
|
63
|
+
- - "<"
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '3'
|
|
47
66
|
- !ruby/object:Gem::Dependency
|
|
48
67
|
name: thor
|
|
49
68
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -58,7 +77,6 @@ dependencies:
|
|
|
58
77
|
- - ">="
|
|
59
78
|
- !ruby/object:Gem::Version
|
|
60
79
|
version: '0'
|
|
61
|
-
description:
|
|
62
80
|
email:
|
|
63
81
|
- open.source@ribose.com
|
|
64
82
|
executables:
|
|
@@ -79,13 +97,19 @@ files:
|
|
|
79
97
|
- LICENSE.txt
|
|
80
98
|
- README.adoc
|
|
81
99
|
- Rakefile
|
|
100
|
+
- TODO.integration/01-gcr-package-cli.md
|
|
82
101
|
- config.yml
|
|
83
102
|
- exe/glossarist
|
|
84
103
|
- glossarist.gemspec
|
|
85
104
|
- lib/glossarist.rb
|
|
86
105
|
- lib/glossarist/asset.rb
|
|
87
106
|
- lib/glossarist/citation.rb
|
|
107
|
+
- lib/glossarist/cli.rb
|
|
108
|
+
- lib/glossarist/cli/package_command.rb
|
|
109
|
+
- lib/glossarist/cli/upgrade_command.rb
|
|
110
|
+
- lib/glossarist/cli/validate_command.rb
|
|
88
111
|
- lib/glossarist/collection.rb
|
|
112
|
+
- lib/glossarist/collection_config.rb
|
|
89
113
|
- lib/glossarist/collections.rb
|
|
90
114
|
- lib/glossarist/collections/asset_collection.rb
|
|
91
115
|
- lib/glossarist/collections/bibliography_collection.rb
|
|
@@ -96,13 +120,19 @@ files:
|
|
|
96
120
|
- lib/glossarist/collections/localization_collection.rb
|
|
97
121
|
- lib/glossarist/collections/typed_collection.rb
|
|
98
122
|
- lib/glossarist/concept.rb
|
|
123
|
+
- lib/glossarist/concept_collector.rb
|
|
99
124
|
- lib/glossarist/concept_data.rb
|
|
100
125
|
- lib/glossarist/concept_date.rb
|
|
126
|
+
- lib/glossarist/concept_document.rb
|
|
127
|
+
- lib/glossarist/concept_enricher.rb
|
|
101
128
|
- lib/glossarist/concept_manager.rb
|
|
129
|
+
- lib/glossarist/concept_reference.rb
|
|
102
130
|
- lib/glossarist/concept_set.rb
|
|
103
131
|
- lib/glossarist/concept_source.rb
|
|
132
|
+
- lib/glossarist/concept_validator.rb
|
|
104
133
|
- lib/glossarist/config.rb
|
|
105
134
|
- lib/glossarist/custom_locality.rb
|
|
135
|
+
- lib/glossarist/dataset_validator.rb
|
|
106
136
|
- lib/glossarist/designation.rb
|
|
107
137
|
- lib/glossarist/designation/abbreviation.rb
|
|
108
138
|
- lib/glossarist/designation/base.rb
|
|
@@ -117,6 +147,10 @@ files:
|
|
|
117
147
|
- lib/glossarist/error/invalid_language_code_error.rb
|
|
118
148
|
- lib/glossarist/error/invalid_type_error.rb
|
|
119
149
|
- lib/glossarist/error/parse_error.rb
|
|
150
|
+
- lib/glossarist/gcr_metadata.rb
|
|
151
|
+
- lib/glossarist/gcr_package.rb
|
|
152
|
+
- lib/glossarist/gcr_statistics.rb
|
|
153
|
+
- lib/glossarist/gcr_validator.rb
|
|
120
154
|
- lib/glossarist/glossary_definition.rb
|
|
121
155
|
- lib/glossarist/locality.rb
|
|
122
156
|
- lib/glossarist/localized_concept.rb
|
|
@@ -124,11 +158,32 @@ files:
|
|
|
124
158
|
- lib/glossarist/managed_concept_collection.rb
|
|
125
159
|
- lib/glossarist/managed_concept_data.rb
|
|
126
160
|
- lib/glossarist/non_verb_rep.rb
|
|
161
|
+
- lib/glossarist/reference_extractor.rb
|
|
162
|
+
- lib/glossarist/reference_resolver.rb
|
|
163
|
+
- lib/glossarist/register_data.rb
|
|
127
164
|
- lib/glossarist/related_concept.rb
|
|
165
|
+
- lib/glossarist/resolution_adapter.rb
|
|
166
|
+
- lib/glossarist/resolution_adapter/local.rb
|
|
167
|
+
- lib/glossarist/resolution_adapter/package.rb
|
|
168
|
+
- lib/glossarist/resolution_adapter/remote.rb
|
|
169
|
+
- lib/glossarist/resolution_adapter/route.rb
|
|
170
|
+
- lib/glossarist/schema_migration.rb
|
|
171
|
+
- lib/glossarist/urn_resolver.rb
|
|
128
172
|
- lib/glossarist/utilities.rb
|
|
129
173
|
- lib/glossarist/utilities/common_functions.rb
|
|
130
174
|
- lib/glossarist/utilities/uuid.rb
|
|
175
|
+
- lib/glossarist/v1.rb
|
|
176
|
+
- lib/glossarist/v1/concept.rb
|
|
177
|
+
- lib/glossarist/v1/cross_references.rb
|
|
178
|
+
- lib/glossarist/v1/register.rb
|
|
179
|
+
- lib/glossarist/validation_result.rb
|
|
131
180
|
- lib/glossarist/version.rb
|
|
181
|
+
- relaton-bib-2.0.0.gem
|
|
182
|
+
- relaton-bib-2.1.0.gem
|
|
183
|
+
- relaton-cen-2.0.0.gem
|
|
184
|
+
- relaton-iec-2.0.0.gem
|
|
185
|
+
- relaton-iso-2.0.0.gem
|
|
186
|
+
- relaton-itu-2.0.0.gem
|
|
132
187
|
homepage: https://github.com/glossarist/glossarist-ruby
|
|
133
188
|
licenses:
|
|
134
189
|
- BSD-2-Clause
|
|
@@ -137,7 +192,6 @@ metadata:
|
|
|
137
192
|
source_code_uri: https://github.com/glossarist/glossarist-ruby
|
|
138
193
|
bug_tracker_uri: https://github.com/glossarist/glossarist-ruby/issues
|
|
139
194
|
rubygems_mfa_required: 'true'
|
|
140
|
-
post_install_message:
|
|
141
195
|
rdoc_options: []
|
|
142
196
|
require_paths:
|
|
143
197
|
- lib
|
|
@@ -152,8 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
152
206
|
- !ruby/object:Gem::Version
|
|
153
207
|
version: '0'
|
|
154
208
|
requirements: []
|
|
155
|
-
rubygems_version: 3.
|
|
156
|
-
signing_key:
|
|
209
|
+
rubygems_version: 3.6.9
|
|
157
210
|
specification_version: 4
|
|
158
211
|
summary: Concept models for terminology glossaries conforming ISO 10241-1.
|
|
159
212
|
test_files: []
|