Class: Hydra::ModsDataset

Inherits:
ActiveFedora::NokogiriDatastream
  • Object
show all
Includes:
CommonModsIndexMethods
Defined in:
vendor/plugins/hydra_repository/lib/hydra/mods_dataset.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from CommonModsIndexMethods

#extract_person_full_names, #extract_person_organizations

Class Method Details

+ (Object) completed_choices



130
131
132
133
134
# File 'vendor/plugins/hydra_repository/lib/hydra/mods_dataset.rb', line 130

def self.completed_choices
  ["Time Series",
    "Snapshot / Sample"
  ]
end

+ (Object) data_type_choices



146
147
148
# File 'vendor/plugins/hydra_repository/lib/hydra/mods_dataset.rb', line 146

def self.data_type_choices
  ["transect","observation","data logging","remote sensing"]
end

+ (Object) interval_choices



137
138
139
140
141
142
143
144
# File 'vendor/plugins/hydra_repository/lib/hydra/mods_dataset.rb', line 137

def self.interval_choices
  ["Monthly",
    "Quarterly",
    "Semi-annually",
    "Annually",
    "Irregular"
  ]
end

+ (Object) person_relator_terms



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'vendor/plugins/hydra_repository/lib/hydra/mods_dataset.rb', line 109

def self.person_relator_terms
   {"anl" => "Analyst",
    "aut" => "Author",
    "clb" => "Collaborator",
    "com" => "Compiler",
    "cre" => "Creator",
    "ctb" => "Contributor",
    "dpt" => "Depositor",
    "dtc" => "Data contributor ",
    "dtm" => "Data manager ",
    "edt" => "Editor",
    "lbr" => "Laboratory ",
    "ldr" => "Laboratory director ",
    "pdr" => "Project director",
    "prg" => "Programmer",
    "res" => "Researcher",
    "rth" => "Research team head",
    "rtm" => "Research team member"
    }
end

+ (Object) valid_child_types



150
151
152
# File 'vendor/plugins/hydra_repository/lib/hydra/mods_dataset.rb', line 150

def self.valid_child_types
  ["data", "supporting file", "profile", "lorem ipsum", "dolor"]
end

+ (Object) xml_template

Generates an empty Mods Article (used when you call ModsArticle.new without passing in existing xml)



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'vendor/plugins/hydra_repository/lib/hydra/mods_dataset.rb', line 61

def self.xml_template
  builder = Nokogiri::XML::Builder.new do |xml|
    xml.mods(:version=>"3.3", "xmlns:xlink"=>"http://www.w3.org/1999/xlink",
       "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
       "xmlns"=>"http://www.loc.gov/mods/v3",
       "xsi:schemaLocation"=>"http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd") {
         xml.titleInfo(:lang=>"") {
           xml.title
         }
         xml.name(:type=>"personal") {
           xml.namePart(:type=>"given")
           xml.namePart(:type=>"family")
           xml.affiliation
           xml.role {
             xml.roleTerm(:authority=>"marcrelator", :type=>"text")
           }
         }
         xml.name(:type=>"corporate") {
           xml.namePart
           xml.affiliation
           xml.role {
             xml.roleTerm("Funder", :authority=>"marcrelator", :type=>"text") 
           }
         }
         xml.typeOfResource "software, multimedia"
         xml.genre("dataset", :authority=>"dct")
         xml.language {
           xml.languageTerm("eng", :authority=>"iso639-2b", :type=>"code")
         }
         xml.abstract
         xml.subject {
           xml.topic
         }
         xml.note(:type=>"completeness")
         xml.note(:type=>"interval")
         xml.note(:type=>"datatype")
         xml.note(:type=>"timespan-start")
         xml.note(:type=>"timespan-end")
         xml.note(:type=>"location")
         xml.note(:type=>"grant")
         xml.note(:type=>"data quality")
         xml.note(:type=>"contact-name")
         xml.note(:type=>"contact-email")
    }
  end
  return builder.doc
end

Instance Method Details

- (Object) to_solr(solr_doc = Solr::Document.new)



153
154
155
156
157
158
# File 'vendor/plugins/hydra_repository/lib/hydra/mods_dataset.rb', line 153

def to_solr(solr_doc=Solr::Document.new)
  super(solr_doc)
  extract_person_full_names.each {|pfn| solr_doc << pfn }
  solr_doc << {:object_type_facet => "Dataset"}
  solr_doc
end