Git Product home page Git Product logo

tigerhawkvok / asm-mammal-database Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 3.0 254.25 MB

American Society of Mammalogists Database

Home Page: http://mammaldiversity.org

License: Other

CoffeeScript 11.50% PHP 42.58% HTML 13.48% Shell 0.92% JavaScript 1.89% CSS 2.32% Ruby 0.01% Makefile 0.13% Tcl 0.02% Python 0.49% Batchfile 0.01% Pawn 0.03% C 0.10% SQLPL 26.48% PLpgSQL 0.05%
asm mammals science wildlife nature

asm-mammal-database's Introduction

ASM Mammalian Diversity Database

You can find the most current version at https://mammaldiversity.org/

Stateful URI

The URIs are stateful! You can always use the same link to recreate the exact parameters.

Specifically, the URI is a Base-64 encoded query string of what is loaded asynchronously.

Therefore,

https://mammaldiversity.org/#dXJzdXMrYXJjdG9zJmxvb3NlPXRydWU

has the query string reconstructed from the bit after the hash:

Base64.decode("dXJzdXMrYXJjdG9zJmxvb3NlPXRydWU")
// returns "ursus+arctos&loose=true"

You can generate links that way, corresponding to the options given in the following API section.

API

Search

Search query parameters

Note: Boolean values are "truthy" in the application; "true", true, and 1 all evaluate to true; "false", false, and 0 all evaluate to false.

  1. q: string The main query, for common names or species.
  2. fuzzy: boolean Use a similar sounding search for results, like SOUNDEX. Note this won't work for authority years or deprecated scientific names. Default false
  3. loose: boolean Don't check for strict matches, allow partials and case-insensitivity Application default true; API default false
  4. global_search: boolean Check all non-boolean columns for the search string simultaneously. Default false
  5. only: string restrict search to this csv column list. Return an error if invalid column specified.
  6. include: string Include additional search columns in this csv list. Return an error if invalid column specified.
  7. type: string restrict search to this major_type. Literal scientific match only. Return an error if the type does not exist. Default null
  8. filter: json restrict search by this list of {"column":"value"} object list. Requires key "BOOLEAN_TYPE" set to either "AND" or "OR". Return an error if the key does not exist, or if an unknown column is specified. This should be supplied as a URL-encoded JSON string (eg, %7B%22species_authority%22:%22neill%22,%22boolean_type%22:%22and%22%7D) or a Base64-encoded string (eg, eyJzcGVjaWVzX2F1dGhvcml0eSI6Im5laWxsIiwiYm9vbGVhbl90eXBlIjoiYW5kIn0), where both examples represent {"species_authority":"neill","boolean_type":"and"}. Default null
  9. limit: int Search result return limit. Default unlimited
  10. order: string A csv list of columns to order by. Defaults to genus, species, subspecies
  11. dwc_only: boolean Return only DarwinCore terminology. Otherwise, the DarwinCore terminology is in each taxon result under the key dwc. Default false

API return

The JSON result gives the following parameters:

  1. status: boolean true or false. true is returned on an good search, regardless of hits.

  2. (false status only) error: A technical error message

  3. (false status only) human_error: A message to display to users.

  4. (bad parameters only) given: The provided parameters.

  5. (bad filter only) columns: The provided column list.

  6. (bad filter only) bad_coulmn: The invalid column.

  7. result: An object containing one taxon per numeric key, which itself contains:

    id # internal counter
    common_name
    genus
    species
    subspecies
    deprecated_scientific # Object, eg {"Genus species":"Authority:Year"}
    simple_linnean_group #eg, prototheria, metatheria, eutheria. Ranked "cohort"
    major_type # eg, boreoeutheria, atlantogenata. Ranked "magnaorder"
    major_subtype # eg afrotheria, euarchotoglires. Ranked "superorder"
    simple_linnean_subgroup # eg, rodent, bat, etc. ~ ranked
    linnean_family # eg, chiroptera, lagomorph. Ranked "family"
    linnean_order # Ranked "order"
    genus_authority #  eg, "Linnaeus"
    species_authority # eg, "Attenborough"
    authority_year # eg, {2013:2014} in the format {"Genus Authority Year":"Species Authority Year"}
    parens_auth_genus # If the genus authority should be in a parenthetical
    parens_auth_species # If the species authority should be in a parenthetical
    notes # Miscellaneous notes for the taxon
    entry # The long-form entry for the taxon
    internal_id # The internal ASM number for the taxon
    source # The primary data source for the entry
    citation # Citation for the taxon
    image # Path to an image, relative to mammaldiversity.org/, if it exists
    image_credit
    image_license
    taxon_author # Last edited by ...
    taxon_credit # The credit for the taxon
    taxon_credit_date # The credit edit date
    dwc # All the DarwinCore terms for the taxon

    If the dwc_only flag is set, only the contents of the key dwc are returned per taxon.

    A sample DarwinCore-formatted response (either as a subkey dwc or the replacement with dwc_only)might look like

    {
      "scientificName": "Diceros bicornis",
      "subspecificEpithet": "",
      "order": "perissodactyla",
      "specificEpithet": "bicornis",
      "genus": "diceros",
      "vernacularName": "Black Rhinoceros",
      "family": "rhinocerotidae",
      "namePublishedIn": "",
      "higherClassification": {
        "cohort": "eutheria",
        "magnaorder": "boreoeutheria",
        "superorder": "laurasiatheria",
        "list": "eutheria|boreoeutheria|laurasiatheria"
      },
      "scientificNameAuthorship": {
        "genus": "",
        "species": "(Linnaeus, 1758)"
      },
      "taxonRank": "species",
      "class": "mammalia",
      "taxonomicStatus": "accepted",
      "dcterms:bibliographicCitation": "Diceros bicornis (ASM Species Account Database #6557) fetched 2017-03-17T15:48:30-0700"
    }
  8. count: The number of results

  9. method: The way the search was executed

  10. query: The requested search

  11. params: The checked matches

  12. query_params: A breakdown of your computed query

    1. bool: The used boolean_type
    2. loose: boolean true or false
    3. fuzzy: boolean true or false
    4. order_by: The way the results are sorted
    5. filter: An object representing any applied filters
      1. had_filter: boolean true or false
      2. filter_params: The used filter parameters
      3. filter_literal: The provided filter in the query
  13. execution_time: The time to execute your query and return your result, in ms.

Please note that all entries are returned in lower case, except for result.[taxon].notes, result[taxon].entry, result[taxon].taxon_credit, and result.[taxon].image (where an image exists and the path includes mixed case).

As the rest of the data have strict formatting requirements, all other formatting is left up to the application to correctly apply CSS styles to generate the desired case.

Search behaviour

Please note that the example JSON results may not have all of the fields or data in the result key of the most recent version. There will be no compatability breaking. All the correct fields are listed above.

The search algorithm behaves as follows:

  1. If the search is_numeric(), a loose search is done against the authority_year column in the database. The returned method with the JSON is authority_year. Example:

    {"status":true,"result":{"0":{"scientificName":"Ursus arctos","subspecificEpithet":"","specificEpithet":"arctos","vernacularName":"brown bear","namePublishedIn":"","higherClassification":{"magnaorder":"foobar","cohort":"eutheria","list":"foobar|eutheria"},"scientificNameAuthorship":{"genus":"test, 2017","species":"linnaeus, 1758"},"taxonRank":"species","taxonomicStatus":"accepted","dcterms:bibliographicCitation":"Ursus arctos (ASM Species Account Database #41688) fetched 2017-03-17T14:33:11-0700"}},"count":1,"method":"year_search","query":"1758","params":{"authority_year":"1758"},"query_params":{"bool":false,"loose":true,"fuzzy":false,"order_by":"genus,species,subspecies,common_name","filter":{"had_filter":false,"filter_params":null,"filter_literal":null}},"do_client_update":false,"execution_time":9.9999904632568}
  2. The search is then checked for the absence of the space character. If no overrides are set, common_name, genus, species, subspecies, major_common_type, major_subtype, and deprecated_scientific columns are all searched. The returned method is spaceless_search. Example:

    {"status":true,"result":{"0":{"scientificName":"Alces alces","subspecificEpithet":"","specificEpithet":"alces","vernacularName":"Moose","namePublishedIn":"","higherClassification":{"cohort":"eutheria","list":"eutheria"},"scientificNameAuthorship":{"genus":"","species":"(Linnaeus, 1758)"},"taxonRank":"species","taxonomicStatus":"accepted","dcterms:bibliographicCitation":"Alces alces (ASM Species Account Database #41782) fetched 2017-03-17T14:34:57-0700"}},"count":1,"method":"spaceless_search_direct","query":"moose","params":{"common_name":"moose","genus":"moose","species":"moose","subspecies":"moose","major_type":"moose","major_subtype":"moose","deprecated_scientific":"moose"},"query_params":{"bool":"OR","loose":true,"fuzzy":false,"order_by":"genus,species,subspecies,common_name","filter":{"had_filter":false,"filter_params":null,"filter_literal":null}},"do_client_update":false,"execution_time":2.500057220459}
  3. The search is then checked for spaces.

    1. If a filter is set (with the required boolean_type parameter):

      1. If there is two or three words, the first word is checked against the genus column, second against the species column, and third against the subspecies column. The returned method is scientific. Example

        {"status":true,"result":{"0":{"scientificName":"Ursus arctos","subspecificEpithet":"","specificEpithet":"arctos","vernacularName":"brown bear","namePublishedIn":"","higherClassification":{"magnaorder":"foobar","cohort":"eutheria","list":"foobar|eutheria"},"scientificNameAuthorship":{"genus":"test, 2017","species":"linnaeus, 1758"},"taxonRank":"species","taxonomicStatus":"accepted","dcterms:bibliographicCitation":"Ursus arctos (ASM Species Account Database #41688) fetched 2017-03-17T14:39:19-0700"}},"count":1,"method":"scientific","query":"ursus arctos","params":{"species_authority":"linnaeus"},"query_params":{"bool":"AND","loose":true,"fuzzy":false,"order_by":"genus,species,subspecies,common_name","filter":{"had_filter":true,"filter_params":{"species_authority":"linnaeus","boolean_type":"and"},"filter_literal":"{\"species_authority\":\"linnaeus\",\"boolean_type\":\"and\"}"}},"do_client_update":false,"execution_time":12.006044387817}
      2. If the above returns no results, the deprecated_scientific column is checked. At the time of this writing, there are no entries in this column and this check will always fail. The returned method is deprecated_scientific.

      3. If the above returns no results, the common_name column is checked. The returned method is no_scientific_common. Example:

        {"status":true,"result":{"0":{"scientificName":"Ursus arctos","subspecificEpithet":"","specificEpithet":"arctos","vernacularName":"brown bear","namePublishedIn":"","higherClassification":{"magnaorder":"foobar","cohort":"eutheria","list":"foobar|eutheria"},"scientificNameAuthorship":{"genus":"test, 2017","species":"linnaeus, 1758"},"taxonRank":"species","taxonomicStatus":"accepted","dcterms:bibliographicCitation":"Ursus arctos (ASM Species Account Database #41688) fetched 2017-03-17T14:41:53-0700"}},"count":1,"method":"no_scientific_common","query":"brown bear","params":{"species_authority":"linnaeus"},"query_params":{"bool":"AND","loose":true,"fuzzy":false,"order_by":"genus,species,subspecies,common_name","filter":{"had_filter":true,"filter_params":{"species_authority":"linnaeus","boolean_type":"and"},"filter_literal":"{\"species_authority\":\"linnaeus\",\"boolean_type\":\"and\"}"}},"do_client_update":false,"execution_time":33.500909805298}
    2. If the filter parameter isn't specified, the above scientific and deprecated scientific searches are executed with "best-guess" boolean types (with returned methods scientific_raw and deprecated_scientific_raw). Example:

      {"status":true,"result":{"0":{"scientificName":"Panthera tigris","subspecificEpithet":"","specificEpithet":"tigris","vernacularName":"Tiger","namePublishedIn":"","higherClassification":{"cohort":"eutheria","list":"eutheria"},"scientificNameAuthorship":{"genus":"","species":"(Linnaeus, 1758)"},"taxonRank":"species","taxonomicStatus":"accepted","dcterms:bibliographicCitation":"Panthera tigris (ASM Species Account Database #15955) fetched 2017-03-17T14:43:49-0700"}},"count":1,"method":"space_common_fallback","query":"pathera tigris","params":{"genus":"pathera","species":"tigris","common_name":"patheratigris"},"query_params":{"bool":"or","loose":true,"fuzzy":false,"order_by":"genus,species,subspecies,common_name","filter":{"had_filter":false,"filter_params":null,"filter_literal":null}},"do_client_update":false,"execution_time":37.499189376831}
      1. If all these fail, and fuzzy is false, the fallback flag is set and a search is done against common_name. The returned method is space_common_fallback. Example:

        {"status":true,"result":{"0":{"scientificName":"Ursus arctos","subspecificEpithet":"","specificEpithet":"arctos","vernacularName":"brown bear","namePublishedIn":"","higherClassification":{"magnaorder":"foobar","cohort":"eutheria","list":"foobar|eutheria"},"scientificNameAuthorship":{"genus":"test, 2017","species":"linnaeus, 1758"},"taxonRank":"species","taxonomicStatus":"accepted","dcterms:bibliographicCitation":"Ursus arctos (ASM Species Account Database #41688) fetched 2017-03-17T14:44:56-0700"}},"count":1,"method":"space_common_fallback","query":"brown bear","params":{"genus":"brown","species":"bear","common_name":"brownbear"},"query_params":{"bool":"or","loose":true,"fuzzy":false,"order_by":"genus,species,subspecies,common_name","filter":{"had_filter":false,"filter_params":null,"filter_literal":null}},"do_client_update":false,"execution_time":64.501047134399}
    3. If the fuzzy flag is set, or the above still gives no results and the loose flag is set, a search is done word-wise on common_name, major_common_type, and major_subtype (eg, for all matches that contain each word as a substring in any of the columns). The returned method is space_loose_fallback. Example

Other API functions

Random Taxon

Parameter Value Required
random true true
require_image bool false

A hit with the argument random=true will return a random taxon, eg:

api.php?random=true

{"genus":"pronolagus","species":"randensis","subspecies":"","specificEpithet":"randensis","subspecificEpithet":"","execution_time":20.604133605957}

Note that the simple (species) and DarwinCore (specificEpithet) values are both returned.

If the flag require_image is set to a truthy value, the returned taxon will be guaranteed to have a Mammal Images Library, iNaturalist, or Calphotos image associated with the taxon. However, the image is not parsed. For example:

api.php?random=true&require_image=true

{"genus":"rhinoceros","species":"sondaicus","subspecies":"","image":"","specificEpithet":"sondaicus","subspecificEpithet":"","execution_time":1561.1729621887}

Note that since several external services may be hit multiple times, the execution time is significantly longer when requiring images.

Unique Datapoints

Parameter Value Required
get_unique true true
col string true

Fetches all distinct entries for a given database column col under the key values for a successful status. For example:

api.php?get_unique=true&col=linnean_order

{"status":true,"values":{"0":"afrosoricida","1":"artiodactyla","2":"carnivora","3":"chiroptera","4":"cingulata","5":"dasyuromorphia","6":"dermoptera","7":"didelphimorphia","8":"diprotodontia","9":"eulipotyphla","10":"hyracoidea","11":"lagomorpha","12":"macroscelidea","13":"microbiotheria","14":"monotremata","15":"notoryctemorphia","16":"paucituberculata","17":"peramelemorphia","18":"perissodactyla","19":"pholidota","20":"pilosa","21":"primates","22":"proboscidea","23":"rodentia","24":"scandentia","25":"sirenia","26":"tubulidentata"},"execution_time":8.540153503418}

Ordered Taxonomy

Parameter Value Required
get_unique true true
col string true

TODO

Direct Queries

Parameter Value Required
action query true
sql_query Base64-encoded string true
dwc bool

Allows certain direct queries against the database. On mammaldiversity.org, security is enforced by a separate low-privilege user executing these queries; however, a separate regex layer level of security exists as well.

Only fairly basic SELECT queries (and a few specific exceptions such as SHOW COLUMNS) are permitted. Programatically, a PDO query is constructed with each column pre-checked for existence separately prior to execution (generating a fatal error on failure). Backticks are optional on column names.

If the flag dwc is specified, only DarwinCore terms will be returned. The default is to return both DarwinCore and internal structure.

Example:

SELECT * FROM `mammal_diversity_database` where `genus`='canis' and species='lupus';

becomes

api.php?sql_query=U0VMRUNUICogRlJPTSBgbWFtbWFsX2RpdmVyc2l0eV9kYXRhYmFzZWAgd2hlcmUgYGdlbnVzYD0nY2FuaXMnIGFuZCBzcGVjaWVzPSdsdXB1cyc7&action=query&dwc=false

returning the reuslt

{"status":true,"statements":{"0":{"result":{"0":{"id":410,"species_authority":"Linnaeus","canonical_sciname":"Canis lupus","image":"","notes":"","authority_year":"{\"1758\":1758}","parens_auth_genus":0,"internal_id":3746,"major_type":"","genus":"canis","taxon_author":"","parens_auth_species":0,"genus_authority":"Linnaeus","deprecated_scientific":"","subspecies":"","simple_linnean_group":"eutheria","linnean_order":"carnivora","source":"iucn","species":"lupus","taxon_credit":"","taxon_credit_date":"","common_name":"Gray Wolf","major_subtype":"","linnean_family":"canidae","simple_linnean_subgroup":"true dogs","citation":null,"image_credit":null,"image_license":null,"entry":null,"common_name_source":"iucn","image_caption":null,"species_authority_citation":null,"genus_authority_citation":null,"dwc":{"scientificName":"Canis lupus","genus":"canis","subspecificEpithet":"","order":"carnivora","specificEpithet":"lupus","vernacularName":"Gray Wolf","family":"canidae","namePublishedIn":null,"higherClassification":{"cohort":"eutheria","list":"eutheria"},"scientificNameAuthorship":{"genus":"Linnaeus, 1758","species":"Linnaeus, 1758"},"taxonRank":"species","class":"mammalia","taxonomicStatus":"accepted","dcterms:bibliographicCitation":"Canis lupus (ASM Species Account Database #3746) fetched 2017-06-14T23:15:43+0000","dcterms:language":"en","dcterms:modified":"2017-06-14T23:15:43+0000","dcterms:license":"https:\/\/creativecommons.org\/licenses\/by-nc\/4.0\/legalcode"}}},"action":"SELECT","query":{"where":" WHERE (`genus`= ?  AND `species`= ? )","values":{"0":"canis","1":"lupus"},"full_query":"SELECT * FROM `mammal_diversity_database` WHERE (`genus`= ?  AND `species`= ? )","used_statement":"SELECT * FROM `mammal_diversity_database` where `genus`='canis' and species='lupus';"}}},"statement_count":1,"provided":"SELECT * FROM `mammal_diversity_database` where `genus`='canis' and species='lupus';","execution_time":0.786066055298}

Old scientific names

Old scientific names are to be stored in the field Deprecated Scientific Names. This field has a rigid required structure. They're written as a JSON entry with special requirements (and no braces).

Therefore, each deprecated scientific name is to be written as "Genus species":"Authority: YYYY", with an arbitrarily long list of those separated by commas. Therefore, be cognizant of the following rules:

  • There should be no space between colons or commas. E.g., "foo":"bar" and "foo:bar","bar":"baz" is OK, but not "foo" :"bar","bar":"baz" or "foo":"bar", "bar":"baz".

  • The "Authority: YEAR" string is optional in the space around the colon. The year has to match the rule

    ^\d{4}$|^\d{4} (\"|')\d{4}(\"|')$
  • The validity of the taxon information is not checked.

Reporting bugs

Please use the issue tracker here to report all bugs.

If you find a security bug, please practice responsible disclosure! Email [email protected] with the issue. The administrative page uses a fork of tigerhawkvok/php-userhandler, As appropriate, report bugs or offer pull requests on the right branch.

Building the application

Dependencies

This writeup assumes you have access to a Linux-like environment. If you run Windows, set up Bash on Ubuntu on Windows (WSL) for best results.

Your life will also be a lot easier if you have Homebrew or LinuxBrew installed.

Build dependencies

  • Yarn You can install Yarn by running brew install yarn
  • Grunt. You can install Grunt from the command line by running yarn global add grunt-cli.
  • Recommended: Coffeescript and Less. They're included locally but often behave better globally via yarn global add coffee-script less
  • Run yarn install to install local dependencies.

Deploy dependencies

  • Blackbox You can install Blackbox by runing brew install blackbox

Deploying

You can update the whole application, with dependencies, by running grunt build at the root directory.

If you don't need to update dependencies, just run grunt qbuild.

Installation

Configuration Files

If you're part of the project, your PGP public key should already be registered in the application. If you need to make changes, do:

blackbox_edit_start PATH/TO/FILE.ext.gpg
# Edit your file
blackbox_edit_end PATH/TO/FILE.ext

The two primary configuration files are CONFIG.php.gpg and admin/CONFIG.php.gpg.

Paths

Install this in the root directory of the site. If this is to be located elsewhere, change the variable searchParams.targetApi in /coffee/search.coffee and recompile the coffeescript.

You can re-prepare the files by running grunt compile at the root directory.

Setting up the database

Please see the documentation in the meta/ directory.

Administration

You can access the administration / editing interface by logging in at https://mammaldiversity.org/admin

If you create a user, an exisiting superuser will need to authorize your access. You will not be able to log in or access the admin interface until this occurs.

If you log in to another device / location, all other session credentials will be invalidated. This occurs at the authentication level, and may require a re-login if your network location changes.

asm-mammal-database's People

Contributors

n8upham avatar tigerhawkvok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

asm-mammal-database's Issues

Search on higher taxon names, other non-species fields

Right now it looks like only the Genus and Species are searchable on the main page? When I type in Rodentia or Muridae I get no search results. Ideally a user would be able to type in anything in the database, e.g., "Thomas" to get all the mammals that Thomas described, etc. -- would that considerably slow down the searches?

Front page layout

  1. Lets change "ASM Species Account Database" to "ASM Mammal Diversity Database"

  2. in the "Search" can we make it a box? Its actually confusing (a bit) about where to click to start typing, whether on that line, or else below it with the blue bar where it says "Search for a common or scientific name above to begin, eg, "Brown Bear" or "Ursus arctos"" — it would be great to just move that blue bar up, with the identical text, and make that the "Search" entry form— Does that make sense?

  3. Add the twitter bar on the right hand side, about 1/4 or 1/5 of the browser window width, similar to the WoRMs site: http://www.marinespecies.org/ ( see #32 )

  4. Can we add a "News" listing under the search field to update folks about new releases of the taxonomy, popular press, etc.? I can write a blog entry for this when we go live

  5. Creative ideas about a landing page image / beautification, etc? We want folks to be excited about mammals when they land here

Thanks man, --nate

Synonym field to allow multiple entries per species

Model this after the IUCN listing where they have a “Synonyms” field in their CSV output that includes data as e.g., "Abrothrix hershkovitzi|Abrothrix markhami|Akodon mansoensis |Akodon olivaceus |Akodon xanthorhinus”

So that is all recent name combinations as separated by pipes.

We can form that synonym pipes column using the 200k+ row listing that I sent you yesterday. Do you want me to work on parsing that, or are you already on it?

Taxonomy Information Page

Via @n8upham

Add a page called “Taxonomy” to the toolbar header— this page will contain sub-links and descriptions about the following:

  • List of new species (since MSW3) and their citations for “evidence" and “name”, including links to the article where we have that info
  • List of genus name transfers (since MSW3) and the citation for the change
  • Summary table comparing counts of species, genera, and families in MSW3 versus our MDD list

Spelling errors

Marsupalia -> Marsupialia
Dasyuromorpha -> Dasyuromorphia

Errors from my database, thanks

Downloading issues

When attempting to download my search results I encountered two separate problems:

  1. I tried several different searches of various sizes, but the HTML/PDF option nearly always failed (an exception is that the HTML option worked but not the pdf for Ursus arctos). A popup appears briefly which says "Failed to create file", but then the "Select Download Type" popup box remains up and I couldn't get it to disappear unless I refreshed the page.

  2. The CSV download option worked great, but I noticed one odd thing: If I clicked a search result to see the info on a particular species, selecting download from that species' page provides the option to "Use current search results", but turning that on didn't restrict the download. The download worked, but I got the whole database. Not a big problem, but having the option for the just the current search results made me think it was somehow able to tap into the search results that led me to the page I was on (of a single species) while downloading. If this is unavoidable, perhaps a simple notification somewhere would help clarify?

New Taxonomy Count

@n8upham :

You mentioned in your email that the new list has 6301 new species. However, when I integrate and update the data, I get a new count of 6733.

It took a while to find the discrepancy, but I finally did.

For example, let's look at the genus Eospalax.

MariaDB [mammal2_asm_sadb]> select genus, species, internal_id from mammal_diversity_database where genus like 'eospalax' order by species;
+----------+-------------+-------------+
| genus    | species     | internal_id |
+----------+-------------+-------------+
| eospalax | baileyi     |   100000481 |
| eospalax | cansus      |   100000482 |
| eospalax | fontanierii |       14118 |
| eospalax | rothschildi |       14121 |
| eospalax | rufescens   |   100000483 |
| eospalax | smithii     |       14122 |
+----------+-------------+-------------+
6 rows in set (0.12 sec)

However, the base dataset you gave has this to say on the subject:

split from frontanierii

for sp = baileyi, cansus, and rufescens. They are tagged as splitFromExisting, but also have no entry under IfTransfer_oldSciName (implying the old taxon is still valid, and it's just been differentiated).

However, the dataset doesn't actually have fontanierii in it as a standalone taxon, making this ambiguous as to if it's been deprecated.

The size of this split from existing set seems to fully encompass the difference in counts.

For now, I'll operate under the assumption that both taxa are valid while I'm completing the data insertion/merge, but this ambiguity needs to be resolved!

"Featured Mammal" on the front page

Via @n8upham

Featured mammal = one of these 4 species with free Mammalian Species accounts: https://academic.oup.com/mspecies/pages/speciesaccounts

  • The goal here is to
    1. showcase this ASM-based journal, and
    2. make an argument to the Board that we should be serving the content of these Mammalian Species articles for free on the MDD website. This would both populate our per-species pages and provide an outlet to these articles that often linger in obscurity, but contain much valuable information
  • Check out that Felis margarita!

My initial response and thoughts:

I will need to ponder the featured mammal entry -- need to figure out a way to both accomplish the goal above and to keep search functions central and accessible.

My best off-the-cuff idea is an auto-opening dialog on first visit / featured taxon change, with some other button or iconography to expose it again manually (so it shows up immediately when it's new to you, but when you're going to the site to do a "routine" search you're not interrupted by content you've already seen before).

There may be a better solution, just I haven't thought of it yet.

Later response:

Yes I like the idea of a featured mammal tab that is popped out the first time, but not on subsequent visits. But maybe on the pop-out tab there can still be a small (thumbnail) version of the MIL image for that featured species? I want to have some mammal images on the front page, so people know there are here to learn about furry things!

Move 'data generated with'

Put at top of Taxon Entry as 'citations' to highlight it more.

Data citation entry should be multiline rather than single line.

Change header on front page

For the main text on the front page, can we use "ASM Mammal Diversity Database"?

And then to correspond, the site title (in the tab header on Firefox) to the same thing?

Thanks man
--nate

Random entry

It works on the main page, but from the summary or info pages it gives error that "cannot retrieve random entry" — all this is awesome though man!

Taxon statistics page -- from ASM Comm Members #4

"On the statistics page, species diversity is plotted as a bar graph (appropriate), but generic diversity is plotted as a filled curve (not ideal). Let’s set a good example of appropriate use of graphs and use bar graphs for both categories."

Maybe side-by-side bar graphs, just slightly to the left or right for genera?

Thanks man (that was the last one!)

Header bar, front page

Lets go with text + icon for the header bar, so that it jumps out at folks more easily to start with. So it would be:

About + icon
Statistics + icon
Forum + icon
Random species + icon

I'd be fine with following that through the entire website, or if its easier we could have icons-only on all pages other than the front page

Advanced search bug -- from ASM Comm Members #1

"I was able to break the search by searching using the advanced options alone (nothing in the standard search box), all my queries returned the entire database. It might be better to label the advanced options as "filters" to narrow down the search results? Or perhaps just refuse to search if the standard search line is blank? I'm not sure which would be an easier fix. "

"No results" return is too small/ephemeral -- from ASM Comm Members #2

"When searching for something that doesn’t exist, a small badge pops up very briefly saying “no results”. It’s easy to miss this though. I’d rather have some stable text that stays put stating this."

"I agree with Jake about the "No Results" needing to be larger and more prominent. I didn't see it for some time while clicking search repeatedly. Also, it appears to be a dynamic, where it returns the fields that had no results...While trying to test the search limits, I was able to have it flash a very large no results box with every field mentioned. It flashed way too fast to read the whole text (I had to screenshot it to read)."

Range maps on species account pages

Note: Stretch goal for milestone! May not accomplish!

Could use the IUCN countries-by-taxon ( http://apiv3.iucnredlist.org/api/v3/docs#species-occurrence-name )

eg:

{"name":"Loxodonta africana","count":40,"result":[{"code":"AO","country":"Angola","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"BF","country":"Burkina Faso","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"BI","country":"Burundi","presence":"Extinct Post-1500","origin":"Native","distribution_code":"Regionally Extinct"},{"code":"BJ","country":"Benin","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"BW","country":"Botswana","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"CD","country":"Congo, The Democratic Republic of the","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"CF","country":"Central African Republic","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"CG","country":"Congo","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"CI","country":"Côte d'Ivoire","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"CM","country":"Cameroon","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"ER","country":"Eritrea","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"ET","country":"Ethiopia","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"GA","country":"Gabon","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"GH","country":"Ghana","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"GM","country":"Gambia","presence":"Extinct Post-1500","origin":"Native","distribution_code":"Regionally Extinct"},{"code":"GN","country":"Guinea","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"GQ","country":"Equatorial Guinea","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"GW","country":"Guinea-Bissau","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"KE","country":"Kenya","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"LR","country":"Liberia","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"ML","country":"Mali","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"MR","country":"Mauritania","presence":"Extinct Post-1500","origin":"Native","distribution_code":"Regionally Extinct"},{"code":"MW","country":"Malawi","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"MZ","country":"Mozambique","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"NA","country":"Namibia","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"NE","country":"Niger","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"NG","country":"Nigeria","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"RW","country":"Rwanda","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"SL","country":"Sierra Leone","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"SN","country":"Senegal","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"SO","country":"Somalia","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"SS","country":"South Sudan","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"SZ","country":"Swaziland","presence":"Extant","origin":"Reintroduced","distribution_code":"Reintroduced"},{"code":"TD","country":"Chad","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"TG","country":"Togo","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"TZ","country":"Tanzania, United Republic of","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"UG","country":"Uganda","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"ZA","country":"South Africa","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"ZM","country":"Zambia","presence":"Extant","origin":"Native","distribution_code":"Native"},{"code":"ZW","country":"Zimbabwe","presence":"Extant","origin":"Native","distribution_code":"Native"}]}

and do a color coded political map???

Need citation migration script

Needs to

  • walk distinct genera
  • Find oldest citation among unformatted (all) and formatted genera
  • Apply oldest as genus citation for all of them
  • Format and apply species citation

blocking #50

Additions to taxon summary page

  • Orders capitalized
  • Y-axis is great on log scale, but can you translate it to real numbers = 1,2,5,10,20,50,100, etc?
  • Genera
    • capitalized
    • italics
  • Display of a text-based table that shows the totals being visualized
  • Ability to sort by descending taxon order? (not critically important if is difficult to implement that, folks can just download and analyze themselves)

Make the ASM logo = link to front search page

When on the About or Summary pages its not easy to navigate back to the main search page, other than to just hit the browser back button. So can we make the ASM logo on the left be associated with the text "Home", and then have it redirect to mammaldiversity.org? I think we don't need to have a direct link to the ASM website other than on the About page.

Thanks!

Search box on front page -- from ASM Comm Members #3

screen shot 2017-06-16 at 6 33 32 pm

"This box looks more like a search box than the actual search box. My first instinct was to not read the text in this box, but to just click and try to type. That doesn’t work. I suggest making this text look less like a search box. "

Enable editing for new columns

  • Column citation for taxon entry citation
  • Column genus_authority_citation
  • Column species_authority_citation

These citations should be displayed on account pages:

  • Genus authority
  • Species authority
  • Entry

Advanced searching vs. all-in-one searching

How much work is involved in making the main search field == a query to all fields in the database? Would there be a cost of longer search times?

Also, when I search "Rodentia" under "Clade" the advanced search still returns no results. I think we want Clade to indicate Higher Taxon in general

Genus Authority does work (e.g., "Thomas" returns 8 results), but species authority returns no results for the same search...

Thanks, --n

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.