Download Latest Version source-archive.zip (6.1 MB)
Email in envelope

Get an email when there's a new version of Taxamatch

Home / taxamatch-ala-java
Name Modified Size InfoDownloads / Week
Parent folder
README.txt 2020-12-26 2.6 kB
source-archive.zip 2020-12-26 6.1 MB
Totals: 2 Items   6.1 MB 0
copied from https://code.google.com/archive/p/ala-nsl/wikis/Taxamatch.wiki (27 Dec 2020)

ala-nsl - Taxamatch.wiki

*Introduction*

This part of the project is a java port of Tony Rees' "Taxamatch" algorithm. The code implements a service that is intended to be pluggable as a java bean. The bean sits on top of a static data store, which must be built offline and included at run time.

Our implementation only stores the ids of the taxa - the assumption is that you are plugging it into something that can do something with those ids. The field name is called "lsid", but you can use any string you like.

We use the JDBM library on top of the data store: it is simple, small, fast, and reasonably well bedded-in.


*Details*

Using the package is a matter of creating a repository file, then using it for searches. We have not implemented any way to delete things from the repository - our model is that you build it from your data and them access it as a static resource - it's not very dynamic.


*creating a repository*

To create a repository file, look at the sample code in class au.org.biodiversity.services.taxamatch.etc.GenerateTaxamatchData .

To create a new repository: TaxamatchDataCreator repo = TaxamatchDataCreator.create(new File(etc, "TAXAMATCH_DATA"));

To add author abbreviations, , genera and species to it: repo.newAuth(authAbbr, authFull, nce); repo.newGenus(id, name, authority, nce); repo.newSpecies(id, genusName, speciesName, authority, nce);

And don't forget to close it properly: repo.commit(); repo.close();

The project includes Tony Rees' list of author abbreviations. These abbreviations affect the authSimilarity part of the search result.


*using it*

To use the repository, load up a repository from a file somewhere and use the interface methods. We use a no-arg constructor and load/unload methods to support bean container environments such as spring.

``` void foo() throws Exception { TaxamatchService tms = getTaxamatchService(); tms.load(); try { TaxamatchResult r = tms.taxamatch("Canis", "L.", null, false); for (TaxamatchGenusItem g : r.matchingGenera) { System.out.println(g.lsid + ": " + g.isPhonetic + ", " + g.editDistance + ", " + g.authSimilarity); } } finally { tms.unload(); } }

TaxamatchService getTaxamatchService() throws Exception { TaxamatchServiceImpl tmsi = new TaxamatchServiceImpl(); tmsi.setRepositoryLocation(new File( System.getProperty("user.dir"), "etc/TAXAMATCH_DATA")); return tmsi; } ```

*See Also*

http://www.cmar.csiro.au/datacentre/taxamatch.htm http://www.anbg.gov.au/confluence http://biodiversity.org.au/service/taxamatch
Source: README.txt, updated 2020-12-26