glossarist 2.5.2 → 2.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe3ff3c4b63696f6cf9642ffe766a6c73ef6a05057f0cbe480ebee2d3120e47d
4
- data.tar.gz: 27792d2279a3cfd6b99ffb98b76d70ee8ca0a6d44d0cf4b34b867ecde21006bc
3
+ metadata.gz: d8c6a7e6d8df0929ec60fdccdc44fd70a4042afec7ccd8f046cdcf6388839d21
4
+ data.tar.gz: 56d29d76e0fc77885edcbc1c59cd533ec99029b4db957ad5772d78bf96356c1c
5
5
  SHA512:
6
- metadata.gz: cdb41f5f64396deae5766ccfeeb39ea5a57cf7c543de1bed2379ef26ece9718bd893d664de5beece5afbb786dc89b920848ad1617cac8a80797b7ca8e5be0f15
7
- data.tar.gz: 701029ee0fe57190dc1f8f8ca5beec1f64afb5321914d2099c99f6d910688431582dbc54183b723e849c1c5e9e7b705c02e7db5a6d6e1851ad7ba5f9883f174b
6
+ metadata.gz: baace51fb6d551075f190957abe4a1736c390ee06dafe7756d691ce35b23770383eb12756bf3790712935879830da929ebf0670007b2f149c26f9b9cdb4bff89
7
+ data.tar.gz: d1faeeaac48cc379ddded9f51fb223b23dc8bcf2f7182e196b6b721d6b2f4bb0674875be5ca9c842a4ddafb343b14a3f46778530d0b19118000b33387437d771
data/.gitignore CHANGED
@@ -22,3 +22,5 @@ localcache
22
22
  .vscode
23
23
 
24
24
  TODO*
25
+
26
+ *.gem
data/.rubocop_todo.yml CHANGED
@@ -1,23 +1,66 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-05-04 09:39:17 UTC using RuboCop version 1.86.1.
3
+ # on 2026-05-06 17:07:44 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: 6
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
12
+ Bundler/OrderedGems:
13
+ Exclude:
14
+ - 'Gemfile'
15
+
9
16
  # Offense count: 1
10
17
  Gemspec/RequiredRubyVersion:
11
18
  Exclude:
12
19
  - 'glossarist.gemspec'
13
20
 
14
- # Offense count: 196
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
+ # Offense count: 1
32
+ # This cop supports safe autocorrection (--autocorrect).
33
+ Layout/EmptyLinesAroundMethodBody:
34
+ Exclude:
35
+ - 'lib/glossarist/transforms/concept_to_tbx_transform.rb'
36
+
37
+ # Offense count: 1
38
+ # This cop supports safe autocorrection (--autocorrect).
39
+ # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
40
+ # SupportedHashRocketStyles: key, separator, table
41
+ # SupportedColonStyles: key, separator, table
42
+ # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
43
+ Layout/HashAlignment:
44
+ Exclude:
45
+ - 'lib/glossarist/gcr_package.rb'
46
+
47
+ # Offense count: 214
15
48
  # This cop supports safe autocorrection (--autocorrect).
16
49
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
17
50
  # URISchemes: http, https
18
51
  Layout/LineLength:
19
52
  Enabled: false
20
53
 
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
+
21
64
  # Offense count: 1
22
65
  # Configuration parameters: AllowedMethods.
23
66
  # AllowedMethods: enums
@@ -30,18 +73,20 @@ Lint/DuplicateMethods:
30
73
  Exclude:
31
74
  - 'lib/glossarist/managed_concept.rb'
32
75
 
33
- # Offense count: 1
76
+ # Offense count: 2
34
77
  # This cop supports safe autocorrection (--autocorrect).
35
78
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
36
79
  # NotImplementedExceptions: NotImplementedError
37
80
  Lint/UnusedMethodArgument:
38
81
  Exclude:
82
+ - 'lib/glossarist/cli/export_command.rb'
39
83
  - 'lib/glossarist/dataset_validator.rb'
40
84
 
41
- # Offense count: 18
85
+ # Offense count: 23
42
86
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
43
87
  Metrics/AbcSize:
44
88
  Exclude:
89
+ - 'lib/glossarist/cli/export_command.rb'
45
90
  - 'lib/glossarist/cli/package_command.rb'
46
91
  - 'lib/glossarist/cli/validate_command.rb'
47
92
  - 'lib/glossarist/concept_manager.rb'
@@ -51,6 +96,8 @@ Metrics/AbcSize:
51
96
  - 'lib/glossarist/reference_resolver.rb'
52
97
  - 'lib/glossarist/resolution_adapter/local.rb'
53
98
  - 'lib/glossarist/schema_migration.rb'
99
+ - 'lib/glossarist/transforms/concept_to_skos_transform.rb'
100
+ - 'lib/glossarist/transforms/concept_to_tbx_transform.rb'
54
101
  - 'lib/glossarist/utilities/uuid.rb'
55
102
  - 'spec/unit/concept_collector_spec.rb'
56
103
 
@@ -60,25 +107,34 @@ Metrics/AbcSize:
60
107
  Metrics/BlockLength:
61
108
  Max: 28
62
109
 
63
- # Offense count: 15
110
+ # Offense count: 19
64
111
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
65
112
  Metrics/CyclomaticComplexity:
66
113
  Exclude:
114
+ - 'lib/glossarist/cli/export_command.rb'
67
115
  - 'lib/glossarist/concept_validator.rb'
68
116
  - 'lib/glossarist/designation/expression.rb'
69
117
  - 'lib/glossarist/gcr_metadata.rb'
118
+ - 'lib/glossarist/gcr_statistics.rb'
70
119
  - 'lib/glossarist/managed_concept.rb'
71
120
  - 'lib/glossarist/reference_extractor.rb'
72
121
  - 'lib/glossarist/reference_resolver.rb'
73
122
  - 'lib/glossarist/resolution_adapter/local.rb'
74
123
  - 'lib/glossarist/schema_migration.rb'
124
+ - 'lib/glossarist/transforms/concept_to_skos_transform.rb'
125
+ - 'lib/glossarist/transforms/concept_to_tbx_transform.rb'
75
126
 
76
- # Offense count: 31
127
+ # Offense count: 35
77
128
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
78
129
  Metrics/MethodLength:
79
130
  Max: 42
80
131
 
81
- # Offense count: 12
132
+ # Offense count: 4
133
+ # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
134
+ Metrics/ParameterLists:
135
+ Max: 6
136
+
137
+ # Offense count: 13
82
138
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
83
139
  Metrics/PerceivedComplexity:
84
140
  Exclude:
@@ -89,6 +145,8 @@ Metrics/PerceivedComplexity:
89
145
  - 'lib/glossarist/reference_resolver.rb'
90
146
  - 'lib/glossarist/resolution_adapter/local.rb'
91
147
  - 'lib/glossarist/schema_migration.rb'
148
+ - 'lib/glossarist/transforms/concept_to_skos_transform.rb'
149
+ - 'lib/glossarist/transforms/concept_to_tbx_transform.rb'
92
150
 
93
151
  # Offense count: 6
94
152
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
@@ -97,6 +155,14 @@ Naming/MethodParameterName:
97
155
  Exclude:
98
156
  - 'lib/glossarist/schema_migration.rb'
99
157
 
158
+ # Offense count: 3
159
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
160
+ # SupportedStyles: snake_case, normalcase, non_integer
161
+ # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
162
+ Naming/VariableNumber:
163
+ Exclude:
164
+ - 'spec/unit/rdf/skos_vocabulary_spec.rb'
165
+
100
166
  # Offense count: 6
101
167
  # This cop supports safe autocorrection (--autocorrect).
102
168
  # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns.
@@ -104,6 +170,12 @@ Naming/MethodParameterName:
104
170
  Style/FormatStringToken:
105
171
  EnforcedStyle: unannotated
106
172
 
173
+ # Offense count: 2
174
+ # This cop supports safe autocorrection (--autocorrect).
175
+ Style/MultilineIfModifier:
176
+ Exclude:
177
+ - 'lib/glossarist/gcr_package.rb'
178
+
107
179
  # Offense count: 1
108
180
  # Configuration parameters: AllowedClasses.
109
181
  Style/OneClassPerFile:
@@ -113,7 +185,15 @@ Style/OneClassPerFile:
113
185
  - 'lib/glossarist.rb'
114
186
 
115
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
+ # Offense count: 4
116
194
  # Configuration parameters: Max.
117
195
  Style/SafeNavigationChainLength:
118
196
  Exclude:
119
197
  - 'lib/glossarist/managed_concept.rb'
198
+ - 'lib/glossarist/transforms/concept_to_skos_transform.rb'
199
+ - 'lib/glossarist/transforms/concept_to_tbx_transform.rb'
data/CLAUDE.md CHANGED
@@ -67,11 +67,24 @@ Three classes handle glossary concept registry (GCR) ZIP packages:
67
67
 
68
68
  ### CLI
69
69
 
70
- The `exe/glossarist` executable uses Thor. Currently provides `generate_latex` which converts concepts to LaTeX glossary entries via `ConceptSet`.
70
+ The `exe/glossarist` executable uses Thor. Commands:
71
+ - `generate_latex` — converts concepts to LaTeX glossary entries
72
+ - `package` — creates `.gcr` ZIP archives with optional compiled formats (`--compiled-formats tbx,jsonld,turtle,jsonl`)
73
+ - `export` — exports concepts in json/tbx/jsonld/turtle/jsonl formats
74
+ - `validate` — validates datasets and `.gcr` files
75
+ - `upgrade` — migrates datasets to current schema version
76
+
77
+ ### Export Transforms
78
+
79
+ - **`ConceptToTbxTransform`** (`transforms/concept_to_tbx_transform.rb`) — converts ManagedConcept to TBX-XML using the tbx gem (ISO 30042:2019). Produces `Tbx::ConceptEntry` per concept or `Tbx::Document` for full export.
80
+ - **`ConceptToSkosTransform`** (`transforms/concept_to_skos_transform.rb`) — converts ManagedConcept to SKOS RDF using `Glossarist::Rdf::SkosConcept`. Has `transform` (single) and `transform_document` (batch, returns `SkosVocabulary`). Produces JSON-LD and Turtle via the unified `rdf` DSL.
81
+ - **SKOS/RDF models** (`lib/glossarist/rdf/`) — `SkosConcept`, `SkosVocabulary` (ConceptScheme container), `LocalizedLiteral` (language-tagged value), namespace classes.
82
+ - TBX, Turtle, JSON-LD, JSONL export all write a single document file; JSON writes per-concept files.
71
83
 
72
84
  ### Dependencies
73
85
 
74
- - `lutaml-model` (~> 0.8) — serialization framework (YAML/XML)
86
+ - `lutaml-model` (~> 0.8.5) — serialization framework (YAML/XML/JSON-LD/Turtle)
87
+ - `tbx` — ISO 30042:2019 TBX model classes
75
88
  - `relaton` (>= 2.0.0, < 3) — bibliography database integration
76
89
  - `thor` — CLI commands
77
90
 
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ gemspec
7
7
  gem "canon"
8
8
  gem "lutaml-model", "~> 0.8.0"
9
9
  gem "rake", "~> 13.0"
10
+ gem "tbx", "~> 0.1"
10
11
  gem "rspec", "~> 3.0"
11
12
  gem "rubocop"
12
13
  gem "rubocop-performance"
@@ -15,20 +16,19 @@ gem "rubocop-rspec"
15
16
 
16
17
  # Override relaton gems with lutaml-model 0.8 compatible versions.
17
18
  # 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.
19
+ # lutaml-integration branches have typed attributes and relaton-bib ~> 2.1.0.
20
20
  # TODO: Remove once relaton gems release versions with lutaml-model 0.8 support.
21
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"
22
+ branch: "lutaml-integration"
23
+ gem "relaton-bib", github: "relaton/relaton-bib", branch: "lutaml-integration"
24
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"
25
+ branch: "lutaml-integration"
26
+ gem "relaton-bsi", github: "relaton/relaton-bsi", branch: "lutaml-integration"
27
27
  gem "relaton-calconnect", github: "relaton/relaton-calconnect",
28
28
  branch: "lutaml-integration"
29
29
  gem "relaton-ccsds", github: "relaton/relaton-ccsds",
30
30
  branch: "lutaml-integration"
31
31
  gem "relaton-cen", github: "relaton/relaton-cen", branch: "lutaml-integration"
32
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"
33
+ gem "relaton-iso", github: "relaton/relaton-iso", branch: "lutaml-integration"
34
34
  gem "relaton-itu", github: "relaton/relaton-itu", branch: "lutaml-integration"
data/README.adoc CHANGED
@@ -407,6 +407,12 @@ Options:
407
407
 
408
408
  |--tags
409
409
  |Tags for the dataset
410
+
411
+ |--compiled-formats
412
+ |Comma-separated compiled formats to bundle (tbx,jsonld,turtle,jsonl)
413
+
414
+ |--concept-uri-template
415
+ |URI template for concept URIs
410
416
  |===
411
417
 
412
418
  Ruby API:
@@ -418,9 +424,89 @@ GcrPackage.create_from_directory(
418
424
  shortname: "mydataset",
419
425
  version: "1.0.0",
420
426
  uri_prefix: "urn:iso:std:iso:19111",
427
+ compiled_formats: ["jsonld", "turtle"],
421
428
  )
422
429
  ----
423
430
 
431
+ === export
432
+
433
+ Export concepts in machine-readable formats.
434
+
435
+ [,bash]
436
+ ----
437
+ glossarist export PATH --format json --output DIR
438
+ glossarist export PATH --format jsonld --output DIR --shortname isotc211
439
+ glossarist export PATH --format turtle --output DIR
440
+ glossarist export PATH --format tbx --output DIR --shortname isotc211
441
+ glossarist export PATH --format jsonl --output DIR
442
+ glossarist export package.gcr --format json --output DIR
443
+ ----
444
+
445
+ The path can be either a concept dataset directory or a `.gcr` file. When exporting from a `.gcr`, the `shortname` and `uri_prefix` are automatically resolved from the package metadata.
446
+
447
+ ==== Output Formats
448
+
449
+ [cols="1,2,1"]
450
+ |===
451
+ |Format |Output |Files
452
+
453
+ |`json`
454
+ |Per-concept JSON files
455
+ |`{concept_id}.json`
456
+
457
+ |`tbx`
458
+ |Single TBX-XML document (ISO 30042:2019)
459
+ |`{shortname}.tbx.xml`
460
+
461
+ |`jsonld`
462
+ |Single JSON-LD file with `@graph`
463
+ |`{shortname}.jsonld`
464
+
465
+ |`turtle`
466
+ |Single Turtle file with all concept triples
467
+ |`{shortname}.ttl`
468
+
469
+ |`jsonl`
470
+ |JSONL file with one JSON-LD object per line
471
+ |`{shortname}.jsonl`
472
+ |===
473
+
474
+ Options:
475
+ [cols="1,1"]
476
+ |===
477
+ |--format (required)
478
+ |Output format: `json`, `tbx`, `jsonld`, `turtle`, or `jsonl`
479
+
480
+ |o, --output (required)
481
+ |Output directory
482
+
483
+ |--shortname
484
+ |Dataset shortname for concept ID prefixing
485
+
486
+ |--uri-prefix
487
+ |URI/URN prefix for the dataset
488
+
489
+ |--site-url
490
+ |Base URL of the glossarist site
491
+
492
+ |--title
493
+ |Dataset title for document header
494
+ |===
495
+
496
+ Ruby API:
497
+ [,ruby]
498
+ ----
499
+ # Export to JSON-LD
500
+ cmd = Glossarist::CLI::ExportCommand.new("path/to/dataset",
501
+ format: "jsonld", output: "/tmp/export", shortname: "isotc211")
502
+ cmd.run
503
+
504
+ # Transform a single concept to SKOS
505
+ skos = Glossarist::Transforms::ConceptToSkosTransform.transform(concept)
506
+ puts skos.to_jsonld
507
+ puts skos.to_turtle
508
+ ----
509
+
424
510
  === validate
425
511
 
426
512
  Validate a dataset directory or `.gcr` file for schema compliance.
data/glossarist.gemspec CHANGED
@@ -31,8 +31,9 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ["lib"]
33
33
 
34
- spec.add_dependency "lutaml-model", "~> 0.8"
34
+ spec.add_dependency "lutaml-model", "~> 0.8.5"
35
35
  spec.add_dependency "relaton", ">= 2.0.0", "< 3"
36
36
  spec.add_dependency "rubyzip", ">= 2.3", "< 3"
37
+ spec.add_dependency "tbx", "~> 0.1"
37
38
  spec.add_dependency "thor"
38
39
  end
@@ -0,0 +1,109 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Glossarist
4
+ class CLI
5
+ class ExportCommand
6
+ EXTENSIONS = {
7
+ "json" => "json",
8
+ "jsonld" => "jsonld",
9
+ "turtle" => "ttl",
10
+ "tbx" => "tbx.xml",
11
+ "jsonl" => "jsonl",
12
+ }.freeze
13
+
14
+ def initialize(path, options)
15
+ @path = path
16
+ @options = options
17
+ end
18
+
19
+ def run
20
+ format = @options[:format]
21
+ output_dir = File.expand_path(@options[:output])
22
+ FileUtils.mkdir_p(output_dir)
23
+
24
+ concepts = load_concepts
25
+ name = resolve_shortname(concepts)
26
+
27
+ case format
28
+ when "json" then export_json(concepts, output_dir)
29
+ when "jsonld" then export_document(concepts, name, output_dir, :jsonld)
30
+ when "turtle" then export_document(concepts, name, output_dir, :turtle)
31
+ when "tbx" then export_tbx(concepts, name, output_dir)
32
+ when "jsonl" then export_jsonl(concepts, name, output_dir)
33
+ end
34
+ rescue ArgumentError => e
35
+ warn "Error: #{e.message}"
36
+ exit 1
37
+ end
38
+
39
+ private
40
+
41
+ def load_concepts
42
+ if @path.end_with?(".gcr")
43
+ package = GcrPackage.load(@path)
44
+ resolve_metadata_from_package(package)
45
+ package.concepts
46
+ else
47
+ collection = ManagedConceptCollection.new
48
+ collection.load_from_files(@path)
49
+ collection.to_a
50
+ end
51
+ end
52
+
53
+ def resolve_metadata_from_package(package)
54
+ @options[:shortname] ||= package.metadata["shortname"]
55
+ @options[:uri_prefix] ||= package.metadata["uri_prefix"]
56
+ end
57
+
58
+ def resolve_shortname(_concepts)
59
+ @options[:shortname] || "glossary"
60
+ end
61
+
62
+ def transform_options
63
+ {
64
+ shortname: @options[:shortname],
65
+ uri_prefix: @options[:uri_prefix],
66
+ site_url: @options[:site_url],
67
+ title: @options[:title],
68
+ }.compact
69
+ end
70
+
71
+ def export_json(concepts, output_dir)
72
+ concepts.each do |concept|
73
+ id = concept.data&.id || concept.identifier
74
+ File.write(File.join(output_dir, "#{id}.json"), concept.to_json)
75
+ end
76
+ end
77
+
78
+ def export_document(concepts, name, output_dir, format)
79
+ require "glossarist/transforms/concept_to_skos_transform"
80
+ vocab = Transforms::ConceptToSkosTransform.transform_document(concepts,
81
+ transform_options)
82
+ ext = EXTENSIONS[format.to_s]
83
+ File.write(File.join(output_dir, "#{name}.#{ext}"),
84
+ vocab.public_send(:"to_#{format}"))
85
+ end
86
+
87
+ def export_tbx(concepts, name, output_dir)
88
+ require "glossarist/transforms/concept_to_tbx_transform"
89
+ doc = Transforms::ConceptToTbxTransform.transform_document(concepts,
90
+ transform_options)
91
+ File.write(File.join(output_dir, "#{name}.#{EXTENSIONS['tbx']}"),
92
+ doc.to_xml)
93
+ end
94
+
95
+ def export_jsonl(concepts, name, output_dir)
96
+ require "glossarist/transforms/concept_to_skos_transform"
97
+ File.open(File.join(output_dir, "#{name}.#{EXTENSIONS['jsonl']}"),
98
+ "w") do |f|
99
+ concepts.each do |concept|
100
+ skos = Transforms::ConceptToSkosTransform.transform(concept,
101
+ transform_options)
102
+ f.write(skos.to_jsonld)
103
+ f.write("\n")
104
+ end
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
@@ -20,6 +20,8 @@ module Glossarist
20
20
  tags: @options[:tags],
21
21
  register_yaml: @options[:register_yaml],
22
22
  uri_prefix: @options[:uri_prefix],
23
+ concept_uri_template: @options[:concept_uri_template],
24
+ compiled_formats: parse_compiled_formats,
23
25
  )
24
26
 
25
27
  puts "Created #{@options[:output]}"
@@ -27,6 +29,15 @@ module Glossarist
27
29
  warn "Error: #{e.message}"
28
30
  exit 1
29
31
  end
32
+
33
+ private
34
+
35
+ def parse_compiled_formats
36
+ raw = @options[:compiled_formats]
37
+ return [] unless raw
38
+
39
+ raw.split(",").map(&:strip).reject(&:empty?)
40
+ end
30
41
  end
31
42
  end
32
43
  end
@@ -57,6 +57,10 @@ module Glossarist
57
57
  option :register_yaml, type: :string,
58
58
  desc: "Path to register.yaml to include in package"
59
59
  option :tags, type: :array, desc: "Tags for the dataset"
60
+ option :compiled_formats, type: :string,
61
+ desc: "Comma-separated compiled formats to bundle (tbx,jsonld,turtle,jsonl)"
62
+ option :concept_uri_template, type: :string,
63
+ desc: "URI template for concept URIs"
60
64
  def package(dir)
61
65
  require_relative "cli/package_command"
62
66
  Glossarist::CLI::PackageCommand.new(dir, options).run
@@ -76,6 +80,25 @@ module Glossarist
76
80
  Glossarist::CLI::ValidateCommand.new(path, options).run
77
81
  end
78
82
 
83
+ desc "export PATH", "Export concepts in machine-readable formats"
84
+ option :format, type: :string, required: true,
85
+ enum: %w[json jsonld turtle tbx jsonl],
86
+ desc: "Output format"
87
+ option :output, aliases: :o, type: :string, required: true,
88
+ desc: "Output directory"
89
+ option :shortname, type: :string,
90
+ desc: "Dataset shortname for concept ID prefixing"
91
+ option :uri_prefix, type: :string,
92
+ desc: "URI/URN prefix for the dataset"
93
+ option :site_url, type: :string,
94
+ desc: "Base URL of the glossarist site"
95
+ option :title, type: :string,
96
+ desc: "Dataset title for document header"
97
+ def export(path)
98
+ require_relative "cli/export_command"
99
+ Glossarist::CLI::ExportCommand.new(path, options).run
100
+ end
101
+
79
102
  def method_missing(*args)
80
103
  warn "No method found named: #{args[0]}"
81
104
  warn "Run with `--help` or `-h` to see available options"
@@ -19,6 +19,7 @@ module Glossarist
19
19
  attribute :license, :string
20
20
  attribute :uri_prefix, :string
21
21
  attribute :concept_uri_template, :string
22
+ attribute :compiled_formats, :string, collection: true
22
23
  attribute :external_references, :hash, collection: true
23
24
 
24
25
  key_value do
@@ -39,6 +40,7 @@ module Glossarist
39
40
  map :license, to: :license
40
41
  map :uri_prefix, to: :uri_prefix
41
42
  map :concept_uri_template, to: :concept_uri_template
43
+ map :compiled_formats, to: :compiled_formats
42
44
  map :external_references, to: :external_references
43
45
  end
44
46
 
@@ -59,6 +61,7 @@ module Glossarist
59
61
  statistics: stats,
60
62
  uri_prefix: options[:uri_prefix],
61
63
  concept_uri_template: options[:concept_uri_template],
64
+ compiled_formats: options[:compiled_formats] || [],
62
65
  external_references: derive_external_references(concepts),
63
66
  )
64
67
  end
@@ -5,6 +5,15 @@ require "fileutils"
5
5
 
6
6
  module Glossarist
7
7
  class GcrPackage
8
+ COMPILED_EXTENSIONS = {
9
+ "tbx" => "tbx.xml",
10
+ "jsonld" => "jsonld",
11
+ "turtle" => "ttl",
12
+ "jsonl" => "jsonl",
13
+ }.freeze
14
+
15
+ KNOWN_COMPILED_FORMATS = COMPILED_EXTENSIONS.keys.freeze
16
+
8
17
  attr_reader :zip_path, :metadata, :concepts
9
18
 
10
19
  def initialize(zip_path)
@@ -13,16 +22,18 @@ module Glossarist
13
22
  @concepts = []
14
23
  end
15
24
 
16
- def self.create(concepts:, metadata:, output_path:, register_data: nil)
25
+ def self.create(concepts:, metadata:, output_path:, register_data: nil,
26
+ compiled_formats: [], **opts)
17
27
  FileUtils.mkdir_p(File.dirname(output_path))
18
28
  package = new(output_path)
19
- package.send(:write, concepts, metadata, register_data)
29
+ package.write(concepts, metadata, register_data,
30
+ compiled_formats: compiled_formats, **opts)
20
31
  package
21
32
  end
22
33
 
23
34
  def self.load(zip_path)
24
35
  package = new(zip_path)
25
- package.send(:read)
36
+ package.read
26
37
  package
27
38
  end
28
39
 
@@ -30,8 +41,14 @@ module Glossarist
30
41
  title: nil, description: nil, owner: nil,
31
42
  tags: [], register_yaml: nil,
32
43
  uri_prefix: nil, concept_uri_template: nil,
33
- streaming: false)
44
+ streaming: false, compiled_formats: [])
34
45
  dir = File.expand_path(dir)
46
+ formats = Array(compiled_formats).map(&:to_s)
47
+
48
+ if streaming && formats.any?
49
+ raise ArgumentError,
50
+ "Compiled formats require batch mode (streaming: true is incompatible)"
51
+ end
35
52
 
36
53
  if streaming
37
54
  create_streaming(dir, output: output, shortname: shortname, version: version,
@@ -44,7 +61,8 @@ module Glossarist
44
61
  title: title, description: description, owner: owner,
45
62
  tags: tags, register_yaml: register_yaml,
46
63
  uri_prefix: uri_prefix,
47
- concept_uri_template: concept_uri_template)
64
+ concept_uri_template: concept_uri_template,
65
+ compiled_formats: formats)
48
66
  end
49
67
  end
50
68
 
@@ -52,9 +70,8 @@ module Glossarist
52
70
  GcrValidator.new.validate(@zip_path)
53
71
  end
54
72
 
55
- private
56
-
57
- def write(concepts, metadata, register_data)
73
+ def write(concepts, metadata, register_data, compiled_formats: [],
74
+ shortname: nil, **opts)
58
75
  Zip::File.open(@zip_path, create: true) do |zf|
59
76
  zf.get_output_stream("metadata.yaml") do |f|
60
77
  f.write(metadata.to_yaml)
@@ -69,6 +86,11 @@ module Glossarist
69
86
  concepts.each do |mc|
70
87
  write_concept(zf, mc)
71
88
  end
89
+
90
+ if compiled_formats.any?
91
+ write_compiled(zf, concepts, compiled_formats, shortname: shortname,
92
+ **opts)
93
+ end
72
94
  end
73
95
  end
74
96
 
@@ -98,10 +120,67 @@ module Glossarist
98
120
  end
99
121
  end
100
122
 
123
+ def write_compiled(zip_file, concepts, formats, shortname: nil, **opts)
124
+ name = shortname || "glossary"
125
+ transform_opts = { shortname: name }.merge(opts.slice(:site_url,
126
+ :uri_prefix, :title))
127
+
128
+ if formats.include?("tbx")
129
+ write_compiled_tbx(zip_file, concepts, transform_opts, name)
130
+ end
131
+
132
+ skos_formats = formats & %w[jsonld turtle jsonl]
133
+ if skos_formats.any?
134
+ write_compiled_skos(zip_file, concepts, skos_formats, transform_opts,
135
+ name)
136
+ end
137
+
138
+ (formats - KNOWN_COMPILED_FORMATS).each do |fmt|
139
+ warn "Warning: Unknown compiled format '#{fmt}', skipping"
140
+ end
141
+ end
142
+
143
+ def write_compiled_tbx(zip_file, concepts, opts, name)
144
+ require "glossarist/transforms/concept_to_tbx_transform"
145
+ doc = Transforms::ConceptToTbxTransform.transform_document(concepts, opts)
146
+ zip_file.get_output_stream("compiled/#{name}.tbx.xml") do |f|
147
+ f.write(doc.to_xml)
148
+ end
149
+ end
150
+
151
+ def write_compiled_skos(zip_file, concepts, formats, opts, name) # rubocop:disable Metrics/MethodLength
152
+ require "glossarist/transforms/concept_to_skos_transform"
153
+ vocab = Transforms::ConceptToSkosTransform.transform_document(concepts,
154
+ opts)
155
+
156
+ if formats.include?("jsonld")
157
+ zip_file.get_output_stream("compiled/#{name}.jsonld") do |f|
158
+ f.write(vocab.to_jsonld)
159
+ end
160
+ end
161
+
162
+ if formats.include?("turtle")
163
+ zip_file.get_output_stream("compiled/#{name}.ttl") do |f|
164
+ f.write(vocab.to_turtle)
165
+ end
166
+ end
167
+
168
+ return unless formats.include?("jsonl")
169
+
170
+ zip_file.get_output_stream("compiled/#{name}.jsonl") do |f|
171
+ concepts.each do |concept|
172
+ skos = Transforms::ConceptToSkosTransform.transform(concept, opts)
173
+ f.write(skos.to_jsonld)
174
+ f.write("\n")
175
+ end
176
+ end
177
+ end
178
+
101
179
  class << self
102
180
  private
103
181
 
104
- def create_batch(dir, output:, shortname:, version:, **opts)
182
+ def create_batch(dir, output:, shortname:, version:,
183
+ compiled_formats: [], **opts)
105
184
  concepts = ConceptCollector.collect(dir)
106
185
  if concepts.empty?
107
186
  raise ArgumentError,
@@ -117,13 +196,17 @@ module Glossarist
117
196
 
118
197
  register_data = load_register_data(opts[:register_yaml], dir)
119
198
  metadata = build_metadata(concepts, shortname: shortname, version: version,
120
- register_data: register_data, **opts)
199
+ register_data: register_data,
200
+ compiled_formats: compiled_formats, **opts)
121
201
 
122
202
  create(
123
203
  concepts: concepts,
124
204
  metadata: metadata,
125
205
  register_data: register_data,
126
206
  output_path: File.expand_path(output),
207
+ compiled_formats: compiled_formats,
208
+ shortname: shortname,
209
+ **opts,
127
210
  )
128
211
  end
129
212
 
@@ -195,7 +278,7 @@ module Glossarist
195
278
  end
196
279
 
197
280
  def build_metadata(concepts, shortname:, version:, register_data: nil,
198
- **opts)
281
+ compiled_formats: [], **opts)
199
282
  GcrMetadata.from_concepts(
200
283
  concepts,
201
284
  register_data: register_data,
@@ -208,6 +291,7 @@ module Glossarist
208
291
  tags: opts[:tags],
209
292
  uri_prefix: opts[:uri_prefix],
210
293
  concept_uri_template: opts[:concept_uri_template],
294
+ compiled_formats: compiled_formats,
211
295
  },
212
296
  )
213
297
  end
@@ -29,7 +29,11 @@ module Glossarist
29
29
  end
30
30
 
31
31
  def self.count_with(l10ns, attr)
32
- l10ns.count { |l| l.data.send(attr)&.any? }
32
+ case attr
33
+ when :definition then l10ns.count { |l| l.data.definition&.any? }
34
+ when :sources then l10ns.count { |l| l.data.sources&.any? }
35
+ else 0
36
+ end
33
37
  end
34
38
  end
35
39
  end
@@ -126,6 +126,16 @@ module Glossarist
126
126
  # Returns concept localization.
127
127
  # @param lang [String] language code
128
128
  # @return [LocalizedConcept]
129
+ def to_jsonld
130
+ require "glossarist/transforms/concept_to_skos_transform"
131
+ Transforms::ConceptToSkosTransform.transform(self).to_jsonld
132
+ end
133
+
134
+ def to_turtle
135
+ require "glossarist/transforms/concept_to_skos_transform"
136
+ Transforms::ConceptToSkosTransform.transform(self).to_turtle
137
+ end
138
+
129
139
  def default_designation
130
140
  localized = localization("eng") || localizations.values.first
131
141
  terms = localized&.preferred_terms&.first || localized&.terms&.first
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Glossarist
4
+ module Rdf
5
+ class LocalizedLiteral < Lutaml::Model::Serializable
6
+ include Lutaml::Rdf::LanguageTagged
7
+
8
+ attribute :value, :string
9
+ attribute :language_code, :string
10
+
11
+ key_value do
12
+ map :value, to: :value
13
+ map :language_code, to: :language_code
14
+ end
15
+
16
+ def language_tag
17
+ language_code
18
+ end
19
+
20
+ def to_s
21
+ value.to_s
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Glossarist
4
+ module Rdf
5
+ module Namespaces
6
+ class DctermsNamespace < Lutaml::Rdf::Namespace
7
+ uri "http://purl.org/dc/terms/"
8
+ prefix "dcterms"
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Glossarist
4
+ module Rdf
5
+ module Namespaces
6
+ class SkosNamespace < Lutaml::Rdf::Namespace
7
+ uri "http://www.w3.org/2004/02/skos/core#"
8
+ prefix "skos"
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Glossarist
4
+ module Rdf
5
+ module Namespaces
6
+ autoload :SkosNamespace, "#{__dir__}/namespaces/skos_namespace"
7
+ autoload :DctermsNamespace, "#{__dir__}/namespaces/dcterms_namespace"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/turtle"
4
+ require "lutaml/jsonld"
5
+ require_relative "../rdf"
6
+
7
+ module Glossarist
8
+ module Rdf
9
+ class SkosConcept < Lutaml::Model::Serializable
10
+ attribute :code, :string
11
+ attribute :labels, LocalizedLiteral, collection: true
12
+ attribute :definitions, LocalizedLiteral, collection: true
13
+ attribute :alt_labels, LocalizedLiteral, collection: true
14
+ attribute :scope_notes, LocalizedLiteral, collection: true
15
+ attribute :sources, :string, collection: true
16
+ attribute :domain, :string
17
+ attribute :date_accepted, :string
18
+
19
+ rdf do
20
+ namespace Namespaces::SkosNamespace, Namespaces::DctermsNamespace
21
+
22
+ subject { |c| "https://glossarist.org/concept/#{c.code}" }
23
+ type "skos:Concept"
24
+
25
+ predicate :notation, namespace: Namespaces::SkosNamespace,
26
+ to: :code
27
+ predicate :prefLabel, namespace: Namespaces::SkosNamespace,
28
+ to: :labels, lang_tagged: true
29
+ predicate :definition, namespace: Namespaces::SkosNamespace,
30
+ to: :definitions, lang_tagged: true
31
+ predicate :altLabel, namespace: Namespaces::SkosNamespace,
32
+ to: :alt_labels, lang_tagged: true
33
+ predicate :scopeNote, namespace: Namespaces::SkosNamespace,
34
+ to: :scope_notes, lang_tagged: true
35
+ predicate :subject, namespace: Namespaces::DctermsNamespace,
36
+ to: :domain
37
+ predicate :source, namespace: Namespaces::DctermsNamespace,
38
+ to: :sources
39
+ predicate :dateAccepted, namespace: Namespaces::DctermsNamespace,
40
+ to: :date_accepted
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/turtle"
4
+ require "lutaml/jsonld"
5
+ require_relative "../rdf"
6
+
7
+ module Glossarist
8
+ module Rdf
9
+ class SkosVocabulary < Lutaml::Model::Serializable
10
+ attribute :id, :string
11
+ attribute :title, :string
12
+ attribute :concepts, SkosConcept, collection: true
13
+
14
+ rdf do
15
+ namespace Namespaces::SkosNamespace, Namespaces::DctermsNamespace
16
+
17
+ subject { |v| "https://glossarist.org/vocab/#{v.id}" }
18
+ type "skos:ConceptScheme"
19
+
20
+ predicate :prefLabel, namespace: Namespaces::SkosNamespace, to: :title
21
+
22
+ members :concepts
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Glossarist
4
+ module Rdf
5
+ autoload :Namespaces, "#{__dir__}/rdf/namespaces"
6
+ autoload :LocalizedLiteral, "#{__dir__}/rdf/localized_literal"
7
+ autoload :SkosConcept, "#{__dir__}/rdf/skos_concept"
8
+ autoload :SkosVocabulary, "#{__dir__}/rdf/skos_vocabulary"
9
+ end
10
+ end
@@ -41,9 +41,7 @@ module Glossarist
41
41
  def designations_for(concept)
42
42
  if concept.is_a?(ManagedConcept)
43
43
  concept.localizations.flat_map do |l10n|
44
- l10n.data.terms.filter_map do |t|
45
- t.respond_to?(:designation) ? t.designation : nil
46
- end
44
+ l10n.data.terms.filter_map(&:designation)
47
45
  end
48
46
  else
49
47
  concept.each_value.flat_map do |lang_block|
@@ -0,0 +1,133 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../rdf"
4
+
5
+ module Glossarist
6
+ module Transforms
7
+ class ConceptToSkosTransform
8
+ def self.transform(managed_concept, options = {})
9
+ new(managed_concept, options).build
10
+ end
11
+
12
+ def self.transform_document(concepts, options = {})
13
+ Rdf::SkosVocabulary.new(
14
+ id: options[:shortname] || "glossary",
15
+ title: options[:title],
16
+ concepts: concepts.map { |c| transform(c, options) },
17
+ )
18
+ end
19
+
20
+ def initialize(managed_concept, options = {})
21
+ @concept = managed_concept
22
+ @options = options
23
+ end
24
+
25
+ def build
26
+ Rdf::SkosConcept.new(
27
+ code: concept_code,
28
+ labels: build_labels,
29
+ definitions: build_definitions,
30
+ alt_labels: build_alt_labels,
31
+ scope_notes: build_scope_notes,
32
+ domain: build_domain,
33
+ sources: build_sources,
34
+ date_accepted: build_date_accepted,
35
+ )
36
+ end
37
+
38
+ private
39
+
40
+ attr_reader :concept, :options
41
+
42
+ def concept_code
43
+ concept.data&.id || concept.identifier
44
+ end
45
+
46
+ def build_labels
47
+ each_localization.filter_map do |lang, l10n|
48
+ term = l10n.preferred_terms&.first || l10n.terms&.first
49
+ next unless term
50
+
51
+ Rdf::LocalizedLiteral.new(
52
+ value: term.designation.to_s,
53
+ language_code: lang,
54
+ )
55
+ end
56
+ end
57
+
58
+ def build_alt_labels
59
+ each_localization.flat_map do |lang, l10n|
60
+ preferred_term = l10n.preferred_terms&.first || l10n.terms&.first
61
+ (l10n.terms || []).reject do |t|
62
+ t == preferred_term
63
+ end.filter_map do |term|
64
+ next unless term.designation
65
+
66
+ Rdf::LocalizedLiteral.new(
67
+ value: term.designation.to_s,
68
+ language_code: lang,
69
+ )
70
+ end
71
+ end
72
+ end
73
+
74
+ def build_definitions
75
+ each_localization.filter_map do |lang, l10n|
76
+ content = l10n.data&.definition&.first&.content
77
+ next unless content
78
+
79
+ Rdf::LocalizedLiteral.new(
80
+ value: content.to_s,
81
+ language_code: lang,
82
+ )
83
+ end
84
+ end
85
+
86
+ def build_scope_notes
87
+ each_localization.filter_map do |lang, l10n|
88
+ note = l10n.data&.notes&.first&.content
89
+ next unless note
90
+
91
+ Rdf::LocalizedLiteral.new(
92
+ value: note.to_s,
93
+ language_code: lang,
94
+ )
95
+ end
96
+ end
97
+
98
+ def build_domain
99
+ l10n = concept.localizations.first
100
+ l10n&.data&.domain
101
+ end
102
+
103
+ def build_sources
104
+ each_localization.flat_map do |_lang, l10n|
105
+ Array(l10n.data&.sources).select(&:authoritative?).filter_map do |src|
106
+ origin = src.origin
107
+ next unless origin
108
+
109
+ origin.ref || origin.text
110
+ end
111
+ end.uniq
112
+ end
113
+
114
+ def build_date_accepted
115
+ date = concept.date_accepted
116
+ return unless date
117
+
118
+ date.date&.iso8601
119
+ end
120
+
121
+ def each_localization
122
+ return enum_for(:each_localization) unless block_given?
123
+
124
+ concept.localizations.each do |l10n|
125
+ lang = l10n.language_code || l10n.data&.language_code
126
+ next unless lang
127
+
128
+ yield lang, l10n
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tbx"
4
+
5
+ module Glossarist
6
+ module Transforms
7
+ class ConceptToTbxTransform
8
+ def self.transform(managed_concept, options = {})
9
+ new(managed_concept, options).build_entry
10
+ end
11
+
12
+ def self.transform_document(concepts, options = {})
13
+ doc = Tbx::Document.new
14
+ body = Tbx::Body.new
15
+ body.concept_entry = concepts.map { |c| transform(c, options) }
16
+ text = Tbx::TextElement.new
17
+ text.body = body
18
+ doc.text = text
19
+
20
+ if options[:title]
21
+ header = doc.tbx_header || Tbx::TbxHeader.new
22
+ file_desc = Tbx::FileDesc.new
23
+ title_stmt = Tbx::TitleStmt.new
24
+ title = Tbx::Title.new
25
+ title.content = options[:title]
26
+ title_stmt.title = title
27
+ file_desc.title_stmt = title_stmt
28
+ header.file_desc = file_desc
29
+ doc.tbx_header = header
30
+ end
31
+
32
+ doc
33
+ end
34
+
35
+ def initialize(managed_concept, options = {})
36
+ @concept = managed_concept
37
+ @options = options
38
+ end
39
+
40
+ def build_entry
41
+ entry = Tbx::ConceptEntry.new
42
+ entry.id = concept_id
43
+ entry.lang_sec = build_lang_sections
44
+ entry
45
+ end
46
+
47
+ private
48
+
49
+ attr_reader :concept, :options
50
+
51
+ def concept_id
52
+ prefix = options[:shortname]
53
+ id = concept.data&.id || concept.identifier
54
+ prefix ? "#{prefix}_#{id}" : id.to_s
55
+ end
56
+
57
+ def build_lang_sections
58
+ concept.localizations.filter_map do |l10n|
59
+ lang = l10n.language_code
60
+ next unless lang
61
+
62
+ ls = Tbx::LangSec.new
63
+ ls.lang = lang
64
+
65
+ term = l10n.preferred_terms&.first || l10n.terms&.first
66
+ if term&.designation
67
+ ts = Tbx::TermSec.new
68
+ t = Tbx::Term.new
69
+ t.content = term.designation.to_s
70
+ ts.term = t
71
+ ls.term_sec = ts
72
+ end
73
+
74
+ definition = l10n.data&.definition&.first&.content
75
+ if definition
76
+ ds = Tbx::Descrip.new
77
+ ds.content = definition.to_s
78
+ ls.descrip = ds
79
+ end
80
+
81
+ ls
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Glossarist
4
+ module Transforms
5
+ autoload :ConceptToSkosTransform,
6
+ "glossarist/transforms/concept_to_skos_transform"
7
+ autoload :ConceptToTbxTransform,
8
+ "glossarist/transforms/concept_to_tbx_transform"
9
+ end
10
+ end
@@ -4,5 +4,5 @@
4
4
  #
5
5
 
6
6
  module Glossarist
7
- VERSION = "2.5.2"
7
+ VERSION = "2.6.0"
8
8
  end
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.5.2
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-05-06 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: lutaml-model
@@ -15,14 +16,14 @@ dependencies:
15
16
  requirements:
16
17
  - - "~>"
17
18
  - !ruby/object:Gem::Version
18
- version: '0.8'
19
+ version: 0.8.5
19
20
  type: :runtime
20
21
  prerelease: false
21
22
  version_requirements: !ruby/object:Gem::Requirement
22
23
  requirements:
23
24
  - - "~>"
24
25
  - !ruby/object:Gem::Version
25
- version: '0.8'
26
+ version: 0.8.5
26
27
  - !ruby/object:Gem::Dependency
27
28
  name: relaton
28
29
  requirement: !ruby/object:Gem::Requirement
@@ -63,6 +64,20 @@ dependencies:
63
64
  - - "<"
64
65
  - !ruby/object:Gem::Version
65
66
  version: '3'
67
+ - !ruby/object:Gem::Dependency
68
+ name: tbx
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '0.1'
74
+ type: :runtime
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '0.1'
66
81
  - !ruby/object:Gem::Dependency
67
82
  name: thor
68
83
  requirement: !ruby/object:Gem::Requirement
@@ -77,6 +92,7 @@ dependencies:
77
92
  - - ">="
78
93
  - !ruby/object:Gem::Version
79
94
  version: '0'
95
+ description:
80
96
  email:
81
97
  - open.source@ribose.com
82
98
  executables:
@@ -105,6 +121,7 @@ files:
105
121
  - lib/glossarist/asset.rb
106
122
  - lib/glossarist/citation.rb
107
123
  - lib/glossarist/cli.rb
124
+ - lib/glossarist/cli/export_command.rb
108
125
  - lib/glossarist/cli/package_command.rb
109
126
  - lib/glossarist/cli/upgrade_command.rb
110
127
  - lib/glossarist/cli/validate_command.rb
@@ -158,6 +175,13 @@ files:
158
175
  - lib/glossarist/managed_concept_collection.rb
159
176
  - lib/glossarist/managed_concept_data.rb
160
177
  - lib/glossarist/non_verb_rep.rb
178
+ - lib/glossarist/rdf.rb
179
+ - lib/glossarist/rdf/localized_literal.rb
180
+ - lib/glossarist/rdf/namespaces.rb
181
+ - lib/glossarist/rdf/namespaces/dcterms_namespace.rb
182
+ - lib/glossarist/rdf/namespaces/skos_namespace.rb
183
+ - lib/glossarist/rdf/skos_concept.rb
184
+ - lib/glossarist/rdf/skos_vocabulary.rb
161
185
  - lib/glossarist/reference_extractor.rb
162
186
  - lib/glossarist/reference_resolver.rb
163
187
  - lib/glossarist/register_data.rb
@@ -168,6 +192,9 @@ files:
168
192
  - lib/glossarist/resolution_adapter/remote.rb
169
193
  - lib/glossarist/resolution_adapter/route.rb
170
194
  - lib/glossarist/schema_migration.rb
195
+ - lib/glossarist/transforms.rb
196
+ - lib/glossarist/transforms/concept_to_skos_transform.rb
197
+ - lib/glossarist/transforms/concept_to_tbx_transform.rb
171
198
  - lib/glossarist/urn_resolver.rb
172
199
  - lib/glossarist/utilities.rb
173
200
  - lib/glossarist/utilities/common_functions.rb
@@ -192,6 +219,7 @@ metadata:
192
219
  source_code_uri: https://github.com/glossarist/glossarist-ruby
193
220
  bug_tracker_uri: https://github.com/glossarist/glossarist-ruby/issues
194
221
  rubygems_mfa_required: 'true'
222
+ post_install_message:
195
223
  rdoc_options: []
196
224
  require_paths:
197
225
  - lib
@@ -206,7 +234,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
234
  - !ruby/object:Gem::Version
207
235
  version: '0'
208
236
  requirements: []
209
- rubygems_version: 3.6.9
237
+ rubygems_version: 3.5.22
238
+ signing_key:
210
239
  specification_version: 4
211
240
  summary: Concept models for terminology glossaries conforming ISO 10241-1.
212
241
  test_files: []