Project

General

Profile

« Previous | Next » 

Revision 14102

inputs/.TNRS/schema.sql: MatchedTaxon: removed unneeded "Name_matched." prefix on source-specific names (only the * is needed because there is only one table)

View differences:

trunk/inputs/.TNRS/schema.sql
394 394
--
395 395

  
396 396
CREATE VIEW "MatchedTaxon" AS
397
 SELECT s."*Name_matched.batch",
397
 SELECT s."*batch",
398 398
    s."concatenatedScientificName",
399 399
    s."matchedTaxonName",
400 400
    s."matchedTaxonRank",
401
    s."*Name_matched.Name_score",
401
    s."*Name_score",
402 402
    s."matchedScientificNameAuthorship",
403 403
    s."matchedScientificNameID",
404
    s."*Name_matched.Author_score",
404
    s."*Author_score",
405 405
    s."matchedFamilyConfidence_fraction",
406 406
    s."matchedFamily",
407 407
    s."matchedGenus",
......
409 409
    s."matchedSpecificEpithet",
410 410
    s."matchedSpeciesConfidence_fraction",
411 411
    s."matchedInfraspecificEpithet",
412
    s."*Name_matched.Infraspecific_epithet_score",
412
    s."*Infraspecific_epithet_score",
413 413
    s."identificationQualifier",
414 414
    s."morphospeciesSuffix",
415 415
    s."taxonomicStatus",
......
419 419
    s."acceptedScientificNameID",
420 420
    s.accepted_species_binomial,
421 421
    s.accepted_family,
422
    s."*Name_matched.Selected",
423
    s."*Name_matched.Source",
424
    s."*Name_matched.Warnings",
425
    s."*Name_matched.Accepted_name_lsid",
422
    s."*Selected",
423
    s."*Source",
424
    s."*Warnings",
425
    s."*Accepted_name_lsid",
426 426
    s.taxon_scrub__is_valid_match,
427 427
    s.scrubbed_unique_taxon_name,
428 428
        CASE
......
430 430
            WHEN (s.accepted_taxon_rank = 'genus'::text) THEN concat_ws(' '::text, s.accepted_taxon_name_no_author, s."morphospeciesSuffix")
431 431
            ELSE s.accepted_species_binomial
432 432
        END AS accepted_morphospecies_binomial
433
   FROM ( SELECT taxon_best_match.batch AS "*Name_matched.batch",
433
   FROM ( SELECT taxon_best_match.batch AS "*batch",
434 434
            taxon_best_match."Name_submitted" AS "concatenatedScientificName",
435 435
            taxon_best_match."Name_matched" AS "matchedTaxonName",
436 436
            taxon_best_match."Name_matched_rank" AS "matchedTaxonRank",
437
            taxon_best_match."Name_score" AS "*Name_matched.Name_score",
437
            taxon_best_match."Name_score" AS "*Name_score",
438 438
            taxon_best_match."Name_matched_author" AS "matchedScientificNameAuthorship",
439 439
            taxon_best_match."Name_matched_url" AS "matchedScientificNameID",
440
            taxon_best_match."Author_score" AS "*Name_matched.Author_score",
440
            taxon_best_match."Author_score" AS "*Author_score",
441 441
            taxon_best_match."Family_score" AS "matchedFamilyConfidence_fraction",
442 442
            taxon_best_match."Name_matched_accepted_family" AS "matchedFamily",
443 443
            taxon_best_match."Genus_matched" AS "matchedGenus",
......
445 445
            taxon_best_match."Specific_epithet_matched" AS "matchedSpecificEpithet",
446 446
            taxon_best_match."Specific_epithet_score" AS "matchedSpeciesConfidence_fraction",
447 447
            taxon_best_match."Infraspecific_epithet_matched" AS "matchedInfraspecificEpithet",
448
            taxon_best_match."Infraspecific_epithet_score" AS "*Name_matched.Infraspecific_epithet_score",
448
            taxon_best_match."Infraspecific_epithet_score" AS "*Infraspecific_epithet_score",
449 449
            taxon_best_match."Annotations" AS "identificationQualifier",
450 450
            taxon_best_match."Unmatched_terms" AS "morphospeciesSuffix",
451 451
            map_taxonomic_status(taxon_best_match."Taxonomic_status", taxon_best_match."Accepted_name") AS "taxonomicStatus",
......
455 455
            taxon_best_match."Accepted_name_url" AS "acceptedScientificNameID",
456 456
            taxon_best_match."Accepted_name_species" AS accepted_species_binomial,
457 457
            taxon_best_match."Accepted_name_family" AS accepted_family,
458
            taxon_best_match."Selected" AS "*Name_matched.Selected",
459
            taxon_best_match."Source" AS "*Name_matched.Source",
460
            taxon_best_match."Warnings" AS "*Name_matched.Warnings",
461
            taxon_best_match."Accepted_name_lsid" AS "*Name_matched.Accepted_name_lsid",
458
            taxon_best_match."Selected" AS "*Selected",
459
            taxon_best_match."Source" AS "*Source",
460
            taxon_best_match."Warnings" AS "*Warnings",
461
            taxon_best_match."Accepted_name_lsid" AS "*Accepted_name_lsid",
462 462
            taxon_best_match.is_valid_match AS taxon_scrub__is_valid_match,
463 463
            taxon_best_match.scrubbed_unique_taxon_name
464 464
           FROM taxon_best_match) s;
......
481 481
--
482 482

  
483 483
CREATE VIEW "ValidMatchedTaxon" AS
484
 SELECT "MatchedTaxon"."*Name_matched.batch",
484
 SELECT "MatchedTaxon"."*batch",
485 485
    "MatchedTaxon"."concatenatedScientificName",
486 486
    "MatchedTaxon"."matchedTaxonName",
487 487
    "MatchedTaxon"."matchedTaxonRank",
488
    "MatchedTaxon"."*Name_matched.Name_score",
488
    "MatchedTaxon"."*Name_score",
489 489
    "MatchedTaxon"."matchedScientificNameAuthorship",
490 490
    "MatchedTaxon"."matchedScientificNameID",
491
    "MatchedTaxon"."*Name_matched.Author_score",
491
    "MatchedTaxon"."*Author_score",
492 492
    "MatchedTaxon"."matchedFamilyConfidence_fraction",
493 493
    "MatchedTaxon"."matchedFamily",
494 494
    "MatchedTaxon"."matchedGenus",
......
496 496
    "MatchedTaxon"."matchedSpecificEpithet",
497 497
    "MatchedTaxon"."matchedSpeciesConfidence_fraction",
498 498
    "MatchedTaxon"."matchedInfraspecificEpithet",
499
    "MatchedTaxon"."*Name_matched.Infraspecific_epithet_score",
499
    "MatchedTaxon"."*Infraspecific_epithet_score",
500 500
    "MatchedTaxon"."identificationQualifier",
501 501
    "MatchedTaxon"."morphospeciesSuffix",
502 502
    "MatchedTaxon"."taxonomicStatus",
......
506 506
    "MatchedTaxon"."acceptedScientificNameID",
507 507
    "MatchedTaxon".accepted_species_binomial,
508 508
    "MatchedTaxon".accepted_family,
509
    "MatchedTaxon"."*Name_matched.Selected",
510
    "MatchedTaxon"."*Name_matched.Source",
511
    "MatchedTaxon"."*Name_matched.Warnings",
512
    "MatchedTaxon"."*Name_matched.Accepted_name_lsid",
509
    "MatchedTaxon"."*Selected",
510
    "MatchedTaxon"."*Source",
511
    "MatchedTaxon"."*Warnings",
512
    "MatchedTaxon"."*Accepted_name_lsid",
513 513
    "MatchedTaxon".taxon_scrub__is_valid_match,
514 514
    "MatchedTaxon".scrubbed_unique_taxon_name,
515 515
    "MatchedTaxon".accepted_morphospecies_binomial
......
743 743

  
744 744
CREATE VIEW taxon_scrub AS
745 745
 SELECT "ValidMatchedTaxon".scrubbed_unique_taxon_name,
746
    "ValidMatchedTaxon"."*Name_matched.batch",
746
    "ValidMatchedTaxon"."*batch",
747 747
    "ValidMatchedTaxon"."concatenatedScientificName",
748 748
    "ValidMatchedTaxon"."matchedTaxonName",
749 749
    "ValidMatchedTaxon"."matchedTaxonRank",
750
    "ValidMatchedTaxon"."*Name_matched.Name_score",
750
    "ValidMatchedTaxon"."*Name_score",
751 751
    "ValidMatchedTaxon"."matchedScientificNameAuthorship",
752 752
    "ValidMatchedTaxon"."matchedScientificNameID",
753
    "ValidMatchedTaxon"."*Name_matched.Author_score",
753
    "ValidMatchedTaxon"."*Author_score",
754 754
    "ValidMatchedTaxon"."matchedFamilyConfidence_fraction",
755 755
    "ValidMatchedTaxon"."matchedFamily",
756 756
    "ValidMatchedTaxon"."matchedGenus",
......
758 758
    "ValidMatchedTaxon"."matchedSpecificEpithet",
759 759
    "ValidMatchedTaxon"."matchedSpeciesConfidence_fraction",
760 760
    "ValidMatchedTaxon"."matchedInfraspecificEpithet",
761
    "ValidMatchedTaxon"."*Name_matched.Infraspecific_epithet_score",
761
    "ValidMatchedTaxon"."*Infraspecific_epithet_score",
762 762
    "ValidMatchedTaxon"."identificationQualifier",
763 763
    "ValidMatchedTaxon"."morphospeciesSuffix",
764 764
    "ValidMatchedTaxon"."taxonomicStatus",
......
768 768
    "ValidMatchedTaxon"."acceptedScientificNameID",
769 769
    "ValidMatchedTaxon".accepted_species_binomial,
770 770
    "ValidMatchedTaxon".accepted_family,
771
    "ValidMatchedTaxon"."*Name_matched.Selected",
772
    "ValidMatchedTaxon"."*Name_matched.Source",
773
    "ValidMatchedTaxon"."*Name_matched.Warnings",
774
    "ValidMatchedTaxon"."*Name_matched.Accepted_name_lsid",
771
    "ValidMatchedTaxon"."*Selected",
772
    "ValidMatchedTaxon"."*Source",
773
    "ValidMatchedTaxon"."*Warnings",
774
    "ValidMatchedTaxon"."*Accepted_name_lsid",
775 775
    "ValidMatchedTaxon".taxon_scrub__is_valid_match,
776 776
    "ValidMatchedTaxon".accepted_morphospecies_binomial,
777 777
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank,
trunk/schemas/vegbien.sql
19506 19506
--
19507 19507

  
19508 19508
CREATE VIEW "MatchedTaxon" AS
19509
 SELECT s."*Name_matched.batch",
19509
 SELECT s."*batch",
19510 19510
    s."concatenatedScientificName",
19511 19511
    s."matchedTaxonName",
19512 19512
    s."matchedTaxonRank",
19513
    s."*Name_matched.Name_score",
19513
    s."*Name_score",
19514 19514
    s."matchedScientificNameAuthorship",
19515 19515
    s."matchedScientificNameID",
19516
    s."*Name_matched.Author_score",
19516
    s."*Author_score",
19517 19517
    s."matchedFamilyConfidence_fraction",
19518 19518
    s."matchedFamily",
19519 19519
    s."matchedGenus",
......
19521 19521
    s."matchedSpecificEpithet",
19522 19522
    s."matchedSpeciesConfidence_fraction",
19523 19523
    s."matchedInfraspecificEpithet",
19524
    s."*Name_matched.Infraspecific_epithet_score",
19524
    s."*Infraspecific_epithet_score",
19525 19525
    s."identificationQualifier",
19526 19526
    s."morphospeciesSuffix",
19527 19527
    s."taxonomicStatus",
......
19531 19531
    s."acceptedScientificNameID",
19532 19532
    s.accepted_species_binomial,
19533 19533
    s.accepted_family,
19534
    s."*Name_matched.Selected",
19535
    s."*Name_matched.Source",
19536
    s."*Name_matched.Warnings",
19537
    s."*Name_matched.Accepted_name_lsid",
19534
    s."*Selected",
19535
    s."*Source",
19536
    s."*Warnings",
19537
    s."*Accepted_name_lsid",
19538 19538
    s.taxon_scrub__is_valid_match,
19539 19539
    s.scrubbed_unique_taxon_name,
19540 19540
        CASE
......
19542 19542
            WHEN (s.accepted_taxon_rank = 'genus'::text) THEN concat_ws(' '::text, s.accepted_taxon_name_no_author, s."morphospeciesSuffix")
19543 19543
            ELSE s.accepted_species_binomial
19544 19544
        END AS accepted_morphospecies_binomial
19545
   FROM ( SELECT taxon_best_match.batch AS "*Name_matched.batch",
19545
   FROM ( SELECT taxon_best_match.batch AS "*batch",
19546 19546
            taxon_best_match."Name_submitted" AS "concatenatedScientificName",
19547 19547
            taxon_best_match."Name_matched" AS "matchedTaxonName",
19548 19548
            taxon_best_match."Name_matched_rank" AS "matchedTaxonRank",
19549
            taxon_best_match."Name_score" AS "*Name_matched.Name_score",
19549
            taxon_best_match."Name_score" AS "*Name_score",
19550 19550
            taxon_best_match."Name_matched_author" AS "matchedScientificNameAuthorship",
19551 19551
            taxon_best_match."Name_matched_url" AS "matchedScientificNameID",
19552
            taxon_best_match."Author_score" AS "*Name_matched.Author_score",
19552
            taxon_best_match."Author_score" AS "*Author_score",
19553 19553
            taxon_best_match."Family_score" AS "matchedFamilyConfidence_fraction",
19554 19554
            taxon_best_match."Name_matched_accepted_family" AS "matchedFamily",
19555 19555
            taxon_best_match."Genus_matched" AS "matchedGenus",
......
19557 19557
            taxon_best_match."Specific_epithet_matched" AS "matchedSpecificEpithet",
19558 19558
            taxon_best_match."Specific_epithet_score" AS "matchedSpeciesConfidence_fraction",
19559 19559
            taxon_best_match."Infraspecific_epithet_matched" AS "matchedInfraspecificEpithet",
19560
            taxon_best_match."Infraspecific_epithet_score" AS "*Name_matched.Infraspecific_epithet_score",
19560
            taxon_best_match."Infraspecific_epithet_score" AS "*Infraspecific_epithet_score",
19561 19561
            taxon_best_match."Annotations" AS "identificationQualifier",
19562 19562
            taxon_best_match."Unmatched_terms" AS "morphospeciesSuffix",
19563 19563
            map_taxonomic_status(taxon_best_match."Taxonomic_status", taxon_best_match."Accepted_name") AS "taxonomicStatus",
......
19567 19567
            taxon_best_match."Accepted_name_url" AS "acceptedScientificNameID",
19568 19568
            taxon_best_match."Accepted_name_species" AS accepted_species_binomial,
19569 19569
            taxon_best_match."Accepted_name_family" AS accepted_family,
19570
            taxon_best_match."Selected" AS "*Name_matched.Selected",
19571
            taxon_best_match."Source" AS "*Name_matched.Source",
19572
            taxon_best_match."Warnings" AS "*Name_matched.Warnings",
19573
            taxon_best_match."Accepted_name_lsid" AS "*Name_matched.Accepted_name_lsid",
19570
            taxon_best_match."Selected" AS "*Selected",
19571
            taxon_best_match."Source" AS "*Source",
19572
            taxon_best_match."Warnings" AS "*Warnings",
19573
            taxon_best_match."Accepted_name_lsid" AS "*Accepted_name_lsid",
19574 19574
            taxon_best_match.is_valid_match AS taxon_scrub__is_valid_match,
19575 19575
            taxon_best_match.scrubbed_unique_taxon_name
19576 19576
           FROM taxon_best_match) s;
......
19593 19593
--
19594 19594

  
19595 19595
CREATE VIEW "ValidMatchedTaxon" AS
19596
 SELECT "MatchedTaxon"."*Name_matched.batch",
19596
 SELECT "MatchedTaxon"."*batch",
19597 19597
    "MatchedTaxon"."concatenatedScientificName",
19598 19598
    "MatchedTaxon"."matchedTaxonName",
19599 19599
    "MatchedTaxon"."matchedTaxonRank",
19600
    "MatchedTaxon"."*Name_matched.Name_score",
19600
    "MatchedTaxon"."*Name_score",
19601 19601
    "MatchedTaxon"."matchedScientificNameAuthorship",
19602 19602
    "MatchedTaxon"."matchedScientificNameID",
19603
    "MatchedTaxon"."*Name_matched.Author_score",
19603
    "MatchedTaxon"."*Author_score",
19604 19604
    "MatchedTaxon"."matchedFamilyConfidence_fraction",
19605 19605
    "MatchedTaxon"."matchedFamily",
19606 19606
    "MatchedTaxon"."matchedGenus",
......
19608 19608
    "MatchedTaxon"."matchedSpecificEpithet",
19609 19609
    "MatchedTaxon"."matchedSpeciesConfidence_fraction",
19610 19610
    "MatchedTaxon"."matchedInfraspecificEpithet",
19611
    "MatchedTaxon"."*Name_matched.Infraspecific_epithet_score",
19611
    "MatchedTaxon"."*Infraspecific_epithet_score",
19612 19612
    "MatchedTaxon"."identificationQualifier",
19613 19613
    "MatchedTaxon"."morphospeciesSuffix",
19614 19614
    "MatchedTaxon"."taxonomicStatus",
......
19618 19618
    "MatchedTaxon"."acceptedScientificNameID",
19619 19619
    "MatchedTaxon".accepted_species_binomial,
19620 19620
    "MatchedTaxon".accepted_family,
19621
    "MatchedTaxon"."*Name_matched.Selected",
19622
    "MatchedTaxon"."*Name_matched.Source",
19623
    "MatchedTaxon"."*Name_matched.Warnings",
19624
    "MatchedTaxon"."*Name_matched.Accepted_name_lsid",
19621
    "MatchedTaxon"."*Selected",
19622
    "MatchedTaxon"."*Source",
19623
    "MatchedTaxon"."*Warnings",
19624
    "MatchedTaxon"."*Accepted_name_lsid",
19625 19625
    "MatchedTaxon".taxon_scrub__is_valid_match,
19626 19626
    "MatchedTaxon".scrubbed_unique_taxon_name,
19627 19627
    "MatchedTaxon".accepted_morphospecies_binomial
......
19855 19855

  
19856 19856
CREATE VIEW taxon_scrub AS
19857 19857
 SELECT "ValidMatchedTaxon".scrubbed_unique_taxon_name,
19858
    "ValidMatchedTaxon"."*Name_matched.batch",
19858
    "ValidMatchedTaxon"."*batch",
19859 19859
    "ValidMatchedTaxon"."concatenatedScientificName",
19860 19860
    "ValidMatchedTaxon"."matchedTaxonName",
19861 19861
    "ValidMatchedTaxon"."matchedTaxonRank",
19862
    "ValidMatchedTaxon"."*Name_matched.Name_score",
19862
    "ValidMatchedTaxon"."*Name_score",
19863 19863
    "ValidMatchedTaxon"."matchedScientificNameAuthorship",
19864 19864
    "ValidMatchedTaxon"."matchedScientificNameID",
19865
    "ValidMatchedTaxon"."*Name_matched.Author_score",
19865
    "ValidMatchedTaxon"."*Author_score",
19866 19866
    "ValidMatchedTaxon"."matchedFamilyConfidence_fraction",
19867 19867
    "ValidMatchedTaxon"."matchedFamily",
19868 19868
    "ValidMatchedTaxon"."matchedGenus",
......
19870 19870
    "ValidMatchedTaxon"."matchedSpecificEpithet",
19871 19871
    "ValidMatchedTaxon"."matchedSpeciesConfidence_fraction",
19872 19872
    "ValidMatchedTaxon"."matchedInfraspecificEpithet",
19873
    "ValidMatchedTaxon"."*Name_matched.Infraspecific_epithet_score",
19873
    "ValidMatchedTaxon"."*Infraspecific_epithet_score",
19874 19874
    "ValidMatchedTaxon"."identificationQualifier",
19875 19875
    "ValidMatchedTaxon"."morphospeciesSuffix",
19876 19876
    "ValidMatchedTaxon"."taxonomicStatus",
......
19880 19880
    "ValidMatchedTaxon"."acceptedScientificNameID",
19881 19881
    "ValidMatchedTaxon".accepted_species_binomial,
19882 19882
    "ValidMatchedTaxon".accepted_family,
19883
    "ValidMatchedTaxon"."*Name_matched.Selected",
19884
    "ValidMatchedTaxon"."*Name_matched.Source",
19885
    "ValidMatchedTaxon"."*Name_matched.Warnings",
19886
    "ValidMatchedTaxon"."*Name_matched.Accepted_name_lsid",
19883
    "ValidMatchedTaxon"."*Selected",
19884
    "ValidMatchedTaxon"."*Source",
19885
    "ValidMatchedTaxon"."*Warnings",
19886
    "ValidMatchedTaxon"."*Accepted_name_lsid",
19887 19887
    "ValidMatchedTaxon".taxon_scrub__is_valid_match,
19888 19888
    "ValidMatchedTaxon".accepted_morphospecies_binomial,
19889 19889
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank,

Also available in: Unified diff