Class: Hyrax::ModelRegistry
- Inherits:
-
Object
- Object
- Hyrax::ModelRegistry
- Defined in:
- app/models/hyrax/model_registry.rb
Overview
Due to the shift from ActiveFedora to Valkyrie, we are at a crossroads where we might have
There are four conceptual high-level models for the metadata modeling:
- AdminSet
-
Where things are “physically” stored.
- Collection
-
What things “logically” belong to.
- Work
-
What the thing is about; these are often sub-divided into different work types
(e.g. an Article, a Monograph, etc.)
- FileSet
-
Artifacts that further describe the thing.
The purpose of this module is to provide an overview and map of the modeling concepts. This is envisioned as a module to interrogate to see how Hyrax conceptually organizes your models.
For each of the above high-level models the ModelRegistry implements two methods:
- <model_type>_classes
-
These are the Ruby constants that represent the conceptual models.
- <model_type>_rdf_representations
-
These are the stored strings that help us describe what #
-
the data models. Very useful in our Solr queries when we want to filter/query on the
-
“has_model_ssim” attribute.
Consider that an AdminSet and a AdministrativeSet conceptually model the same thing; the latter implements via Valkyrie and the former via ActiveFedora.
multiple models for the versions: an ActiveFedora AdminSet and a Valkyrie AdminSet.
Class Method Summary collapse
- .admin_set_class_names ⇒ Array<String>
- .admin_set_classes ⇒ Array<Class>
- .admin_set_rdf_representations ⇒ Array<String>
- .collection_class_names ⇒ Array<String>
- .collection_classes ⇒ Array<String>
- .collection_has_model_ssim ⇒ Object
- .collection_rdf_representations ⇒ Object
- .file_set_class_names ⇒ Array<String>
- .file_set_classes ⇒ Object
- .file_set_rdf_representations ⇒ Array<String>
- .work_class_names ⇒ Array<Class>
- .work_classes ⇒ Object
- .work_rdf_representations ⇒ Array<String>
Class Method Details
.admin_set_class_names ⇒ Array<String>
31 32 33 |
# File 'app/models/hyrax/model_registry.rb', line 31 def self.admin_set_class_names ["::AdminSet", "::Hyrax::AdministrativeSet", Hyrax.config.admin_set_model].uniq end |
.admin_set_classes ⇒ Array<Class>
37 38 39 |
# File 'app/models/hyrax/model_registry.rb', line 37 def self.admin_set_classes classes_from(admin_set_class_names) end |
.admin_set_rdf_representations ⇒ Array<String>
43 44 45 |
# File 'app/models/hyrax/model_registry.rb', line 43 def self.admin_set_rdf_representations rdf_representations_from(admin_set_classes) end |
.collection_class_names ⇒ Array<String>
49 50 51 |
# File 'app/models/hyrax/model_registry.rb', line 49 def self.collection_class_names ["::Collection", "::Hyrax::PcdmCollection", Hyrax.config.collection_model].uniq end |
.collection_classes ⇒ Array<String>
55 56 57 |
# File 'app/models/hyrax/model_registry.rb', line 55 def self.collection_classes classes_from(collection_class_names) end |
.collection_has_model_ssim ⇒ Object
63 64 65 |
# File 'app/models/hyrax/model_registry.rb', line 63 def self.collection_has_model_ssim collection_rdf_representations end |
.collection_rdf_representations ⇒ Object
59 60 61 |
# File 'app/models/hyrax/model_registry.rb', line 59 def self.collection_rdf_representations rdf_representations_from(collection_classes) end |
.file_set_class_names ⇒ Array<String>
69 70 71 |
# File 'app/models/hyrax/model_registry.rb', line 69 def self.file_set_class_names ["::FileSet", "::Hyrax::FileSet", Hyrax.config.file_set_model].uniq end |
.file_set_classes ⇒ Object
73 74 75 |
# File 'app/models/hyrax/model_registry.rb', line 73 def self.file_set_classes classes_from(file_set_class_names) end |
.file_set_rdf_representations ⇒ Array<String>
79 80 81 |
# File 'app/models/hyrax/model_registry.rb', line 79 def self.file_set_rdf_representations rdf_representations_from(file_set_classes) end |
.work_class_names ⇒ Array<Class>
Consider the Wings::ModelRegistry and how we perform mappings.
87 88 89 |
# File 'app/models/hyrax/model_registry.rb', line 87 def self.work_class_names Hyrax.config.registered_curation_concern_types end |
.work_classes ⇒ Object
91 92 93 |
# File 'app/models/hyrax/model_registry.rb', line 91 def self.work_classes classes_from(work_class_names) end |
.work_rdf_representations ⇒ Array<String>
97 98 99 |
# File 'app/models/hyrax/model_registry.rb', line 97 def self.work_rdf_representations rdf_representations_from(work_classes) end |