colrapi 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aea2e44a818d41cd832614bd00cb148714061db766ef82a61be48a036568d032
4
- data.tar.gz: d7b3de2c633901fc8e30f6f80fb8fe47bbb1b9702d016f1240fed959c26479ba
3
+ metadata.gz: 07aa378c2254f300d7086a0a2679e36a594a99a939d4487adb8745f96abe50b6
4
+ data.tar.gz: ada0fe3d028b8a20be01c229165fdff97ee67fd0684d078989891e067d68a862
5
5
  SHA512:
6
- metadata.gz: a24bec052600b4f5cf3402e5cf8b5ad62e40dd5178d79285812acd594caaa91d18c4dd28c29bbb4eba6eb9da8aaec5a619d2263c929c49edc1b91dfef9caa5f9
7
- data.tar.gz: 7b495d6b3ea866840958a56334a1493f94b39568df0a474b6de5cae4940c18206a3041c9920b2567ade50d71326d13861502722bfaa1433e0e45e3a626c33b2e
6
+ metadata.gz: 12513f5a616691d81568970d0f5e65c9198990c8a167327c0e9d36b856f562f2cbb56004a7a78a01e6e6a2d7be5c3d3cfbd51c51f67f561c63ff2b480ebe0b20
7
+ data.tar.gz: 9245c8a61aa5f716467cf64d8bafb00a6d0987d88a2055411c3baa8ee9a62b8b04f14a882987f65b4b6e9003bd228004cae950e1ff5cadb21ae69fb5c03c82b2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.6] - 2025-03-25
4
+ - Added more nameusage_search parameters:
5
+ - authorship
6
+ - authorship_year
7
+ - extinct
8
+ - field
9
+ - name_type
10
+ - nomenclatural_code
11
+ - nomenclatural_status
12
+ - origin
13
+ - secondary_source
14
+ - sector_dataset_id
15
+ - sector_mode
16
+ - status
17
+ - taxonomic_group
18
+
3
19
  ## [0.1.5] - 2025-03-25
4
20
  - Added usage_id to nameusage_search
5
21
 
@@ -18,14 +18,18 @@ module Colrapi
18
18
  @regexp = args[:regexp]
19
19
  @content = Array(args[:content]) if args[:content]
20
20
  @name = args[:name]
21
- @authorship = args[:authorship]
22
- @code = args[:code]
21
+ @authorship = Array(args[:authorship]) if args[:authorship]
22
+ @authorship_year = Array(args[:authorship_year]) if args[:authorship_year]
23
+ @code = Array(args[:code]) if args[:code]
24
+ @nomenclatural_code = Array(args[:nomenclatural_code]) if args[:nomenclatural_code] # unfortunately code and nom_code get used on different endpoints
25
+ @field = Array(args[:field]) if args[:field]
23
26
  @type = Array(args[:type]) if args[:type]
24
27
  @rank = Array(args[:rank]) if args[:rank]
25
28
  @facet = Array(args[:facet]) if args[:facet]
29
+ @extinct = Array(args[:extinct]) if args[:extinct]
26
30
  @min_rank = args[:min_rank]
27
31
  @max_rank = args[:max_rank]
28
- @environment = args[:environment]
32
+ @environment = Array(args[:environment]) if args[:environment]
29
33
  @highest_taxon_id = args[:highest_taxon_id]
30
34
  @usage_id = args[:usage_id]
31
35
  @parent_rank = args[:parent_rank]
@@ -43,6 +47,7 @@ module Colrapi
43
47
  @has_gbif_id = args[:has_gbif_id]
44
48
  @gbif_id = args[:gbif_id]
45
49
  @gbif_publisher_id = args[:gbif_publisher_id]
50
+ @taxonomic_group = Array(args[:taxonomic_group]) if args[:taxonomic_group]
46
51
  @editor = args[:editor]
47
52
  @reviewer = args[:reviewer]
48
53
  @modified_by = args[:modified_by]
@@ -64,6 +69,12 @@ module Colrapi
64
69
  @min = args[:min]
65
70
  @max = args[:max]
66
71
  @min_size = args[:min_size]
72
+ @name_type = Array(args[:name_type]) if args[:name_type]
73
+ @nomenclatural_status = Array(args[:nomenclatural_status]) if args[:nomenclatural_status]
74
+ @status = Array(args[:status]) if args[:status]
75
+ @sector_mode = Array(args[:sector_mode]) if args[:sector_mode]
76
+ @sector_dataset_id = Array(args[:sector_dataset_id]) if args[:sector_dataset_id]
77
+ @secondary_source = Array(args[:secondary_source]) if args[:secondary_source]
67
78
  @size = args[:size]
68
79
  @within_superkingdom = args[:within_superkingdom]
69
80
  @within_kingdom = args[:within_kingdom]
@@ -108,16 +119,19 @@ module Colrapi
108
119
 
109
120
  def perform
110
121
 
111
- args = { q: @q, regex: @regexp, attempt: @attempt, content: @content, name: @name, authorship: @authorship, code: @code, type: @type,
122
+ args = { q: @q, regex: @regexp, attempt: @attempt, content: @content, name: @name, authorship: @authorship,
123
+ authorshipYear: @authorship_year, code: @code, nomCode: @nomenclatural_code, field: @field, extinct: @extinct, type: @type,
112
124
  rank: @rank, minRank: @min_rank, maxRank: @max_rank, parentRank: @parent_rank, projectKey: @project_id,
113
125
  term: @term, termOp: @term_operator, status: @status, decisionMode: @decision_mode,
114
126
  alias: @short_title, private: @private, releasedFrom: @released_from, contributesTo: @contributes_to,
115
- hasSourceDataset: @has_source_dataset, hasGbifKey: @has_gbif_id, gbifKey: @gbif_id,
127
+ hasSourceDataset: @has_source_dataset, hasGbifKey: @has_gbif_id, group: @taxonomic_group, gbifKey: @gbif_id,
116
128
  gbifPublisherKey: @gbif_publisher_id, editor: @editor, reviewer: @reviewer, modifiedBy: @modified_by,
117
129
  id: @id, format: @format, root: @root_id, root2: @root2_id, synonyms: @include_synonyms,
118
130
  showParent: @include_parent, origin: @origin, original: @original, license: @license, rowType: @row_type,
119
131
  created: @created_after, createdBefore: @created_before, issued: @issued, issuedBefore: @issued_before,
120
132
  modified: @modified_after, modifiedBefore: @modified_before, lastSync: @last_synced_before,
133
+ status: @status, nomStatus: @nomenclatural_status, nameType: @name_type,
134
+ sectorMode: @sector_mode, sectorDatasetKey: @sector_dataset_id, secondarySourceGroup: @secondary_source,
121
135
  minSize: @min_size, size: @size, issue: @issue, min: @min, max: @max, datasetKey: @dataset_id_filter,
122
136
  withoutData: @without_data, superkingdom: @within_superkingdom, kingdom: @within_kingdom,
123
137
  subkingdom: @within_subkingdom, superphylum: @within_superphylum, phylum: @within_phylum,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Colrapi
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
data/lib/colrapi.rb CHANGED
@@ -543,20 +543,33 @@ module Colrapi
543
543
 
544
544
  # Search the nameusage route, which uses Elastic Search
545
545
  #
546
- # @param q [String] A query string
546
+ # @param authorship [Array, String, nil] filters by authorship
547
+ # @param authorship_year [Array, String, nil] filters by authorship year
548
+ # @param content [Array, String, nil] restrict search to SCIENTIFIC_NAME, or AUTHORSHIP
547
549
  # @param dataset_id [String, nil] restricts name usage search within a dataset
548
550
  # @param endpoint [String, nil] some endpoints have nested options
549
- # @param content [Array, String, nil] restrict search to SCIENTIFIC_NAME, or AUTHORSHIP
550
- # @param issue [Array, String, nil] the data quality issue
551
- # @param type [String, nil] sets the type of search to PREFIX, WHOLE_WORDS, or EXACT
552
- # @param rank [String, nil] taxonomic rank of name usages
553
- # @param min_rank [String, nil] minimum taxonomic rank of name usages
554
- # @param max_rank [String, nil] maximum taxonomic rank of name usages
555
- # @param facet [Array, String, nil] the search facet
556
551
  # @param environment [Array, String, nil] filter by environment (MARINE, TERRESTRIAL, FRESHWATER, BRACKISH)
552
+ # @param extinct [Array, int, nil] filter by extinct status (0, 1)
553
+ # @param facet [Array, String, nil] the search facet
554
+ # @param field [Array, String, nil] filter by name field (see: http://api.checklistbank.org/vocab/namefield)
557
555
  # @param highest_taxon_id [String, nil] Filter by highest taxon ID
556
+ # @param issue [Array, String, nil] the data quality issue
557
+ # @param max_rank [String, nil] maximum taxonomic rank of name usages
558
+ # @param min_rank [String, nil] minimum taxonomic rank of name usages
559
+ # @param name_type [Array, String, nil] filter by name type (hybrid formula, informal, no name, otu, placeholder, scientific, virus)
560
+ # @param nomenclatural_code [Array, String, nil] filter by nomenclatural code (botanical, zoological, bacterial, viral, phytosociological, cultivars)
561
+ # @param nomenclatural_status [Array, String, nil] filter by nomenclatural status (acceptable, conserved, doubtful, established, manuscript, not established, rejected, unacceptable)
562
+ # @param origin [Array, String, nil] filter by origin of the name usage (see: http://api.checklistbank.org/vocab/origin)
563
+ # @param q [String] A query string
564
+ # @param rank [Array, String, nil] taxonomic rank of name usages
565
+ # @param secondary_source [Array, String, nil] filter by secondary source (authorship, basionym, extinct, holotype, parent, published in, rank, temporal range)
566
+ # @param sector_dataset_id [Array, String, nil] filter by the sector source dataset ID
567
+ # @param sector_mode [Array, String, nil] filter by the sector mode (attach, merge, union)
568
+ # @param status [Array, String, nil] filter by taxonomic status (accepted, ambiguous synonym, misapplied, provisionally accepted, synonym)
569
+ # @param taxonomic_group [Array, String, nil] filter by taxonomic group (see: http://api.checklistbank.org/vocab/taxgroup)
570
+ # @param type [String, nil] sets the type of search to PREFIX, WHOLE_WORDS, or EXACT
558
571
  # @param usage_id [String, nil] Filter by usage ID
559
- #
572
+ #
560
573
  # @param sort_by [String, nil] sort results by NAME, TAXONOMIC, INDEX_NAME_ID, NATIVE, or RELEVANCE
561
574
  # @param reverse [Boolean] sort in reverse order
562
575
  # @param offset [Integer] Offset for pagination
@@ -564,20 +577,29 @@ module Colrapi
564
577
  # @param verbose [Boolean] Print headers to STDOUT
565
578
  #
566
579
  # @return [Array, Boolean] An array of hashes
567
- def self.nameusage_search(q: nil, dataset_id: nil, endpoint: 'nameusage/search', content: nil, issue: nil,
580
+ def self.nameusage_search(q: nil, authorship: nil, authorship_year: nil, dataset_id: nil,
581
+ endpoint: 'nameusage/search', extinct: nil, field: nil, content: nil, issue: nil,
568
582
  type: nil, rank: nil, min_rank: nil, max_rank: nil, environment: nil, facet: nil,
569
- highest_taxon_id: nil, usage_id: nil, sort_by: nil, reverse: nil, offset: nil, limit: nil,
570
- verbose: false)
583
+ nomenclatural_code: nil, highest_taxon_id: nil, usage_id: nil, nomenclatural_status: nil,
584
+ name_type: nil, origin: nil, secondary_source: nil,
585
+ sector_mode: nil, sector_dataset_id: nil, status: nil, taxonomic_group: nil,
586
+ sort_by: nil, reverse: nil, offset: nil, limit: nil, verbose: false)
571
587
 
572
588
  # a nil dataset_id will search name usages from all datasets in ChecklistBank
573
589
  unless dataset_id.nil?
574
590
  endpoint = "dataset/#{dataset_id}/nameusage/search"
575
591
  end
576
592
 
577
- Request.new(endpoint: endpoint, q: q, content: content, issue: issue, type: type,
578
- rank: rank, min_rank: min_rank, max_rank: max_rank, facet: facet, environment: environment,
579
- highest_taxon_id: highest_taxon_id, usage_id: usage_id, sort_by: sort_by, reverse: reverse,
580
- offset: offset, limit: limit, verbose: verbose).perform
593
+ Request.new(endpoint: endpoint, q: q, authorship: authorship, authorship_year: authorship_year,
594
+ extinct: extinct, field: field, content: content, issue: issue, type: type,
595
+ rank: rank, min_rank: min_rank, max_rank: max_rank, facet: facet,
596
+ nomenclatural_code: nomenclatural_code,environment: environment,
597
+ highest_taxon_id: highest_taxon_id, usage_id: usage_id,
598
+ name_type: name_type, nomenclatural_status: nomenclatural_status, origin: origin,
599
+ secondary_source: secondary_source, sector_mode: sector_mode,
600
+ sector_dataset_id: sector_dataset_id, status: status, taxonomic_group: taxonomic_group,
601
+ sort_by: sort_by, reverse: reverse, offset: offset, limit: limit,
602
+ verbose: verbose).perform
581
603
  end
582
604
 
583
605
  # Get a name usage suggestion
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colrapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Yoder, Geoff Ower
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-25 00:00:00.000000000 Z
11
+ date: 2025-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -198,7 +198,7 @@ licenses:
198
198
  metadata:
199
199
  homepage_uri: https://github.com/SpeciesFileGroup/colrapi
200
200
  source_code_uri: https://github.com/SpeciesFileGroup/colrapi
201
- changelog_uri: https://github.com/SpeciesFileGroup/colrapi/releases/tag/v0.1.5
201
+ changelog_uri: https://github.com/SpeciesFileGroup/colrapi/releases/tag/v0.1.6
202
202
  post_install_message:
203
203
  rdoc_options: []
204
204
  require_paths: