Class: DissertationCatch
- Inherits:
-
ReferentFilter
- Object
- ReferentFilter
- DissertationCatch
- Includes:
- MetadataHelper
- Defined in:
- lib/referent_filters/dissertation_catch.rb
Constant Summary collapse
- @@da_issns =
['00959154', '00993123', '04194209', '04194217', '0420073X', '00993123', '10427279', '03076075']
Instance Method Summary collapse
-
#filter(referent) ⇒ Object
input: ropenurl ContextObject Is this a citation to a Dissertation Abstracts issn, or do we otherwise think it’s a dissertation citation? Then change it to a dissertation citation.
Methods included from MetadataHelper
#get_doi, #get_gpo_item_nums, #get_identifier, #get_isbn, #get_issn, #get_lccn, #get_oclcnum, #get_pmid, #get_search_creator, #get_search_terms, #get_search_title, #get_sudoc, #get_top_level_creator, #get_year, #normalize_lccn, #normalize_title, #raw_search_title, #title_is_serial?
Methods included from MarcHelper
#add_856_links, #edition_statement, #get_title, #get_years, #gmd_values, #service_type_for_856, #should_skip_856_link?, #strip_gmd
Instance Method Details
#filter(referent) ⇒ Object
input: ropenurl ContextObject Is this a citation to a Dissertation Abstracts issn, or do we otherwise think it’s a dissertation citation? Then change it to a dissertation citation.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/referent_filters/dissertation_catch.rb', line 10 def filter(referent) issn = get_identifier(:urn, "issn", referent) return unless issn # normalize removing hyphen issn.gsub!('-', '') if ( @@da_issns.find { |i| i == issn } ) # || lc($jtitle) =~ /dissertation/i || lc($jtitle2) =~ /dissertation/i) referent.enhance_referent("genre", "dissertation") = referent. # Reset it's title to the dissertation title title = ['atitle'] || ['title'] referent.enhance_referent("btitle", title) referent.enhance_referent("title", title, true, false, :overwrite => true) # Now erase titles that do not apply referent.remove_value("atitle") referent.remove_value("jtitle") referent.remove_value("stitle") # issn or isbn are wrong, probably point to Dissertation Abstracts referent.remove_value("issn") referent.remove_value("isbn") # Same with all article level metadata referent.remove_value("volume") referent.remove_value("issue") referent.remove_value("issue_start") referent.remove_value("spage") referent.remove_value("epage") end end |