glossarist 2.14.15 → 2.14.16

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: 655f02b361ee905c65608800454cda81b99801df1abf0432527d81e0a664ee51
4
- data.tar.gz: 2af428ac0c45bf6dacb03dd93c5c325dcfd04b63263f2704eeda13371319fd38
3
+ metadata.gz: a584d4edbe83762292055fa2a0e6af624d66a277b511a28ad34e01f03e4c05fc
4
+ data.tar.gz: d5e638432a0d281469f4531b4ded63047b68b8005cbdaeade9d09a32c75172dd
5
5
  SHA512:
6
- metadata.gz: 98bec4dd3f9d1db11a79391ec081ca840ca1dd6c1b5b33a6cc0bfe066989c6d7f52b2ca3787fed77ef0e75e96bc0e999e6ced1965c0872c3debffbc316a6f365
7
- data.tar.gz: 8430eebf7f31174bd40959db9826a0bb334452cc4ce8560853d42c936e2964de25a404094d1766bdbfef12325f81d05f77b514dea7c3a842f8fc0bd6fc943746
6
+ metadata.gz: c1804db5d0ea4deaf8e87a35545570856a42d66593d8cf07e93bf43a1e81b464a13bd875590f022c6f548c0438a595f5b74d1e98ab394eed22f7d478cc229903
7
+ data.tar.gz: 6d5db078479e2824d7dfd82baa39a127e86f04bcfd1eee56be26000d6b5f372a23a31f0a39e5bdd66cdb765d241f5c80981d748fe7883cb093c0c11bcb6ddbc3
@@ -150,24 +150,38 @@ Both snake_case and camelCase keys are accepted on read; the writer emits snake_
150
150
 
151
151
  == Relations (relations/)
152
152
 
153
- One file per n-ary relation, named `<slug>.yaml` under the comprehensive concept's id:
153
+ One file per n-ary relation (hyperedge), named `<criterion-slug>.yaml` under the comprehensive concept's id. The `type` field distinguishes the relation kind (`partitive_relation`, `generic_relation`, ...):
154
154
 
155
155
  [,yaml]
156
156
  ----
157
157
  ---
158
+ type: partitive_relation
158
159
  comprehensive:
159
- ref: urn:my-glossary:concept:3a75582e-...
160
- partitives:
161
- - ref: urn:my-glossary:concept:4b0e2358-...
162
- multiplicity: compulsory # or optional / compulsory_multiple / ...
160
+ source: VIM
161
+ id: '112-02-09'
162
+ members:
163
+ - ref:
164
+ source: VIM
165
+ id: '112-02-10'
166
+ presence: required # or optional (ISO 704 line style)
167
+ count: exactly_one # or at_least_one / multiple
163
168
  is_delimiting: false
164
- - ref: urn:my-glossary:concept:5c1f3469-...
169
+ - ref:
170
+ source: VIM
171
+ id: '112-03-26'
165
172
  completeness: complete # or partial
166
173
  criterion:
167
- eng: physical structure
174
+ eng: measurement result composition
168
175
  ----
169
176
 
170
- ISO 704 requires at least two partitives; `Validation::Rules` enforces structural invariants (GLS-2xx series).
177
+ ISO 704 requires at least two members per relation; `Validation::Rules` enforces structural invariants (GLS-2xx series).
178
+
179
+ A single comprehensive concept can carry N hyperedges (one per criterion of subdivision), each in its own file under `relations/<comprehensive-id>/`. Legacy files with a `partitives:` key (member list with the `multiplicity` enum instead of the `presence`/`count` decomposition) are read for backward compatibility; the writer emits the `members` form above.
180
+
181
+ [NOTE]
182
+ --
183
+ *Remaining transition step.* The concept-model shapes' property path still reads `hasPartitiveRelation`; the v3.3 shape bump renames it to `hasMember` (the native ontology property). The wire keys and semantics shown here are current.
184
+ --
171
185
 
172
186
  == bibliography.yaml
173
187
 
@@ -1,12 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Glossarist
4
+ # Deprecated: retained for ABI compatibility only. No internal callers
5
+ # remain — build concepts as a plain Array and persist through
6
+ # GlossaryStore. Removal is slated for the next major release.
4
7
  class ManagedConceptCollection
5
8
  include Enumerable
6
9
 
7
10
  attr_accessor :managed_concepts
8
11
 
9
12
  def initialize(file_key: nil)
13
+ warn "[glossarist] ManagedConceptCollection is deprecated; use a " \
14
+ "plain Array and GlossaryStore (removal slated for 3.0)"
10
15
  @managed_concepts = []
11
16
  @managed_concepts_ids = {}
12
17
  @file_key = file_key
@@ -15,7 +15,12 @@ module Glossarist
15
15
  return nil unless reference.is_a?(ConceptReference)
16
16
  return nil unless reference.source == @source_id
17
17
 
18
- concepts.by_id_and(reference.concept_id, reference.version)
18
+ # concepts is any Enumerable of ManagedConcepts (Array or
19
+ # GlossaryStore); match the uuid or the data id, with version.
20
+ concepts.find do |c|
21
+ (c.uuid == reference.concept_id || c.data&.id == reference.concept_id) &&
22
+ (reference.version.nil? || c.version == reference.version)
23
+ end
19
24
  end
20
25
  end
21
26
  end
@@ -58,7 +58,7 @@ module Glossarist
58
58
  save_to_path(existing, dataset_path)
59
59
 
60
60
  ImportResult.new(
61
- concepts: existing.managed_concepts,
61
+ concepts: existing,
62
62
  conflicts: result_state.conflicts,
63
63
  source_files: xml_files,
64
64
  skipped_count: result_state.skipped,
@@ -78,7 +78,7 @@ module Glossarist
78
78
  existing_mc = index[key]
79
79
 
80
80
  if existing_mc.nil?
81
- existing.store(mc)
81
+ existing << mc
82
82
  index[key] = mc
83
83
  else
84
84
  state.conflicts << DuplicateConflict.new(
@@ -179,26 +179,26 @@ module Glossarist
179
179
  end
180
180
 
181
181
  def replace_in_collection(collection, old_mc, new_mc)
182
- collection.managed_concepts.delete(old_mc)
183
- collection.store(new_mc)
182
+ collection.delete(old_mc)
183
+ collection << new_mc
184
184
  end
185
185
 
186
186
  def load_existing(path)
187
- collection = ManagedConceptCollection.new
187
+ collection = []
188
188
  if path.end_with?(".gcr")
189
189
  package = GcrPackage.load(path)
190
- package.concepts.each { |mc| collection.store(mc) }
190
+ package.concepts.each { |mc| collection << mc }
191
191
  else
192
192
  GlossaryStore.new.tap do |s|
193
193
  s.load(path)
194
- end.each_concept { |mc| collection.store(mc) }
194
+ end.each_concept { |mc| collection << mc }
195
195
  end
196
196
  collection
197
197
  end
198
198
 
199
199
  def save_to_path(collection, path)
200
200
  if path.end_with?(".gcr")
201
- tmpdir = build_temp_dataset(collection.managed_concepts)
201
+ tmpdir = build_temp_dataset(collection)
202
202
  begin
203
203
  GC.start
204
204
  tmp_gcr = "#{path}.tmp.#{Process.pid}"
@@ -215,7 +215,7 @@ module Glossarist
215
215
  FileUtils.rm_f(tmp_gcr)
216
216
  end
217
217
  else
218
- save_dataset(collection.managed_concepts, path)
218
+ save_dataset(collection, path)
219
219
  end
220
220
  end
221
221
 
@@ -4,5 +4,5 @@
4
4
  #
5
5
 
6
6
  module Glossarist
7
- VERSION = "2.14.15"
7
+ VERSION = "2.14.16"
8
8
  end
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.14.15
4
+ version: 2.14.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-10 00:00:00.000000000 Z
11
+ date: 2026-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model