Class: Hyrax::ModelRegistry

Inherits:
Object
  • Object
show all
Defined in:
app/models/hyrax/model_registry.rb

Overview

Note:

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

Class Method Details

.admin_set_class_namesArray<String>

Returns:

  • (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_classesArray<Class>

Returns:

  • (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_representationsArray<String>

Returns:

  • (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_namesArray<String>

Returns:

  • (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_classesArray<String>

Returns:

  • (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_ssimObject



63
64
65
# File 'app/models/hyrax/model_registry.rb', line 63

def self.collection_has_model_ssim
  collection_rdf_representations
end

.collection_rdf_representationsObject



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_namesArray<String>

Returns:

  • (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_classesObject



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_representationsArray<String>

Returns:

  • (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_namesArray<Class>

TODO:

Consider the Wings::ModelRegistry and how we perform mappings.

Returns:

  • (Array<Class>)


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_classesObject



91
92
93
# File 'app/models/hyrax/model_registry.rb', line 91

def self.work_classes
  classes_from(work_class_names)
end

.work_rdf_representationsArray<String>

Returns:

  • (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