Class: DissertationCatch

Inherits:
ReferentFilter show all
Includes:
MetadataHelper
Defined in:
app/referent_filters/dissertation_catch.rb

Constant Summary collapse

@@da_issns =
[]

Instance Method Summary collapse

Methods included from MetadataHelper

#get_doi, #get_epage, #get_gpo_item_nums, #get_identifier, #get_isbn, #get_issn, #get_lccn, #get_month, #get_oclcnum, #get_pmid, #get_search_creator, #get_search_terms, #get_search_title, #get_spage, #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: Umlaut Referent object 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.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'app/referent_filters/dissertation_catch.rb', line 32

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 = if ['atitle'].present?
      ['atitle']
    elsif ['title'].present?
      ['title']
    end
    referent.enhance_referent("btitle", title) if title.present?
    referent.enhance_referent("title", title, true, false, :overwrite => true) if title.present?

    # 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")
    referent.remove_value("pages")
  end

end