Project

General

Profile

« Previous | Next » 

Revision 14943

schemas/public_.sql: added 2014-11-16.Ana_Maria_Csergo.demography_and_habitat.private view

View differences:

public_.sql
7086 7086

  
7087 7087

  
7088 7088
--
7089
-- Name: 2014-11-16.Ana_Maria_Csergo.demography_and_habitat.private; Type: VIEW; Schema: public; Owner: -
7090
--
7091

  
7092
CREATE VIEW "2014-11-16.Ana_Maria_Csergo.demography_and_habitat.private" AS
7093
 SELECT view_full_occurrence_individual.datasource,
7094
    view_full_occurrence_individual.country,
7095
    view_full_occurrence_individual.locality,
7096
    view_full_occurrence_individual.latitude,
7097
    view_full_occurrence_individual.longitude,
7098
    view_full_occurrence_individual.coord_uncertainty_m,
7099
    view_full_occurrence_individual.georef_sources,
7100
    view_full_occurrence_individual.georef_protocol,
7101
    view_full_occurrence_individual.is_geovalid,
7102
    view_full_occurrence_individual.is_new_world,
7103
    view_full_occurrence_individual.is_location_cultivated,
7104
    view_full_occurrence_individual.custodial_institution_codes,
7105
    view_full_occurrence_individual.collection_code,
7106
    view_full_occurrence_individual.catalog_number,
7107
    view_full_occurrence_individual.recorded_by,
7108
    view_full_occurrence_individual.date_collected,
7109
    view_full_occurrence_individual.verbatim_family,
7110
    view_full_occurrence_individual.verbatim_scientific_name,
7111
    view_full_occurrence_individual.identified_by,
7112
    view_full_occurrence_individual.date_identified,
7113
    view_full_occurrence_individual.identification_remarks,
7114
    view_full_occurrence_individual.family_matched,
7115
    view_full_occurrence_individual.name_matched,
7116
    view_full_occurrence_individual.name_matched_author,
7117
    view_full_occurrence_individual.taxonomic_status,
7118
    view_full_occurrence_individual.scrubbed_family,
7119
    view_full_occurrence_individual.scrubbed_genus,
7120
    view_full_occurrence_individual.scrubbed_specific_epithet,
7121
    view_full_occurrence_individual.scrubbed_species_binomial,
7122
    view_full_occurrence_individual.scrubbed_taxon_name_no_author,
7123
    view_full_occurrence_individual.scrubbed_author,
7124
    view_full_occurrence_individual.scrubbed_taxon_name_with_author,
7125
    view_full_occurrence_individual.is_cultivated
7126
   FROM view_full_occurrence_individual
7127
  WHERE (view_full_occurrence_individual.datasource <> ANY ('{GBIF}'::text[]));
7128

  
7129

  
7130
--
7089 7131
-- Name: 2014-3-11.Jeff_Ott.climatic_range_determinants; Type: VIEW; Schema: public; Owner: -
7090 7132
--
7091 7133

  
......
9141 9183

  
9142 9184

  
9143 9185
--
9144
-- Name: iucn_red_list_view; Type: VIEW; Schema: public; Owner: -
9145
--
9146

  
9147
CREATE VIEW iucn_red_list_view AS
9148
 SELECT DISTINCT taxon_scrub."*Accepted_name_family" AS accepted_family,
9149
    taxon_scrub."*Accepted_name_species" AS accepted_species_binomial
9150
   FROM (taxonlabel
9151
   JOIN "TNRS".taxon_scrub ON ((taxon_scrub."*Name_submitted" = taxonlabel.taxonomicname)))
9152
  WHERE (((taxonlabel.source_id = source_by_shortname('IUCN'::text)) AND (taxon_scrub."*Accepted_name_family" IS NOT NULL)) AND (taxon_scrub."*Accepted_name_species" IS NOT NULL));
9153

  
9154

  
9155
--
9156
-- Name: VIEW iucn_red_list_view; Type: COMMENT; Schema: public; Owner: -
9157
--
9158

  
9159
COMMENT ON VIEW iucn_red_list_view IS '
9160
after updating this:
9161
SELECT iucn_red_list_view_modify();
9162
';
9163

  
9164

  
9165
--
9166 9186
-- Name: location; Type: TABLE; Schema: public; Owner: -; Tablespace: 
9167 9187
--
9168 9188

  
......
11201 11221

  
11202 11222

  
11203 11223
--
11204
-- Name: taxondetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: 
11205
--
11206

  
11207
CREATE TABLE taxondetermination (
11208
    taxondetermination_id integer NOT NULL,
11209
    taxonoccurrence_id integer NOT NULL,
11210
    source_id integer NOT NULL,
11211
    taxonverbatim_id integer NOT NULL,
11212
    party_id integer,
11213
    role role DEFAULT 'unknown'::role NOT NULL,
11214
    determinationtype text,
11215
    reference_id integer,
11216
    isoriginal boolean,
11217
    iscurrent__verbatim boolean,
11218
    iscurrent boolean DEFAULT false NOT NULL,
11219
    taxonfit text,
11220
    taxonconfidence text,
11221
    grouptype text,
11222
    notes text,
11223
    revisions boolean,
11224
    determinationdate date
11225
);
11226

  
11227

  
11228
--
11229
-- Name: TABLE taxondetermination; Type: COMMENT; Schema: public; Owner: -
11230
--
11231

  
11232
COMMENT ON TABLE taxondetermination IS '
11233
Equivalent to VegBank''s taxoninterpretation table.
11234
';
11235

  
11236

  
11237
--
11238
-- Name: taxonverbatim; Type: TABLE; Schema: public; Owner: -; Tablespace: 
11239
--
11240

  
11241
CREATE TABLE taxonverbatim (
11242
    taxonverbatim_id integer NOT NULL,
11243
    source_id integer NOT NULL,
11244
    taxonlabel_id integer,
11245
    verbatimrank text,
11246
    taxonomicname text,
11247
    taxonname text,
11248
    author text,
11249
    family text,
11250
    genus text,
11251
    specific_epithet text,
11252
    subspecies text,
11253
    morphospecies text,
11254
    morphoname text,
11255
    growthform growthform,
11256
    description text,
11257
    CONSTRAINT taxonverbatim_required_key CHECK (((taxonlabel_id IS NOT NULL) OR (morphoname IS NOT NULL)))
11258
);
11259

  
11260

  
11261
--
11262
-- Name: TABLE taxonverbatim; Type: COMMENT; Schema: public; Owner: -
11263
--
11264

  
11265
COMMENT ON TABLE taxonverbatim IS '
11266
Component parts of the taxonlabel. Contains the datasource''s original taxonomic name components, as well as any parsed components produced by name resolution.
11267
';
11268

  
11269

  
11270
--
11271
-- Name: COLUMN taxonverbatim.verbatimrank; Type: COMMENT; Schema: public; Owner: -
11272
--
11273

  
11274
COMMENT ON COLUMN taxonverbatim.verbatimrank IS '
11275
The taxon''s verbatim level in the taxonomic hierarchy. Does not need to be in the taxonrank closed list.
11276
';
11277

  
11278

  
11279
--
11280
-- Name: COLUMN taxonverbatim.taxonomicname; Type: COMMENT; Schema: public; Owner: -
11281
--
11282

  
11283
COMMENT ON COLUMN taxonverbatim.taxonomicname IS '
11284
The full taxonomic name which uniquely identifies this taxon, including the author of that name. The family should be omitted if possible.
11285

  
11286
Equivalent to Darwin Core''s scientificName.
11287
';
11288

  
11289

  
11290
--
11291
-- Name: COLUMN taxonverbatim.taxonname; Type: COMMENT; Schema: public; Owner: -
11292
--
11293

  
11294
COMMENT ON COLUMN taxonverbatim.taxonname IS '
11295
The taxonomic name without the author. The family should be omitted if possible.
11296
';
11297

  
11298

  
11299
--
11300
-- Name: COLUMN taxonverbatim.author; Type: COMMENT; Schema: public; Owner: -
11301
--
11302

  
11303
COMMENT ON COLUMN taxonverbatim.author IS '
11304
The author of the taxonomic name.
11305

  
11306
Equivalent to Darwin Core''s scientificNameAuthorship.
11307
';
11308

  
11309

  
11310
--
11311
-- Name: COLUMN taxonverbatim.family; Type: COMMENT; Schema: public; Owner: -
11312
--
11313

  
11314
COMMENT ON COLUMN taxonverbatim.family IS '
11315
The family of the taxonomic name. This is a cached field for easy querying; this should also be stored in taxonlabel at the appropriate rank.
11316
';
11317

  
11318

  
11319
--
11320
-- Name: COLUMN taxonverbatim.genus; Type: COMMENT; Schema: public; Owner: -
11321
--
11322

  
11323
COMMENT ON COLUMN taxonverbatim.genus IS '
11324
The genus portion of the taxonomic name. This is a cached field for easy querying; this should also be stored in taxonlabel at the appropriate rank.
11325
';
11326

  
11327

  
11328
--
11329
-- Name: COLUMN taxonverbatim.specific_epithet; Type: COMMENT; Schema: public; Owner: -
11330
--
11331

  
11332
COMMENT ON COLUMN taxonverbatim.specific_epithet IS '
11333
The specific epithet portion of the taxonomic name. This is a cached field for easy querying; this should also be stored in taxonlabel at the appropriate rank.
11334
';
11335

  
11336

  
11337
--
11338
-- Name: COLUMN taxonverbatim.morphospecies; Type: COMMENT; Schema: public; Owner: -
11339
--
11340

  
11341
COMMENT ON COLUMN taxonverbatim.morphospecies IS '
11342
The morphospecies suffix.
11343
';
11344

  
11345

  
11346
--
11347
-- Name: trait; Type: TABLE; Schema: public; Owner: -; Tablespace: 
11348
--
11349

  
11350
CREATE TABLE trait (
11351
    trait_id integer NOT NULL,
11352
    taxonoccurrence_id integer NOT NULL,
11353
    name text NOT NULL,
11354
    value text,
11355
    units text
11356
);
11357

  
11358

  
11359
--
11360
-- Name: taxon_trait_view; Type: VIEW; Schema: public; Owner: -
11361
--
11362

  
11363
CREATE VIEW taxon_trait_view AS
11364
 SELECT taxon_scrub."[scrubbed_]name[_no_author]~(-Accepted_-)__@TNRS__@vegpath.org" AS "scientificName",
11365
    trait.name AS "measurementType",
11366
    trait.value AS "measurementValue",
11367
    trait.units AS "measurementUnit",
11368
    "plot.**".country,
11369
    "plot.**".state_province,
11370
    "plot.**".county,
11371
    "plot.**".locality,
11372
    "plot.**".latitude,
11373
    "plot.**".longitude,
11374
    "plot.**".coord_uncertainty_m
11375
   FROM ((((((trait
11376
   LEFT JOIN taxonoccurrence USING (taxonoccurrence_id))
11377
   LEFT JOIN taxondetermination ON (((taxondetermination.taxonoccurrence_id = taxonoccurrence.taxonoccurrence_id) AND taxondetermination.iscurrent)))
11378
   LEFT JOIN taxonverbatim USING (taxonverbatim_id))
11379
   LEFT JOIN taxonlabel USING (taxonlabel_id))
11380
   LEFT JOIN "TNRS".taxon_scrub ON ((taxon_scrub."*Name_submitted" = taxonlabel.taxonomicname)))
11381
   LEFT JOIN "plot.**" USING (locationevent_id))
11382
  WHERE (taxon_scrub."[scrubbed_]name[_no_author]~(-Accepted_-)__@TNRS__@vegpath.org" IS NOT NULL);
11383

  
11384

  
11385
--
11386 11224
-- Name: taxonalt; Type: TABLE; Schema: public; Owner: -; Tablespace: 
11387 11225
--
11388 11226

  
......
11498 11336

  
11499 11337

  
11500 11338
--
11339
-- Name: taxondetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: 
11340
--
11341

  
11342
CREATE TABLE taxondetermination (
11343
    taxondetermination_id integer NOT NULL,
11344
    taxonoccurrence_id integer NOT NULL,
11345
    source_id integer NOT NULL,
11346
    taxonverbatim_id integer NOT NULL,
11347
    party_id integer,
11348
    role role DEFAULT 'unknown'::role NOT NULL,
11349
    determinationtype text,
11350
    reference_id integer,
11351
    isoriginal boolean,
11352
    iscurrent__verbatim boolean,
11353
    iscurrent boolean DEFAULT false NOT NULL,
11354
    taxonfit text,
11355
    taxonconfidence text,
11356
    grouptype text,
11357
    notes text,
11358
    revisions boolean,
11359
    determinationdate date
11360
);
11361

  
11362

  
11363
--
11364
-- Name: TABLE taxondetermination; Type: COMMENT; Schema: public; Owner: -
11365
--
11366

  
11367
COMMENT ON TABLE taxondetermination IS '
11368
Equivalent to VegBank''s taxoninterpretation table.
11369
';
11370

  
11371

  
11372
--
11501 11373
-- Name: taxondetermination_taxondetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
11502 11374
--
11503 11375

  
......
11649 11521

  
11650 11522

  
11651 11523
--
11524
-- Name: taxonverbatim; Type: TABLE; Schema: public; Owner: -; Tablespace: 
11525
--
11526

  
11527
CREATE TABLE taxonverbatim (
11528
    taxonverbatim_id integer NOT NULL,
11529
    source_id integer NOT NULL,
11530
    taxonlabel_id integer,
11531
    verbatimrank text,
11532
    taxonomicname text,
11533
    taxonname text,
11534
    author text,
11535
    family text,
11536
    genus text,
11537
    specific_epithet text,
11538
    subspecies text,
11539
    morphospecies text,
11540
    morphoname text,
11541
    growthform growthform,
11542
    description text,
11543
    CONSTRAINT taxonverbatim_required_key CHECK (((taxonlabel_id IS NOT NULL) OR (morphoname IS NOT NULL)))
11544
);
11545

  
11546

  
11547
--
11548
-- Name: TABLE taxonverbatim; Type: COMMENT; Schema: public; Owner: -
11549
--
11550

  
11551
COMMENT ON TABLE taxonverbatim IS '
11552
Component parts of the taxonlabel. Contains the datasource''s original taxonomic name components, as well as any parsed components produced by name resolution.
11553
';
11554

  
11555

  
11556
--
11557
-- Name: COLUMN taxonverbatim.verbatimrank; Type: COMMENT; Schema: public; Owner: -
11558
--
11559

  
11560
COMMENT ON COLUMN taxonverbatim.verbatimrank IS '
11561
The taxon''s verbatim level in the taxonomic hierarchy. Does not need to be in the taxonrank closed list.
11562
';
11563

  
11564

  
11565
--
11566
-- Name: COLUMN taxonverbatim.taxonomicname; Type: COMMENT; Schema: public; Owner: -
11567
--
11568

  
11569
COMMENT ON COLUMN taxonverbatim.taxonomicname IS '
11570
The full taxonomic name which uniquely identifies this taxon, including the author of that name. The family should be omitted if possible.
11571

  
11572
Equivalent to Darwin Core''s scientificName.
11573
';
11574

  
11575

  
11576
--
11577
-- Name: COLUMN taxonverbatim.taxonname; Type: COMMENT; Schema: public; Owner: -
11578
--
11579

  
11580
COMMENT ON COLUMN taxonverbatim.taxonname IS '
11581
The taxonomic name without the author. The family should be omitted if possible.
11582
';
11583

  
11584

  
11585
--
11586
-- Name: COLUMN taxonverbatim.author; Type: COMMENT; Schema: public; Owner: -
11587
--
11588

  
11589
COMMENT ON COLUMN taxonverbatim.author IS '
11590
The author of the taxonomic name.
11591

  
11592
Equivalent to Darwin Core''s scientificNameAuthorship.
11593
';
11594

  
11595

  
11596
--
11597
-- Name: COLUMN taxonverbatim.family; Type: COMMENT; Schema: public; Owner: -
11598
--
11599

  
11600
COMMENT ON COLUMN taxonverbatim.family IS '
11601
The family of the taxonomic name. This is a cached field for easy querying; this should also be stored in taxonlabel at the appropriate rank.
11602
';
11603

  
11604

  
11605
--
11606
-- Name: COLUMN taxonverbatim.genus; Type: COMMENT; Schema: public; Owner: -
11607
--
11608

  
11609
COMMENT ON COLUMN taxonverbatim.genus IS '
11610
The genus portion of the taxonomic name. This is a cached field for easy querying; this should also be stored in taxonlabel at the appropriate rank.
11611
';
11612

  
11613

  
11614
--
11615
-- Name: COLUMN taxonverbatim.specific_epithet; Type: COMMENT; Schema: public; Owner: -
11616
--
11617

  
11618
COMMENT ON COLUMN taxonverbatim.specific_epithet IS '
11619
The specific epithet portion of the taxonomic name. This is a cached field for easy querying; this should also be stored in taxonlabel at the appropriate rank.
11620
';
11621

  
11622

  
11623
--
11624
-- Name: COLUMN taxonverbatim.morphospecies; Type: COMMENT; Schema: public; Owner: -
11625
--
11626

  
11627
COMMENT ON COLUMN taxonverbatim.morphospecies IS '
11628
The morphospecies suffix.
11629
';
11630

  
11631

  
11632
--
11652 11633
-- Name: taxonverbatim_taxonverbatim_id_seq; Type: SEQUENCE; Schema: public; Owner: -
11653 11634
--
11654 11635

  
......
11699 11680

  
11700 11681

  
11701 11682
--
11702
-- Name: tnrs_input_name; Type: VIEW; Schema: public; Owner: -
11683
-- Name: trait; Type: TABLE; Schema: public; Owner: -; Tablespace: 
11703 11684
--
11704 11685

  
11705
CREATE VIEW tnrs_input_name AS
11706
 SELECT DISTINCT taxonlabel.taxonomicname
11707
   FROM (taxonlabel
11708
   LEFT JOIN "TNRS".taxon_match ON ((taxon_match."*Name_submitted" = taxonlabel.taxonomicname)))
11709
  WHERE (((taxonlabel.taxonomicname IS NOT NULL) AND (taxon_match."*Name_submitted" IS NULL)) AND "TNRS".taxon_name_is_safe(taxonlabel.taxonomicname))
11710
  ORDER BY taxonlabel.taxonomicname;
11686
CREATE TABLE trait (
11687
    trait_id integer NOT NULL,
11688
    taxonoccurrence_id integer NOT NULL,
11689
    name text NOT NULL,
11690
    value text,
11691
    units text
11692
);
11711 11693

  
11712 11694

  
11713 11695
--
......
12199 12181

  
12200 12182

  
12201 12183
--
12202
-- Name: view_full_occurrence_individual_view; Type: VIEW; Schema: public; Owner: -
12203
--
12204

  
12205
CREATE VIEW view_full_occurrence_individual_view AS
12206
 SELECT "plot.**".datasource,
12207
    "plot.**".country,
12208
    "plot.**".state_province,
12209
    "plot.**".county,
12210
    "plot.**".locality,
12211
    "plot.**".latitude,
12212
    "plot.**".longitude,
12213
    "plot.**".coord_uncertainty_m,
12214
    "plot.**".georef_sources,
12215
    "plot.**".georef_protocol,
12216
    "plot.**".is_geovalid,
12217
    "plot.**".is_new_world,
12218
    "plot.**".project_id,
12219
    "plot.**".project_contributors,
12220
    "plot.**".location_id,
12221
    "plot.**".plot_name,
12222
    "plot.**".subplot,
12223
    "plot.**".is_location_cultivated,
12224
    "plot.**".locationevent_id,
12225
    "plot.**".event_date,
12226
    "plot.**".elevation_m,
12227
    "plot.**".slope_aspect_deg,
12228
    "plot.**".slope_gradient_deg,
12229
    "plot.**".plot_area_ha,
12230
    "plot.**".sampling_protocol,
12231
    "plot.**".temperature_c,
12232
    "plot.**".precip_mm,
12233
    "plot.**".stratum_name,
12234
    "plot.**".community_concept_name,
12235
    "plot.**".observation_contributors,
12236
    sourcelist.name AS custodial_institution_codes,
12237
    specimenreplicate.collectioncode_dwc AS collection_code,
12238
    specimenreplicate.catalognumber_dwc AS catalog_number,
12239
    specimenreplicate.sourceaccessioncode AS occurrence_id,
12240
    collector.fullname AS recorded_by,
12241
    plantobservation.authorplantcode AS record_number,
12242
    COALESCE(aggregateoccurrence.collectiondate, "plot.**".event_date) AS date_collected,
12243
    taxonverbatim.family AS verbatim_family,
12244
    COALESCE(taxonverbatim.taxonomicname, (taxonverbatim.taxonname || COALESCE((' '::text || taxonverbatim.author), ''::text)), taxonlabel.taxonomicname) AS verbatim_scientific_name,
12245
    identifiedby.fullname AS identified_by,
12246
    taxondetermination.determinationdate AS date_identified,
12247
    taxondetermination.notes AS identification_remarks,
12248
    taxon_scrub."*Name_matched_accepted_family" AS family_matched,
12249
    taxon_scrub."*Name_matched" AS name_matched,
12250
    taxon_scrub."*Name_matched_author" AS name_matched_author,
12251
    family_higher_plant_group.higher_plant_group,
12252
    taxon_scrub."[scrubbed_]taxonomicStatus__@DwC__@vegpath.org" AS taxonomic_status,
12253
    taxon_scrub."[scrubbed_]family~(-Accepted_-)__@TNRS__@vegpath.org" AS scrubbed_family,
12254
    taxon_scrub."[scrubbed_]genus__@DwC__@vegpath.org" AS scrubbed_genus,
12255
    taxon_scrub."[scrubbed_]specificEpithet__@DwC__@vegpath.org" AS scrubbed_specific_epithet,
12256
    ((taxon_scrub."[scrubbed_]genus__@DwC__@vegpath.org" || ' '::text) || taxon_scrub."[scrubbed_]specificEpithet__@DwC__@vegpath.org") AS scrubbed_species_binomial,
12257
    taxon_scrub."[scrubbed_]name[_no_author]~(-Accepted_-)__@TNRS__@vegpath.org" AS scrubbed_taxon_name_no_author,
12258
    taxon_scrub."[scrubbed_]author~(-Accepted_-)__@TNRS__@vegpath.org" AS scrubbed_author,
12259
    taxon_scrub."[scrubbed_]scientificName[_with_author]__@DwC__@vegpath.org" AS scrubbed_taxon_name_with_author,
12260
    taxon_scrub."[scrubbed_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org" AS scrubbed_species_binomial_with_morphospecies,
12261
    taxonoccurrence.growthform AS growth_form,
12262
    plantobservation.reproductivecondition AS reproductive_condition,
12263
    (((cultivated_family_locations.country IS NOT NULL) OR _or(taxonoccurrence.iscultivated, "plot.**".is_location_cultivated)))::integer AS is_cultivated,
12264
        CASE
12265
            WHEN (taxonoccurrence.iscultivated IS NOT NULL) THEN taxonoccurrence.cultivatedbasis
12266
            WHEN ("plot.**".is_location_cultivated IS NOT NULL) THEN NULL::text
12267
            ELSE NULL::text
12268
        END AS is_cultivated_basis,
12269
    aggregateoccurrence.notes AS occurrence_remarks,
12270
    _fraction_to_percent(aggregateoccurrence.cover_fraction) AS cover_percent,
12271
    taxonoccurrence.sourceaccessioncode AS taxon_observation_id,
12272
    taxonoccurrence.authortaxoncode AS taxon_name_usage_concept_author_code,
12273
    aggregateoccurrence.sourceaccessioncode AS aggregate_organism_observation_id,
12274
    plantobservation.sourceaccessioncode AS individual_organism_observation_id,
12275
    plantobservation.authorplantcode AS individual_id,
12276
    aggregateoccurrence.count AS individual_count,
12277
    plantobservation.plantobservation_id
12278
   FROM ((((((((((((("plot.**"
12279
   LEFT JOIN taxonoccurrence USING (locationevent_id))
12280
   LEFT JOIN party collector ON ((collector.party_id = taxonoccurrence.collector_id)))
12281
   LEFT JOIN aggregateoccurrence USING (taxonoccurrence_id))
12282
   LEFT JOIN plantobservation USING (aggregateoccurrence_id))
12283
   LEFT JOIN specimenreplicate USING (plantobservation_id))
12284
   LEFT JOIN sourcelist ON ((sourcelist.sourcelist_id = specimenreplicate.duplicate_institutions_sourcelist_id)))
12285
   LEFT JOIN taxondetermination ON (((taxondetermination.taxonoccurrence_id = taxonoccurrence.taxonoccurrence_id) AND taxondetermination.iscurrent)))
12286
   LEFT JOIN party identifiedby ON ((identifiedby.party_id = taxondetermination.party_id)))
12287
   LEFT JOIN taxonverbatim USING (taxonverbatim_id))
12288
   LEFT JOIN taxonlabel USING (taxonlabel_id))
12289
   LEFT JOIN "TNRS".taxon_scrub ON ((taxon_scrub."*Name_submitted" = taxonlabel.taxonomicname)))
12290
   LEFT JOIN family_higher_plant_group ON ((family_higher_plant_group.family = taxon_scrub."[scrubbed_]family~(-Accepted_-)__@TNRS__@vegpath.org")))
12291
   LEFT JOIN cultivated_family_locations ON (((cultivated_family_locations.family = taxon_scrub."[scrubbed_]family~(-Accepted_-)__@TNRS__@vegpath.org") AND (cultivated_family_locations.country = "plot.**".country))));
12292

  
12293

  
12294
--
12295
-- Name: VIEW view_full_occurrence_individual_view; Type: COMMENT; Schema: public; Owner: -
12296
--
12297

  
12298
COMMENT ON VIEW view_full_occurrence_individual_view IS '
12299
after updating this:
12300
SELECT view_full_occurrence_individual_view_modify()
12301
add applicable columns to analytical_specimen, analytical_plot
12302

  
12303
materialize time: 2 days (42 h; "152473233.340 ms") @r14645 @vegbiendev
12304

  
12305
CREATE INDEX runtime:
12306
1-column: 10 min - 1.5 h depending on the datatype and % populated
12307
	(plot_area_ha: "10:45.92"; taxonomic_status: "1:28:16") @r14089 @vegbiendev
12308
2-column: ~2 h ((datasource, scrubbed_species_binomial_with_morphospecies):
12309
	"2:11:31") @r14089 @vegbiendev
12310
';
12311

  
12312

  
12313
--
12314
-- Name: COLUMN view_full_occurrence_individual_view.datasource; Type: COMMENT; Schema: public; Owner: -
12315
--
12316

  
12317
COMMENT ON COLUMN view_full_occurrence_individual_view.datasource IS 'http://datasource__@Brad__.identifier_examples@vegpath.org;
12318
"the person [or] institution that provided the data [to this database] (the *proximate* data provider)"';
12319

  
12320

  
12321
--
12322
-- Name: COLUMN view_full_occurrence_individual_view.country; Type: COMMENT; Schema: public; Owner: -
12323
--
12324

  
12325
COMMENT ON COLUMN view_full_occurrence_individual_view.country IS 'http://country__@DwC__@vegpath.org;
12326
http://geoscrub.geoscrub_output.acceptedCountry__@VegBIEN__@vegpath.org;
12327
"The name of the country or major administrative unit in which the Location occurs"';
12328

  
12329

  
12330
--
12331
-- Name: COLUMN view_full_occurrence_individual_view.state_province; Type: COMMENT; Schema: public; Owner: -
12332
--
12333

  
12334
COMMENT ON COLUMN view_full_occurrence_individual_view.state_province IS 'http://stateProvince__@DwC__@vegpath.org;
12335
"The name of the next smaller administrative region than country (state, province, canton, department, region, etc.) in which the Location occurs"';
12336

  
12337

  
12338
--
12339
-- Name: COLUMN view_full_occurrence_individual_view.county; Type: COMMENT; Schema: public; Owner: -
12340
--
12341

  
12342
COMMENT ON COLUMN view_full_occurrence_individual_view.county IS 'http://county__@DwC__@vegpath.org;
12343
"The full, unabbreviated name of the next smaller administrative region than stateProvince (county, shire, department, etc.) in which the Location occurs"';
12344

  
12345

  
12346
--
12347
-- Name: COLUMN view_full_occurrence_individual_view.locality; Type: COMMENT; Schema: public; Owner: -
12348
--
12349

  
12350
COMMENT ON COLUMN view_full_occurrence_individual_view.locality IS 'http://locality__@DwC__@vegpath.org;
12351
"The specific description of the place"';
12352

  
12353

  
12354
--
12355
-- Name: COLUMN view_full_occurrence_individual_view.latitude; Type: COMMENT; Schema: public; Owner: -
12356
--
12357

  
12358
COMMENT ON COLUMN view_full_occurrence_individual_view.latitude IS 'http://decimalLatitude__@DwC__@vegpath.org;
12359
"The geographic latitude (in decimal degrees, using the spatial reference system given in geodeticDatum) of the geographic center of a Location"';
12360

  
12361

  
12362
--
12363
-- Name: COLUMN view_full_occurrence_individual_view.longitude; Type: COMMENT; Schema: public; Owner: -
12364
--
12365

  
12366
COMMENT ON COLUMN view_full_occurrence_individual_view.longitude IS 'http://decimalLongitude__@DwC__@vegpath.org;
12367
"The geographic longitude (in decimal degrees, using the spatial reference system given in geodeticDatum) of the geographic center of a Location"';
12368

  
12369

  
12370
--
12371
-- Name: COLUMN view_full_occurrence_individual_view.coord_uncertainty_m; Type: COMMENT; Schema: public; Owner: -
12372
--
12373

  
12374
COMMENT ON COLUMN view_full_occurrence_individual_view.coord_uncertainty_m IS 'http://coordinateUncertaintyInMeters__@DwC__@vegpath.org;
12375
for a point observation, this is the fuzziness of the coordinates. for a plot (or other shape), this is the radius of the circle that circumscribes the entire plot, or the fuzziness, whichever is greater. note that the DwC definition is confusingly worded: it uses the ambiguous term Location, which sometimes refers to the asserted named place, but which they intended to refer to the plot or point.';
12376

  
12377

  
12378
--
12379
-- Name: COLUMN view_full_occurrence_individual_view.georef_sources; Type: COMMENT; Schema: public; Owner: -
12380
--
12381

  
12382
COMMENT ON COLUMN view_full_occurrence_individual_view.georef_sources IS 'http://georeferenceSources__@DwC__@vegpath.org;
12383
"A list (concatenated and separated) of maps, gazetteers, or other resources used to georeference the Location, described specifically enough to allow anyone in the future to use the same resources"';
12384

  
12385

  
12386
--
12387
-- Name: COLUMN view_full_occurrence_individual_view.georef_protocol; Type: COMMENT; Schema: public; Owner: -
12388
--
12389

  
12390
COMMENT ON COLUMN view_full_occurrence_individual_view.georef_protocol IS 'http://georeferenceProtocol__@DwC__@vegpath.org;
12391
"A description or reference to the methods used to determine the spatial footprint, coordinates, and uncertainties"';
12392

  
12393

  
12394
--
12395
-- Name: COLUMN view_full_occurrence_individual_view.is_geovalid; Type: COMMENT; Schema: public; Owner: -
12396
--
12397

  
12398
COMMENT ON COLUMN view_full_occurrence_individual_view.is_geovalid IS 'whether the coordinates are within the boundary of the asserted named places';
12399

  
12400

  
12401
--
12402
-- Name: COLUMN view_full_occurrence_individual_view.is_new_world; Type: COMMENT; Schema: public; Owner: -
12403
--
12404

  
12405
COMMENT ON COLUMN view_full_occurrence_individual_view.is_new_world IS 'whether the country is in the Americas';
12406

  
12407

  
12408
--
12409
-- Name: COLUMN view_full_occurrence_individual_view.project_id; Type: COMMENT; Schema: public; Owner: -
12410
--
12411

  
12412
COMMENT ON COLUMN view_full_occurrence_individual_view.project_id IS 'http://projectID__@VegX__.plotObservation@vegpath.org;
12413
http://project.sourceaccessioncode__@VegBIEN__.public@vegpath.org;
12414
"A reference to a specific ''project''"';
12415

  
12416

  
12417
--
12418
-- Name: COLUMN view_full_occurrence_individual_view.project_contributors; Type: COMMENT; Schema: public; Owner: -
12419
--
12420

  
12421
COMMENT ON COLUMN view_full_occurrence_individual_view.project_contributors IS 'http://projectContributor[s]__@VegBank__@vegpath.org;
12422
"intersection entit[ies] used to ''link'' a party with a specific project wherein vegetation plots are described"';
12423

  
12424

  
12425
--
12426
-- Name: COLUMN view_full_occurrence_individual_view.location_id; Type: COMMENT; Schema: public; Owner: -
12427
--
12428

  
12429
COMMENT ON COLUMN view_full_occurrence_individual_view.location_id IS 'http://locationID__@DwC__@vegpath.org;
12430
"An identifier for the set of location information (data associated with dcterms:Location)"';
12431

  
12432

  
12433
--
12434
-- Name: COLUMN view_full_occurrence_individual_view.plot_name; Type: COMMENT; Schema: public; Owner: -
12435
--
12436

  
12437
COMMENT ON COLUMN view_full_occurrence_individual_view.plot_name IS 'http://plotName__@VegX__.plot@vegpath.org;
12438
"Name or label for a plot"';
12439

  
12440

  
12441
--
12442
-- Name: COLUMN view_full_occurrence_individual_view.subplot; Type: COMMENT; Schema: public; Owner: -
12443
--
12444

  
12445
COMMENT ON COLUMN view_full_occurrence_individual_view.subplot IS 'http://subplot__@SALVIAS__.Plot_data@vegpath.org;
12446
http://location.authorlocationcode__@VegBIEN__.public@vegpath.org;
12447
"Code for subplot, line, or any other subsample or subdivision of plot"';
12448

  
12449

  
12450
--
12451
-- Name: COLUMN view_full_occurrence_individual_view.is_location_cultivated; Type: COMMENT; Schema: public; Owner: -
12452
--
12453

  
12454
COMMENT ON COLUMN view_full_occurrence_individual_view.is_location_cultivated IS 'whether the occurrence''s *location* was flagged as cultivated. note that this refers just to the cultivated status of the *location*; the occurrence may be cultivated even if the location isn''t.';
12455

  
12456

  
12457
--
12458
-- Name: COLUMN view_full_occurrence_individual_view.locationevent_id; Type: COMMENT; Schema: public; Owner: -
12459
--
12460

  
12461
COMMENT ON COLUMN view_full_occurrence_individual_view.locationevent_id IS 'http://locationevent.locationevent_id__@VegBIEN__.public@vegpath.org;
12462
autogenerated ID for locationevent';
12463

  
12464

  
12465
--
12466
-- Name: COLUMN view_full_occurrence_individual_view.event_date; Type: COMMENT; Schema: public; Owner: -
12467
--
12468

  
12469
COMMENT ON COLUMN view_full_occurrence_individual_view.event_date IS 'http://eventDate__@DwC__@vegpath.org;
12470
"The date-time or interval during which an Event occurred. For occurrences, this is the date-time when the event was recorded."';
12471

  
12472

  
12473
--
12474
-- Name: COLUMN view_full_occurrence_individual_view.elevation_m; Type: COMMENT; Schema: public; Owner: -
12475
--
12476

  
12477
COMMENT ON COLUMN view_full_occurrence_individual_view.elevation_m IS 'http://(-minimum-)ElevationInMeters__@DwC__@vegpath.org;
12478
the "elevation (altitude, usually above sea level), in meters"';
12479

  
12480

  
12481
--
12482
-- Name: COLUMN view_full_occurrence_individual_view.slope_aspect_deg; Type: COMMENT; Schema: public; Owner: -
12483
--
12484

  
12485
COMMENT ON COLUMN view_full_occurrence_individual_view.slope_aspect_deg IS 'http://slopeAspect[_deg]__@VegX__.plot@vegpath.org;
12486
"Representative azimuth of slope gradient (0-360 degrees) or as a cardinal direction (e.g. N, S, NE)"';
12487

  
12488

  
12489
--
12490
-- Name: COLUMN view_full_occurrence_individual_view.slope_gradient_deg; Type: COMMENT; Schema: public; Owner: -
12491
--
12492

  
12493
COMMENT ON COLUMN view_full_occurrence_individual_view.slope_gradient_deg IS 'http://slopeGradient[_deg]__@VegX__.plot@vegpath.org;
12494
"Representative inclination of slope in degrees"';
12495

  
12496

  
12497
--
12498
-- Name: COLUMN view_full_occurrence_individual_view.plot_area_ha; Type: COMMENT; Schema: public; Owner: -
12499
--
12500

  
12501
COMMENT ON COLUMN view_full_occurrence_individual_view.plot_area_ha IS 'http://plot.area[_ha]__@VegX__@vegpath.org;
12502
"Total area of the plot"';
12503

  
12504

  
12505
--
12506
-- Name: COLUMN view_full_occurrence_individual_view.sampling_protocol; Type: COMMENT; Schema: public; Owner: -
12507
--
12508

  
12509
COMMENT ON COLUMN view_full_occurrence_individual_view.sampling_protocol IS 'http://samplingProtocol__@DwC__@vegpath.org;
12510
"The name of, reference to, or description of the method or protocol used during an Event"';
12511

  
12512

  
12513
--
12514
-- Name: COLUMN view_full_occurrence_individual_view.temperature_c; Type: COMMENT; Schema: public; Owner: -
12515
--
12516

  
12517
COMMENT ON COLUMN view_full_occurrence_individual_view.temperature_c IS 'http://temperature[_C]__@VegX__.plotObs.obsCond@vegpath.org;
12518
"Temperature during observation [...] [in] Celsius"';
12519

  
12520

  
12521
--
12522
-- Name: COLUMN view_full_occurrence_individual_view.precip_mm; Type: COMMENT; Schema: public; Owner: -
12523
--
12524

  
12525
COMMENT ON COLUMN view_full_occurrence_individual_view.precip_mm IS 'http://precip_mm__@SALVIAS__.Plot_metadata@vegpath.org;
12526
"Total annual precipitation, in mm"';
12527

  
12528

  
12529
--
12530
-- Name: COLUMN view_full_occurrence_individual_view.stratum_name; Type: COMMENT; Schema: public; Owner: -
12531
--
12532

  
12533
COMMENT ON COLUMN view_full_occurrence_individual_view.stratum_name IS 'http://stratumName__@VegX__.stratum@vegpath.org;
12534
"Name associated with this stratum"';
12535

  
12536

  
12537
--
12538
-- Name: COLUMN view_full_occurrence_individual_view.community_concept_name; Type: COMMENT; Schema: public; Owner: -
12539
--
12540

  
12541
COMMENT ON COLUMN view_full_occurrence_individual_view.community_concept_name IS 'http://communityConcept.name__@VegX__.communityDet@vegpath.org;
12542
"A textual label for a community type. A community type is an abstract grouping of organisms that tend to co-occur on the landscape due to shared ecological requirements or preferences."';
12543

  
12544

  
12545
--
12546
-- Name: COLUMN view_full_occurrence_individual_view.observation_contributors; Type: COMMENT; Schema: public; Owner: -
12547
--
12548

  
12549
COMMENT ON COLUMN view_full_occurrence_individual_view.observation_contributors IS 'http://observationContributor[s]__@VegBank__@vegpath.org;
12550
"intersection[s] that link[] a party with a specific plot observation event"';
12551

  
12552

  
12553
--
12554
-- Name: COLUMN view_full_occurrence_individual_view.custodial_institution_codes; Type: COMMENT; Schema: public; Owner: -
12555
--
12556

  
12557
COMMENT ON COLUMN view_full_occurrence_individual_view.custodial_institution_codes IS 'http://[custodial_]institutionCode[s]__@DwC__@vegpath.org;
12558
"The name[s] (or acronym[s]) in use by the institution[s] having custody of the object(s) or information referred to in the record"';
12559

  
12560

  
12561
--
12562
-- Name: COLUMN view_full_occurrence_individual_view.collection_code; Type: COMMENT; Schema: public; Owner: -
12563
--
12564

  
12565
COMMENT ON COLUMN view_full_occurrence_individual_view.collection_code IS 'http://collectionCode__@DwC__@vegpath.org;
12566
"The name, acronym, coden, or initialism identifying the collection or data set from which the record was derived"';
12567

  
12568

  
12569
--
12570
-- Name: COLUMN view_full_occurrence_individual_view.catalog_number; Type: COMMENT; Schema: public; Owner: -
12571
--
12572

  
12573
COMMENT ON COLUMN view_full_occurrence_individual_view.catalog_number IS 'http://catalogNumber__@DwC__@vegpath.org;
12574
"An identifier (preferably unique) for the record within the data set or collection"';
12575

  
12576

  
12577
--
12578
-- Name: COLUMN view_full_occurrence_individual_view.occurrence_id; Type: COMMENT; Schema: public; Owner: -
12579
--
12580

  
12581
COMMENT ON COLUMN view_full_occurrence_individual_view.occurrence_id IS 'http://occurrenceID__@DwC__@vegpath.org;
12582
"An identifier for the Occurrence (as opposed to a particular digital record of the occurrence). In the absence of a persistent global unique identifier, construct one from a combination of identifiers in the record that will most closely make the occurrenceID globally unique."';
12583

  
12584

  
12585
--
12586
-- Name: COLUMN view_full_occurrence_individual_view.recorded_by; Type: COMMENT; Schema: public; Owner: -
12587
--
12588

  
12589
COMMENT ON COLUMN view_full_occurrence_individual_view.recorded_by IS 'http://recordedBy__@DwC__@vegpath.org;
12590
"A list (concatenated and separated) of names of people, groups, or organizations responsible for recording the original Occurrence. The primary collector or observer, especially one who applies a personal identifier (recordNumber), should be listed first."';
12591

  
12592

  
12593
--
12594
-- Name: COLUMN view_full_occurrence_individual_view.record_number; Type: COMMENT; Schema: public; Owner: -
12595
--
12596

  
12597
COMMENT ON COLUMN view_full_occurrence_individual_view.record_number IS 'http://recordNumber__@DwC__@vegpath.org;
12598
"An identifier given to the Occurrence at the time it was recorded. Often serves as a link between field notes and an Occurrence record, such as a specimen collector''s number."';
12599

  
12600

  
12601
--
12602
-- Name: COLUMN view_full_occurrence_individual_view.date_collected; Type: COMMENT; Schema: public; Owner: -
12603
--
12604

  
12605
COMMENT ON COLUMN view_full_occurrence_individual_view.date_collected IS 'http://(-Earliest-)DateCollected__-2007-04-17__@DwC__.hist@vegpath.org;
12606
the "date-time (Common Era calendar) in a date-time period during which an organism or group of organisms was collected or observed"';
12607

  
12608

  
12609
--
12610
-- Name: COLUMN view_full_occurrence_individual_view.verbatim_family; Type: COMMENT; Schema: public; Owner: -
12611
--
12612

  
12613
COMMENT ON COLUMN view_full_occurrence_individual_view.verbatim_family IS 'http://[verbatim_]family__@DwC__@vegpath.org;
12614
"The full scientific name of the family in which the taxon is classified [*before* any TNRS scrubbing]"';
12615

  
12616

  
12617
--
12618
-- Name: COLUMN view_full_occurrence_individual_view.verbatim_scientific_name; Type: COMMENT; Schema: public; Owner: -
12619
--
12620

  
12621
COMMENT ON COLUMN view_full_occurrence_individual_view.verbatim_scientific_name IS 'http://[verbatim_]scientificName__@DwC__@vegpath.org;
12622
"The full scientific name [*before* any TNRS scrubbing], with authorship and date information if known. When forming part of an Identification, this should be the name in lowest level taxonomic rank that can be determined."';
12623

  
12624

  
12625
--
12626
-- Name: COLUMN view_full_occurrence_individual_view.identified_by; Type: COMMENT; Schema: public; Owner: -
12627
--
12628

  
12629
COMMENT ON COLUMN view_full_occurrence_individual_view.identified_by IS 'http://identifiedBy__@DwC__@vegpath.org;
12630
"A list (concatenated and separated) of names of people, groups, or organizations who assigned the Taxon to the subject"';
12631

  
12632

  
12633
--
12634
-- Name: COLUMN view_full_occurrence_individual_view.date_identified; Type: COMMENT; Schema: public; Owner: -
12635
--
12636

  
12637
COMMENT ON COLUMN view_full_occurrence_individual_view.date_identified IS 'http://dateIdentified__@DwC__@vegpath.org;
12638
"The date on which the subject was identified as representing the Taxon"';
12639

  
12640

  
12641
--
12642
-- Name: COLUMN view_full_occurrence_individual_view.identification_remarks; Type: COMMENT; Schema: public; Owner: -
12643
--
12644

  
12645
COMMENT ON COLUMN view_full_occurrence_individual_view.identification_remarks IS 'http://identificationRemarks__@DwC__@vegpath.org;
12646
"Comments or notes about the Identification"';
12647

  
12648

  
12649
--
12650
-- Name: COLUMN view_full_occurrence_individual_view.family_matched; Type: COMMENT; Schema: public; Owner: -
12651
--
12652

  
12653
COMMENT ON COLUMN view_full_occurrence_individual_view.family_matched IS 'http://Family_matched__@TNRS__@vegpath.org;
12654
http://TNRS.taxon_scrub.matchedFamily__@VegBIEN__@vegpath.org;
12655
"The closest matching family in the TNRS database to the family submitted"';
12656

  
12657

  
12658
--
12659
-- Name: COLUMN view_full_occurrence_individual_view.name_matched; Type: COMMENT; Schema: public; Owner: -
12660
--
12661

  
12662
COMMENT ON COLUMN view_full_occurrence_individual_view.name_matched IS 'http://Name_matched__@TNRS__@vegpath.org;
12663
"Scientific name with the highest match score. May be an exact match or a fuzzy match."';
12664

  
12665

  
12666
--
12667
-- Name: COLUMN view_full_occurrence_individual_view.name_matched_author; Type: COMMENT; Schema: public; Owner: -
12668
--
12669

  
12670
COMMENT ON COLUMN view_full_occurrence_individual_view.name_matched_author IS 'http://Name_matched_author__@TNRS__@vegpath.org;
12671
"Standard authority for the matched name"';
12672

  
12673

  
12674
--
12675
-- Name: COLUMN view_full_occurrence_individual_view.higher_plant_group; Type: COMMENT; Schema: public; Owner: -
12676
--
12677

  
12678
COMMENT ON COLUMN view_full_occurrence_individual_view.higher_plant_group IS 'http://[higher_plant_group~]higherClassification__@DwC__@vegpath.org;
12679
closed list derived from higher taxa';
12680

  
12681

  
12682
--
12683
-- Name: COLUMN view_full_occurrence_individual_view.taxonomic_status; Type: COMMENT; Schema: public; Owner: -
12684
--
12685

  
12686
COMMENT ON COLUMN view_full_occurrence_individual_view.taxonomic_status IS 'http://taxonomicStatus__@DwC__@vegpath.org;
12687
"The status of the use of the scientificName as a label for a taxon. Requires taxonomic opinion to define the scope of a taxon. [...] Examples: "invalid", "misapplied", "homotypic synonym", "accepted"."';
12688

  
12689

  
12690
--
12691
-- Name: COLUMN view_full_occurrence_individual_view.scrubbed_family; Type: COMMENT; Schema: public; Owner: -
12692
--
12693

  
12694
COMMENT ON COLUMN view_full_occurrence_individual_view.scrubbed_family IS 'the family of the TNRS accepted or matched name';
12695

  
12696

  
12697
--
12698
-- Name: COLUMN view_full_occurrence_individual_view.scrubbed_genus; Type: COMMENT; Schema: public; Owner: -
12699
--
12700

  
12701
COMMENT ON COLUMN view_full_occurrence_individual_view.scrubbed_genus IS 'the genus of the TNRS accepted or matched name';
12702

  
12703

  
12704
--
12705
-- Name: COLUMN view_full_occurrence_individual_view.scrubbed_specific_epithet; Type: COMMENT; Schema: public; Owner: -
12706
--
12707

  
12708
COMMENT ON COLUMN view_full_occurrence_individual_view.scrubbed_specific_epithet IS 'the specific epithet of the TNRS accepted or matched name';
12709

  
12710

  
12711
--
12712
-- Name: COLUMN view_full_occurrence_individual_view.scrubbed_species_binomial; Type: COMMENT; Schema: public; Owner: -
12713
--
12714

  
12715
COMMENT ON COLUMN view_full_occurrence_individual_view.scrubbed_species_binomial IS 'the species binomial of the TNRS accepted or matched name';
12716

  
12717

  
12718
--
12719
-- Name: COLUMN view_full_occurrence_individual_view.scrubbed_taxon_name_no_author; Type: COMMENT; Schema: public; Owner: -
12720
--
12721

  
12722
COMMENT ON COLUMN view_full_occurrence_individual_view.scrubbed_taxon_name_no_author IS 'the taxon name without author of the TNRS accepted or matched name';
12723

  
12724

  
12725
--
12726
-- Name: COLUMN view_full_occurrence_individual_view.scrubbed_author; Type: COMMENT; Schema: public; Owner: -
12727
--
12728

  
12729
COMMENT ON COLUMN view_full_occurrence_individual_view.scrubbed_author IS 'the author of the TNRS accepted or matched name';
12730

  
12731

  
12732
--
12733
-- Name: COLUMN view_full_occurrence_individual_view.scrubbed_taxon_name_with_author; Type: COMMENT; Schema: public; Owner: -
12734
--
12735

  
12736
COMMENT ON COLUMN view_full_occurrence_individual_view.scrubbed_taxon_name_with_author IS 'the taxon name with author of the TNRS accepted or matched name';
12737

  
12738

  
12739
--
12740
-- Name: COLUMN view_full_occurrence_individual_view.scrubbed_species_binomial_with_morphospecies; Type: COMMENT; Schema: public; Owner: -
12741
--
12742

  
12743
COMMENT ON COLUMN view_full_occurrence_individual_view.scrubbed_species_binomial_with_morphospecies IS 'http://speciesBinomialWithMorphospecies__@VegCore__@vegpath.org;
12744
http://TNRS.taxon_scrub.scrubbed_morphospecies_binomial__@VegBIEN__.public@vegpath.org;
12745
"combine the `taxon` plus `morphospecies` to produce a unique string, `taxonMorphospecies`";
12746
a morphospecies is a custom species name assigned in the field by the collector (which does not validate to anything in TNRS)';
12747

  
12748

  
12749
--
12750
-- Name: COLUMN view_full_occurrence_individual_view.growth_form; Type: COMMENT; Schema: public; Owner: -
12751
--
12752

  
12753
COMMENT ON COLUMN view_full_occurrence_individual_view.growth_form IS 'http://[growth_form=]habit__@SALVIAS__.Plot_data@vegpath.org;
12754
"Growth form"; "Closed pick list"';
12755

  
12756

  
12757
--
12758
-- Name: COLUMN view_full_occurrence_individual_view.reproductive_condition; Type: COMMENT; Schema: public; Owner: -
12759
--
12760

  
12761
COMMENT ON COLUMN view_full_occurrence_individual_view.reproductive_condition IS 'http://reproductiveCondition__@DwC__@vegpath.org;
12762
"The reproductive condition of the biological individual(s) represented in the Occurrence. Recommended best practice is to use a controlled vocabulary."';
12763

  
12764

  
12765
--
12766
-- Name: COLUMN view_full_occurrence_individual_view.is_cultivated; Type: COMMENT; Schema: public; Owner: -
12767
--
12768

  
12769
COMMENT ON COLUMN view_full_occurrence_individual_view.is_cultivated IS 'whether the occurrence was flagged as cultivated';
12770

  
12771

  
12772
--
12773
-- Name: COLUMN view_full_occurrence_individual_view.is_cultivated_basis; Type: COMMENT; Schema: public; Owner: -
12774
--
12775

  
12776
COMMENT ON COLUMN view_full_occurrence_individual_view.is_cultivated_basis IS 'why the occurrence was flagged as cultivated';
12777

  
12778

  
12779
--
12780
-- Name: COLUMN view_full_occurrence_individual_view.occurrence_remarks; Type: COMMENT; Schema: public; Owner: -
12781
--
12782

  
12783
COMMENT ON COLUMN view_full_occurrence_individual_view.occurrence_remarks IS 'http://occurrenceRemarks__@DwC__@vegpath.org;
12784
"Comments or notes about the Occurrence"';
12785

  
12786

  
12787
--
12788
-- Name: COLUMN view_full_occurrence_individual_view.cover_percent; Type: COMMENT; Schema: public; Owner: -
12789
--
12790

  
12791
COMMENT ON COLUMN view_full_occurrence_individual_view.cover_percent IS 'http://coverPercent__@VegX__.attribute.ordinal@vegpath.org;
12792
"Average cover of the index in percent"';
12793

  
12794

  
12795
--
12796
-- Name: COLUMN view_full_occurrence_individual_view.taxon_observation_id; Type: COMMENT; Schema: public; Owner: -
12797
--
12798

  
12799
COMMENT ON COLUMN view_full_occurrence_individual_view.taxon_observation_id IS 'http://taxonObservation[.id]__@VegBank__@vegpath.org;
12800
"identifier assigned [by the datasource] to each unique observation of a taxon in a plot"';
12801

  
12802

  
12803
--
12804
-- Name: COLUMN view_full_occurrence_individual_view.taxon_name_usage_concept_author_code; Type: COMMENT; Schema: public; Owner: -
12805
--
12806

  
12807
COMMENT ON COLUMN view_full_occurrence_individual_view.taxon_name_usage_concept_author_code IS 'http://taxonNameUsageConcept.authorCode__@VegX__@vegpath.org;
12808
"Verbat[i]m short code used by the author to signify the species at time of observation"';
12809

  
12810

  
12811
--
12812
-- Name: COLUMN view_full_occurrence_individual_view.aggregate_organism_observation_id; Type: COMMENT; Schema: public; Owner: -
12813
--
12814

  
12815
COMMENT ON COLUMN view_full_occurrence_individual_view.aggregate_organism_observation_id IS 'http://aggregateOrganismObservation.id__@VegX__@vegpath.org;
12816
the ID for "An observation applying to all occurrences of an organism based on an aggregation factor. It contains an AggregateValue, which is an assessment of the overall occurrence of an organism in a Plot (e.g. number of stems, percentage cover, total biomass, basal area)."';
12817

  
12818

  
12819
--
12820
-- Name: COLUMN view_full_occurrence_individual_view.individual_organism_observation_id; Type: COMMENT; Schema: public; Owner: -
12821
--
12822

  
12823
COMMENT ON COLUMN view_full_occurrence_individual_view.individual_organism_observation_id IS 'http://individualOrganismObservation.id__@VegX__@vegpath.org;
12824
the ID for "An observation applying to one occurrence of an organism (or part of an organism). It is a container for measurements made on the organism (e.g. diameter, height, crown dimensions, biomass, growth form, number of stems)."';
12825

  
12826

  
12827
--
12828
-- Name: COLUMN view_full_occurrence_individual_view.individual_id; Type: COMMENT; Schema: public; Owner: -
12829
--
12830

  
12831
COMMENT ON COLUMN view_full_occurrence_individual_view.individual_id IS 'http://individualID__@DwC__@vegpath.org;
12832
"An identifier for an individual or named group of individual organisms represented in the Occurrence"';
12833

  
12834

  
12835
--
12836
-- Name: COLUMN view_full_occurrence_individual_view.individual_count; Type: COMMENT; Schema: public; Owner: -
12837
--
12838

  
12839
COMMENT ON COLUMN view_full_occurrence_individual_view.individual_count IS 'http://individualCount__@DwC__@vegpath.org;
12840
"The number of individuals represented present at the time of the Occurrence"';
12841

  
12842

  
12843
--
12844
-- Name: COLUMN view_full_occurrence_individual_view.plantobservation_id; Type: COMMENT; Schema: public; Owner: -
12845
--
12846

  
12847
COMMENT ON COLUMN view_full_occurrence_individual_view.plantobservation_id IS 'http://plantobservation."_id__@VegBIEN__.public@vegpath.org;
12848
VegBIEN-autogenerated identifier for the individual';
12849

  
12850

  
12851
--
12852 12184
-- Name: voucher; Type: TABLE; Schema: public; Owner: -; Tablespace: 
12853 12185
--
12854 12186

  
......
13355 12687

  
13356 12688

  
13357 12689
--
13358
-- Name: _plots_20_tnrs_names; Type: VIEW; Schema: public_validations; Owner: -
13359
--
13360

  
13361
CREATE VIEW _plots_20_tnrs_names AS
13362
 SELECT taxonverbatim.taxonomicname AS verbatim_name_with_author,
13363
    taxonlabel.taxonomicname AS tnrs_input_name,
13364
    taxon_scrub."[scrubbed_]taxonomicStatus__@DwC__@vegpath.org" AS tnrs_taxonomic_status,
13365
    taxon_scrub."*Accepted_name_family" AS tnrs_accepted_name_family,
13366
    taxon_scrub."*Accepted_name" AS tnrs_accepted_name,
13367
    taxon_scrub."*Accepted_name_author" AS tnrs_accepted_name_author,
13368
    taxon_scrub."[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org" AS taxon_morphospecies
13369
   FROM ((public.taxonverbatim
13370
   JOIN public.taxonlabel USING (taxonlabel_id))
13371
   JOIN "TNRS".taxon_scrub ON ((taxon_scrub."*Name_submitted" = taxonlabel.taxonomicname)))
13372
  WHERE (taxonverbatim.source_id = ( SELECT public.source_by_shortname(("current_schema"())::text) AS source_by_shortname))
13373
  ORDER BY taxonlabel.taxonomicname;
13374

  
13375

  
13376
--
13377
-- Name: VIEW _plots_20_tnrs_names; Type: COMMENT; Schema: public_validations; Owner: -
13378
--
13379

  
13380
COMMENT ON VIEW _plots_20_tnrs_names IS '
13381
The first check is done while checking up on Aaron''s quantitative validations
13382
("comparing the results of the plot output queries run on VegBIEN to the data in
13383
VegBank"). Several input-output queries include verbatim taxon names; if they
13384
pass then Aaron is forming the verbatim name correctly. Even though it concerns
13385
the verbatim name and not the resolved name, this first check is important. If
13386
Aaron is messing up the verbatim name somehow, the resolved name will not be
13387
correct.
13388

  
13389
The second check should focus on determining if Aaron is reconstructing
13390
morphospecies names correctly. The TNRS stores the morphospecies part of the
13391
name (e.g., "sp.1") in the column "Unmatched_terms"; a bit of additional
13392
manipulation is required to concatenated it with the resolved part of the name
13393
to form the morphospecies string ("Miconia sp.1", "Carex ''fuzzy leaf''"). As I
13394
found out only recently, Aaron does NOT renormalize the resolved names back to
13395
the core database. He simple stores the verbatim TNRS output. Fully formed
13396
morphospecies names are therefore not stored anywhere in the database, but are
13397
reassembled on the fly when generating an analytical extract. Aaron''s rules for
13398
doing this are embedded in a script somewhere, I have no idea where. For Brian
13399
or Bob to assess if Aaron is re-concatenating morphospecies names correctly,
13400
they will need to request analytical extracts for one or two of their plots, and
13401
compare them to the names in their original databases. This second step
13402
shouldn''t take long. If the resolved morphospecies name in Aaron''s analytical
13403
extract looks correct, you''re done.
13404
';
13405

  
13406

  
13407
--
13408 12690
-- Name: _specimens_01_count_of_total_records_specimens_in_source_db; Type: VIEW; Schema: public_validations; Owner: -
13409 12691
--
13410 12692

  
......
18476 17758

  
18477 17759

  
18478 17760
--
18479
-- Name: taxonlabel_taxonomicname_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: 
18480
--
18481

  
18482
CREATE INDEX taxonlabel_taxonomicname_idx ON taxonlabel USING btree (taxonomicname) WHERE ((taxonomicname IS NOT NULL) AND "TNRS".taxon_name_is_safe(taxonomicname));
18483

  
18484

  
18485
--
18486 17761
-- Name: taxonlabel_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
18487 17762
--
18488 17763

  
......
20038 19313

  
20039 19314

  
20040 19315
--
19316
-- Name: 2014-11-16.Ana_Maria_Csergo.demography_and_habitat.private; Type: ACL; Schema: public; Owner: -
19317
--
19318

  
19319
REVOKE ALL ON TABLE "2014-11-16.Ana_Maria_Csergo.demography_and_habitat.private" FROM PUBLIC;
19320
REVOKE ALL ON TABLE "2014-11-16.Ana_Maria_Csergo.demography_and_habitat.private" FROM bien;
19321
GRANT ALL ON TABLE "2014-11-16.Ana_Maria_Csergo.demography_and_habitat.private" TO bien;
19322
GRANT SELECT ON TABLE "2014-11-16.Ana_Maria_Csergo.demography_and_habitat.private" TO bien_read;
19323

  
19324

  
19325
--
20041 19326
-- Name: 2014-3-11.Jeff_Ott.climatic_range_determinants; Type: ACL; Schema: public; Owner: -
20042 19327
--
20043 19328

  
......
20361 19646

  
20362 19647

  
20363 19648
--
20364
-- Name: iucn_red_list_view; Type: ACL; Schema: public; Owner: -
20365
--
20366

  
20367
REVOKE ALL ON TABLE iucn_red_list_view FROM PUBLIC;
20368
REVOKE ALL ON TABLE iucn_red_list_view FROM bien;
20369
GRANT ALL ON TABLE iucn_red_list_view TO bien;
20370
GRANT SELECT ON TABLE iucn_red_list_view TO bien_read;
20371

  
20372

  
20373
--
20374 19649
-- Name: location; Type: ACL; Schema: public; Owner: -
20375 19650
--
20376 19651

  
......
20734 20009

  
20735 20010

  
20736 20011
--
20737
-- Name: taxondetermination; Type: ACL; Schema: public; Owner: -
20738
--
20739

  
20740
REVOKE ALL ON TABLE taxondetermination FROM PUBLIC;
20741
REVOKE ALL ON TABLE taxondetermination FROM bien;
20742
GRANT ALL ON TABLE taxondetermination TO bien;
20743
GRANT SELECT ON TABLE taxondetermination TO bien_read;
20744

  
20745

  
20746
--
20747
-- Name: taxonverbatim; Type: ACL; Schema: public; Owner: -
20748
--
20749

  
20750
REVOKE ALL ON TABLE taxonverbatim FROM PUBLIC;
20751
REVOKE ALL ON TABLE taxonverbatim FROM bien;
20752
GRANT ALL ON TABLE taxonverbatim TO bien;
20753
GRANT SELECT ON TABLE taxonverbatim TO bien_read;
20754

  
20755

  
20756
--
20757
-- Name: trait; Type: ACL; Schema: public; Owner: -
20758
--
20759

  
20760
REVOKE ALL ON TABLE trait FROM PUBLIC;
20761
REVOKE ALL ON TABLE trait FROM bien;
20762
GRANT ALL ON TABLE trait TO bien;
20763
GRANT SELECT ON TABLE trait TO bien_read;
20764

  
20765

  
20766
--
20767
-- Name: taxon_trait_view; Type: ACL; Schema: public; Owner: -
20768
--
20769

  
20770
REVOKE ALL ON TABLE taxon_trait_view FROM PUBLIC;
20771
REVOKE ALL ON TABLE taxon_trait_view FROM bien;
20772
GRANT ALL ON TABLE taxon_trait_view TO bien;
20773
GRANT SELECT ON TABLE taxon_trait_view TO bien_read;
20774

  
20775

  
20776
--
20777 20012
-- Name: taxonalt; Type: ACL; Schema: public; Owner: -
20778 20013
--
20779 20014

  
......
20804 20039

  
20805 20040

  
20806 20041
--
20042
-- Name: taxondetermination; Type: ACL; Schema: public; Owner: -
20043
--
20044

  
20045
REVOKE ALL ON TABLE taxondetermination FROM PUBLIC;
20046
REVOKE ALL ON TABLE taxondetermination FROM bien;
20047
GRANT ALL ON TABLE taxondetermination TO bien;
20048
GRANT SELECT ON TABLE taxondetermination TO bien_read;
20049

  
20050

  
20051
--
20807 20052
-- Name: taxonlabel_relationship; Type: ACL; Schema: public; Owner: -
20808 20053
--
20809 20054

  
......
20834 20079

  
20835 20080

  
20836 20081
--
20082
-- Name: taxonverbatim; Type: ACL; Schema: public; Owner: -
20083
--
20084

  
20085
REVOKE ALL ON TABLE taxonverbatim FROM PUBLIC;
20086
REVOKE ALL ON TABLE taxonverbatim FROM bien;
20087
GRANT ALL ON TABLE taxonverbatim TO bien;
20088
GRANT SELECT ON TABLE taxonverbatim TO bien_read;
20089

  
20090

  
20091
--
20837 20092
-- Name: telephone; Type: ACL; Schema: public; Owner: -
20838 20093
--
20839 20094

  
......
20844 20099

  
20845 20100

  
20846 20101
--
20847
-- Name: tnrs_input_name; Type: ACL; Schema: public; Owner: -
20102
-- Name: trait; Type: ACL; Schema: public; Owner: -
20848 20103
--
20849 20104

  
20850
REVOKE ALL ON TABLE tnrs_input_name FROM PUBLIC;
20851
REVOKE ALL ON TABLE tnrs_input_name FROM bien;
20852
GRANT ALL ON TABLE tnrs_input_name TO bien;
20853
GRANT SELECT ON TABLE tnrs_input_name TO bien_read;
20105
REVOKE ALL ON TABLE trait FROM PUBLIC;
20106
REVOKE ALL ON TABLE trait FROM bien;
20107
GRANT ALL ON TABLE trait TO bien;
20108
GRANT SELECT ON TABLE trait TO bien_read;
20854 20109

  
20855 20110

  
20856 20111
--
......
20914 20169

  
20915 20170

  
20916 20171
--
20917
-- Name: view_full_occurrence_individual_view; Type: ACL; Schema: public; Owner: -
20918
--
20919

  
20920
REVOKE ALL ON TABLE view_full_occurrence_individual_view FROM PUBLIC;
20921
REVOKE ALL ON TABLE view_full_occurrence_individual_view FROM bien;
20922
GRANT ALL ON TABLE view_full_occurrence_individual_view TO bien;
20923
GRANT SELECT ON TABLE view_full_occurrence_individual_view TO bien_read;
20924

  
20925

  
20926
--
20927 20172
-- Name: voucher; Type: ACL; Schema: public; Owner: -
20928 20173
--
20929 20174

  

Also available in: Unified diff