Skip to content

Commit

Permalink
#53 revise taxon_name_XXX, /{id} endpoints. Onl tazon_names/{id} work…
Browse files Browse the repository at this point in the history
…ing correctl.
  • Loading branch information
jrflood committed May 5, 2022
1 parent ad1dba8 commit a853f5f
Show file tree
Hide file tree
Showing 14 changed files with 697 additions and 136 deletions.
182 changes: 75 additions & 107 deletions api/api.raml

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions api/examples/taxon_name_relationships_id-result-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": 283818,
"subject_taxon_name_id": 153,
"object_taxon_name_id": 153,
"subject_status_tag": "as original species of",
"object_status_tag": "in original combination with original species",
"type": "TaxonNameRelationship::OriginalCombination::OriginalSpecies",
"created_by_id": 1,
"updated_by_id": 1,
"project_id": 2,
"created_at": "2021-08-16T19:37:39.014Z",
"updated_at": "2021-08-16T19:37:39.014Z",
"inverse_assignment_method": "original_species",
"assignment_method": "species_in_original_combination",
"subject_name": "Ripipteryx antennata Hebard, 1924",
"object_name": "Ripipteryx antennata Hebard, 1924",
"global_id": "gid://taxon-works/TaxonNameRelationship::OriginalCombination::OriginalSpecies/283818"
}
218 changes: 218 additions & 0 deletions api/examples/taxon_names-parse-result-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
{
"data": {
"protonyms": {
"genus": [
{
"id": 146,
"name": "Ripipteryx",
"parent_id": 104,
"cached": "Ripipteryx",
"cached_is_valid": true,
"cached_html": "<i>Ripipteryx</i>",
"feminine_name": null,
"masculine_name": null,
"neuter_name": null,
"cached_author_year": "Newman, 1834",
"etymology": null,
"year_of_publication": null,
"verbatim_author": null,
"rank": "genus",
"rank_string": "NomenclaturalRank::Iczn::GenusGroup::Genus",
"type": "Protonym",
"created_by_id": 1,
"updated_by_id": 19,
"project_id": 2,
"cached_valid_taxon_name_id": 146,
"cached_original_combination": "Ripipteryx",
"cached_original_combination_html": "<i>Ripipteryx</i>",
"cached_secondary_homonym": null,
"cached_primary_homonym": "Ripipteryx",
"created_at": "2013-02-12T18:23:00.000Z",
"updated_at": "2015-05-07T09:56:00.000Z",
"nomenclatural_code": "iczn",
"verbatim_name": null,
"object_tag": "<i>Ripipteryx</i>",
"object_label": "Ripipteryx Newman, 1834",
"global_id": "gid://taxon-works/Protonym/146",
"base_class": "TaxonName",
"url_for": "http://localhost:3000/taxon_names/parse",
"object_url": "/taxon_names/146",
"original_combination": "<i>Ripipteryx</i> Newman, 1834"
}
],
"subgenus": [],
"species": [
{
"id": 153,
"name": "antennata",
"parent_id": 150,
"cached": "Ripipteryx antennata",
"cached_is_valid": true,
"cached_html": "<i>Ripipteryx antennata</i>",
"feminine_name": null,
"masculine_name": null,
"neuter_name": null,
"cached_author_year": "Hebard, 1924",
"etymology": null,
"year_of_publication": null,
"verbatim_author": null,
"rank": "species",
"rank_string": "NomenclaturalRank::Iczn::SpeciesGroup::Species",
"type": "Protonym",
"created_by_id": 1,
"updated_by_id": 19,
"project_id": 2,
"cached_valid_taxon_name_id": 153,
"cached_original_combination": "Ripipteryx antennata",
"cached_original_combination_html": "<i>Ripipteryx antennata</i>",
"cached_secondary_homonym": "Ripipteryx antennata",
"cached_primary_homonym": "Ripipteryx antennata",
"created_at": "2013-02-12T18:23:00.000Z",
"updated_at": "2017-11-14T12:47:00.000Z",
"nomenclatural_code": "iczn",
"verbatim_name": null,
"object_tag": "<i>Ripipteryx antennata</i>",
"object_label": "Ripipteryx antennata Hebard, 1924",
"global_id": "gid://taxon-works/Protonym/153",
"base_class": "TaxonName",
"url_for": "http://localhost:3000/taxon_names/parse",
"object_url": "/taxon_names/153",
"original_combination": "<i>Ripipteryx antennata</i> Hebard, 1924"
},
{
"id": 5148,
"name": "antennata",
"parent_id": 5127,
"cached": "Trilophidia antennata",
"cached_is_valid": false,
"cached_html": "<i>Trilophidia antennata</i>",
"feminine_name": null,
"masculine_name": null,
"neuter_name": null,
"cached_author_year": "Krauss, 1877",
"etymology": null,
"year_of_publication": null,
"verbatim_author": null,
"rank": "species",
"rank_string": "NomenclaturalRank::Iczn::SpeciesGroup::Species",
"type": "Protonym",
"created_by_id": 1,
"updated_by_id": 1,
"project_id": 2,
"cached_valid_taxon_name_id": 5147,
"cached_original_combination": "Trilophidia antennata",
"cached_original_combination_html": "<i>Trilophidia antennata</i>",
"cached_secondary_homonym": "Trilophidia antennata",
"cached_primary_homonym": "Trilophidia antennata",
"created_at": "2013-02-12T18:23:00.000Z",
"updated_at": "2013-07-20T16:40:00.000Z",
"nomenclatural_code": "iczn",
"verbatim_name": null,
"object_tag": "<i>Trilophidia antennata</i>",
"object_label": "Trilophidia antennata Krauss, 1877",
"global_id": "gid://taxon-works/Protonym/5148",
"base_class": "TaxonName",
"url_for": "http://localhost:3000/taxon_names/parse",
"object_url": "/taxon_names/5148",
"original_combination": "<i>Trilophidia antennata</i> Krauss, 1877"
},
{
"id": 13351,
"name": "antennata",
"parent_id": 13350,
"cached": "Ootua antennata",
"cached_is_valid": true,
"cached_html": "<i>Ootua antennata</i>",
"feminine_name": null,
"masculine_name": null,
"neuter_name": null,
"cached_author_year": "Uvarov, 1927",
"etymology": null,
"year_of_publication": null,
"verbatim_author": null,
"rank": "species",
"rank_string": "NomenclaturalRank::Iczn::SpeciesGroup::Species",
"type": "Protonym",
"created_by_id": 1,
"updated_by_id": 1,
"project_id": 2,
"cached_valid_taxon_name_id": 13351,
"cached_original_combination": "Ootua antennata",
"cached_original_combination_html": "<i>Ootua antennata</i>",
"cached_secondary_homonym": "Ootua antennata",
"cached_primary_homonym": "Ootua antennata",
"created_at": "2013-02-12T18:23:00.000Z",
"updated_at": "2013-07-20T16:40:00.000Z",
"nomenclatural_code": "iczn",
"verbatim_name": null,
"object_tag": "<i>Ootua antennata</i>",
"object_label": "Ootua antennata Uvarov, 1927",
"global_id": "gid://taxon-works/Protonym/13351",
"base_class": "TaxonName",
"url_for": "http://localhost:3000/taxon_names/parse",
"object_url": "/taxon_names/13351",
"original_combination": "<i>Ootua antennata</i> Uvarov, 1927"
},
],
"subspecies": [],
"variety": [],
"form": []
},
"parse": {
"author": null,
"year": null,
"genus": "Ripipteryx",
"subgenus": null,
"species": "antennata",
"subspecies": null,
"variety": null,
"form": null
},
"unambiguous": false,
"existing_combination_id": null
},
"other_matches": {
"verbatim": [],
"subgenus": [],
"original": [],
"original_combination": [
{
"id": 153,
"name": "antennata",
"parent_id": 150,
"cached": "Ripipteryx antennata",
"cached_is_valid": true,
"cached_html": "<i>Ripipteryx antennata</i>",
"feminine_name": null,
"masculine_name": null,
"neuter_name": null,
"cached_author_year": "Hebard, 1924",
"etymology": null,
"year_of_publication": null,
"verbatim_author": null,
"rank": "species",
"rank_string": "NomenclaturalRank::Iczn::SpeciesGroup::Species",
"type": "Protonym",
"created_by_id": 1,
"updated_by_id": 19,
"project_id": 2,
"cached_valid_taxon_name_id": 153,
"cached_original_combination": "Ripipteryx antennata",
"cached_original_combination_html": "<i>Ripipteryx antennata</i>",
"cached_secondary_homonym": "Ripipteryx antennata",
"cached_primary_homonym": "Ripipteryx antennata",
"created_at": "2013-02-12T18:23:00.000Z",
"updated_at": "2017-11-14T12:47:00.000Z",
"nomenclatural_code": "iczn",
"verbatim_name": null,
"object_tag": "<i>Ripipteryx antennata</i>",
"object_label": "Ripipteryx antennata Hebard, 1924",
"global_id": "gid://taxon-works/Protonym/153",
"base_class": "TaxonName",
"url_for": "http://localhost:3000/taxon_names/parse",
"object_url": "/taxon_names/153",
"original_combination": "<i>Ripipteryx antennata</i> Hebard, 1924"
}
]
}
}
13 changes: 13 additions & 0 deletions api/examples/taxon_names_classifications_id-result-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": 101,
"taxon_name_id": 1006,
"type": "TaxonNameClassification::Iczn::Unavailable::NomenNudum",
"created_by_id": 1,
"updated_by_id": 19,
"project_id": 2,
"created_at": "2013-02-12T18:23:00.000Z",
"updated_at": "2020-12-10T10:39:00.000Z",
"object_tag": "<i>Deltonotus cristatus</i> Hancock, 1907 (nomen nudum)",
"url": "http://localhost:3000/taxon_name_classifications/101.json",
"global_id": "gid://taxon-works/TaxonNameClassification::Iczn::Unavailable::NomenNudum/101"
}
9 changes: 3 additions & 6 deletions api/traits/TaxonName-search.raml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ queryParameters:
When `true` then only return taxon names that have citations attached to them.
type: boolean
required: false
enum: [true, false, TRUE, FALSE, True, False]
example: false
example: [true, false, TRUE, FALSE, True, False]
descendants:
description: |
Filter by parenthood. When set to true and one or more taxon_name_id values are provided then the request matches taxa which are children of at least one of the taxa specified by the taxon_name_ids. Has no effect if taxon_name_id is not provided.
Expand Down Expand Up @@ -64,9 +63,8 @@ queryParameters:
description: |
When `true` then only return taxon names that are linked to one or more Otus.
type: boolean
enum: [true, false, TRUE, FALSE, True, False]
example: [true, false, TRUE, FALSE, True, False]
required: false
example: true
project_id:
description: |
Project identifier. In the absence of a project token you must provide this parameter.
Expand Down Expand Up @@ -96,8 +94,7 @@ queryParameters:
Boolean. When `true` then only return taxon names that are linked to a type specimen (collection object).
type: string
required: false
enum: [true, false, TRUE, FALSE, True, False]
example: TRUE
example: [true, false, TRUE, FALSE, True, False]
updated_since:
description: |
Names updated (modified_at property) since this datetime.
Expand Down
14 changes: 0 additions & 14 deletions api/traits/TaxonName123status.raml

This file was deleted.

7 changes: 7 additions & 0 deletions api/traits/TaxonNameClassificationsID-search.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
responses:
200:
body:
application/json:
type: TaxonNameClassification[]
uniqueItems: true
example: !include /examples/taxon_names_classifications_id-result-example.json
7 changes: 7 additions & 0 deletions api/traits/TaxonNameID-search.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
responses:
200:
body:
application/json:
type: TaxonName[]
uniqueItems: true
example: !include /examples/taxon_names_id-result-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ responses:
type: TaxonName[]
maxItems: 100
uniqueItems: true
example: !include /examples/taxon_names_123-result-example.json
example: !include /examples/taxon_names_id_inventory-result-example.json
20 changes: 20 additions & 0 deletions api/traits/TaxonNameParse.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
description: Returns a single TaxonName instance with related data included.
queryParameters:
combination_id:
description: |
Combination_id to restrict scope of results
type: boolean
required: false
query_string:
description: |
String expression of name(s) to parse against.
type: string
required: true
example: Ripipteryx antennata
responses:
200:
body:
application/json:
type: TaxonNameParse[]
uniqueItems: true
example: !include /examples/taxon_names-parse-result-example.json
7 changes: 7 additions & 0 deletions api/traits/TaxonNameRelationshipsID.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
responses:
200:
body:
application/json:
type: TaxonNameRelationships[]
uniqueItems: true
example: !include /examples/taxon_name_relationships_id-result-example.json
Loading

0 comments on commit a853f5f

Please sign in to comment.