Bauble / bauble.classic

this is how Bauble and Ghini both started
GNU General Public License v2.0
10 stars 34 forks source link

one click BGCI PlantSearch update #225

Closed mfrasca closed 8 years ago

mfrasca commented 8 years ago

the title comes from a comment to issue #163. @RoDuth wrote: I was talking about making it easy to keep our records up to date at BGCI's PlantSearch as this is one of the easiest ways to make our collections available to researchers etc.(We already get lots of requests via this system and have worked with a couple of them) The institution data should already be in Bauble, maybe just need somewhere to save your login. I'm sure BGCI would be happy to know there was a database option out there that could do it in one simple step... And I imagine they would be happy to help make it happen. (may even get you a few more recommendations?) See instructions here: http://www.bgci.org/resources/plantsearchuploadinstructions/

mfrasca commented 8 years ago

looks like we need a report and it looks quite easy. they (tpl) don't seem to have a web api for this, you need do it by hand, but I will ask.

the only difficulty might be in the Generic Hybrid Symbol: according to the genus class documentation, your genus-hybrid-marker is just the first character of your genus epithet, if it is a x or ×. Bauble does not handle it much further than that, not yet.

the other fields? Generic Epithet, Specific Hybrid Symbol, Specific Epithet, Infraspecific Rank, Infraspecific Epithet, Cultivar Epithet

the last three offer some complication, since Bauble considers a cultivar just one possible form of infraspecific information. and Bauble offers (why is that?) 4 levels of infraspecific information.

in species, I can implement infraspecific_rank, infraspecific_epithet, cultivar_epithet as properties. so we can use them in the report we need here. I might also implement hybrid_marker as a property of genus, and epithet as genus without the marker. doing this as properties allows us stay with the same database structure, that is within the 1.0 line.

once I've implemented these properties, writing the report should be a simple straightforward task.

mfrasca commented 8 years ago

@RoDuth, do you want to have a look at this?

## This file is part of bauble.classic.
##
## bauble.classic is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## bauble.classic is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with bauble.classic. If not, see <http://www.gnu.org/licenses/>.
##
<%
from bauble.plugins.report import get_species_pertinent_to
%>Generic Hybrid Symbol,Generic Epithet,Specific Hybrid Symbol,Specific Epithet,Infraspecific Rank,Infraspecific Epithet,Cultivar Epithet
% for v in get_species_pertinent_to(values):
<%
    genus = v.genus.genus
    if genus.startswith('Zzz-'):
        continue
    species_epithet = v.sp
    if species_epithet.startswith('sp'):
        species_epithet = ''
    hybrid_marker = ''
    if '×' in v.sp:
        hybrid_marker = 'H'
    if '×' in v.sp[:1]:
        hybrid_marker = '×'
        species_epithet = species_epithet[1:]
%>${v.genus.hybrid_marker},${v.genus.epithet},${hybrid_marker},${species_epithet},${v.infraspecific_rank or ''},${v.infraspecific_epithet or ''},${v.cultivar_epithet or ''}
% endfor
RoDuth commented 8 years ago

Looks good... If I'm interpreting it right! :dizzy_face: When I last tried my hand at updating PlantSearch it was hours of manual handling to get it all in order!! This was with our original FileMaker Pro database that isn't anything like ITF2 compatible (the name is just one field and it doesn't even use accession numbers!!!) and what sent me on the journey of looking for something better. How nice it will be to do this simply and easily!

The 4 levels of infraspecific information is due to something similar to the use of subfamilies and tribes etc. they are classifications that are not required as part of the name but they can be handy to know, (as you have pointed out). I believe the convention is to use the last (or lowest) rank only to form the name, the others are just considered part of the classification (similar to how the subfamily is not required as you can always look it up if you have the binomial). Its another one of those fuzzy areas where sometimes they are used sometimes they aren't, depending on the audience I guess. I only very occasionally find a use for more than one but if I do I make sure to stick to the correct order i.e. subsp...var...f...cv. Which is normally how you will see a name with the extra parts written anyway. So, technically as long as you use the last from the list it should be OK, at least for me.

RoDuth commented 8 years ago

I just found this on Wikipedia, on the page for Infraspecific name, which I think explains it well

Sometimes more than three parts will be given; strictly speaking, this is not a name, but a classification. The ICN gives the example of Saxifraga aizoon var. aizoon subvar. brevifolia f. multicaulis subf. surculosa; the name of the subform would be Saxifraga aizoon subf. surculosa.[6]

mfrasca commented 8 years ago

note to myself: please correct infraspecific_rank and infraspecific_epithet so that it takes the lowest ranked among the four inserted. @RoDuth : IIUC, cultivar is non-ranked, so an hypothetical Saxifraga aizoon var. aizoon subvar. brevifolia f. multicaulis cv. 'Bellissima' would get infraspecific_rank: f., infraspecific_epithet: multicaulis, cultivar_epithet: Bellissima

mfrasca commented 8 years ago

@RoDuth just for the fun of testing it out (#221):

mario@rune:~$ python bauble/plugins/plants/ask_tpl.py
Saxifraga aizoon
your match is
Saxifraga aizoon Neuman (Saxifragaceae)
synonym of
Saxifraga paniculata (Neuman) Karlsson (Saxifragaceae)

taking a bit less than 2s

mfrasca commented 8 years ago

This issue was moved to Ghini/ghini.desktop#128