glossarist 2.9.1 → 2.10.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 +4 -4
- data/data/concept-model/README.md +4 -2
- data/data/concept-model/SOURCE.json +2 -2
- data/lib/glossarist/register_data.rb +0 -47
- data/lib/glossarist/tasks/sync_model.rb +1 -0
- data/lib/glossarist/transforms/concept_to_gloss_transform.rb +27 -20
- data/lib/glossarist/validation/rules/dataset_context.rb +2 -2
- 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: 483020f943aae466ffd07054d852c766673b71ca17c4289d59be667c2bd7fb4f
|
|
4
|
+
data.tar.gz: 876d6fdcdf3c087a4c6487a48e81592a14317bde57047fb7087104b2093d4e4f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f7bca485b83de6c31bcf896f95d27007794e97eb54f1fc7136e7fa590b237d4a53735f9a136e624447bb886d6d5ff52b43a3adadbd3611dde296a06f2b214f7
|
|
7
|
+
data.tar.gz: b7a489b23c7d504340cf7ae0c7bad68755d20cae57cacf8a6b340e2dde75a35fd64cce798157e9f0d4b0fc09a83d4f4fc94f7a58654d5cfda0c9aca835f77285
|
|
@@ -12,6 +12,7 @@ concept-model.
|
|
|
12
12
|
|
|
13
13
|
| File | Purpose |
|
|
14
14
|
|------|---------|
|
|
15
|
+
| `prefixes.ttl` | Canonical prefix bindings SSOT — consumed verbatim by every Turtle/JSON-LD serializer in the ecosystem |
|
|
15
16
|
| `glossarist.context.jsonld` | JSON-LD term map — reference |
|
|
16
17
|
| `glossarist.ttl` | OWL ontology (reference; not currently read at runtime) |
|
|
17
18
|
| `shapes/glossarist.shacl.ttl` | SHACL shapes — loaded by `Glossarist::Validation::ShaclValidator` at runtime |
|
|
@@ -21,8 +22,9 @@ concept-model.
|
|
|
21
22
|
Update these files from the latest concept-model tag:
|
|
22
23
|
|
|
23
24
|
```bash
|
|
24
|
-
rake glossarist:sync:model # fetches latest
|
|
25
|
-
rake glossarist:sync:model[v3.
|
|
25
|
+
rake glossarist:sync:model # fetches latest released tag
|
|
26
|
+
rake glossarist:sync:model[v3.1.0] # pin to a specific tag
|
|
27
|
+
rake glossarist:sync:model[main] # tracking upstream main (uncommon)
|
|
26
28
|
```
|
|
27
29
|
|
|
28
30
|
The sync task fetches via the GitHub raw endpoint (no clone needed).
|
|
@@ -37,53 +37,6 @@ module Glossarist
|
|
|
37
37
|
map "translations", to: :translations
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
def [](key)
|
|
41
|
-
case key
|
|
42
|
-
when "shortname", "id" then shortname
|
|
43
|
-
when "name" then name
|
|
44
|
-
when "description" then description
|
|
45
|
-
when "schema_version" then schema_version
|
|
46
|
-
when "version" then version
|
|
47
|
-
when "owner" then owner
|
|
48
|
-
when "languages" then languages
|
|
49
|
-
when "subregisters" then subregisters
|
|
50
|
-
when "uri_prefix" then uri_prefix
|
|
51
|
-
when "concept_uri_template" then concept_uri_template
|
|
52
|
-
when "homepage" then homepage
|
|
53
|
-
when "repository" then repository
|
|
54
|
-
when "license" then license
|
|
55
|
-
when "tags" then tags
|
|
56
|
-
when "translations" then translations
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def dig(*keys)
|
|
61
|
-
return nil if keys.empty?
|
|
62
|
-
|
|
63
|
-
first = self[keys.first]
|
|
64
|
-
keys.length == 1 ? first : nil
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def to_h
|
|
68
|
-
h = {}
|
|
69
|
-
h["shortname"] = shortname if shortname
|
|
70
|
-
h["name"] = name if name
|
|
71
|
-
h["description"] = description if description
|
|
72
|
-
h["schema_version"] = schema_version if schema_version
|
|
73
|
-
h["version"] = version if version
|
|
74
|
-
h["owner"] = owner if owner
|
|
75
|
-
h["languages"] = languages if languages && !languages.empty?
|
|
76
|
-
h["subregisters"] = subregisters if subregisters && !subregisters.empty?
|
|
77
|
-
h["uri_prefix"] = uri_prefix if uri_prefix
|
|
78
|
-
h["concept_uri_template"] = concept_uri_template if concept_uri_template
|
|
79
|
-
h["homepage"] = homepage if homepage
|
|
80
|
-
h["repository"] = repository if repository
|
|
81
|
-
h["license"] = license if license
|
|
82
|
-
h["tags"] = tags if tags && !tags.empty?
|
|
83
|
-
h["translations"] = translations if translations && !translations.empty?
|
|
84
|
-
h
|
|
85
|
-
end
|
|
86
|
-
|
|
87
40
|
def self.from_file(path)
|
|
88
41
|
return nil unless File.exist?(path)
|
|
89
42
|
|
|
@@ -20,10 +20,17 @@ module Glossarist
|
|
|
20
20
|
.transform_keys(&:to_s)
|
|
21
21
|
.freeze
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
# Maps each Designation subclass to the method that builds its RDF
|
|
24
|
+
# counterpart. Lookup is by exact class — a Designation instance is
|
|
25
|
+
# always exactly one of these classes (the STI pattern in
|
|
26
|
+
# Designation::Base#of_yaml enforces this). Adding a new Designation
|
|
27
|
+
# subclass means adding one entry here, not editing a case/when.
|
|
28
|
+
DESIGNATION_BUILDERS = {
|
|
29
|
+
Designation::Abbreviation => :build_gloss_abbreviation,
|
|
30
|
+
Designation::Expression => :build_gloss_expression,
|
|
31
|
+
Designation::GraphicalSymbol => :build_gloss_graphical_symbol,
|
|
32
|
+
Designation::LetterSymbol => :build_gloss_letter_symbol,
|
|
33
|
+
Designation::Symbol => :build_gloss_symbol,
|
|
27
34
|
}.freeze
|
|
28
35
|
|
|
29
36
|
def self.transform(managed_concept, options = {})
|
|
@@ -165,21 +172,21 @@ module Glossarist
|
|
|
165
172
|
end
|
|
166
173
|
|
|
167
174
|
def designation_instance_for(desig, common_attrs, concept_id, lang, index)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
175
|
+
builder = DESIGNATION_BUILDERS[desig.class] || :build_gloss_expression
|
|
176
|
+
send(builder, desig, common_attrs, concept_id, lang, index)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def build_gloss_graphical_symbol(desig, common_attrs, *_unused)
|
|
180
|
+
Rdf::GlossGraphicalSymbol.new(common_attrs.merge(text: desig.text,
|
|
181
|
+
image: desig.image))
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def build_gloss_letter_symbol(desig, common_attrs, *_unused)
|
|
185
|
+
Rdf::GlossLetterSymbol.new(common_attrs.merge(text: desig.text))
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
def build_gloss_symbol(_desig, common_attrs, *_unused)
|
|
189
|
+
Rdf::GlossSymbol.new(common_attrs)
|
|
183
190
|
end
|
|
184
191
|
|
|
185
192
|
def designation_common_attrs(desig, concept_id, lang, index)
|
|
@@ -337,7 +344,7 @@ desig_index)
|
|
|
337
344
|
Array(dates).map do |date|
|
|
338
345
|
Rdf::GlossConceptDate.new(
|
|
339
346
|
date_value: date.date&.to_s,
|
|
340
|
-
date_type:
|
|
347
|
+
date_type: "gloss:status/#{date.type}",
|
|
341
348
|
concept_id: concept_id.to_s,
|
|
342
349
|
)
|
|
343
350
|
end
|
|
@@ -51,8 +51,8 @@ module Glossarist
|
|
|
51
51
|
def declared_languages
|
|
52
52
|
@declared_languages ||= begin
|
|
53
53
|
reg = load_register_data
|
|
54
|
-
if reg && reg
|
|
55
|
-
reg
|
|
54
|
+
if reg && reg.languages.is_a?(Array)
|
|
55
|
+
reg.languages
|
|
56
56
|
else
|
|
57
57
|
actual_languages
|
|
58
58
|
end
|
data/lib/glossarist/version.rb
CHANGED