humlab-sead / sead_change_control

Sane SEAD change control using Sqitch.
1 stars 0 forks source link

Add bibliography filters #299

Open johanvonboer opened 5 years ago

johanvonboer commented 5 years ago

https://github.com/humlab-sead/supersead/issues/17

roger-mahler commented 5 years ago

This is caused by limitations in design and ideas behind the old faceting browsing. This design is implemented in the new system as is. These facets exist but doesn't work as expected. This is SQL generated for "modern". The graph-search does not work in these cases. The system must be adjusted to allow explicit paths to be specified (i.e. tbl_facet_route". This has an impact on the entire system though, since the routes from all facet's in the facet chain are merged into one single route.

    SELECT category, count(value) AS count
    FROM (
        SELECT view_taxa_biblio.biblio_id AS category, tbl_sites.site_id AS value
        FROM tbl_sites
        FEL: left join tbl_sample_groups  on tbl_sample_groups."site_id" = tbl_sites."site_id"  
        FEL: left join tbl_physical_samples  on tbl_physical_samples."sample_group_id" = tbl_sample_groups."sample_group_id"
        FEL: left join tbl_analysis_entities  on tbl_analysis_entities."physical_sample_id" = tbl_physical_samples."physical_sample_id"
        FEL: left join tbl_abundances  on tbl_abundances."analysis_entity_id" = tbl_analysis_entities."analysis_entity_id"
        left join tbl_taxa_tree_master  on tbl_taxa_tree_master."taxon_id" = tbl_abundances."taxon_id"
        left join (
            select tbl_text_distribution.biblio_id, tbl_text_distribution.taxon_id
            from tbl_text_distribution
            union
            select tbl_text_biology.biblio_id, tbl_text_biology.taxon_id
            from tbl_text_biology
            union
            select tbl_taxonomy_notes.biblio_id, tbl_taxonomy_notes.taxon_id
            from tbl_taxonomy_notes

            /* new sources */
            union
            select tbl_text_identification_keys.biblio_id, tbl_text_identification_keys.text_identification_key_id
            from public.tbl_text_identification_keys
            union
            select tbl_species_associations.biblio_id, tbl_text_identification_keys.text_identification_key_id
            from public.tbl_text_identification_keys

        ) as view_taxa_biblio  
          on view_taxa_biblio."taxon_id" = tbl_taxa_tree_master."taxon_id"
        left join tbl_biblio
          on tbl_biblio."biblio_id" = view_taxa_biblio."biblio_id"
        WHERE 1 = 1
        GROUP BY view_taxa_biblio.biblio_id, tbl_sites.site_id
    ) AS x
    GROUP BY category
visead commented 5 months ago

The bibliography modern seems to be working as expected in SuperSEAD. But the bibliography sites is not working - it is including modern references. The SQL needs to be adjusted to not include the bibliography modern results in the sites and sites/Samplegroups filters.