Project

General

Profile

« Previous | Next » 

Revision 9973

inputs/.TNRS/schema.sql: tnrs_populate_fields(): Is_plant: also consider homonyms using new family_is_homonym, genus_is_homonym (see wiki.vegpath.org/Result_filtering#taxon_is_plant)

View differences:

inputs/.TNRS/schema.sql
100 100
        ELSE family_is_homonym OR genus_is_homonym
101 101
        END);
102 102
    new."Is_plant" = (CASE
103
        WHEN new."Family_score" = 1 THEN true -- exact match
104
        ELSE -- Family_matched IS NULL
103
        WHEN new."Family_score" = 1 AND NOT family_is_homonym -- exact match
104
            THEN true
105
        ELSE -- consider genus
105 106
            (CASE
106 107
            WHEN new."Genus_score" =  1    -- exact match
107
                THEN "Specific_epithet_is_plant"
108
                THEN
109
                (CASE
110
                WHEN NOT genus_is_homonym THEN true
111
                ELSE "Specific_epithet_is_plant"
112
                END)
108 113
            WHEN new."Genus_score" >= 0.85 -- fuzzy match
109 114
                THEN "Specific_epithet_is_plant"
110 115
            ELSE NULL -- ambiguous

Also available in: Unified diff