Skip to content

Jeffersonktw/NomenMatch

 
 

Repository files navigation

NomenMatch

This branch is developed based on original version of NomenMatch. The following steps will run both original version (v1) and new version (v2) at the same time, if you only need particular version, please refer to respective branch.

Main changes compared to original version (v1)

  1. matching name of higher ranks such as order, family, genus
  2. matching common names (in traditional chinese)

Installing

  1. build image
 $ docker-compose build
  1. run devel
 $ docker-compose up -d
  1. create solr core & set custom config (only first time)
  $ docker-compose exec solr bash
  $ ./bin/solr create_core -c taxa
  $ cp solrconfig.xml /var/solr/data/taxa/conf
  $ cp managed-schema /var/solr/data/taxa/conf
  $ exit
  $ docker-compose restart solr
  1. prepare data for v1
  • prepare source data csv and put it in source-data folder
  • copy conf/sources.csv to source-data folder if source-data don't have sources.csv
  • modified souces.csv to map source id and source info
  $ cp conf/sources.csv source-data 
  1. import data (example: TaiCOL) for v1
  $ docker-compose exec php bash
  $ cd /code/workspace
  $ php ./importChecklistToSolr.php ../source-data/<taicol-checklist.csv> taicol
  1. prepare data for v2
  • prepare source data csv and put it in source-data folder
  • copy conf/sources.csv to source-data folder if source-data don't have sources.csv
  • modified souces.csv to map source id and source info
  $ cp v2/conf/sources.csv source-data 
  1. import data (example: TaiCOL) for v2
  $ docker-compose exec php bash
  $ cd /code/v2/workspace
  $ php ./importChecklistToSolr.php ../source-data/<taicol-checklist.csv> taicol_2

Note in order to distinguish between original TaiCOL and new TaiCOL, we use different source_id. (taicol for original TaiCOL and taicol_2 for new TaiCOL)

Source data format

Tab seperated, see v2/workspace/data/example.csv
Column definition:

  • namecode
  • accepted_namecode
  • scientific_name (full name or canonical form is ok)
  • name_url_id (the id which can be used to create a valid url to a taxon name page)
  • accepted_name_url_id (the id which can be used to create a valid url to an accepted taxon name page, if the name is a synonym)
  • family
  • order
  • class
  • phylum
  • kingdom
  • simple_name
  • name_status

Note example code for generating source data could be found in ./scripts folder.

Describe source data

Edit conf/sources.example.csv and rename to sources.csv
Column definition:

  • source_id
  • source_name
  • url_base (when combined with [accepted] name_url_id, it becomes valid url for the taxon, blah blah)
    for example,
  • citation format
  • source data page
  • date (of source data fetched, downloaded, or created)

Delete source data in solr

Under v2/workspace dir, run

php clean_source.php {source_id}

to remove a specific source from solr, or run

php clean_source.php all

to remove all sources at once.
If this script doesn't work, usually it means java heap space out of memory. Try to restart solr and then run again.

Demo

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 56.6%
  • HTML 16.4%
  • JavaScript 15.1%
  • Python 11.2%
  • Shell 0.3%
  • CSS 0.2%
  • Dockerfile 0.2%