glossarist 2.8.2 → 2.8.4
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 +413 -63
- data/Gemfile +1 -0
- data/glossarist.gemspec +1 -1
- data/lib/glossarist/bibliography_data.rb +41 -0
- data/lib/glossarist/bibliography_entry.rb +13 -0
- data/lib/glossarist/citation.rb +8 -2
- data/lib/glossarist/cli/export_command.rb +10 -5
- data/lib/glossarist/cli/validate_command.rb +21 -5
- data/lib/glossarist/collection.rb +2 -2
- data/lib/glossarist/collections/bibliography_collection.rb +2 -1
- data/lib/glossarist/collections/collection.rb +2 -2
- data/lib/glossarist/collections/localization_collection.rb +4 -4
- data/lib/glossarist/concept_collector.rb +6 -6
- data/lib/glossarist/concept_document.rb +2 -1
- data/lib/glossarist/concept_manager.rb +6 -7
- data/lib/glossarist/concept_set.rb +4 -4
- data/lib/glossarist/concept_store.rb +38 -48
- data/lib/glossarist/dataset_validator.rb +2 -1
- data/lib/glossarist/gcr_package_definition.rb +37 -0
- data/lib/glossarist/gcr_statistics.rb +2 -2
- data/lib/glossarist/glossary_definition.rb +1 -1
- data/lib/glossarist/glossary_store.rb +201 -0
- data/lib/glossarist/managed_concept_collection.rb +2 -2
- data/lib/glossarist/rdf/gloss_citation.rb +8 -4
- data/lib/glossarist/rdf/gloss_concept.rb +6 -3
- data/lib/glossarist/rdf/gloss_concept_date.rb +4 -2
- data/lib/glossarist/rdf/gloss_concept_reference.rb +6 -3
- data/lib/glossarist/rdf/gloss_concept_source.rb +6 -3
- data/lib/glossarist/rdf/gloss_designation.rb +56 -25
- data/lib/glossarist/rdf/gloss_grammar_info.rb +19 -9
- data/lib/glossarist/rdf/gloss_locality.rb +6 -3
- data/lib/glossarist/rdf/gloss_localized_concept.rb +14 -7
- data/lib/glossarist/rdf/gloss_non_verbal_rep.rb +9 -4
- data/lib/glossarist/rdf/gloss_pronunciation.rb +13 -6
- data/lib/glossarist/rdf/gloss_reference.rb +8 -4
- data/lib/glossarist/rdf/namespaces.rb +3 -2
- data/lib/glossarist/rdf/relationship_predicates.rb +14 -7
- data/lib/glossarist/rdf.rb +2 -1
- data/lib/glossarist/register_data.rb +68 -18
- data/lib/glossarist/schema_migration.rb +8 -5
- data/lib/glossarist/transforms/concept_to_gloss_transform.rb +23 -10
- data/lib/glossarist/v2/concept_data.rb +2 -1
- data/lib/glossarist/v2/concept_document.rb +1 -1
- data/lib/glossarist/v3/concept_data.rb +2 -1
- data/lib/glossarist/v3/concept_document.rb +1 -1
- data/lib/glossarist/validation/asset_index.rb +2 -2
- data/lib/glossarist/validation/bibliography_index.rb +2 -1
- data/lib/glossarist/validation/rules/asciidoc_xref_rule.rb +2 -1
- data/lib/glossarist/validation/rules/authoritative_source_rule.rb +1 -1
- data/lib/glossarist/validation/rules/bibliography_yaml_rule.rb +1 -1
- data/lib/glossarist/validation/rules/citation_completeness_rule.rb +1 -1
- data/lib/glossarist/validation/rules/concept_count_rule.rb +2 -3
- data/lib/glossarist/validation/rules/concept_id_rule.rb +0 -1
- data/lib/glossarist/validation/rules/concept_id_uniqueness_rule.rb +0 -1
- data/lib/glossarist/validation/rules/concept_mention_rule.rb +1 -2
- data/lib/glossarist/validation/rules/concept_status_rule.rb +1 -2
- data/lib/glossarist/validation/rules/concept_uri_rule.rb +1 -1
- data/lib/glossarist/validation/rules/date_type_rule.rb +5 -3
- data/lib/glossarist/validation/rules/date_validity_rule.rb +1 -1
- data/lib/glossarist/validation/rules/definition_content_rule.rb +1 -2
- data/lib/glossarist/validation/rules/domain_target_rule.rb +1 -1
- data/lib/glossarist/validation/rules/duplicate_term_rule.rb +1 -2
- data/lib/glossarist/validation/rules/entry_status_rule.rb +1 -2
- data/lib/glossarist/validation/rules/filename_id_rule.rb +2 -3
- data/lib/glossarist/validation/rules/image_reference_rule.rb +3 -2
- data/lib/glossarist/validation/rules/l10n_uuid_integrity_rule.rb +1 -2
- data/lib/glossarist/validation/rules/language_coverage_rule.rb +1 -2
- data/lib/glossarist/validation/rules/language_list_rule.rb +2 -3
- data/lib/glossarist/validation/rules/locality_completeness_rule.rb +3 -1
- data/lib/glossarist/validation/rules/localization_consistency_rule.rb +1 -1
- data/lib/glossarist/validation/rules/localization_presence_rule.rb +0 -1
- data/lib/glossarist/validation/rules/model_validity_rule.rb +1 -1
- data/lib/glossarist/validation/rules/orphaned_bibliography_rule.rb +2 -1
- data/lib/glossarist/validation/rules/orphaned_images_rule.rb +6 -4
- data/lib/glossarist/validation/rules/orphaned_l10n_files_rule.rb +1 -2
- data/lib/glossarist/validation/rules/preferred_term_rule.rb +1 -2
- data/lib/glossarist/validation/rules/related_concept_cycle_rule.rb +2 -2
- data/lib/glossarist/validation/rules/related_concept_rule.rb +1 -2
- data/lib/glossarist/validation/rules/related_concept_symmetry_rule.rb +1 -1
- data/lib/glossarist/validation/rules/related_concept_target_rule.rb +1 -1
- data/lib/glossarist/validation/rules/source_type_rule.rb +2 -2
- data/lib/glossarist/validation/rules/source_urn_format_rule.rb +2 -2
- data/lib/glossarist/validation/rules/terms_presence_rule.rb +1 -1
- data/lib/glossarist/validation/rules/uuid_format_rule.rb +1 -1
- data/lib/glossarist/version.rb +1 -1
- data/lib/glossarist.rb +4 -0
- data/scripts/migrate_dataset.rb +14 -8
- data/scripts/migrate_isotc204_to_v3.rb +3 -1
- data/scripts/migrate_isotc211_to_v3.rb +5 -3
- data/scripts/migrate_osgeo_to_v3.rb +4 -2
- data/scripts/upgrade_dataset_to_v3.rb +0 -0
- metadata +13 -5
|
@@ -6,7 +6,7 @@ module Glossarist
|
|
|
6
6
|
# Verifies that related concept refs point to concepts that exist
|
|
7
7
|
# in the dataset (for local refs) or have valid source/URN (for external).
|
|
8
8
|
class RelatedConceptTargetRule < Base
|
|
9
|
-
URN_RE = %r{\Aurn:[a-z0-9][a-z0-9-]{0,31}:[a-z0-9()+,\-.:=@;$_!*'%/?#]+\z}i
|
|
9
|
+
URN_RE = %r{\Aurn:[a-z0-9][a-z0-9-]{0,31}:[a-z0-9()+,\-.:=@;$_!*'%/?#]+\z}i
|
|
10
10
|
|
|
11
11
|
def code = "GLS-110"
|
|
12
12
|
def category = :references
|
|
@@ -27,7 +27,7 @@ module Glossarist
|
|
|
27
27
|
"source #{idx + 1} has invalid type '#{source.type}'",
|
|
28
28
|
code: "GLS-202", severity: severity,
|
|
29
29
|
location: fname,
|
|
30
|
-
suggestion: "Use one of: #{VALID_TYPES.join(', ')}"
|
|
30
|
+
suggestion: "Use one of: #{VALID_TYPES.join(', ')}"
|
|
31
31
|
)
|
|
32
32
|
end
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ module Glossarist
|
|
|
37
37
|
"source #{idx + 1} has invalid status '#{source.status}'",
|
|
38
38
|
code: "GLS-203", severity: severity,
|
|
39
39
|
location: fname,
|
|
40
|
-
suggestion: "Use one of: #{VALID_STATUSES.join(', ')}"
|
|
40
|
+
suggestion: "Use one of: #{VALID_STATUSES.join(', ')}"
|
|
41
41
|
)
|
|
42
42
|
end
|
|
43
43
|
|
|
@@ -6,7 +6,7 @@ module Glossarist
|
|
|
6
6
|
# Validates that every URN-format source in citations and references
|
|
7
7
|
# follows a recognized scheme (iso, iec, itu, etc).
|
|
8
8
|
class SourceUrnFormatRule < Base
|
|
9
|
-
URN_RE = %r{\Aurn:([a-z0-9][a-z0-9-]{0,31}):(.+)\z}i
|
|
9
|
+
URN_RE = %r{\Aurn:([a-z0-9][a-z0-9-]{0,31}):(.+)\z}i
|
|
10
10
|
|
|
11
11
|
KNOWN_SCHEMES = %w[
|
|
12
12
|
iso iec itu iso:std:iso iso:std:iec
|
|
@@ -27,7 +27,7 @@ module Glossarist
|
|
|
27
27
|
issues = []
|
|
28
28
|
|
|
29
29
|
all_refs(concept).each_with_index do |ref_str, idx|
|
|
30
|
-
next unless ref_str
|
|
30
|
+
next unless ref_str&.start_with?("urn:")
|
|
31
31
|
|
|
32
32
|
match = URN_RE.match(ref_str)
|
|
33
33
|
unless match
|
|
@@ -27,7 +27,7 @@ module Glossarist
|
|
|
27
27
|
"#{fname}/#{lang}: must have at least 1 term",
|
|
28
28
|
code: code, severity: severity,
|
|
29
29
|
location: "#{fname}/#{lang}",
|
|
30
|
-
suggestion: "Add at least one term/designation to this localization"
|
|
30
|
+
suggestion: "Add at least one term/designation to this localization"
|
|
31
31
|
)
|
|
32
32
|
end
|
|
33
33
|
|
|
@@ -4,7 +4,7 @@ module Glossarist
|
|
|
4
4
|
module Validation
|
|
5
5
|
module Rules
|
|
6
6
|
class UuidFormatRule < Base
|
|
7
|
-
UUID_RE = /\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/i
|
|
7
|
+
UUID_RE = /\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/i
|
|
8
8
|
|
|
9
9
|
def code = "GLS-016"
|
|
10
10
|
def category = :integrity
|
data/lib/glossarist/version.rb
CHANGED
data/lib/glossarist.rb
CHANGED
|
@@ -11,6 +11,8 @@ module Glossarist
|
|
|
11
11
|
autoload :Asset, "glossarist/asset"
|
|
12
12
|
autoload :AssetReference, "glossarist/asset_reference"
|
|
13
13
|
autoload :BibliographicReference, "glossarist/bibliographic_reference"
|
|
14
|
+
autoload :BibliographyData, "glossarist/bibliography_data"
|
|
15
|
+
autoload :BibliographyEntry, "glossarist/bibliography_entry"
|
|
14
16
|
autoload :Citation, "glossarist/citation"
|
|
15
17
|
autoload :CLI, "glossarist/cli"
|
|
16
18
|
autoload :CollectionConfig, "glossarist/collection_config"
|
|
@@ -43,6 +45,7 @@ module Glossarist
|
|
|
43
45
|
autoload :Designation, "glossarist/designation"
|
|
44
46
|
autoload :Error, "glossarist/error"
|
|
45
47
|
autoload :GcrPackage, "glossarist/gcr_package"
|
|
48
|
+
autoload :GcrPackageDefinition, "glossarist/gcr_package_definition"
|
|
46
49
|
autoload :GcrMetadata, "glossarist/gcr_metadata"
|
|
47
50
|
autoload :GcrStatistics, "glossarist/gcr_statistics"
|
|
48
51
|
autoload :GcrValidator, "glossarist/gcr_validator"
|
|
@@ -74,6 +77,7 @@ module Glossarist
|
|
|
74
77
|
autoload :V3, "glossarist/v3"
|
|
75
78
|
autoload :VERSION, "glossarist/version"
|
|
76
79
|
autoload :GlossaryDefinition, "glossarist/glossary_definition"
|
|
80
|
+
autoload :GlossaryStore, "glossarist/glossary_store"
|
|
77
81
|
|
|
78
82
|
LANG_CODES = %w[eng ara deu fra spa ita jpn kor pol por srp swe zho rus fin
|
|
79
83
|
dan nld msa nob nno].freeze
|
data/scripts/migrate_dataset.rb
CHANGED
|
@@ -45,7 +45,7 @@ def add_subject_area_concepts(collection)
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
existing_ids = collection.
|
|
48
|
+
existing_ids = collection.to_set { |c| c.data.id }
|
|
49
49
|
|
|
50
50
|
areas.each_key do |area_id|
|
|
51
51
|
next if existing_ids.include?(area_id)
|
|
@@ -83,7 +83,8 @@ def add_subject_area_concepts(collection)
|
|
|
83
83
|
),
|
|
84
84
|
)
|
|
85
85
|
|
|
86
|
-
mc.related = [Glossarist::RelatedConcept.new(type: "broader",
|
|
86
|
+
mc.related = [Glossarist::RelatedConcept.new(type: "broader",
|
|
87
|
+
content: area_id)]
|
|
87
88
|
|
|
88
89
|
section_code = parts.length > 1 ? parts[0..1].join("-") : parts[0]
|
|
89
90
|
l10n = build_domain_localization(section_id, section_code, "eng")
|
|
@@ -94,7 +95,7 @@ def add_subject_area_concepts(collection)
|
|
|
94
95
|
end
|
|
95
96
|
end
|
|
96
97
|
|
|
97
|
-
def build_domain_localization(id,
|
|
98
|
+
def build_domain_localization(id, _label, lang_code)
|
|
98
99
|
cd = Glossarist::ConceptData.new(
|
|
99
100
|
id: id,
|
|
100
101
|
language_code: lang_code,
|
|
@@ -133,6 +134,7 @@ if add_iev_domains
|
|
|
133
134
|
|
|
134
135
|
identifier = concept.data.id.to_s
|
|
135
136
|
next if identifier.empty? || identifier.start_with?("area-", "section-")
|
|
137
|
+
|
|
136
138
|
parts = identifier.split("-")
|
|
137
139
|
next unless parts.length >= 2
|
|
138
140
|
|
|
@@ -166,11 +168,15 @@ end
|
|
|
166
168
|
|
|
167
169
|
# Copy register.yaml if present
|
|
168
170
|
register_src = File.join(File.dirname(source_dir), "register.yaml")
|
|
169
|
-
if File.exist?(register_src) && !File.exist?(File.join(output_dir, "..",
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
if File.exist?(register_src) && !File.exist?(File.join(output_dir, "..",
|
|
172
|
+
"register.yaml"))
|
|
173
|
+
is_managed_format ? File.dirname(output_dir) : output_dir
|
|
174
|
+
register_dst = if File.exist?(File.join(File.dirname(source_dir),
|
|
175
|
+
"register.yaml"))
|
|
176
|
+
File.join(
|
|
177
|
+
is_managed_format ? File.dirname(output_dir) : File.dirname(output_dir), "register.yaml"
|
|
178
|
+
)
|
|
179
|
+
end
|
|
174
180
|
if register_dst
|
|
175
181
|
FileUtils.mkdir_p(File.dirname(register_dst))
|
|
176
182
|
FileUtils.cp(register_src, register_dst) unless register_src == register_dst
|
|
@@ -70,7 +70,9 @@ collection.each do |concept|
|
|
|
70
70
|
|
|
71
71
|
# Add broader relation to section
|
|
72
72
|
concept.related ||= []
|
|
73
|
-
unless concept.related.any?
|
|
73
|
+
unless concept.related.any? do |r|
|
|
74
|
+
r.type == "broader" && r.ref&.id == section_uri
|
|
75
|
+
end
|
|
74
76
|
concept.related << Glossarist::RelatedConcept.new(
|
|
75
77
|
type: "broader",
|
|
76
78
|
content: section_uri,
|
|
@@ -26,13 +26,13 @@ ISO_SOURCE_URN = "urn:iso:std:iso"
|
|
|
26
26
|
def extract_domain_id(ref_text)
|
|
27
27
|
# Match various ISO reference patterns
|
|
28
28
|
patterns = [
|
|
29
|
-
%r{ISO/IEC/IEEE\s+([\d-]+)},
|
|
29
|
+
%r{ISO/IEC/IEEE\s+([\d-]+)}, # ISO/IEC/IEEE 24765:2017
|
|
30
30
|
%r{ISO/IEC\s+([\d-]+)}, # ISO/IEC 19501:2005
|
|
31
31
|
%r{ISO/TS\s+([\d-]+)}, # ISO/TS 19130:2010
|
|
32
32
|
%r{ISO/TR\s+([\d-]+)}, # ISO/TR 19120:2001
|
|
33
33
|
%r{ISO/IEC\s+Guide\s+([\d-]+)}, # ISO/IEC Guide 98-3:2008
|
|
34
34
|
%r{ISO\s+DIS\s+([\d-]+)}, # ISO DIS 19123-1:2022
|
|
35
|
-
%r{ISO\s+(
|
|
35
|
+
%r{ISO\s+(\d+-?\d*)}, # ISO 19136-1:2020
|
|
36
36
|
]
|
|
37
37
|
|
|
38
38
|
patterns.each do |pat|
|
|
@@ -95,7 +95,9 @@ collection.each do |concept|
|
|
|
95
95
|
|
|
96
96
|
# Add broader relation to domain concept
|
|
97
97
|
concept.related ||= []
|
|
98
|
-
unless concept.related.any?
|
|
98
|
+
unless concept.related.any? do |r|
|
|
99
|
+
r.type == "broader" && r.ref&.id == domain_id
|
|
100
|
+
end
|
|
99
101
|
concept.related << Glossarist::RelatedConcept.new(
|
|
100
102
|
type: "broader",
|
|
101
103
|
content: domain_id,
|
|
@@ -32,7 +32,7 @@ def extract_domain_id(ref_text)
|
|
|
32
32
|
%r{ISO/IEC\s+([\d-]+)},
|
|
33
33
|
%r{ISO/TS\s+([\d-]+)},
|
|
34
34
|
%r{ISO/TR\s+([\d-]+)},
|
|
35
|
-
%r{ISO\s+(
|
|
35
|
+
%r{ISO\s+(\d+-?\d*)},
|
|
36
36
|
]
|
|
37
37
|
|
|
38
38
|
patterns.each do |pat|
|
|
@@ -95,7 +95,9 @@ collection.each do |concept|
|
|
|
95
95
|
|
|
96
96
|
# Add broader relation to domain concept
|
|
97
97
|
concept.related ||= []
|
|
98
|
-
unless concept.related.any?
|
|
98
|
+
unless concept.related.any? do |r|
|
|
99
|
+
r.type == "broader" && r.ref&.id == domain_id
|
|
100
|
+
end
|
|
99
101
|
concept.related << Glossarist::RelatedConcept.new(
|
|
100
102
|
type: "broader",
|
|
101
103
|
content: domain_id,
|
|
File without changes
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: glossarist
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.8.
|
|
4
|
+
version: 2.8.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-06-03 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: lutaml-model
|
|
@@ -29,14 +30,14 @@ dependencies:
|
|
|
29
30
|
requirements:
|
|
30
31
|
- - "~>"
|
|
31
32
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.
|
|
33
|
+
version: 0.2.0
|
|
33
34
|
type: :runtime
|
|
34
35
|
prerelease: false
|
|
35
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
37
|
requirements:
|
|
37
38
|
- - "~>"
|
|
38
39
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 0.
|
|
40
|
+
version: 0.2.0
|
|
40
41
|
- !ruby/object:Gem::Dependency
|
|
41
42
|
name: paint
|
|
42
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -147,6 +148,7 @@ dependencies:
|
|
|
147
148
|
- - ">="
|
|
148
149
|
- !ruby/object:Gem::Version
|
|
149
150
|
version: '0'
|
|
151
|
+
description:
|
|
150
152
|
email:
|
|
151
153
|
- open.source@ribose.com
|
|
152
154
|
executables:
|
|
@@ -174,6 +176,8 @@ files:
|
|
|
174
176
|
- lib/glossarist/asset.rb
|
|
175
177
|
- lib/glossarist/asset_reference.rb
|
|
176
178
|
- lib/glossarist/bibliographic_reference.rb
|
|
179
|
+
- lib/glossarist/bibliography_data.rb
|
|
180
|
+
- lib/glossarist/bibliography_entry.rb
|
|
177
181
|
- lib/glossarist/citation.rb
|
|
178
182
|
- lib/glossarist/cli.rb
|
|
179
183
|
- lib/glossarist/cli/compare_command.rb
|
|
@@ -231,9 +235,11 @@ files:
|
|
|
231
235
|
- lib/glossarist/error/parse_error.rb
|
|
232
236
|
- lib/glossarist/gcr_metadata.rb
|
|
233
237
|
- lib/glossarist/gcr_package.rb
|
|
238
|
+
- lib/glossarist/gcr_package_definition.rb
|
|
234
239
|
- lib/glossarist/gcr_statistics.rb
|
|
235
240
|
- lib/glossarist/gcr_validator.rb
|
|
236
241
|
- lib/glossarist/glossary_definition.rb
|
|
242
|
+
- lib/glossarist/glossary_store.rb
|
|
237
243
|
- lib/glossarist/locality.rb
|
|
238
244
|
- lib/glossarist/localized_concept.rb
|
|
239
245
|
- lib/glossarist/managed_concept.rb
|
|
@@ -400,6 +406,7 @@ metadata:
|
|
|
400
406
|
source_code_uri: https://github.com/glossarist/glossarist-ruby
|
|
401
407
|
bug_tracker_uri: https://github.com/glossarist/glossarist-ruby/issues
|
|
402
408
|
rubygems_mfa_required: 'true'
|
|
409
|
+
post_install_message:
|
|
403
410
|
rdoc_options: []
|
|
404
411
|
require_paths:
|
|
405
412
|
- lib
|
|
@@ -414,7 +421,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
414
421
|
- !ruby/object:Gem::Version
|
|
415
422
|
version: '0'
|
|
416
423
|
requirements: []
|
|
417
|
-
rubygems_version: 3.
|
|
424
|
+
rubygems_version: 3.5.22
|
|
425
|
+
signing_key:
|
|
418
426
|
specification_version: 4
|
|
419
427
|
summary: Concept models for terminology glossaries conforming ISO 10241-1.
|
|
420
428
|
test_files: []
|