glossarist 2.6.0 → 2.6.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/.rubocop_todo.yml +10 -50
- data/Gemfile +1 -1
- data/lib/glossarist/cli/export_command.rb +16 -16
- data/lib/glossarist/concept_set.rb +0 -2
- data/lib/glossarist/managed_concept.rb +0 -13
- data/lib/glossarist/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4e48f1d237829b78cd052e39afdd7c952c468be894e25856f79f93471ea2dc6
|
|
4
|
+
data.tar.gz: f6502f7012e30138193c4c28eee2ab551020edf27ff0c6e08cc39939e5d0c0c3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bcfb39fe52138d23d489cfbff45f62b0f00161d3183ef66dbb5718fcbc30694ef5e426bc9f7797329480dddb01a7c96b8f6e1dfc43e392032441bb62487c723a
|
|
7
|
+
data.tar.gz: 289911c5a5851389cb5e37fbc07bd45825b00cdd51fa8cac5679168af3ec9e2b7313f6afbd7093fb93b35384bfc7318dcb97a22d72869f78a321883f4ab299a4
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2026-05-06
|
|
3
|
+
# on 2026-05-06 18:35:41 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:
|
|
9
|
+
# Offense count: 5
|
|
10
10
|
# This cop supports safe autocorrection (--autocorrect).
|
|
11
11
|
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
|
|
12
12
|
Bundler/OrderedGems:
|
|
@@ -18,49 +18,27 @@ Gemspec/RequiredRubyVersion:
|
|
|
18
18
|
Exclude:
|
|
19
19
|
- 'glossarist.gemspec'
|
|
20
20
|
|
|
21
|
-
# Offense count: 10
|
|
22
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
23
|
-
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
24
|
-
# SupportedStyles: with_first_argument, with_fixed_indentation
|
|
25
|
-
Layout/ArgumentAlignment:
|
|
26
|
-
Exclude:
|
|
27
|
-
- 'lib/glossarist/cli/export_command.rb'
|
|
28
|
-
- 'lib/glossarist/gcr_package.rb'
|
|
29
|
-
- 'spec/unit/gcr_package_spec.rb'
|
|
30
|
-
|
|
31
21
|
# Offense count: 1
|
|
32
22
|
# This cop supports safe autocorrection (--autocorrect).
|
|
33
|
-
Layout/
|
|
23
|
+
Layout/ClosingParenthesisIndentation:
|
|
34
24
|
Exclude:
|
|
35
|
-
- '
|
|
25
|
+
- 'spec/unit/concept_set_spec.rb'
|
|
36
26
|
|
|
37
27
|
# Offense count: 1
|
|
38
28
|
# This cop supports safe autocorrection (--autocorrect).
|
|
39
|
-
# Configuration parameters:
|
|
40
|
-
#
|
|
41
|
-
|
|
42
|
-
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
|
43
|
-
Layout/HashAlignment:
|
|
29
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
30
|
+
# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
|
|
31
|
+
Layout/FirstArgumentIndentation:
|
|
44
32
|
Exclude:
|
|
45
|
-
- '
|
|
33
|
+
- 'spec/unit/concept_set_spec.rb'
|
|
46
34
|
|
|
47
|
-
# Offense count:
|
|
35
|
+
# Offense count: 202
|
|
48
36
|
# This cop supports safe autocorrection (--autocorrect).
|
|
49
37
|
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
|
|
50
38
|
# URISchemes: http, https
|
|
51
39
|
Layout/LineLength:
|
|
52
40
|
Enabled: false
|
|
53
41
|
|
|
54
|
-
# Offense count: 12
|
|
55
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
56
|
-
# Configuration parameters: AllowInHeredoc.
|
|
57
|
-
Layout/TrailingWhitespace:
|
|
58
|
-
Exclude:
|
|
59
|
-
- 'lib/glossarist/cli/export_command.rb'
|
|
60
|
-
- 'lib/glossarist/gcr_package.rb'
|
|
61
|
-
- 'lib/glossarist/transforms/concept_to_tbx_transform.rb'
|
|
62
|
-
- 'spec/unit/gcr_package_spec.rb'
|
|
63
|
-
|
|
64
42
|
# Offense count: 1
|
|
65
43
|
# Configuration parameters: AllowedMethods.
|
|
66
44
|
# AllowedMethods: enums
|
|
@@ -68,18 +46,12 @@ Lint/ConstantDefinitionInBlock:
|
|
|
68
46
|
Exclude:
|
|
69
47
|
- 'spec/unit/utilities/common_functions_spec.rb'
|
|
70
48
|
|
|
71
|
-
# Offense count:
|
|
72
|
-
Lint/DuplicateMethods:
|
|
73
|
-
Exclude:
|
|
74
|
-
- 'lib/glossarist/managed_concept.rb'
|
|
75
|
-
|
|
76
|
-
# Offense count: 2
|
|
49
|
+
# Offense count: 1
|
|
77
50
|
# This cop supports safe autocorrection (--autocorrect).
|
|
78
51
|
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
|
|
79
52
|
# NotImplementedExceptions: NotImplementedError
|
|
80
53
|
Lint/UnusedMethodArgument:
|
|
81
54
|
Exclude:
|
|
82
|
-
- 'lib/glossarist/cli/export_command.rb'
|
|
83
55
|
- 'lib/glossarist/dataset_validator.rb'
|
|
84
56
|
|
|
85
57
|
# Offense count: 23
|
|
@@ -170,12 +142,6 @@ Naming/VariableNumber:
|
|
|
170
142
|
Style/FormatStringToken:
|
|
171
143
|
EnforcedStyle: unannotated
|
|
172
144
|
|
|
173
|
-
# Offense count: 2
|
|
174
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
175
|
-
Style/MultilineIfModifier:
|
|
176
|
-
Exclude:
|
|
177
|
-
- 'lib/glossarist/gcr_package.rb'
|
|
178
|
-
|
|
179
145
|
# Offense count: 1
|
|
180
146
|
# Configuration parameters: AllowedClasses.
|
|
181
147
|
Style/OneClassPerFile:
|
|
@@ -184,12 +150,6 @@ Style/OneClassPerFile:
|
|
|
184
150
|
- 'test/**/*'
|
|
185
151
|
- 'lib/glossarist.rb'
|
|
186
152
|
|
|
187
|
-
# Offense count: 1
|
|
188
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
189
|
-
Style/RedundantAssignment:
|
|
190
|
-
Exclude:
|
|
191
|
-
- 'lib/glossarist/transforms/concept_to_tbx_transform.rb'
|
|
192
|
-
|
|
193
153
|
# Offense count: 4
|
|
194
154
|
# Configuration parameters: Max.
|
|
195
155
|
Style/SafeNavigationChainLength:
|
data/Gemfile
CHANGED
|
@@ -7,12 +7,12 @@ gemspec
|
|
|
7
7
|
gem "canon"
|
|
8
8
|
gem "lutaml-model", "~> 0.8.0"
|
|
9
9
|
gem "rake", "~> 13.0"
|
|
10
|
-
gem "tbx", "~> 0.1"
|
|
11
10
|
gem "rspec", "~> 3.0"
|
|
12
11
|
gem "rubocop"
|
|
13
12
|
gem "rubocop-performance"
|
|
14
13
|
gem "rubocop-rake"
|
|
15
14
|
gem "rubocop-rspec"
|
|
15
|
+
gem "tbx", "~> 0.1"
|
|
16
16
|
|
|
17
17
|
# Override relaton gems with lutaml-model 0.8 compatible versions.
|
|
18
18
|
# Released 2.0.0 gems have untyped lutaml-model attributes that fail with 0.8+.
|
|
@@ -5,10 +5,7 @@ module Glossarist
|
|
|
5
5
|
class ExportCommand
|
|
6
6
|
EXTENSIONS = {
|
|
7
7
|
"json" => "json",
|
|
8
|
-
|
|
9
|
-
"turtle" => "ttl",
|
|
10
|
-
"tbx" => "tbx.xml",
|
|
11
|
-
"jsonl" => "jsonl",
|
|
8
|
+
**GcrPackage::COMPILED_EXTENSIONS,
|
|
12
9
|
}.freeze
|
|
13
10
|
|
|
14
11
|
def initialize(path, options)
|
|
@@ -22,12 +19,12 @@ module Glossarist
|
|
|
22
19
|
FileUtils.mkdir_p(output_dir)
|
|
23
20
|
|
|
24
21
|
concepts = load_concepts
|
|
25
|
-
name = resolve_shortname
|
|
22
|
+
name = resolve_shortname
|
|
26
23
|
|
|
27
24
|
case format
|
|
28
25
|
when "json" then export_json(concepts, output_dir)
|
|
29
|
-
when "jsonld" then
|
|
30
|
-
when "turtle" then
|
|
26
|
+
when "jsonld" then export_jsonld(concepts, name, output_dir)
|
|
27
|
+
when "turtle" then export_turtle(concepts, name, output_dir)
|
|
31
28
|
when "tbx" then export_tbx(concepts, name, output_dir)
|
|
32
29
|
when "jsonl" then export_jsonl(concepts, name, output_dir)
|
|
33
30
|
end
|
|
@@ -55,7 +52,7 @@ module Glossarist
|
|
|
55
52
|
@options[:uri_prefix] ||= package.metadata["uri_prefix"]
|
|
56
53
|
end
|
|
57
54
|
|
|
58
|
-
def resolve_shortname
|
|
55
|
+
def resolve_shortname
|
|
59
56
|
@options[:shortname] || "glossary"
|
|
60
57
|
end
|
|
61
58
|
|
|
@@ -75,27 +72,30 @@ module Glossarist
|
|
|
75
72
|
end
|
|
76
73
|
end
|
|
77
74
|
|
|
78
|
-
def
|
|
75
|
+
def export_jsonld(concepts, name, output_dir)
|
|
79
76
|
require "glossarist/transforms/concept_to_skos_transform"
|
|
80
77
|
vocab = Transforms::ConceptToSkosTransform.transform_document(concepts,
|
|
81
78
|
transform_options)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
File.write(File.join(output_dir, "#{name}.jsonld"), vocab.to_jsonld)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def export_turtle(concepts, name, output_dir)
|
|
83
|
+
require "glossarist/transforms/concept_to_skos_transform"
|
|
84
|
+
vocab = Transforms::ConceptToSkosTransform.transform_document(concepts,
|
|
85
|
+
transform_options)
|
|
86
|
+
File.write(File.join(output_dir, "#{name}.ttl"), vocab.to_turtle)
|
|
85
87
|
end
|
|
86
88
|
|
|
87
89
|
def export_tbx(concepts, name, output_dir)
|
|
88
90
|
require "glossarist/transforms/concept_to_tbx_transform"
|
|
89
91
|
doc = Transforms::ConceptToTbxTransform.transform_document(concepts,
|
|
90
92
|
transform_options)
|
|
91
|
-
File.write(File.join(output_dir, "#{name}
|
|
92
|
-
doc.to_xml)
|
|
93
|
+
File.write(File.join(output_dir, "#{name}.tbx.xml"), doc.to_xml)
|
|
93
94
|
end
|
|
94
95
|
|
|
95
96
|
def export_jsonl(concepts, name, output_dir)
|
|
96
97
|
require "glossarist/transforms/concept_to_skos_transform"
|
|
97
|
-
File.open(File.join(output_dir, "#{name}
|
|
98
|
-
"w") do |f|
|
|
98
|
+
File.open(File.join(output_dir, "#{name}.jsonl"), "w") do |f|
|
|
99
99
|
concepts.each do |concept|
|
|
100
100
|
skos = Transforms::ConceptToSkosTransform.transform(concept,
|
|
101
101
|
transform_options)
|
|
@@ -10,8 +10,6 @@ module Glossarist
|
|
|
10
10
|
attribute :dates, ConceptDate, collection: true
|
|
11
11
|
attribute :sources, ConceptSource
|
|
12
12
|
attribute :date_accepted, ConceptDate
|
|
13
|
-
# TODO: convert to LocalizedConceptCollection when custom
|
|
14
|
-
# collections are implemented in lutaml-model
|
|
15
13
|
attribute :status, :string,
|
|
16
14
|
values: Glossarist::GlossaryDefinition::CONCEPT_STATUSES
|
|
17
15
|
|
|
@@ -35,14 +33,6 @@ module Glossarist
|
|
|
35
33
|
map :uuid, to: :uuid, with: { from: :uuid_from_yaml, to: :uuid_to_yaml }
|
|
36
34
|
end
|
|
37
35
|
|
|
38
|
-
def localized_concepts
|
|
39
|
-
data.localized_concepts
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def localized_concepts=(val)
|
|
43
|
-
data.localized_concepts = val
|
|
44
|
-
end
|
|
45
|
-
|
|
46
36
|
def localizations
|
|
47
37
|
data.localizations
|
|
48
38
|
end
|
|
@@ -123,9 +113,6 @@ module Glossarist
|
|
|
123
113
|
end
|
|
124
114
|
alias :add_l10n :add_localization
|
|
125
115
|
|
|
126
|
-
# Returns concept localization.
|
|
127
|
-
# @param lang [String] language code
|
|
128
|
-
# @return [LocalizedConcept]
|
|
129
116
|
def to_jsonld
|
|
130
117
|
require "glossarist/transforms/concept_to_skos_transform"
|
|
131
118
|
Transforms::ConceptToSkosTransform.transform(self).to_jsonld
|
data/lib/glossarist/version.rb
CHANGED