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
|
@@ -18,10 +18,14 @@ module Glossarist
|
|
|
18
18
|
|
|
19
19
|
types "gloss:Citation"
|
|
20
20
|
|
|
21
|
-
predicate :citationSource, namespace: Namespaces::GlossaristNamespace,
|
|
22
|
-
|
|
23
|
-
predicate :
|
|
24
|
-
|
|
21
|
+
predicate :citationSource, namespace: Namespaces::GlossaristNamespace,
|
|
22
|
+
to: :source
|
|
23
|
+
predicate :citationId, namespace: Namespaces::GlossaristNamespace,
|
|
24
|
+
to: :id
|
|
25
|
+
predicate :citationVersion, namespace: Namespaces::GlossaristNamespace,
|
|
26
|
+
to: :version
|
|
27
|
+
predicate :citationLink, namespace: Namespaces::GlossaristNamespace,
|
|
28
|
+
to: :link
|
|
25
29
|
|
|
26
30
|
members :locality, link: "gloss:hasLocality"
|
|
27
31
|
end
|
|
@@ -28,8 +28,10 @@ module Glossarist
|
|
|
28
28
|
|
|
29
29
|
types "gloss:Concept", "skos:Concept"
|
|
30
30
|
|
|
31
|
-
predicate :identifier, namespace: Namespaces::GlossaristNamespace,
|
|
32
|
-
|
|
31
|
+
predicate :identifier, namespace: Namespaces::GlossaristNamespace,
|
|
32
|
+
to: :identifier
|
|
33
|
+
predicate :hasStatus, namespace: Namespaces::GlossaristNamespace,
|
|
34
|
+
to: :status, uri_reference: true
|
|
33
35
|
|
|
34
36
|
members :localizations,
|
|
35
37
|
link: "gloss:hasLocalization"
|
|
@@ -41,7 +43,8 @@ module Glossarist
|
|
|
41
43
|
link: "gloss:hasDate"
|
|
42
44
|
|
|
43
45
|
RelationshipPredicates::CONCEPT_REL_PREDICATES.each do |type, (ns, name)|
|
|
44
|
-
predicate name, namespace: ns, to: :"#{type}_targets",
|
|
46
|
+
predicate name, namespace: ns, to: :"#{type}_targets",
|
|
47
|
+
uri_reference: true
|
|
45
48
|
end
|
|
46
49
|
end
|
|
47
50
|
end
|
|
@@ -16,8 +16,10 @@ module Glossarist
|
|
|
16
16
|
|
|
17
17
|
types "gloss:ConceptDate"
|
|
18
18
|
|
|
19
|
-
predicate :dateValue, namespace: Namespaces::GlossaristNamespace,
|
|
20
|
-
|
|
19
|
+
predicate :dateValue, namespace: Namespaces::GlossaristNamespace,
|
|
20
|
+
to: :date_value
|
|
21
|
+
predicate :dateType, namespace: Namespaces::GlossaristNamespace,
|
|
22
|
+
to: :date_type, uri_reference: true
|
|
21
23
|
end
|
|
22
24
|
end
|
|
23
25
|
end
|
|
@@ -19,9 +19,12 @@ module Glossarist
|
|
|
19
19
|
|
|
20
20
|
types "gloss:ConceptReference"
|
|
21
21
|
|
|
22
|
-
predicate :refType, namespace: Namespaces::GlossaristNamespace,
|
|
23
|
-
|
|
24
|
-
predicate :
|
|
22
|
+
predicate :refType, namespace: Namespaces::GlossaristNamespace,
|
|
23
|
+
to: :ref_type
|
|
24
|
+
predicate :conceptId, namespace: Namespaces::GlossaristNamespace,
|
|
25
|
+
to: :concept_id
|
|
26
|
+
predicate :sourceUri, namespace: Namespaces::GlossaristNamespace,
|
|
27
|
+
to: :source
|
|
25
28
|
predicate :urn, namespace: Namespaces::GlossaristNamespace, to: :urn
|
|
26
29
|
end
|
|
27
30
|
end
|
|
@@ -17,9 +17,12 @@ module Glossarist
|
|
|
17
17
|
|
|
18
18
|
types "gloss:ConceptSource"
|
|
19
19
|
|
|
20
|
-
predicate :sourceStatus, namespace: Namespaces::GlossaristNamespace,
|
|
21
|
-
|
|
22
|
-
predicate :
|
|
20
|
+
predicate :sourceStatus, namespace: Namespaces::GlossaristNamespace,
|
|
21
|
+
to: :status, uri_reference: true
|
|
22
|
+
predicate :sourceType, namespace: Namespaces::GlossaristNamespace,
|
|
23
|
+
to: :type, uri_reference: true
|
|
24
|
+
predicate :modification, namespace: Namespaces::GlossaristNamespace,
|
|
25
|
+
to: :modification
|
|
23
26
|
|
|
24
27
|
members :origin, link: "gloss:sourceOrigin"
|
|
25
28
|
end
|
|
@@ -5,20 +5,30 @@ require "lutaml/model"
|
|
|
5
5
|
module Glossarist
|
|
6
6
|
module Rdf
|
|
7
7
|
COMMON_DESIGNATION_PREDICATES = lambda { |dsl|
|
|
8
|
-
dsl.predicate :literalForm, namespace: Namespaces::SkosxlNamespace,
|
|
9
|
-
|
|
10
|
-
dsl.predicate :
|
|
11
|
-
|
|
12
|
-
dsl.predicate :
|
|
13
|
-
|
|
14
|
-
dsl.predicate :
|
|
15
|
-
|
|
16
|
-
dsl.predicate :
|
|
8
|
+
dsl.predicate :literalForm, namespace: Namespaces::SkosxlNamespace,
|
|
9
|
+
to: :designation
|
|
10
|
+
dsl.predicate :normativeStatus,
|
|
11
|
+
namespace: Namespaces::GlossaristNamespace, to: :normative_status, uri_reference: true
|
|
12
|
+
dsl.predicate :hasTermType, namespace: Namespaces::GlossaristNamespace,
|
|
13
|
+
to: :term_type, uri_reference: true
|
|
14
|
+
dsl.predicate :isInternational,
|
|
15
|
+
namespace: Namespaces::GlossaristNamespace, to: :international
|
|
16
|
+
dsl.predicate :isAbsent, namespace: Namespaces::GlossaristNamespace,
|
|
17
|
+
to: :absent
|
|
18
|
+
dsl.predicate :geographicalArea,
|
|
19
|
+
namespace: Namespaces::GlossaristNamespace, to: :language
|
|
20
|
+
dsl.predicate :language, namespace: Namespaces::DctermsNamespace,
|
|
21
|
+
to: :lang_code
|
|
22
|
+
dsl.predicate :script, namespace: Namespaces::GlossaristNamespace,
|
|
23
|
+
to: :script
|
|
24
|
+
dsl.predicate :conversionSystem,
|
|
25
|
+
namespace: Namespaces::GlossaristNamespace, to: :system
|
|
17
26
|
dsl.members :pronunciations, link: "gloss:hasPronunciation"
|
|
18
27
|
dsl.members :sources
|
|
19
28
|
|
|
20
29
|
RelationshipPredicates::DESIGNATION_REL_PREDICATES.each do |type, (ns, name)|
|
|
21
|
-
dsl.predicate name, namespace: ns, to: :"#{type}_targets",
|
|
30
|
+
dsl.predicate name, namespace: ns, to: :"#{type}_targets",
|
|
31
|
+
uri_reference: true
|
|
22
32
|
end
|
|
23
33
|
}.freeze
|
|
24
34
|
|
|
@@ -53,7 +63,9 @@ module Glossarist
|
|
|
53
63
|
rdf do
|
|
54
64
|
namespace(*DESIGNATION_NAMESPACES)
|
|
55
65
|
|
|
56
|
-
subject
|
|
66
|
+
subject do |d|
|
|
67
|
+
"concept/#{d.concept_id}/#{d.lang_code}/designation/#{d.index}"
|
|
68
|
+
end
|
|
57
69
|
|
|
58
70
|
types "gloss:Designation", "skosxl:Label"
|
|
59
71
|
|
|
@@ -70,14 +82,19 @@ module Glossarist
|
|
|
70
82
|
rdf do
|
|
71
83
|
namespace(*DESIGNATION_NAMESPACES)
|
|
72
84
|
|
|
73
|
-
subject
|
|
85
|
+
subject do |d|
|
|
86
|
+
"concept/#{d.concept_id}/#{d.lang_code}/designation/#{d.index}"
|
|
87
|
+
end
|
|
74
88
|
|
|
75
89
|
types "gloss:Expression", "skosxl:Label"
|
|
76
90
|
|
|
77
91
|
COMMON_DESIGNATION_PREDICATES.call(self)
|
|
78
|
-
predicate :prefix, namespace: Namespaces::GlossaristNamespace,
|
|
79
|
-
|
|
80
|
-
predicate :
|
|
92
|
+
predicate :prefix, namespace: Namespaces::GlossaristNamespace,
|
|
93
|
+
to: :prefix
|
|
94
|
+
predicate :usageInfo, namespace: Namespaces::GlossaristNamespace,
|
|
95
|
+
to: :usage_info
|
|
96
|
+
predicate :fieldOfApplication,
|
|
97
|
+
namespace: Namespaces::GlossaristNamespace, to: :field_of_application
|
|
81
98
|
members :grammar_info, link: "gloss:hasGrammarInfo"
|
|
82
99
|
end
|
|
83
100
|
end
|
|
@@ -90,18 +107,26 @@ module Glossarist
|
|
|
90
107
|
rdf do
|
|
91
108
|
namespace(*DESIGNATION_NAMESPACES)
|
|
92
109
|
|
|
93
|
-
subject
|
|
110
|
+
subject do |d|
|
|
111
|
+
"concept/#{d.concept_id}/#{d.lang_code}/designation/#{d.index}"
|
|
112
|
+
end
|
|
94
113
|
|
|
95
114
|
types "gloss:Abbreviation", "skosxl:Label"
|
|
96
115
|
|
|
97
116
|
COMMON_DESIGNATION_PREDICATES.call(self)
|
|
98
|
-
predicate :prefix, namespace: Namespaces::GlossaristNamespace,
|
|
99
|
-
|
|
100
|
-
predicate :
|
|
117
|
+
predicate :prefix, namespace: Namespaces::GlossaristNamespace,
|
|
118
|
+
to: :prefix
|
|
119
|
+
predicate :usageInfo, namespace: Namespaces::GlossaristNamespace,
|
|
120
|
+
to: :usage_info
|
|
121
|
+
predicate :fieldOfApplication,
|
|
122
|
+
namespace: Namespaces::GlossaristNamespace, to: :field_of_application
|
|
101
123
|
members :grammar_info, link: "gloss:hasGrammarInfo"
|
|
102
|
-
predicate :isAcronym, namespace: Namespaces::GlossaristNamespace,
|
|
103
|
-
|
|
104
|
-
predicate :
|
|
124
|
+
predicate :isAcronym, namespace: Namespaces::GlossaristNamespace,
|
|
125
|
+
to: :acronym
|
|
126
|
+
predicate :isInitialism, namespace: Namespaces::GlossaristNamespace,
|
|
127
|
+
to: :initialism
|
|
128
|
+
predicate :isTruncation, namespace: Namespaces::GlossaristNamespace,
|
|
129
|
+
to: :truncation
|
|
105
130
|
end
|
|
106
131
|
end
|
|
107
132
|
|
|
@@ -109,7 +134,9 @@ module Glossarist
|
|
|
109
134
|
rdf do
|
|
110
135
|
namespace(*DESIGNATION_NAMESPACES)
|
|
111
136
|
|
|
112
|
-
subject
|
|
137
|
+
subject do |d|
|
|
138
|
+
"concept/#{d.concept_id}/#{d.lang_code}/designation/#{d.index}"
|
|
139
|
+
end
|
|
113
140
|
|
|
114
141
|
types "gloss:Symbol", "skosxl:Label"
|
|
115
142
|
|
|
@@ -123,7 +150,9 @@ module Glossarist
|
|
|
123
150
|
rdf do
|
|
124
151
|
namespace(*DESIGNATION_NAMESPACES)
|
|
125
152
|
|
|
126
|
-
subject
|
|
153
|
+
subject do |d|
|
|
154
|
+
"concept/#{d.concept_id}/#{d.lang_code}/designation/#{d.index}"
|
|
155
|
+
end
|
|
127
156
|
|
|
128
157
|
types "gloss:LetterSymbol", "skosxl:Label"
|
|
129
158
|
|
|
@@ -139,7 +168,9 @@ module Glossarist
|
|
|
139
168
|
rdf do
|
|
140
169
|
namespace(*DESIGNATION_NAMESPACES)
|
|
141
170
|
|
|
142
|
-
subject
|
|
171
|
+
subject do |d|
|
|
172
|
+
"concept/#{d.concept_id}/#{d.lang_code}/designation/#{d.index}"
|
|
173
|
+
end
|
|
143
174
|
|
|
144
175
|
types "gloss:GraphicalSymbol", "skosxl:Label"
|
|
145
176
|
|
|
@@ -15,18 +15,28 @@ module Glossarist
|
|
|
15
15
|
rdf do
|
|
16
16
|
namespace Namespaces::GlossaristNamespace
|
|
17
17
|
|
|
18
|
-
subject
|
|
18
|
+
subject do |g|
|
|
19
|
+
"concept/#{g.concept_id}/#{g.lang_code}/designation/#{g.index}/grammar"
|
|
20
|
+
end
|
|
19
21
|
|
|
20
22
|
types "gloss:GrammarInfo"
|
|
21
23
|
|
|
22
|
-
predicate :gender, namespace: Namespaces::GlossaristNamespace,
|
|
23
|
-
|
|
24
|
-
predicate :
|
|
25
|
-
|
|
26
|
-
predicate :
|
|
27
|
-
|
|
28
|
-
predicate :
|
|
29
|
-
|
|
24
|
+
predicate :gender, namespace: Namespaces::GlossaristNamespace,
|
|
25
|
+
to: :gender, uri_reference: true
|
|
26
|
+
predicate :number, namespace: Namespaces::GlossaristNamespace,
|
|
27
|
+
to: :number, uri_reference: true
|
|
28
|
+
predicate :isNoun, namespace: Namespaces::GlossaristNamespace,
|
|
29
|
+
to: :noun?
|
|
30
|
+
predicate :isVerb, namespace: Namespaces::GlossaristNamespace,
|
|
31
|
+
to: :verb?
|
|
32
|
+
predicate :isAdjective, namespace: Namespaces::GlossaristNamespace,
|
|
33
|
+
to: :adjective?
|
|
34
|
+
predicate :isAdverb, namespace: Namespaces::GlossaristNamespace,
|
|
35
|
+
to: :adverb?
|
|
36
|
+
predicate :isPreposition, namespace: Namespaces::GlossaristNamespace,
|
|
37
|
+
to: :preposition?
|
|
38
|
+
predicate :isParticiple, namespace: Namespaces::GlossaristNamespace,
|
|
39
|
+
to: :participle?
|
|
30
40
|
end
|
|
31
41
|
|
|
32
42
|
def noun?
|
|
@@ -16,9 +16,12 @@ module Glossarist
|
|
|
16
16
|
|
|
17
17
|
types "gloss:Locality"
|
|
18
18
|
|
|
19
|
-
predicate :localityType, namespace: Namespaces::GlossaristNamespace,
|
|
20
|
-
|
|
21
|
-
predicate :
|
|
19
|
+
predicate :localityType, namespace: Namespaces::GlossaristNamespace,
|
|
20
|
+
to: :locality_type
|
|
21
|
+
predicate :referenceFrom, namespace: Namespaces::GlossaristNamespace,
|
|
22
|
+
to: :reference_from
|
|
23
|
+
predicate :referenceTo, namespace: Namespaces::GlossaristNamespace,
|
|
24
|
+
to: :reference_to
|
|
22
25
|
end
|
|
23
26
|
end
|
|
24
27
|
end
|
|
@@ -32,13 +32,20 @@ module Glossarist
|
|
|
32
32
|
|
|
33
33
|
types "gloss:LocalizedConcept", "skos:Concept"
|
|
34
34
|
|
|
35
|
-
predicate :language, namespace: Namespaces::DctermsNamespace,
|
|
36
|
-
|
|
37
|
-
predicate :
|
|
38
|
-
|
|
39
|
-
predicate :
|
|
40
|
-
|
|
41
|
-
predicate :
|
|
35
|
+
predicate :language, namespace: Namespaces::DctermsNamespace,
|
|
36
|
+
to: :language_code
|
|
37
|
+
predicate :hasEntryStatus, namespace: Namespaces::GlossaristNamespace,
|
|
38
|
+
to: :entry_status, uri_reference: true
|
|
39
|
+
predicate :domain, namespace: Namespaces::GlossaristNamespace,
|
|
40
|
+
to: :domain
|
|
41
|
+
predicate :release, namespace: Namespaces::GlossaristNamespace,
|
|
42
|
+
to: :release
|
|
43
|
+
predicate :lineageSimilarity,
|
|
44
|
+
namespace: Namespaces::GlossaristNamespace, to: :lineage_similarity
|
|
45
|
+
predicate :script, namespace: Namespaces::GlossaristNamespace,
|
|
46
|
+
to: :script
|
|
47
|
+
predicate :conversionSystem,
|
|
48
|
+
namespace: Namespaces::GlossaristNamespace, to: :system
|
|
42
49
|
|
|
43
50
|
members :designations,
|
|
44
51
|
link: ->(d) { GlossLocalizedConcept.skosxl_label_for(d) }
|
|
@@ -16,13 +16,18 @@ module Glossarist
|
|
|
16
16
|
rdf do
|
|
17
17
|
namespace Namespaces::GlossaristNamespace
|
|
18
18
|
|
|
19
|
-
subject
|
|
19
|
+
subject do |n|
|
|
20
|
+
"concept/#{n.concept_id}/#{n.lang_code}/nonverbal/#{n.index}"
|
|
21
|
+
end
|
|
20
22
|
|
|
21
23
|
types "gloss:NonVerbalRepresentation"
|
|
22
24
|
|
|
23
|
-
predicate :representationType,
|
|
24
|
-
|
|
25
|
-
predicate :
|
|
25
|
+
predicate :representationType,
|
|
26
|
+
namespace: Namespaces::GlossaristNamespace, to: :representation_type
|
|
27
|
+
predicate :representationRef,
|
|
28
|
+
namespace: Namespaces::GlossaristNamespace, to: :representation_ref
|
|
29
|
+
predicate :representationText,
|
|
30
|
+
namespace: Namespaces::GlossaristNamespace, to: :representation_text
|
|
26
31
|
|
|
27
32
|
members :sources
|
|
28
33
|
end
|
|
@@ -17,15 +17,22 @@ module Glossarist
|
|
|
17
17
|
rdf do
|
|
18
18
|
namespace Namespaces::GlossaristNamespace
|
|
19
19
|
|
|
20
|
-
subject
|
|
20
|
+
subject do |p|
|
|
21
|
+
"concept/#{p.concept_id}/#{p.lang_code}/pronunciation/#{p.index}"
|
|
22
|
+
end
|
|
21
23
|
|
|
22
24
|
types "gloss:Pronunciation"
|
|
23
25
|
|
|
24
|
-
predicate :pronunciationContent,
|
|
25
|
-
|
|
26
|
-
predicate :
|
|
27
|
-
|
|
28
|
-
predicate :
|
|
26
|
+
predicate :pronunciationContent,
|
|
27
|
+
namespace: Namespaces::GlossaristNamespace, to: :content
|
|
28
|
+
predicate :pronunciationLanguage,
|
|
29
|
+
namespace: Namespaces::GlossaristNamespace, to: :language
|
|
30
|
+
predicate :pronunciationScript,
|
|
31
|
+
namespace: Namespaces::GlossaristNamespace, to: :script
|
|
32
|
+
predicate :pronunciationCountry,
|
|
33
|
+
namespace: Namespaces::GlossaristNamespace, to: :country
|
|
34
|
+
predicate :pronunciationSystem,
|
|
35
|
+
namespace: Namespaces::GlossaristNamespace, to: :system
|
|
29
36
|
end
|
|
30
37
|
end
|
|
31
38
|
end
|
|
@@ -30,12 +30,16 @@ module Glossarist
|
|
|
30
30
|
|
|
31
31
|
types "gloss:Reference"
|
|
32
32
|
|
|
33
|
-
predicate :citationText, namespace: Namespaces::GlossaristNamespace,
|
|
34
|
-
|
|
33
|
+
predicate :citationText, namespace: Namespaces::GlossaristNamespace,
|
|
34
|
+
to: :text
|
|
35
|
+
predicate :source, namespace: Namespaces::GlossaristNamespace,
|
|
36
|
+
to: :source
|
|
35
37
|
predicate :refId, namespace: Namespaces::GlossaristNamespace, to: :id
|
|
36
|
-
predicate :version, namespace: Namespaces::GlossaristNamespace,
|
|
38
|
+
predicate :version, namespace: Namespaces::GlossaristNamespace,
|
|
39
|
+
to: :version
|
|
37
40
|
predicate :link, namespace: Namespaces::GlossaristNamespace, to: :link
|
|
38
|
-
predicate :refType, namespace: Namespaces::GlossaristNamespace,
|
|
41
|
+
predicate :refType, namespace: Namespaces::GlossaristNamespace,
|
|
42
|
+
to: :ref_type
|
|
39
43
|
predicate :urn, namespace: Namespaces::GlossaristNamespace, to: :urn
|
|
40
44
|
predicate :term, namespace: Namespaces::GlossaristNamespace, to: :term
|
|
41
45
|
members :locality, link: "gloss:hasLocality"
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
module Glossarist
|
|
4
4
|
module Rdf
|
|
5
5
|
module Namespaces
|
|
6
|
-
autoload :DctermsNamespace,
|
|
7
|
-
autoload :GlossaristNamespace,
|
|
6
|
+
autoload :DctermsNamespace, "#{__dir__}/namespaces/dcterms_namespace"
|
|
7
|
+
autoload :GlossaristNamespace,
|
|
8
|
+
"#{__dir__}/namespaces/glossarist_namespace"
|
|
8
9
|
autoload :IsoThesNamespace, "#{__dir__}/namespaces/iso_thes_namespace"
|
|
9
10
|
autoload :OwlNamespace, "#{__dir__}/namespaces/owl_namespace"
|
|
10
11
|
autoload :RdfNamespace, "#{__dir__}/namespaces/rdf_namespace"
|
|
@@ -18,7 +18,8 @@ module Glossarist
|
|
|
18
18
|
broader_partitive: [Namespaces::IsoThesNamespace, :broaderPartitive],
|
|
19
19
|
narrower_partitive: [Namespaces::IsoThesNamespace, :narrowerPartitive],
|
|
20
20
|
broader_instantial: [Namespaces::IsoThesNamespace, :broaderInstantial],
|
|
21
|
-
narrower_instantial: [Namespaces::IsoThesNamespace,
|
|
21
|
+
narrower_instantial: [Namespaces::IsoThesNamespace,
|
|
22
|
+
:narrowerInstantial],
|
|
22
23
|
equivalent: [Namespaces::SkosNamespace, :exactMatch],
|
|
23
24
|
close_match: [Namespaces::SkosNamespace, :closeMatch],
|
|
24
25
|
broad_match: [Namespaces::SkosNamespace, :broadMatch],
|
|
@@ -30,17 +31,23 @@ module Glossarist
|
|
|
30
31
|
superseded_by: [Namespaces::GlossaristNamespace, :supersededBy],
|
|
31
32
|
compare: [Namespaces::GlossaristNamespace, :compares],
|
|
32
33
|
contrast: [Namespaces::GlossaristNamespace, :contrasts],
|
|
33
|
-
sequentially_related_concept: [Namespaces::GlossaristNamespace,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
sequentially_related_concept: [Namespaces::GlossaristNamespace,
|
|
35
|
+
:sequentiallyRelated],
|
|
36
|
+
spatially_related_concept: [Namespaces::GlossaristNamespace,
|
|
37
|
+
:spatiallyRelated],
|
|
38
|
+
temporally_related_concept: [Namespaces::GlossaristNamespace,
|
|
39
|
+
:temporallyRelated],
|
|
40
|
+
related_concept_broader: [Namespaces::GlossaristNamespace,
|
|
41
|
+
:relatedConceptBroader],
|
|
42
|
+
related_concept_narrower: [Namespaces::GlossaristNamespace,
|
|
43
|
+
:relatedConceptNarrower],
|
|
38
44
|
}.freeze
|
|
39
45
|
|
|
40
46
|
DESIGNATION_REL_PREDICATES = {
|
|
41
47
|
homograph: [Namespaces::GlossaristNamespace, :hasHomograph],
|
|
42
48
|
false_friend: [Namespaces::GlossaristNamespace, :hasFalseFriend],
|
|
43
|
-
abbreviated_form_for: [Namespaces::GlossaristNamespace,
|
|
49
|
+
abbreviated_form_for: [Namespaces::GlossaristNamespace,
|
|
50
|
+
:abbreviatedFormFor],
|
|
44
51
|
short_form_for: [Namespaces::GlossaristNamespace, :shortFormFor],
|
|
45
52
|
}.freeze
|
|
46
53
|
|
data/lib/glossarist/rdf.rb
CHANGED
|
@@ -12,7 +12,8 @@ module Glossarist
|
|
|
12
12
|
autoload :GlossLocality, "#{__dir__}/rdf/gloss_locality"
|
|
13
13
|
autoload :GlossCitation, "#{__dir__}/rdf/gloss_citation"
|
|
14
14
|
autoload :GlossConceptSource, "#{__dir__}/rdf/gloss_concept_source"
|
|
15
|
-
autoload :GlossDetailedDefinition,
|
|
15
|
+
autoload :GlossDetailedDefinition,
|
|
16
|
+
"#{__dir__}/rdf/gloss_detailed_definition"
|
|
16
17
|
autoload :GlossPronunciation, "#{__dir__}/rdf/gloss_pronunciation"
|
|
17
18
|
autoload :GlossGrammarInfo, "#{__dir__}/rdf/gloss_grammar_info"
|
|
18
19
|
autoload :GlossNonVerbalRep, "#{__dir__}/rdf/gloss_non_verbal_rep"
|
|
@@ -2,38 +2,88 @@
|
|
|
2
2
|
|
|
3
3
|
module Glossarist
|
|
4
4
|
class RegisterData < Lutaml::Model::Serializable
|
|
5
|
-
attribute :
|
|
5
|
+
attribute :key, :string, default: -> { "register" }
|
|
6
|
+
attribute :shortname, :string
|
|
7
|
+
attribute :name, :string
|
|
8
|
+
attribute :description, :string
|
|
9
|
+
attribute :schema_version, :string
|
|
10
|
+
attribute :version, :string
|
|
11
|
+
attribute :owner, :string
|
|
12
|
+
attribute :languages, :string, collection: true
|
|
13
|
+
attribute :subregisters, :hash, default: -> { {} }
|
|
14
|
+
attribute :uri_prefix, :string
|
|
15
|
+
attribute :concept_uri_template, :string
|
|
16
|
+
attribute :homepage, :string
|
|
17
|
+
attribute :repository, :string
|
|
18
|
+
attribute :license, :string
|
|
19
|
+
attribute :tags, :string, collection: true
|
|
6
20
|
|
|
7
21
|
key_value do
|
|
8
|
-
map
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
22
|
+
map %i[id shortname], to: :shortname
|
|
23
|
+
map "name", to: :name
|
|
24
|
+
map "description", to: :description
|
|
25
|
+
map "schema_version", to: :schema_version
|
|
26
|
+
map "version", to: :version
|
|
27
|
+
map "owner", to: :owner
|
|
28
|
+
map "languages", to: :languages
|
|
29
|
+
map "subregisters", to: :subregisters
|
|
30
|
+
map "uri_prefix", to: :uri_prefix
|
|
31
|
+
map "concept_uri_template", to: :concept_uri_template
|
|
32
|
+
map "homepage", to: :homepage
|
|
33
|
+
map "repository", to: :repository
|
|
34
|
+
map "license", to: :license
|
|
35
|
+
map "tags", to: :tags
|
|
15
36
|
end
|
|
16
37
|
|
|
17
38
|
def [](key)
|
|
18
|
-
|
|
39
|
+
case key
|
|
40
|
+
when "shortname", "id" then shortname
|
|
41
|
+
when "name" then name
|
|
42
|
+
when "description" then description
|
|
43
|
+
when "schema_version" then schema_version
|
|
44
|
+
when "version" then version
|
|
45
|
+
when "owner" then owner
|
|
46
|
+
when "languages" then languages
|
|
47
|
+
when "subregisters" then subregisters
|
|
48
|
+
when "uri_prefix" then uri_prefix
|
|
49
|
+
when "concept_uri_template" then concept_uri_template
|
|
50
|
+
when "homepage" then homepage
|
|
51
|
+
when "repository" then repository
|
|
52
|
+
when "license" then license
|
|
53
|
+
when "tags" then tags
|
|
54
|
+
end
|
|
19
55
|
end
|
|
20
56
|
|
|
21
57
|
def dig(*keys)
|
|
22
|
-
|
|
58
|
+
return nil if keys.empty?
|
|
59
|
+
|
|
60
|
+
first = self[keys.first]
|
|
61
|
+
keys.length == 1 ? first : nil
|
|
23
62
|
end
|
|
24
63
|
|
|
25
64
|
def to_h
|
|
26
|
-
|
|
65
|
+
h = {}
|
|
66
|
+
h["shortname"] = shortname if shortname
|
|
67
|
+
h["name"] = name if name
|
|
68
|
+
h["description"] = description if description
|
|
69
|
+
h["schema_version"] = schema_version if schema_version
|
|
70
|
+
h["version"] = version if version
|
|
71
|
+
h["owner"] = owner if owner
|
|
72
|
+
h["languages"] = languages if languages && !languages.empty?
|
|
73
|
+
h["subregisters"] = subregisters if subregisters && !subregisters.empty?
|
|
74
|
+
h["uri_prefix"] = uri_prefix if uri_prefix
|
|
75
|
+
h["concept_uri_template"] = concept_uri_template if concept_uri_template
|
|
76
|
+
h["homepage"] = homepage if homepage
|
|
77
|
+
h["repository"] = repository if repository
|
|
78
|
+
h["license"] = license if license
|
|
79
|
+
h["tags"] = tags if tags && !tags.empty?
|
|
80
|
+
h
|
|
27
81
|
end
|
|
28
82
|
|
|
29
|
-
def
|
|
30
|
-
|
|
31
|
-
end
|
|
83
|
+
def self.from_file(path)
|
|
84
|
+
return nil unless File.exist?(path)
|
|
32
85
|
|
|
33
|
-
|
|
34
|
-
model.data.each do |key, value|
|
|
35
|
-
doc[key] = value
|
|
36
|
-
end
|
|
86
|
+
from_yaml(File.read(path, encoding: "utf-8"))
|
|
37
87
|
end
|
|
38
88
|
end
|
|
39
89
|
end
|
|
@@ -23,7 +23,10 @@ module Glossarist
|
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
unless current == target
|
|
27
|
+
raise Error,
|
|
28
|
+
"Migration chain too long or unresolvable"
|
|
29
|
+
end
|
|
27
30
|
|
|
28
31
|
concept.schema_version = target
|
|
29
32
|
concept
|
|
@@ -53,8 +56,8 @@ module Glossarist
|
|
|
53
56
|
|
|
54
57
|
LANG_CODES = Glossarist::LANG_CODES
|
|
55
58
|
|
|
56
|
-
IEV_PATTERN = /\{\{([^,}]+),\s*IEV:([^}]+)\}\}
|
|
57
|
-
URN_PATTERN = /\{urn:iso:std:iso:(\d+):([^,}]+),([^}]+)\}
|
|
59
|
+
IEV_PATTERN = /\{\{([^,}]+),\s*IEV:([^}]+)\}\}/
|
|
60
|
+
URN_PATTERN = /\{urn:iso:std:iso:(\d+):([^,}]+),([^}]+)\}/
|
|
58
61
|
|
|
59
62
|
attr_reader :from_version, :to_version
|
|
60
63
|
|
|
@@ -149,7 +152,7 @@ module Glossarist
|
|
|
149
152
|
src = lc.delete("authoritative_source")
|
|
150
153
|
return if lc.key?("sources")
|
|
151
154
|
|
|
152
|
-
sources = (src.is_a?(Array) ? src : [src]).
|
|
155
|
+
sources = (src.is_a?(Array) ? src : [src]).filter_map do |s|
|
|
153
156
|
next unless s.is_a?(Hash)
|
|
154
157
|
|
|
155
158
|
origin = {}
|
|
@@ -166,7 +169,7 @@ module Glossarist
|
|
|
166
169
|
end
|
|
167
170
|
end
|
|
168
171
|
entry
|
|
169
|
-
end
|
|
172
|
+
end
|
|
170
173
|
|
|
171
174
|
lc["sources"] = sources if sources.any?
|
|
172
175
|
end
|