Class: Puree::XMLExtractor::Thesis

Inherits:
Publication show all
Includes:
DoiMixin, PagesMixin
Defined in:
lib/puree/xml_extractor/thesis.rb

Overview

Thesis XML extractor.

Direct Known Subclasses

DoctoralThesis, MastersThesis

Instance Method Summary collapse

Methods included from PagesMixin

#pages

Methods included from DoiMixin

#doi

Methods inherited from Publication

#bibliographical_note, #category, #description, #dois, #files, #keywords, #language, #links, #organisations, #owner, #persons_external, #persons_internal, #persons_other, #publication_place, #publisher, #scopus_id, #statuses, #subtitle, #title, #translated_subtitle, #translated_title, #type

Methods included from WorkflowStateMixin

#workflow_state

Methods included from ExternalOrganisationsMixin

#external_organisations

Methods included from AssociatedMixin

#associated

Methods inherited from Resource

#created, #get_data?, #locale, #modified, #uuid, #xpath_query

Methods inherited from Base

#xpath_query_for_multi_value, #xpath_query_for_single_value

Constructor Details

#initialize(xml:) ⇒ Thesis

Returns a new instance of Thesis.



10
11
12
# File 'lib/puree/xml_extractor/thesis.rb', line 10

def initialize(xml:)
  super
end

Instance Method Details

#award_dateTime?

Returns:

  • (Time, nil)


15
16
17
18
# File 'lib/puree/xml_extractor/thesis.rb', line 15

def award_date
  xpath_result = xpath_query_for_single_value('/awardDate')
  Time.parse xpath_result if xpath_result
end

#awarding_institutionPuree::Model::OrganisationHeader?



21
22
23
24
# File 'lib/puree/xml_extractor/thesis.rb', line 21

def awarding_institution
  xpath_result = xpath_query '/awardingInstitution/internalExternalOrganisationAssociation/organisation'
  Puree::XMLExtractor::Shared.organisation_header xpath_result
end

#qualificationString?

Returns:

  • (String, nil)


27
28
29
30
31
32
33
34
35
# File 'lib/puree/xml_extractor/thesis.rb', line 27

def qualification
  types = {
      '/dk/atira/pure/thesis/qualification/mphil' => 'MPhil',
      '/dk/atira/pure/thesis/qualification/phd' => 'PhD',
      '/dk/atira/pure/thesis/qualification/masters_by_research' => 'Masters by Research'
  }
  xpath_result = xpath_query_for_single_value '/qualification/uri'
  types[xpath_result]
end

#sponsorsArray<String>

Returns:

  • (Array<String>)


38
39
40
# File 'lib/puree/xml_extractor/thesis.rb', line 38

def sponsors
  xpath_query_for_multi_value '/sponsors/externalOrganisation/name'
end