| title | glossarist-ruby |
|---|---|
| description | Ruby gem implementing the Glossarist concept model with multi-language YAML serialization, GCR packages, and TBX/SKOS/Turtle export |
Ruby gem implementing the Glossarist concept model in Ruby. All the entities in the concept model are available as classes and all the attributes are available as methods of those classes. This gem also allows you to read/write data to concept datasets or create your own collection and save that to Glossarist model V2 dataset.
Add this line to your application's Gemfile:
gem 'glossarist'And then execute:
bundle installOr install it yourself as:
gem install glossaristGlossarist model V2 dataset is a collection of concepts and their localized concepts in the form of YAML files. The storage structure of the dataset has 2 forms:
- Each concept is stored in a concept YAML file and its localized concepts are stored in separate YAML files. The concept files are stored in the
conceptfolder and its localized concepts are stored in thelocalized_conceptfolder. - Each concept and its related localized concepts are stored in a single YAML file. These concept files are stored directly in the specified path.
To load the Glossarist model V2 dataset:
collection = Glossarist::ManagedConceptCollection.new
collection.load_from_files("path/to/glossarist-v2-dataset")collection = Glossarist::ManagedConceptCollection.new
collection.load_from_files("path/to/glossarist-v2-dataset")
# ... Update the collection ...
collection.save_to_files("path/to/glossarist-v2-dataset")To write with concepts and their localized concepts grouped into single files:
collection.save_grouped_concepts_to_files("path/to/glossarist-v2-dataset")This is a collection for managed concepts. It includes the Ruby Enumerable module.
collection = Glossarist::ManagedConceptCollection.newFollowing fields are available for ManagedConcept:
| Field | Description |
|---|---|
id |
String identifier for the concept |
uuid |
UUID for the concept |
related |
Array of RelatedConcept |
status |
Lifecycle status (valid, draft, submitted, superseded, retired) |
dates |
Array of ConceptDate |
localized_concepts |
Hash of localizations (language code → UUID) |
domains |
Subject area references |
sources |
Concept-level bibliographical sources |
localizations |
Hash of localizations (language code → LocalizedConcept) |
concept = Glossarist::ManagedConcept.new({
"data" => {
"id" => "123",
"localized_concepts" => {
"ara" => "<uuid>",
"eng" => "<uuid>"
},
"localizations" => [...],
"domains" => [
{ "concept_id" => "103", "ref_type" => "domain" },
],
},
})Localizations of the term to different languages.
| Field | Description |
|---|---|
id |
Optional identifier for cross-references |
uuid |
UUID for the concept |
designations |
Array of Designations |
domain |
URI reference to the subject area |
related |
Array of per-language RelatedConcept |
subject |
Subject of the term |
definition |
Array of DetailedDefinition |
non_verb_rep |
Array of non-verbal representations |
notes |
Zero or more notes |
examples |
Zero or more examples |
language_code |
ISO-639 3-letter language code |
script |
ISO 15924 4-letter script code |
system |
ISO 24229 conversion system code |
entry_status |
notValid, valid, superseded, or retired |
classification |
preferred, admitted, or deprecated |
references |
Typed references |
dates |
Per-language governance events |
release |
Release version |
review_type |
editorial or substantive |
lineage_similarity |
Lineage similarity score |
- Concept Model docs — the entity model this gem implements
- Standards compliance — ISO standard mappings for TBX, SKOS, and Turtle export