Module: Plazucchini

Extended by:
Configuration
Defined in:
lib/plazucchini.rb,
lib/plazucchini/error.rb,
lib/plazucchini/utils.rb,
lib/plazucchini/request.rb,
lib/plazucchini/version.rb,
lib/plazucchini/xml_parser.rb

Defined Under Namespace

Modules: Utils, XmlParser Classes: BadGateway, Error, InternalServerError, NotFound, Request, RequestError, ServiceUnavailable, Unauthorized

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Methods included from Configuration

configuration, define_setting

Class Method Details

.authors_described_species(author: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Authors Described Species

How many new species have been described in papers authored by the given author?

Parameters:

  • author (String) (defaults to: nil)

    The author (default: “Agosti, D”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the authors’ described species counts



25
26
27
28
# File 'lib/plazucchini.rb', line 25

def self.authors_described_species(author: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Authors/DescribedSpecies"
  Request.new(endpoint: endpoint, method: :get, format: :json, author:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.authors_material_type_citations(genus_epithet: nil, species_epithet: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Authors Material Type Citations

How many times the given taxon types appear in material citations?
NOTE: This endpoint is misplaced in the API - it queries by taxon, not author

Parameters:

  • genus_epithet (String) (defaults to: nil)

    The genus epithet (default: “Tyrannosaurus”)

  • species_epithet (String) (defaults to: nil)

    The species epithet (default: “rex”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with material type citation counts



42
43
44
45
# File 'lib/plazucchini.rb', line 42

def self.authors_material_type_citations(genus_epithet: nil, species_epithet: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Authors/MaterialTypeCitations"
  Request.new(endpoint: endpoint, method: :get, format: :json, genus_epithet:, species_epithet:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.authors_new_species(author: nil, status: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Authors New Species

How many new species have been described by the given author?

Parameters:

  • author (String) (defaults to: nil)

    The author (required, default: “Malabarba”)

  • status (String) (defaults to: nil)

    The taxonomic status (default: “sp. nov.”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the authors’ new species counts



58
59
60
61
# File 'lib/plazucchini.rb', line 58

def self.authors_new_species(author: nil, status: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Authors/NewSpecies"
  Request.new(endpoint: endpoint, method: :get, format: :json, author:, status:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.authors_publication_dates(author: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Authors Publication Dates

When did the given author publish?

Parameters:

  • author (String) (defaults to: nil)

    The author (default: “Agosti, D”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the authors’ publication dates and counts



73
74
75
76
# File 'lib/plazucchini.rb', line 73

def self.authors_publication_dates(author: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Authors/PublicationDate"
  Request.new(endpoint: endpoint, method: :get, format: :json, author:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.authors_publication_journals(author: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Authors Publication Journals

In which journals did the given author publish?

Parameters:

  • author (String) (defaults to: nil)

    The author (default: “Agosti, D”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the authors’ publication journals and counts



88
89
90
91
# File 'lib/plazucchini.rb', line 88

def self.authors_publication_journals(author: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Authors/PublicationJournals"
  Request.new(endpoint: endpoint, method: :get, format: :json, author:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.authors_publication_partners(author: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Authors Publication Partners (Co-Authors)

With whom did the given author publish?

Parameters:

  • author (String) (defaults to: nil)

    The author (default: “Agosti, D”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the authors’ co-authors and collaboration counts



103
104
105
106
# File 'lib/plazucchini.rb', line 103

def self.authors_publication_partners(author: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Authors/PublicationPartners"
  Request.new(endpoint: endpoint, method: :get, format: :json, author:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.authors_specimen_locations(collector: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Authors Specimen Locations

Where are the specimens collected by the given collector deposited?
NOTE: This endpoint is misplaced in the API - it queries by collector, not author

Parameters:

  • collector (String) (defaults to: nil)

    The collector (default: “Agosti”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with specimen deposit locations and counts



119
120
121
122
# File 'lib/plazucchini.rb', line 119

def self.authors_specimen_locations(collector: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Authors/SpecimenLocation"
  Request.new(endpoint: endpoint, method: :get, format: :json, collector:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.authors_treatment_count(author: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Authors Treatment Count

How many treatments have been authored by the given author?

Parameters:

  • author (String) (defaults to: nil)

    The author (required, default: “Linnaeus”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the authors’ treatment counts



134
135
136
137
# File 'lib/plazucchini.rb', line 134

def self.authors_treatment_count(author: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Authors/TreatmentCount"
  Request.new(endpoint: endpoint, method: :get, format: :json, author:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.contributors_material_citations(user: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Contributors Liberated Material Citations

How many material citations have been liberated by the given person?

Parameters:

  • user (String) (defaults to: nil)

    The user that made the contribution (default: “tatiana”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the contributors’ material citation counts



149
150
151
152
# File 'lib/plazucchini.rb', line 149

def self.contributors_material_citations(user: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Contributors/LiberatedMaterialCitations"
  Request.new(endpoint: endpoint, method: :get, format: :json, user:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.contributors_pages(user: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Contributors Liberated Pages

How many pages have been liberated by the given person?

Parameters:

  • user (String) (defaults to: nil)

    The user that made the contribution (default: “tatiana”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the contributors’ page counts



164
165
166
167
# File 'lib/plazucchini.rb', line 164

def self.contributors_pages(user: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Contributors/LiberatedPages"
  Request.new(endpoint: endpoint, method: :get, format: :json, user:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.contributors_publications(user: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Contributors Liberated Publications

How many publications have been liberated by the given person?

Parameters:

  • user (String) (defaults to: nil)

    The user that made the contribution (default: “tatiana”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the contributors’ publication counts



179
180
181
182
# File 'lib/plazucchini.rb', line 179

def self.contributors_publications(user: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Contributors/LiberatedPublications"
  Request.new(endpoint: endpoint, method: :get, format: :json, user:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.contributors_treatments(user: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Contributors Liberated Treatments

How many treatments have been liberated by the given person?

Parameters:

  • user (String) (defaults to: nil)

    The user that made the contribution (default: “tatiana”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the contributors’ treatment counts



194
195
196
197
# File 'lib/plazucchini.rb', line 194

def self.contributors_treatments(user: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Contributors/LiberatedTreatments"
  Request.new(endpoint: endpoint, method: :get, format: :json, user:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.institutions_cited_materials(collection_code: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Institutions Cited Materials

How many publications cite materials deposited in the given institution?

Parameters:

  • collection_code (String) (defaults to: nil)

    The collection code (default: “MNHN”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with institutions’ cited material counts



209
210
211
212
# File 'lib/plazucchini.rb', line 209

def self.institutions_cited_materials(collection_code: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Institutions/CitedMaterials"
  Request.new(endpoint: endpoint, method: :get, format: :json, collection_code:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.institutions_distribution_range(collection_code: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Institutions Distribution Range

What is the range of distribution covered by the given institution?

Parameters:

  • collection_code (String) (defaults to: nil)

    The collection code (default: “MNHN”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with institutions’ geographic distribution data



224
225
226
227
# File 'lib/plazucchini.rb', line 224

def self.institutions_distribution_range(collection_code: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Institutions/DistributionRange"
  Request.new(endpoint: endpoint, method: :get, format: :json, collection_code:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.institutions_journal_occurrences(collection_code: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Institutions Journal Occurrences

In which journals is the data of the given institution published?
NOTE: The API endpoint is misspelled as "JournalOccurances"

Parameters:

  • collection_code (String) (defaults to: nil)

    The collection code (default: “MNHN”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with institutions’ journal occurrence data



240
241
242
243
# File 'lib/plazucchini.rb', line 240

def self.institutions_journal_occurrences(collection_code: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Institutions/JournalOccurances"  # API endpoint is misspelled
  Request.new(endpoint: endpoint, method: :get, format: :json, collection_code:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.institutions_specimens_stored(collection_code: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Institutions Specimens Stored

Parameters:

  • collection_code (String) (defaults to: nil)

    The collection code (default: MNHN)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with institutions’ specimens stored



254
255
256
257
# File 'lib/plazucchini.rb', line 254

def self.institutions_specimens_stored(collection_code: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Institutions/SpecimenStored"
  Request.new(endpoint: endpoint, method: :get, format: :json, collection_code:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.institutions_stored_types(collection_code: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Institutions Stored Types

Parameters:

  • collection_code (String) (defaults to: nil)

    The collection code (default: MNHN)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with institutions’ stored types



268
269
270
271
# File 'lib/plazucchini.rb', line 268

def self.institutions_stored_types(collection_code: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Institutions/StoredTypes"
  Request.new(endpoint: endpoint, method: :get, format: :json, collection_code:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.journals_cited_collections(journal: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Journals Cited Collections

Parameters:

  • journal (String) (defaults to: nil)

    The journal name (default: Phytotaxa)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with journal cited collections



282
283
284
285
# File 'lib/plazucchini.rb', line 282

def self.journals_cited_collections(journal: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Journals/CitedCollections"
  Request.new(endpoint: endpoint, method: :get, format: :json, journal:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.journals_published_figures_count(journal: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Journals Published Figures Count

Parameters:

  • journal (String) (defaults to: nil)

    The journal name (default: Zootaxa)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with published figures counts



296
297
298
299
# File 'lib/plazucchini.rb', line 296

def self.journals_published_figures_count(journal: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Journals/PublishedFiguresCount"
  Request.new(endpoint: endpoint, method: :get, format: :json, journal:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.journals_published_material_distribution(journal: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Journals Published Material Distribution

Parameters:

  • journal (String) (defaults to: nil)

    The journal name (default: Phytotaxa)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with published material distribution counts



310
311
312
313
# File 'lib/plazucchini.rb', line 310

def self.journals_published_material_distribution(journal: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Journals/PublishedMaterialDistribution"
  Request.new(endpoint: endpoint, method: :get, format: :json, journal:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.journals_published_new_species_count(journal: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Journals Published New Species Count

Parameters:

  • journal (String) (defaults to: nil)

    The journal name

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with published new species counts



324
325
326
327
# File 'lib/plazucchini.rb', line 324

def self.journals_published_new_species_count(journal: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Journals/PublishedNewSpeciesCount"
  Request.new(endpoint: endpoint, method: :get, format: :json, journal:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.journals_published_page_count(journal: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Journals Published Page Count

Parameters:

  • journal (String) (defaults to: nil)

    The journal name (default: )

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with published page counts



338
339
340
341
# File 'lib/plazucchini.rb', line 338

def self.journals_published_page_count(journal: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Journals/PublishedPageCount"
  Request.new(endpoint: endpoint, method: :get, format: :json, journal:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.journals_published_synonyms(journal: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Journals Published Synonyms Count

Parameters:

  • journal (String) (defaults to: nil)

    The journal name

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with published synonyms counts



352
353
354
355
# File 'lib/plazucchini.rb', line 352

def self.journals_published_synonyms(journal: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Journals/PublishedSynonyms"
  Request.new(endpoint: endpoint, method: :get, format: :json, journal:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.journals_published_tables(journal: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Journals Published Tables Count

Parameters:

  • journal (String) (defaults to: nil)

    The journal name

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with published tables counts



366
367
368
369
# File 'lib/plazucchini.rb', line 366

def self.journals_published_tables(journal: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Journals/PublishedTabels"  # endpoint is misspelled in the API
  Request.new(endpoint: endpoint, method: :get, format: :json, journal:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.journals_published_treatment_count(journal: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Journals Published Treatment Count

Parameters:

  • journal (String) (defaults to: nil)

    The journal name

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with published treatment counts



380
381
382
383
# File 'lib/plazucchini.rb', line 380

def self.journals_published_treatment_count(journal: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Journals/PublishedTreatmentCount"
  Request.new(endpoint: endpoint, method: :get, format: :json, journal:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.metrics_journal_data_count(limit: nil, order_mode: nil, verbose: false) ⇒ Array

Metrics Journal Data Count

Parameters:

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with metrics data counts



393
394
395
396
# File 'lib/plazucchini.rb', line 393

def self.metrics_journal_data_count(limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Metrics/JournalDataCount"
  Request.new(endpoint: endpoint, method: :get, format: :json, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.metrics_user_contribution_count(limit: nil, order_mode: nil, verbose: false) ⇒ Array

Metrics User Contribution Count

Parameters:

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with metrics data counts



406
407
408
409
# File 'lib/plazucchini.rb', line 406

def self.metrics_user_contribution_count(limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Metrics/UserContributionCount"
  Request.new(endpoint: endpoint, method: :get, format: :json, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.ping(verbose: false) ⇒ Hash

Ping the API (check if the service is alive)

Parameters:

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Hash)

    Returns => true if the API is reachable

Raises:



564
565
566
567
568
# File 'lib/plazucchini.rb', line 564

def self.ping(verbose: false)                                                                                                                                                                                                                              
  endpoint = "/v1/Metrics/JournalDataCount"                                                                                                                                                                                                                
  Request.new(endpoint: endpoint, method: :get, format: :json, limit: 1, verbose: verbose).perform                                                                                                                                                         
  {"pong" => true}                                                                                                                                                                                                                                                   
end

.specimens_with_genes(genus_epithet: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Specimens With Genes

How many specimens are documented with gene sequences?
NOTE: This endpoint is misplaced in the API under Authors - it queries by genus, not author

Parameters:

  • genus_epithet (String) (defaults to: nil)

    The genus (required, default: “Exobasidium”)

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with specimens that have gene sequence data



422
423
424
425
# File 'lib/plazucchini.rb', line 422

def self.specimens_with_genes(genus_epithet: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Authors/SpecimenWithGenes"  # API endpoint is misplaced under Authors
  Request.new(endpoint: endpoint, method: :get, format: :json, genus_epithet:, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.taxon_materials_citations(genus_epithet: nil, species_epithet: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Taxon Materials Citations

Parameters:

  • genus_epithet (String) (defaults to: nil)

    The genus of the treatment

  • species_epithet (String) (defaults to: nil)

    The species of the treatment

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with taxon materials citations



437
438
439
440
441
# File 'lib/plazucchini.rb', line 437

def self.taxon_materials_citations(genus_epithet: nil, species_epithet: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Taxon/MaterialCitations"
  Request.new(endpoint: endpoint, method: :get, format: :json, genus_epithet: genus_epithet, species_epithet: species_epithet,
              limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.taxon_occurrence_by_materials_citation(limit: nil, order_mode: nil, verbose: false) ⇒ Array

Taxon Occurrence By Material Citation

NOTE: The API endpoint is misspelled as "OccuranceByMaterialCitation"

Parameters:

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with taxon occurrence by material citation results



451
452
453
454
# File 'lib/plazucchini.rb', line 451

def self.taxon_occurrence_by_materials_citation(limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Taxon/OccuranceByMaterialCitation"  # API endpoint is misspelled
  Request.new(endpoint: endpoint, method: :get, format: :json, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.taxon_specimens_in_collections(genus_epithet: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Taxon Specimens In Collections

Parameters:

  • genus_epithet (String) (defaults to: nil)

    The genus of the treatment

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array of taxon specimens in collections



464
465
466
467
# File 'lib/plazucchini.rb', line 464

def self.taxon_specimens_in_collections(genus_epithet: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Taxon/SpecimensInCollections"
  Request.new(endpoint: endpoint, method: :get, format: :json, genus_epithet: genus_epithet, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.taxon_treatments_for_taxon(genus_epithet: nil, species_epithet: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Taxon Treatments for taxon

Parameters:

  • genus_epithet (String) (defaults to: nil)

    The genus of the treatment

  • species_epithet (String) (defaults to: nil)

    The species of the treatment

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array of taxon treatments for taxon results



478
479
480
481
482
# File 'lib/plazucchini.rb', line 478

def self.taxon_treatments_for_taxon(genus_epithet: nil, species_epithet: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Taxon/TreatmentsForTaxon"
  Request.new(endpoint: endpoint, method: :get, format: :json, genus_epithet: genus_epithet, species_epithet: species_epithet,
              limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.taxon_treatments_with_keys(genus_epithet: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Taxon Treatments With Keys

Find treatments that contain taxonomic keys for the given genus

Parameters:

  • genus_epithet (String) (defaults to: nil)

    The genus of the treatment

  • limit (nil, Integer) (defaults to: nil)

    The optional result limit

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array of treatments with taxonomic keys



494
495
496
497
# File 'lib/plazucchini.rb', line 494

def self.taxon_treatments_with_keys(genus_epithet: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Taxon/TreatmentsWithKeys"
  Request.new(endpoint: endpoint, method: :get, format: :json, genus_epithet: genus_epithet, limit: limit, order_mode: order_mode, verbose: verbose).perform
end

.treatments_fetch(uuid:, verbose: false) ⇒ Hash

Treatments Fetch

Fetch the full treatment document by UUID

Parameters:

  • uuid (String)

    The UUID of the treatment to fetch (required)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Hash)

    The full treatment data as a hash (converted from XML)



507
508
509
510
# File 'lib/plazucchini.rb', line 507

def self.treatments_fetch(uuid:, verbose: false)
  endpoint = "/v1/Treatments/fetch"
  Request.new(endpoint: endpoint, method: :get, format: :xml, uuid:, verbose: verbose).perform
end

.treatments_search(kingdom_epithet: nil, phylum_epithet: nil, class_epithet: nil, order_epithet: nil, family_epithet: nil, genus_epithet: nil, species_epithet: nil, limit: nil, order_mode: nil, verbose: false) ⇒ Array

Search treatments

Search for treatments by taxonomic rank

Parameters:

  • kingdom_epithet (nil, String) (defaults to: nil)

    The kingdom to search (optional)

  • phylum_epithet (nil, String) (defaults to: nil)

    The phylum to search (optional)

  • class_epithet (nil, String) (defaults to: nil)

    The class to search (optional)

  • order_epithet (nil, String) (defaults to: nil)

    The order to search (optional)

  • family_epithet (nil, String) (defaults to: nil)

    The family to search (optional)

  • genus_epithet (nil, String) (defaults to: nil)

    The genus to search (optional)

  • species_epithet (nil, String) (defaults to: nil)

    The species to search (optional)

  • limit (nil, Integer) (defaults to: nil)

    The search result limit (optional)

  • order_mode (nil, String) (defaults to: nil)

    The optional sort order (ASC, DESC, nil)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array of matching treatments



528
529
530
531
# File 'lib/plazucchini.rb', line 528

def self.treatments_search(kingdom_epithet: nil, phylum_epithet: nil, class_epithet: nil, order_epithet: nil, family_epithet: nil, genus_epithet: nil, species_epithet: nil, limit: nil, order_mode: nil, verbose: false)
  endpoint = "/v1/Treatments/search"
  Request.new(endpoint: endpoint, method: :get, format: :json, kingdom_epithet:, phylum_epithet:, class_epithet:, order_epithet:, family_epithet:, genus_epithet:, species_epithet:, limit:, order_mode:, verbose: verbose).perform
end

.treatments_search_by_doi(doi:, verbose: false) ⇒ Array

Search treatments by DOI

Find treatments associated with the given DOI

Parameters:

  • doi (String)

    The DOI to search for (required)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array of matching treatments



541
542
543
544
# File 'lib/plazucchini.rb', line 541

def self.treatments_search_by_doi(doi:, verbose: false)
  endpoint = "/v1/Treatments/searchByDOI"
  Request.new(endpoint: endpoint, method: :get, format: :json, doi:, verbose: verbose).perform
end

.treatments_summary(uuid:, verbose: false) ⇒ Array

Get a treatment summary

Fetch a summary of the treatment by UUID

Parameters:

  • uuid (String)

    The UUID of the treatment (required)

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Array)

    An array with the treatment summary data



553
554
555
556
# File 'lib/plazucchini.rb', line 553

def self.treatments_summary(uuid:, verbose: false)
  endpoint = "/v1/Treatments/summary"
  Request.new(endpoint: endpoint, method: :get, format: :json, uuid:, verbose: verbose).perform
end