Project

General

Profile

« Previous | Next » 

Revision 14279

inputs/.TNRS/schema.sql: taxon_match: put matched-taxon derived columns before accepted-taxon derived columns

View differences:

trunk/inputs/test_taxonomic_names/_scrub/TNRS.sql
125 125
CREATE FUNCTION taxon_match__fill() RETURNS trigger
126 126
    LANGUAGE plpgsql
127 127
    AS $$
128
DECLARE
129
	"Specific_epithet_is_plant" boolean :=
130
		(CASE
131
		WHEN   new."Infraspecific_epithet_matched"	 IS NOT NULL
132
			OR new."Infraspecific_epithet_2_matched" IS NOT NULL
133
			OR new."Specific_epithet_score" >= 0.9 -- fuzzy match
134
			THEN true
135
		ELSE NULL -- ambiguous
136
		END);
137
	never_homonym boolean = COALESCE(new."Author_score" >= 0.6, false);
138
		-- author disambiguates
139
	family_is_homonym boolean = NOT never_homonym
140
		AND "TNRS".family_is_homonym(new."Family_matched");
141
	genus_is_homonym  boolean = NOT never_homonym
142
		AND "TNRS".genus_is_homonym(new."Genus_matched");
143
	matched_taxon_name_with_author text = NULLIF(concat_ws(' '
144
		, NULLIF(NULLIF(new."Name_matched_accepted_family", 'Unknown'),
145
			new."Name_matched")
146
		, NULLIF(new."Name_matched", 'No suitable matches found.')
147
		, new."Name_matched_author"
148
		), '');
149
	accepted_taxon_name_with_author text = NULLIF(concat_ws(' '
150
		, NULLIF(NULLIF(new."Accepted_name_family", 'Unknown'),
151
			new."Accepted_name")
152
		, new."Accepted_name"
153
		, new."Accepted_name_author"
154
		), '');
155 128
BEGIN
156
	/* exclude homonyms because these are not valid matches (i.e. TNRS provides
157
	a name, but the name is not meaningful because it is not unambiguous). */
158
	new.is_valid_match = new."Taxonomic_status" != 'Invalid'
159
		AND COALESCE(CASE
160
		WHEN new."Family_score" = 1 AND NOT family_is_homonym -- exact match
161
			THEN true
162
		ELSE -- consider genus
129
	DECLARE
130
		"Specific_epithet_is_plant" boolean :=
163 131
			(CASE
164
			WHEN new."Genus_score" =  1	   -- exact match
165
				THEN
132
			WHEN   new."*Infraspecific_epithet_matched"	 IS NOT NULL
133
				OR new."*Infraspecific_epithet_2_matched" IS NOT NULL
134
				OR new."*Specific_epithet_score" >= 0.9 -- fuzzy match
135
				THEN true
136
			ELSE NULL -- ambiguous
137
			END);
138
		never_homonym boolean = COALESCE(new."*Author_score" >= 0.6, false);
139
			-- author disambiguates
140
		family_is_homonym boolean = NOT never_homonym
141
			AND "TNRS".family_is_homonym(new."*Family_matched");
142
		genus_is_homonym  boolean = NOT never_homonym
143
			AND "TNRS".genus_is_homonym(new."*Genus_matched");
144
	BEGIN
145
		/* exclude homonyms because these are not valid matches (TNRS provides a
146
		name, but the name is not meaningful because it is not unambiguous) */
147
		new.is_valid_match = new."*Taxonomic_status" != 'Invalid'
148
			AND COALESCE(CASE
149
			WHEN new."*Family_score" = 1 AND NOT family_is_homonym -- exact match
150
				THEN true
151
			ELSE -- consider genus
166 152
				(CASE
167
				WHEN NOT genus_is_homonym THEN true
168
				ELSE "Specific_epithet_is_plant"
153
				WHEN new."*Genus_score" =  1	   -- exact match
154
					THEN
155
					(CASE
156
					WHEN NOT genus_is_homonym THEN true
157
					ELSE "Specific_epithet_is_plant"
158
					END)
159
				WHEN new."*Genus_score" >= 0.85 -- fuzzy match
160
					THEN "Specific_epithet_is_plant"
161
				ELSE NULL -- ambiguous
169 162
				END)
170
			WHEN new."Genus_score" >= 0.85 -- fuzzy match
171
				THEN "Specific_epithet_is_plant"
172
			ELSE NULL -- ambiguous
173
			END)
174
		END, false);
175
	new.scrubbed_unique_taxon_name = COALESCE(
176
		accepted_taxon_name_with_author, matched_taxon_name_with_author);
163
			END, false);
164
	END;
177 165
	
166
	DECLARE
167
		matched_taxon_name_with_author text = NULLIF(concat_ws(' '
168
			, NULLIF(NULLIF(new."*Name_matched_accepted_family", 'Unknown'),
169
				new."*Name_matched")
170
			, NULLIF(new."*Name_matched", 'No suitable matches found.')
171
			, new."*Name_matched_author"
172
			), '');
173
		accepted_taxon_name_with_author text = NULLIF(concat_ws(' '
174
			, NULLIF(NULLIF(new."*Accepted_name_family", 'Unknown'),
175
				new."*Accepted_name")
176
			, new."*Accepted_name"
177
			, new."*Accepted_name_author"
178
			), '');
179
	BEGIN
180
		new.scrubbed_unique_taxon_name = COALESCE(
181
			accepted_taxon_name_with_author, matched_taxon_name_with_author);
182
	END;
183
	
178 184
	RETURN new;
179 185
END;
180 186
$$;
......
196 202

  
197 203

  
198 204
--
205
-- Name: taxon_match__fill_derived(); Type: FUNCTION; Schema: TNRS; Owner: bien
206
--
207

  
208
CREATE FUNCTION taxon_match__fill_derived() RETURNS trigger
209
    LANGUAGE plpgsql
210
    AS $$
211
BEGIN
212
	new."__accepted_{genus,specific_epithet}" = (SELECT
213
		regexp_split_to_array("*Accepted_name_species", ' '::text)
214
		FROM (SELECT new.*) new);
215
	
216
	new."[accepted_]genus__@DwC__@vegpath.org" = (SELECT
217
		"__accepted_{genus,specific_epithet}"[1]
218
		FROM (SELECT new.*) new);
219
	
220
	new."[accepted_]specificEpithet__@DwC__@vegpath.org" = (SELECT
221
		"__accepted_{genus,specific_epithet}"[2]
222
		FROM (SELECT new.*) new);
223
	
224
	new.__accepted_infraspecific_label = (SELECT
225
		ltrim(NULLIF(util.remove_prefix("*Accepted_name_species", "*Accepted_name", require := true), ''::text), ' '::text)
226
		FROM (SELECT new.*) new);
227
	
228
	new."__accepted_infraspecific_{rank,epithet}" = (SELECT
229
		regexp_split_to_array(__accepted_infraspecific_label, ' '::text)
230
		FROM (SELECT new.*) new);
231
	
232
	new."[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" = (SELECT
233
		"__accepted_infraspecific_{rank,epithet}"[1]
234
		FROM (SELECT new.*) new);
235
	
236
	new."[accepted_]infraspecificEpithet__@DwC__@vegpath.org" = (SELECT
237
		"__accepted_infraspecific_{rank,epithet}"[2]
238
		FROM (SELECT new.*) new);
239
	
240
	new."[matched_]scientificName[_with_author]__@DwC__@vegpath.org" = (SELECT
241
		"*Name_matched" || COALESCE((' '::text || "*Name_matched_author"), ''::text)
242
		FROM (SELECT new.*) new);
243
	
244
	new."[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" = (SELECT
245
		"*Accepted_name" || COALESCE((' '::text || "*Accepted_name_author"), ''::text)
246
		FROM (SELECT new.*) new);
247
	
248
	new.matched_has_accepted = (SELECT
249
		"*Accepted_name" IS NOT NULL
250
		FROM (SELECT new.*) new);
251
	
252
	new."[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT
253
		("*Genus_matched" || ' '::text) || "*Specific_epithet_matched"
254
		FROM (SELECT new.*) new);
255
	
256
	RETURN new;
257
END;
258
$$;
259

  
260

  
261
ALTER FUNCTION "TNRS".taxon_match__fill_derived() OWNER TO bien;
262

  
263
--
264
-- Name: FUNCTION taxon_match__fill_derived(); Type: COMMENT; Schema: TNRS; Owner: bien
265
--
266

  
267
COMMENT ON FUNCTION taxon_match__fill_derived() IS '
268
autogenerated, do not edit
269

  
270
to regenerate:
271
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
272
';
273

  
274

  
275
--
199 276
-- Name: taxon_match__match_num__fill(); Type: FUNCTION; Schema: TNRS; Owner: bien
200 277
--
201 278

  
......
280 357
CREATE TABLE taxon_match (
281 358
    batch text DEFAULT now() NOT NULL,
282 359
    match_num integer NOT NULL,
283
    "Name_number" integer NOT NULL,
284
    "Name_submitted" text NOT NULL,
285
    "Overall_score" double precision,
286
    "Name_matched" text,
287
    "Name_matched_rank" text,
288
    "Name_score" double precision,
289
    "Name_matched_author" text,
290
    "Name_matched_url" text,
291
    "Author_matched" text,
292
    "Author_score" double precision,
293
    "Family_matched" text,
294
    "Family_score" double precision,
295
    "Name_matched_accepted_family" text,
296
    "Genus_matched" text,
297
    "Genus_score" double precision,
298
    "Specific_epithet_matched" text,
299
    "Specific_epithet_score" double precision,
300
    "Infraspecific_rank" text,
301
    "Infraspecific_epithet_matched" text,
302
    "Infraspecific_epithet_score" double precision,
303
    "Infraspecific_rank_2" text,
304
    "Infraspecific_epithet_2_matched" text,
305
    "Infraspecific_epithet_2_score" double precision,
306
    "Annotations" text,
307
    "Unmatched_terms" text,
308
    "Taxonomic_status" text,
309
    "Accepted_name" text,
310
    "Accepted_name_author" text,
311
    "Accepted_name_rank" text,
312
    "Accepted_name_url" text,
313
    "Accepted_name_species" text,
314
    "Accepted_name_family" text,
315
    "Selected" text,
316
    "Source" text,
317
    "Warnings" text,
318
    "Accepted_name_lsid" text,
360
    "*Name_number" integer NOT NULL,
361
    "*Name_submitted" text NOT NULL,
362
    "*Overall_score" double precision,
363
    "*Name_matched" text,
364
    "*Name_matched_rank" text,
365
    "*Name_score" double precision,
366
    "*Name_matched_author" text,
367
    "*Name_matched_url" text,
368
    "*Author_matched" text,
369
    "*Author_score" double precision,
370
    "*Family_matched" text,
371
    "*Family_score" double precision,
372
    "*Name_matched_accepted_family" text,
373
    "*Genus_matched" text,
374
    "*Genus_score" double precision,
375
    "*Specific_epithet_matched" text,
376
    "*Specific_epithet_score" double precision,
377
    "*Infraspecific_rank" text,
378
    "*Infraspecific_epithet_matched" text,
379
    "*Infraspecific_epithet_score" double precision,
380
    "*Infraspecific_rank_2" text,
381
    "*Infraspecific_epithet_2_matched" text,
382
    "*Infraspecific_epithet_2_score" double precision,
383
    "*Annotations" text,
384
    "*Unmatched_terms" text,
385
    "*Taxonomic_status" text,
386
    "*Accepted_name" text,
387
    "*Accepted_name_author" text,
388
    "*Accepted_name_rank" text,
389
    "*Accepted_name_url" text,
390
    "*Accepted_name_species" text,
391
    "*Accepted_name_family" text,
392
    "*Selected" text,
393
    "*Source" text,
394
    "*Warnings" text,
395
    "*Accepted_name_lsid" text,
319 396
    is_valid_match boolean NOT NULL,
320
    scrubbed_unique_taxon_name text
397
    scrubbed_unique_taxon_name text,
398
    "[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org" text,
399
    "[matched_]scientificName[_with_author]__@DwC__@vegpath.org" text,
400
    matched_has_accepted boolean,
401
    "__accepted_{genus,specific_epithet}" text[],
402
    "[accepted_]genus__@DwC__@vegpath.org" text,
403
    "[accepted_]specificEpithet__@DwC__@vegpath.org" text,
404
    __accepted_infraspecific_label text,
405
    "__accepted_infraspecific_{rank,epithet}" text[],
406
    "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" text,
407
    "[accepted_]infraspecificEpithet__@DwC__@vegpath.org" text,
408
    "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" text,
409
    CONSTRAINT "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" CHECK ((NOT ("[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" IS DISTINCT FROM "__accepted_infraspecific_{rank,epithet}"[1]))),
410
    CONSTRAINT "[accepted_]genus__@DwC__@vegpath.org" CHECK ((NOT ("[accepted_]genus__@DwC__@vegpath.org" IS DISTINCT FROM "__accepted_{genus,specific_epithet}"[1]))),
411
    CONSTRAINT "[accepted_]infraspecificEpithet__@DwC__@vegpath.org" CHECK ((NOT ("[accepted_]infraspecificEpithet__@DwC__@vegpath.org" IS DISTINCT FROM "__accepted_infraspecific_{rank,epithet}"[2]))),
412
    CONSTRAINT "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" CHECK ((NOT ("[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" IS DISTINCT FROM ("*Accepted_name" || COALESCE((' '::text || "*Accepted_name_author"), ''::text))))),
413
    CONSTRAINT "[accepted_]specificEpithet__@DwC__@vegpath.org" CHECK ((NOT ("[accepted_]specificEpithet__@DwC__@vegpath.org" IS DISTINCT FROM "__accepted_{genus,specific_epithet}"[2]))),
414
    CONSTRAINT "[matched_]scientificName[_with_author]__@DwC__@vegpath.org" CHECK ((NOT ("[matched_]scientificName[_with_author]__@DwC__@vegpath.org" IS DISTINCT FROM ("*Name_matched" || COALESCE((' '::text || "*Name_matched_author"), ''::text))))),
415
    CONSTRAINT "[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org" CHECK ((NOT ("[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org" IS DISTINCT FROM (("*Genus_matched" || ' '::text) || "*Specific_epithet_matched")))),
416
    CONSTRAINT __accepted_infraspecific_label CHECK ((NOT (__accepted_infraspecific_label IS DISTINCT FROM ltrim(NULLIF(util.remove_prefix("*Accepted_name_species", "*Accepted_name", require := true), ''::text), ' '::text)))),
417
    CONSTRAINT "__accepted_infraspecific_{rank,epithet}" CHECK ((NOT ("__accepted_infraspecific_{rank,epithet}" IS DISTINCT FROM regexp_split_to_array(__accepted_infraspecific_label, ' '::text)))),
418
    CONSTRAINT "__accepted_{genus,specific_epithet}" CHECK ((NOT ("__accepted_{genus,specific_epithet}" IS DISTINCT FROM regexp_split_to_array("*Accepted_name_species", ' '::text)))),
419
    CONSTRAINT matched_has_accepted CHECK ((NOT (matched_has_accepted IS DISTINCT FROM ("*Accepted_name" IS NOT NULL))))
321 420
);
322 421

  
323 422

  
......
328 427
--
329 428

  
330 429
COMMENT ON TABLE taxon_match IS '
430
whenever columns are renamed:
431
SELECT util.derived_cols_sync(''"TNRS".taxon_match'');
432

  
331 433
to remove columns or add columns at the end:
332 434
$ rm=1 inputs/.TNRS/data.sql.run
333 435
$ make schemas/remake
......
341 443
ALTER TABLE "TNRS".taxon_match DISABLE TRIGGER taxon_match__fill; --speeds up update
342 444
UPDATE "TNRS".taxon_match SET "col" = value;
343 445
	-- runtime: 30 min ("5564201 rows affected, 1624829 ms execution time")
446
CLUSTER "TNRS".taxon_match; -- ensure rows are exported in sorted order
344 447
ALTER TABLE "TNRS".taxon_match ENABLE TRIGGER taxon_match__fill;
345 448
VACUUM ANALYZE "TNRS".taxon_match --remove previous rows; runtime: 1.5 min ("92633 ms")
346 449

  
......
349 452

  
350 453

  
351 454
--
455
-- Name: COLUMN taxon_match."[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org"; Type: COMMENT; Schema: TNRS; Owner: bien
456
--
457

  
458
COMMENT ON COLUMN taxon_match."[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org" IS '
459
derived column; = ("*Genus_matched" || '' ''::text) || "*Specific_epithet_matched"
460

  
461
to modify expr:
462
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org'')::util.col, $$"*Genus_matched" || '' ''::text || "*Specific_epithet_matched"$$)::util.derived_col_def);
463
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
464

  
465
to rename:
466
# rename column
467
# rename CHECK constraint
468
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
469
';
470

  
471

  
472
--
473
-- Name: COLUMN taxon_match."[matched_]scientificName[_with_author]__@DwC__@vegpath.org"; Type: COMMENT; Schema: TNRS; Owner: bien
474
--
475

  
476
COMMENT ON COLUMN taxon_match."[matched_]scientificName[_with_author]__@DwC__@vegpath.org" IS '
477
derived column; = "*Name_matched" || COALESCE(('' ''::text || "*Name_matched_author"), ''''::text)
478

  
479
to modify expr:
480
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[matched_]scientificName[_with_author]__@DwC__@vegpath.org'')::util.col, $$"*Name_matched" || COALESCE(('' ''::text || "*Name_matched_author"), ''''::text)$$)::util.derived_col_def);
481
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
482

  
483
to rename:
484
# rename column
485
# rename CHECK constraint
486
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
487
';
488

  
489

  
490
--
491
-- Name: COLUMN taxon_match.matched_has_accepted; Type: COMMENT; Schema: TNRS; Owner: bien
492
--
493

  
494
COMMENT ON COLUMN taxon_match.matched_has_accepted IS '
495
derived column; = "*Accepted_name" IS NOT NULL
496

  
497
to modify expr:
498
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''matched_has_accepted'')::util.col, $$"*Accepted_name" IS NOT NULL$$)::util.derived_col_def);
499
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
500

  
501
to rename:
502
# rename column
503
# rename CHECK constraint
504
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
505
';
506

  
507

  
508
--
509
-- Name: COLUMN taxon_match."__accepted_{genus,specific_epithet}"; Type: COMMENT; Schema: TNRS; Owner: bien
510
--
511

  
512
COMMENT ON COLUMN taxon_match."__accepted_{genus,specific_epithet}" IS '
513
derived column; = regexp_split_to_array("*Accepted_name_species", '' ''::text)
514

  
515
to modify expr:
516
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''__accepted_{genus,specific_epithet}'')::util.col, $$regexp_split_to_array("*Accepted_name_species", '' ''::text)$$)::util.derived_col_def);
517
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
518

  
519
to rename:
520
# rename column
521
# rename CHECK constraint
522
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
523
';
524

  
525

  
526
--
527
-- Name: COLUMN taxon_match."[accepted_]genus__@DwC__@vegpath.org"; Type: COMMENT; Schema: TNRS; Owner: bien
528
--
529

  
530
COMMENT ON COLUMN taxon_match."[accepted_]genus__@DwC__@vegpath.org" IS '
531
derived column; = "__accepted_{genus,specific_epithet}"[1]
532

  
533
to modify expr:
534
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[accepted_]genus__@DwC__@vegpath.org'')::util.col, $$"__accepted_{genus,specific_epithet}"[1]$$)::util.derived_col_def);
535
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
536

  
537
to rename:
538
# rename column
539
# rename CHECK constraint
540
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
541
';
542

  
543

  
544
--
545
-- Name: COLUMN taxon_match."[accepted_]specificEpithet__@DwC__@vegpath.org"; Type: COMMENT; Schema: TNRS; Owner: bien
546
--
547

  
548
COMMENT ON COLUMN taxon_match."[accepted_]specificEpithet__@DwC__@vegpath.org" IS '
549
derived column; = "__accepted_{genus,specific_epithet}"[2]
550

  
551
to modify expr:
552
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[accepted_]specificEpithet__@DwC__@vegpath.org'')::util.col, $$"__accepted_{genus,specific_epithet}"[2]$$)::util.derived_col_def);
553
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
554

  
555
to rename:
556
# rename column
557
# rename CHECK constraint
558
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
559
';
560

  
561

  
562
--
563
-- Name: COLUMN taxon_match.__accepted_infraspecific_label; Type: COMMENT; Schema: TNRS; Owner: bien
564
--
565

  
566
COMMENT ON COLUMN taxon_match.__accepted_infraspecific_label IS '
567
derived column; = ltrim(NULLIF(util.remove_prefix("*Accepted_name_species", "*Accepted_name", require := true), ''''::text), '' ''::text)
568

  
569
to modify expr:
570
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''__accepted_infraspecific_label'')::util.col, $$ltrim(NULLIF(util.remove_prefix("*Accepted_name_species", "*Accepted_name", require := true), ''''::text), '' ''::text)$$)::util.derived_col_def);
571
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
572

  
573
to rename:
574
# rename column
575
# rename CHECK constraint
576
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
577
';
578

  
579

  
580
--
581
-- Name: COLUMN taxon_match."__accepted_infraspecific_{rank,epithet}"; Type: COMMENT; Schema: TNRS; Owner: bien
582
--
583

  
584
COMMENT ON COLUMN taxon_match."__accepted_infraspecific_{rank,epithet}" IS '
585
derived column; = regexp_split_to_array(__accepted_infraspecific_label, '' ''::text)
586

  
587
to modify expr:
588
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''__accepted_infraspecific_{rank,epithet}'')::util.col, $$regexp_split_to_array(__accepted_infraspecific_label, '' ''::text)$$)::util.derived_col_def);
589
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
590

  
591
to rename:
592
# rename column
593
# rename CHECK constraint
594
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
595
';
596

  
597

  
598
--
599
-- Name: COLUMN taxon_match."[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org"; Type: COMMENT; Schema: TNRS; Owner: bien
600
--
601

  
602
COMMENT ON COLUMN taxon_match."[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" IS '
603
derived column; = "__accepted_infraspecific_{rank,epithet}"[1]
604

  
605
to modify expr:
606
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org'')::util.col, $$"__accepted_infraspecific_{rank,epithet}"[1]$$)::util.derived_col_def);
607
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
608

  
609
to rename:
610
# rename column
611
# rename CHECK constraint
612
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
613
';
614

  
615

  
616
--
617
-- Name: COLUMN taxon_match."[accepted_]infraspecificEpithet__@DwC__@vegpath.org"; Type: COMMENT; Schema: TNRS; Owner: bien
618
--
619

  
620
COMMENT ON COLUMN taxon_match."[accepted_]infraspecificEpithet__@DwC__@vegpath.org" IS '
621
derived column; = "__accepted_infraspecific_{rank,epithet}"[2]
622

  
623
to modify expr:
624
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[accepted_]infraspecificEpithet__@DwC__@vegpath.org'')::util.col, $$"__accepted_infraspecific_{rank,epithet}"[2]$$)::util.derived_col_def);
625
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
626

  
627
to rename:
628
# rename column
629
# rename CHECK constraint
630
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
631
';
632

  
633

  
634
--
635
-- Name: COLUMN taxon_match."[accepted_]scientificName[_with_author]__@DwC__@vegpath.org"; Type: COMMENT; Schema: TNRS; Owner: bien
636
--
637

  
638
COMMENT ON COLUMN taxon_match."[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" IS '
639
derived column; = "*Accepted_name" || COALESCE(('' ''::text || "*Accepted_name_author"), ''''::text)
640

  
641
to modify expr:
642
SELECT util.derived_col_update(((''"TNRS".taxon_match'', ''[accepted_]scientificName[_with_author]__@DwC__@vegpath.org'')::util.col, $$"*Accepted_name" || COALESCE(('' ''::text || "*Accepted_name_author"), ''''::text)$$)::util.derived_col_def);
643
SELECT util.derived_cols_populate(''"TNRS".taxon_match''::regclass);
644

  
645
to rename:
646
# rename column
647
# rename CHECK constraint
648
SELECT util.derived_cols_update(''"TNRS".taxon_match''::regclass);
649
';
650

  
651

  
652
--
653
-- Name: taxon_best_match; Type: VIEW; Schema: TNRS; Owner: bien
654
--
655

  
656
CREATE VIEW taxon_best_match AS
657
 SELECT taxon_match.batch,
658
    taxon_match.match_num,
659
    taxon_match."*Name_number",
660
    taxon_match."*Name_submitted",
661
    taxon_match."*Overall_score",
662
    taxon_match."*Name_matched",
663
    taxon_match."*Name_matched_rank",
664
    taxon_match."*Name_score",
665
    taxon_match."*Name_matched_author",
666
    taxon_match."*Name_matched_url",
667
    taxon_match."*Author_matched",
668
    taxon_match."*Author_score",
669
    taxon_match."*Family_matched",
670
    taxon_match."*Family_score",
671
    taxon_match."*Name_matched_accepted_family",
672
    taxon_match."*Genus_matched",
673
    taxon_match."*Genus_score",
674
    taxon_match."*Specific_epithet_matched",
675
    taxon_match."*Specific_epithet_score",
676
    taxon_match."*Infraspecific_rank",
677
    taxon_match."*Infraspecific_epithet_matched",
678
    taxon_match."*Infraspecific_epithet_score",
679
    taxon_match."*Infraspecific_rank_2",
680
    taxon_match."*Infraspecific_epithet_2_matched",
681
    taxon_match."*Infraspecific_epithet_2_score",
682
    taxon_match."*Annotations",
683
    taxon_match."*Unmatched_terms",
684
    taxon_match."*Taxonomic_status",
685
    taxon_match."*Accepted_name",
686
    taxon_match."*Accepted_name_author",
687
    taxon_match."*Accepted_name_rank",
688
    taxon_match."*Accepted_name_url",
689
    taxon_match."*Accepted_name_species",
690
    taxon_match."*Accepted_name_family",
691
    taxon_match."*Selected",
692
    taxon_match."*Source",
693
    taxon_match."*Warnings",
694
    taxon_match."*Accepted_name_lsid",
695
    taxon_match.is_valid_match,
696
    taxon_match.scrubbed_unique_taxon_name,
697
    taxon_match."__accepted_{genus,specific_epithet}",
698
    taxon_match."[accepted_]genus__@DwC__@vegpath.org",
699
    taxon_match."[accepted_]specificEpithet__@DwC__@vegpath.org",
700
    taxon_match.__accepted_infraspecific_label,
701
    taxon_match."__accepted_infraspecific_{rank,epithet}",
702
    taxon_match."[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org",
703
    taxon_match."[accepted_]infraspecificEpithet__@DwC__@vegpath.org",
704
    taxon_match."[matched_]scientificName[_with_author]__@DwC__@vegpath.org",
705
    taxon_match."[accepted_]scientificName[_with_author]__@DwC__@vegpath.org"
706
   FROM taxon_match
707
  WHERE (taxon_match."*Selected" = 'true'::text);
708

  
709

  
710
ALTER TABLE "TNRS".taxon_best_match OWNER TO bien;
711

  
712
--
713
-- Name: VIEW taxon_best_match; Type: COMMENT; Schema: TNRS; Owner: bien
714
--
715

  
716
COMMENT ON VIEW taxon_best_match IS '
717
to modify:
718
SELECT util.recreate_view(''"TNRS"."taxon_best_match"'', $$
719
SELECT __
720
$$);
721
';
722

  
723

  
724
--
352 725
-- Name: MatchedTaxon; Type: VIEW; Schema: TNRS; Owner: bien
353 726
--
354 727

  
355 728
CREATE VIEW "MatchedTaxon" AS
356
 SELECT s."*Name_matched.batch",
357
    s."concatenatedScientificName",
358
    s."matchedTaxonName",
359
    s."matchedTaxonRank",
360
    s."*Name_matched.Name_score",
361
    s."matchedScientificNameAuthorship",
362
    s."matchedScientificNameID",
363
    s."*Name_matched.Author_score",
364
    s."matchedFamilyConfidence_fraction",
365
    s."matchedFamily",
366
    s."matchedGenus",
367
    s."matchedGenusConfidence_fraction",
368
    s."matchedSpecificEpithet",
369
    s."matchedSpeciesConfidence_fraction",
370
    s."matchedInfraspecificEpithet",
371
    s."*Name_matched.Infraspecific_epithet_score",
372
    s."identificationQualifier",
373
    s."morphospeciesSuffix",
374
    s."taxonomicStatus",
375
    s.accepted_taxon_name_no_author,
376
    s.accepted_author,
377
    s.accepted_taxon_rank,
378
    s."acceptedScientificNameID",
379
    s.accepted_species_binomial,
380
    s.accepted_family,
381
    s."*Name_matched.Selected",
382
    s."*Name_matched.Source",
383
    s."*Name_matched.Warnings",
384
    s."*Name_matched.Accepted_name_lsid",
385
    s.taxon_scrub__is_valid_match,
386
    s.scrubbed_unique_taxon_name,
729
 SELECT taxon_best_match.batch,
730
    taxon_best_match.match_num,
731
    taxon_best_match."*Name_number",
732
    taxon_best_match."*Name_submitted",
733
    taxon_best_match."*Overall_score",
734
    taxon_best_match."*Name_matched",
735
    taxon_best_match."*Name_matched_rank",
736
    taxon_best_match."*Name_score",
737
    taxon_best_match."*Name_matched_author",
738
    taxon_best_match."*Name_matched_url",
739
    taxon_best_match."*Author_matched",
740
    taxon_best_match."*Author_score",
741
    taxon_best_match."*Family_matched",
742
    taxon_best_match."*Family_score",
743
    taxon_best_match."*Name_matched_accepted_family",
744
    taxon_best_match."*Genus_matched",
745
    taxon_best_match."*Genus_score",
746
    taxon_best_match."*Specific_epithet_matched",
747
    taxon_best_match."*Specific_epithet_score",
748
    taxon_best_match."*Infraspecific_rank",
749
    taxon_best_match."*Infraspecific_epithet_matched",
750
    taxon_best_match."*Infraspecific_epithet_score",
751
    taxon_best_match."*Infraspecific_rank_2",
752
    taxon_best_match."*Infraspecific_epithet_2_matched",
753
    taxon_best_match."*Infraspecific_epithet_2_score",
754
    taxon_best_match."*Annotations",
755
    taxon_best_match."*Unmatched_terms",
756
    taxon_best_match."*Taxonomic_status",
757
    taxon_best_match."*Accepted_name",
758
    taxon_best_match."*Accepted_name_author",
759
    taxon_best_match."*Accepted_name_rank",
760
    taxon_best_match."*Accepted_name_url",
761
    taxon_best_match."*Accepted_name_species",
762
    taxon_best_match."*Accepted_name_family",
763
    taxon_best_match."*Selected",
764
    taxon_best_match."*Source",
765
    taxon_best_match."*Warnings",
766
    taxon_best_match."*Accepted_name_lsid",
767
    taxon_best_match.is_valid_match,
768
    taxon_best_match.scrubbed_unique_taxon_name,
769
    taxon_best_match."__accepted_{genus,specific_epithet}",
770
    taxon_best_match."[accepted_]genus__@DwC__@vegpath.org",
771
    taxon_best_match."[accepted_]specificEpithet__@DwC__@vegpath.org",
772
    taxon_best_match.__accepted_infraspecific_label,
773
    taxon_best_match."__accepted_infraspecific_{rank,epithet}",
774
    taxon_best_match."[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org",
775
    taxon_best_match."[accepted_]infraspecificEpithet__@DwC__@vegpath.org",
776
    taxon_best_match."[matched_]scientificName[_with_author]__@DwC__@vegpath.org",
777
    taxon_best_match."[accepted_]scientificName[_with_author]__@DwC__@vegpath.org",
778
    map_taxonomic_status(taxon_best_match."*Taxonomic_status", taxon_best_match."*Accepted_name") AS "taxonomicStatus",
387 779
        CASE
388
            WHEN (s.accepted_taxon_rank = 'family'::text) THEN concat_ws(' '::text, s.accepted_family, s."morphospeciesSuffix")
389
            WHEN (s.accepted_taxon_rank = 'genus'::text) THEN concat_ws(' '::text, s.accepted_taxon_name_no_author, s."morphospeciesSuffix")
390
            ELSE s.accepted_species_binomial
780
            WHEN (taxon_best_match."*Accepted_name_rank" = 'family'::text) THEN concat_ws(' '::text, taxon_best_match."*Accepted_name_family", taxon_best_match."*Unmatched_terms")
781
            WHEN (taxon_best_match."*Accepted_name_rank" = 'genus'::text) THEN concat_ws(' '::text, taxon_best_match."*Accepted_name", taxon_best_match."*Unmatched_terms")
782
            ELSE taxon_best_match."*Accepted_name_species"
391 783
        END AS accepted_morphospecies_binomial
392
   FROM ( SELECT taxon_match.batch AS "*Name_matched.batch",
393
            taxon_match."Name_submitted" AS "concatenatedScientificName",
394
            taxon_match."Name_matched" AS "matchedTaxonName",
395
            taxon_match."Name_matched_rank" AS "matchedTaxonRank",
396
            taxon_match."Name_score" AS "*Name_matched.Name_score",
397
            taxon_match."Name_matched_author" AS "matchedScientificNameAuthorship",
398
            taxon_match."Name_matched_url" AS "matchedScientificNameID",
399
            taxon_match."Author_score" AS "*Name_matched.Author_score",
400
            taxon_match."Family_score" AS "matchedFamilyConfidence_fraction",
401
            COALESCE(taxon_match."Name_matched_accepted_family", taxon_match."Accepted_name_family") AS "matchedFamily",
402
            taxon_match."Genus_matched" AS "matchedGenus",
403
            taxon_match."Genus_score" AS "matchedGenusConfidence_fraction",
404
            taxon_match."Specific_epithet_matched" AS "matchedSpecificEpithet",
405
            taxon_match."Specific_epithet_score" AS "matchedSpeciesConfidence_fraction",
406
            taxon_match."Infraspecific_epithet_matched" AS "matchedInfraspecificEpithet",
407
            taxon_match."Infraspecific_epithet_score" AS "*Name_matched.Infraspecific_epithet_score",
408
            taxon_match."Annotations" AS "identificationQualifier",
409
            taxon_match."Unmatched_terms" AS "morphospeciesSuffix",
410
            map_taxonomic_status(taxon_match."Taxonomic_status", taxon_match."Accepted_name") AS "taxonomicStatus",
411
            taxon_match."Accepted_name" AS accepted_taxon_name_no_author,
412
            taxon_match."Accepted_name_author" AS accepted_author,
413
            taxon_match."Accepted_name_rank" AS accepted_taxon_rank,
414
            taxon_match."Accepted_name_url" AS "acceptedScientificNameID",
415
            taxon_match."Accepted_name_species" AS accepted_species_binomial,
416
            taxon_match."Accepted_name_family" AS accepted_family,
417
            taxon_match."Selected" AS "*Name_matched.Selected",
418
            taxon_match."Source" AS "*Name_matched.Source",
419
            taxon_match."Warnings" AS "*Name_matched.Warnings",
420
            taxon_match."Accepted_name_lsid" AS "*Name_matched.Accepted_name_lsid",
421
            taxon_match.is_valid_match AS taxon_scrub__is_valid_match,
422
            taxon_match.scrubbed_unique_taxon_name
423
           FROM taxon_match) s;
784
   FROM taxon_best_match;
424 785

  
425 786

  
426 787
ALTER TABLE "TNRS"."MatchedTaxon" OWNER TO bien;
......
444 805
CREATE TABLE "Source" (
445 806
    "*row_num" integer NOT NULL,
446 807
    "sourceType" text DEFAULT 'aggregator'::text NOT NULL,
447
    "datasetURL" text DEFAULT 'http://tnrs.iplantcollaborative.org/TNRSapp.html'::text NOT NULL,
808
    "datasetURL" text DEFAULT 'http://[TNRS_dev_server].iplantcollaborative.org/TNRSapp.html'::text NOT NULL,
448 809
    CONSTRAINT nulls_mapped CHECK (true)
449 810
);
450 811

  
......
474 835
--
475 836

  
476 837
CREATE VIEW "ValidMatchedTaxon" AS
477
 SELECT "MatchedTaxon"."*Name_matched.batch",
478
    "MatchedTaxon"."concatenatedScientificName",
479
    "MatchedTaxon"."matchedTaxonName",
480
    "MatchedTaxon"."matchedTaxonRank",
481
    "MatchedTaxon"."*Name_matched.Name_score",
482
    "MatchedTaxon"."matchedScientificNameAuthorship",
483
    "MatchedTaxon"."matchedScientificNameID",
484
    "MatchedTaxon"."*Name_matched.Author_score",
485
    "MatchedTaxon"."matchedFamilyConfidence_fraction",
486
    "MatchedTaxon"."matchedFamily",
487
    "MatchedTaxon"."matchedGenus",
488
    "MatchedTaxon"."matchedGenusConfidence_fraction",
489
    "MatchedTaxon"."matchedSpecificEpithet",
490
    "MatchedTaxon"."matchedSpeciesConfidence_fraction",
491
    "MatchedTaxon"."matchedInfraspecificEpithet",
492
    "MatchedTaxon"."*Name_matched.Infraspecific_epithet_score",
493
    "MatchedTaxon"."identificationQualifier",
494
    "MatchedTaxon"."morphospeciesSuffix",
838
 SELECT "MatchedTaxon".batch,
839
    "MatchedTaxon".match_num,
840
    "MatchedTaxon"."*Name_number",
841
    "MatchedTaxon"."*Name_submitted",
842
    "MatchedTaxon"."*Overall_score",
843
    "MatchedTaxon"."*Name_matched",
844
    "MatchedTaxon"."*Name_matched_rank",
845
    "MatchedTaxon"."*Name_score",
846
    "MatchedTaxon"."*Name_matched_author",
847
    "MatchedTaxon"."*Name_matched_url",
848
    "MatchedTaxon"."*Author_matched",
849
    "MatchedTaxon"."*Author_score",
850
    "MatchedTaxon"."*Family_matched",
851
    "MatchedTaxon"."*Family_score",
852
    "MatchedTaxon"."*Name_matched_accepted_family",
853
    "MatchedTaxon"."*Genus_matched",
854
    "MatchedTaxon"."*Genus_score",
855
    "MatchedTaxon"."*Specific_epithet_matched",
856
    "MatchedTaxon"."*Specific_epithet_score",
857
    "MatchedTaxon"."*Infraspecific_rank",
858
    "MatchedTaxon"."*Infraspecific_epithet_matched",
859
    "MatchedTaxon"."*Infraspecific_epithet_score",
860
    "MatchedTaxon"."*Infraspecific_rank_2",
861
    "MatchedTaxon"."*Infraspecific_epithet_2_matched",
862
    "MatchedTaxon"."*Infraspecific_epithet_2_score",
863
    "MatchedTaxon"."*Annotations",
864
    "MatchedTaxon"."*Unmatched_terms",
865
    "MatchedTaxon"."*Taxonomic_status",
866
    "MatchedTaxon"."*Accepted_name",
867
    "MatchedTaxon"."*Accepted_name_author",
868
    "MatchedTaxon"."*Accepted_name_rank",
869
    "MatchedTaxon"."*Accepted_name_url",
870
    "MatchedTaxon"."*Accepted_name_species",
871
    "MatchedTaxon"."*Accepted_name_family",
872
    "MatchedTaxon"."*Selected",
873
    "MatchedTaxon"."*Source",
874
    "MatchedTaxon"."*Warnings",
875
    "MatchedTaxon"."*Accepted_name_lsid",
876
    "MatchedTaxon".is_valid_match,
877
    "MatchedTaxon".scrubbed_unique_taxon_name,
878
    "MatchedTaxon"."__accepted_{genus,specific_epithet}",
879
    "MatchedTaxon"."[accepted_]genus__@DwC__@vegpath.org",
880
    "MatchedTaxon"."[accepted_]specificEpithet__@DwC__@vegpath.org",
881
    "MatchedTaxon".__accepted_infraspecific_label,
882
    "MatchedTaxon"."__accepted_infraspecific_{rank,epithet}",
883
    "MatchedTaxon"."[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org",
884
    "MatchedTaxon"."[accepted_]infraspecificEpithet__@DwC__@vegpath.org",
885
    "MatchedTaxon"."[matched_]scientificName[_with_author]__@DwC__@vegpath.org",
886
    "MatchedTaxon"."[accepted_]scientificName[_with_author]__@DwC__@vegpath.org",
495 887
    "MatchedTaxon"."taxonomicStatus",
496
    "MatchedTaxon".accepted_taxon_name_no_author,
497
    "MatchedTaxon".accepted_author,
498
    "MatchedTaxon".accepted_taxon_rank,
499
    "MatchedTaxon"."acceptedScientificNameID",
500
    "MatchedTaxon".accepted_species_binomial,
501
    "MatchedTaxon".accepted_family,
502
    "MatchedTaxon"."*Name_matched.Selected",
503
    "MatchedTaxon"."*Name_matched.Source",
504
    "MatchedTaxon"."*Name_matched.Warnings",
505
    "MatchedTaxon"."*Name_matched.Accepted_name_lsid",
506
    "MatchedTaxon".taxon_scrub__is_valid_match,
507
    "MatchedTaxon".scrubbed_unique_taxon_name,
508 888
    "MatchedTaxon".accepted_morphospecies_binomial
509 889
   FROM "MatchedTaxon"
510
  WHERE "MatchedTaxon".taxon_scrub__is_valid_match;
890
  WHERE "MatchedTaxon".is_valid_match;
511 891

  
512 892

  
513 893
ALTER TABLE "TNRS"."ValidMatchedTaxon" OWNER TO bien;
......
623 1003
--
624 1004

  
625 1005
CREATE VIEW taxon_match_input AS
626
 SELECT taxon_match."Name_number",
627
    taxon_match."Name_submitted",
628
    taxon_match."Overall_score",
629
    taxon_match."Name_matched",
630
    taxon_match."Name_matched_rank",
631
    taxon_match."Name_score",
632
    taxon_match."Name_matched_author",
633
    taxon_match."Name_matched_url",
634
    taxon_match."Author_matched",
635
    taxon_match."Author_score",
636
    taxon_match."Family_matched",
637
    taxon_match."Family_score",
638
    taxon_match."Name_matched_accepted_family",
639
    taxon_match."Genus_matched",
640
    taxon_match."Genus_score",
641
    taxon_match."Specific_epithet_matched",
642
    taxon_match."Specific_epithet_score",
643
    taxon_match."Infraspecific_rank",
644
    taxon_match."Infraspecific_epithet_matched",
645
    taxon_match."Infraspecific_epithet_score",
646
    taxon_match."Infraspecific_rank_2",
647
    taxon_match."Infraspecific_epithet_2_matched",
648
    taxon_match."Infraspecific_epithet_2_score",
649
    taxon_match."Annotations",
650
    taxon_match."Unmatched_terms",
651
    taxon_match."Taxonomic_status",
652
    taxon_match."Accepted_name",
653
    taxon_match."Accepted_name_author",
654
    taxon_match."Accepted_name_rank",
655
    taxon_match."Accepted_name_url",
656
    taxon_match."Accepted_name_species",
657
    taxon_match."Accepted_name_family",
658
    taxon_match."Selected",
659
    taxon_match."Source",
660
    taxon_match."Warnings",
661
    taxon_match."Accepted_name_lsid"
1006
 SELECT taxon_match."*Name_number" AS "Name_number",
1007
    taxon_match."*Name_submitted" AS "Name_submitted",
1008
    taxon_match."*Overall_score" AS "Overall_score",
1009
    taxon_match."*Name_matched" AS "Name_matched",
1010
    taxon_match."*Name_matched_rank" AS "Name_matched_rank",
1011
    taxon_match."*Name_score" AS "Name_score",
1012
    taxon_match."*Name_matched_author" AS "Name_matched_author",
1013
    taxon_match."*Name_matched_url" AS "Name_matched_url",
1014
    taxon_match."*Author_matched" AS "Author_matched",
1015
    taxon_match."*Author_score" AS "Author_score",
1016
    taxon_match."*Family_matched" AS "Family_matched",
1017
    taxon_match."*Family_score" AS "Family_score",
1018
    taxon_match."*Name_matched_accepted_family" AS "Name_matched_accepted_family",
1019
    taxon_match."*Genus_matched" AS "Genus_matched",
1020
    taxon_match."*Genus_score" AS "Genus_score",
1021
    taxon_match."*Specific_epithet_matched" AS "Specific_epithet_matched",
1022
    taxon_match."*Specific_epithet_score" AS "Specific_epithet_score",
1023
    taxon_match."*Infraspecific_rank" AS "Infraspecific_rank",
1024
    taxon_match."*Infraspecific_epithet_matched" AS "Infraspecific_epithet_matched",
1025
    taxon_match."*Infraspecific_epithet_score" AS "Infraspecific_epithet_score",
1026
    taxon_match."*Infraspecific_rank_2" AS "Infraspecific_rank_2",
1027
    taxon_match."*Infraspecific_epithet_2_matched" AS "Infraspecific_epithet_2_matched",
1028
    taxon_match."*Infraspecific_epithet_2_score" AS "Infraspecific_epithet_2_score",
1029
    taxon_match."*Annotations" AS "Annotations",
1030
    taxon_match."*Unmatched_terms" AS "Unmatched_terms",
1031
    taxon_match."*Taxonomic_status" AS "Taxonomic_status",
1032
    taxon_match."*Accepted_name" AS "Accepted_name",
1033
    taxon_match."*Accepted_name_author" AS "Accepted_name_author",
1034
    taxon_match."*Accepted_name_rank" AS "Accepted_name_rank",
1035
    taxon_match."*Accepted_name_url" AS "Accepted_name_url",
1036
    taxon_match."*Accepted_name_species" AS "Accepted_name_species",
1037
    taxon_match."*Accepted_name_family" AS "Accepted_name_family",
1038
    taxon_match."*Selected" AS "Selected",
1039
    taxon_match."*Source" AS "Source",
1040
    taxon_match."*Warnings" AS "Warnings",
1041
    taxon_match."*Accepted_name_lsid" AS "Accepted_name_lsid"
662 1042
   FROM taxon_match;
663 1043

  
664 1044

  
......
715 1095
--
716 1096

  
717 1097
CREATE VIEW "taxon_scrub.scrubbed_unique_taxon_name.*" AS
718
 SELECT taxon_match."Name_submitted" AS scrubbed_unique_taxon_name,
719
    taxon_match."Name_matched_rank" AS scrubbed_taxon_rank,
720
    COALESCE(taxon_match."Name_matched_accepted_family", taxon_match."Family_matched") AS scrubbed_family,
721
    taxon_match."Genus_matched" AS scrubbed_genus,
722
    taxon_match."Specific_epithet_matched" AS scrubbed_specific_epithet,
723
    taxon_match."Infraspecific_rank" AS scrubbed_infraspecific_rank,
724
    taxon_match."Infraspecific_epithet_matched" AS scrubbed_infraspecific_epithet,
725
    taxon_match."Name_matched_author" AS scrubbed_author,
726
    taxon_match."Name_matched" AS scrubbed_taxon_name_no_author,
727
    (taxon_match."Name_matched" || COALESCE((' '::text || taxon_match."Name_matched_author"), ''::text)) AS scrubbed_taxon_name_with_author
1098
 SELECT taxon_match."*Name_submitted" AS scrubbed_unique_taxon_name,
1099
    taxon_match."*Name_matched_rank" AS scrubbed_taxon_rank,
1100
    COALESCE(taxon_match."*Name_matched_accepted_family", taxon_match."*Family_matched") AS scrubbed_family,
1101
    taxon_match."*Genus_matched" AS scrubbed_genus,
1102
    taxon_match."*Specific_epithet_matched" AS scrubbed_specific_epithet,
1103
    taxon_match."*Infraspecific_rank" AS scrubbed_infraspecific_rank,
1104
    taxon_match."*Infraspecific_epithet_matched" AS scrubbed_infraspecific_epithet,
1105
    taxon_match."*Name_matched_author" AS scrubbed_author,
1106
    taxon_match."*Name_matched" AS scrubbed_taxon_name_no_author,
1107
    (taxon_match."*Name_matched" || COALESCE((' '::text || taxon_match."*Name_matched_author"), ''::text)) AS scrubbed_taxon_name_with_author
728 1108
   FROM taxon_match;
729 1109

  
730 1110

  
......
750 1130

  
751 1131
CREATE VIEW taxon_scrub AS
752 1132
 SELECT "ValidMatchedTaxon".scrubbed_unique_taxon_name,
753
    "ValidMatchedTaxon"."*Name_matched.batch",
754
    "ValidMatchedTaxon"."concatenatedScientificName",
755
    "ValidMatchedTaxon"."matchedTaxonName",
756
    "ValidMatchedTaxon"."matchedTaxonRank",
757
    "ValidMatchedTaxon"."*Name_matched.Name_score",
758
    "ValidMatchedTaxon"."matchedScientificNameAuthorship",
759
    "ValidMatchedTaxon"."matchedScientificNameID",
760
    "ValidMatchedTaxon"."*Name_matched.Author_score",
761
    "ValidMatchedTaxon"."matchedFamilyConfidence_fraction",
762
    "ValidMatchedTaxon"."matchedFamily",
763
    "ValidMatchedTaxon"."matchedGenus",
764
    "ValidMatchedTaxon"."matchedGenusConfidence_fraction",
765
    "ValidMatchedTaxon"."matchedSpecificEpithet",
766
    "ValidMatchedTaxon"."matchedSpeciesConfidence_fraction",
767
    "ValidMatchedTaxon"."matchedInfraspecificEpithet",
768
    "ValidMatchedTaxon"."*Name_matched.Infraspecific_epithet_score",
769
    "ValidMatchedTaxon"."identificationQualifier",
770
    "ValidMatchedTaxon"."morphospeciesSuffix",
1133
    "ValidMatchedTaxon".batch,
1134
    "ValidMatchedTaxon".match_num,
1135
    "ValidMatchedTaxon"."*Name_number",
1136
    "ValidMatchedTaxon"."*Name_submitted",
1137
    "ValidMatchedTaxon"."*Overall_score",
1138
    "ValidMatchedTaxon"."*Name_matched",
1139
    "ValidMatchedTaxon"."*Name_matched_rank",
1140
    "ValidMatchedTaxon"."*Name_score",
1141
    "ValidMatchedTaxon"."*Name_matched_author",
1142
    "ValidMatchedTaxon"."*Name_matched_url",
1143
    "ValidMatchedTaxon"."*Author_matched",
1144
    "ValidMatchedTaxon"."*Author_score",
1145
    "ValidMatchedTaxon"."*Family_matched",
1146
    "ValidMatchedTaxon"."*Family_score",
1147
    "ValidMatchedTaxon"."*Name_matched_accepted_family",
1148
    "ValidMatchedTaxon"."*Genus_matched",
1149
    "ValidMatchedTaxon"."*Genus_score",
1150
    "ValidMatchedTaxon"."*Specific_epithet_matched",
1151
    "ValidMatchedTaxon"."*Specific_epithet_score",
1152
    "ValidMatchedTaxon"."*Infraspecific_rank",
1153
    "ValidMatchedTaxon"."*Infraspecific_epithet_matched",
1154
    "ValidMatchedTaxon"."*Infraspecific_epithet_score",
1155
    "ValidMatchedTaxon"."*Infraspecific_rank_2",
1156
    "ValidMatchedTaxon"."*Infraspecific_epithet_2_matched",
1157
    "ValidMatchedTaxon"."*Infraspecific_epithet_2_score",
1158
    "ValidMatchedTaxon"."*Annotations",
1159
    "ValidMatchedTaxon"."*Unmatched_terms",
1160
    "ValidMatchedTaxon"."*Taxonomic_status",
1161
    "ValidMatchedTaxon"."*Accepted_name",
1162
    "ValidMatchedTaxon"."*Accepted_name_author",
1163
    "ValidMatchedTaxon"."*Accepted_name_rank",
1164
    "ValidMatchedTaxon"."*Accepted_name_url",
1165
    "ValidMatchedTaxon"."*Accepted_name_species",
1166
    "ValidMatchedTaxon"."*Accepted_name_family",
1167
    "ValidMatchedTaxon"."*Selected",
1168
    "ValidMatchedTaxon"."*Source",
1169
    "ValidMatchedTaxon"."*Warnings",
1170
    "ValidMatchedTaxon"."*Accepted_name_lsid",
1171
    "ValidMatchedTaxon".is_valid_match,
1172
    "ValidMatchedTaxon"."__accepted_{genus,specific_epithet}",
1173
    "ValidMatchedTaxon"."[accepted_]genus__@DwC__@vegpath.org",
1174
    "ValidMatchedTaxon"."[accepted_]specificEpithet__@DwC__@vegpath.org",
1175
    "ValidMatchedTaxon".__accepted_infraspecific_label,
1176
    "ValidMatchedTaxon"."__accepted_infraspecific_{rank,epithet}",
1177
    "ValidMatchedTaxon"."[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org",
1178
    "ValidMatchedTaxon"."[accepted_]infraspecificEpithet__@DwC__@vegpath.org",
1179
    "ValidMatchedTaxon"."[matched_]scientificName[_with_author]__@DwC__@vegpath.org",
1180
    "ValidMatchedTaxon"."[accepted_]scientificName[_with_author]__@DwC__@vegpath.org",
771 1181
    "ValidMatchedTaxon"."taxonomicStatus",
772
    "ValidMatchedTaxon".accepted_taxon_name_no_author,
773
    "ValidMatchedTaxon".accepted_author,
774
    "ValidMatchedTaxon".accepted_taxon_rank,
775
    "ValidMatchedTaxon"."acceptedScientificNameID",
776
    "ValidMatchedTaxon".accepted_species_binomial,
777
    "ValidMatchedTaxon".accepted_family,
778
    "ValidMatchedTaxon"."*Name_matched.Selected",
779
    "ValidMatchedTaxon"."*Name_matched.Source",
780
    "ValidMatchedTaxon"."*Name_matched.Warnings",
781
    "ValidMatchedTaxon"."*Name_matched.Accepted_name_lsid",
782
    "ValidMatchedTaxon".taxon_scrub__is_valid_match,
783 1182
    "ValidMatchedTaxon".accepted_morphospecies_binomial,
784 1183
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank,
785 1184
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_family,
......
791 1190
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_name_no_author,
792 1191
    "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_name_with_author,
793 1192
        CASE
794
            WHEN ("taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank = 'family'::text) THEN concat_ws(' '::text, "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_family, "ValidMatchedTaxon"."morphospeciesSuffix")
795
            WHEN ("taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank = 'genus'::text) THEN concat_ws(' '::text, "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_name_no_author, "ValidMatchedTaxon"."morphospeciesSuffix")
1193
            WHEN ("taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank = 'family'::text) THEN concat_ws(' '::text, "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_family, "ValidMatchedTaxon"."*Unmatched_terms")
1194
            WHEN ("taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_rank = 'genus'::text) THEN concat_ws(' '::text, "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_taxon_name_no_author, "ValidMatchedTaxon"."*Unmatched_terms")
796 1195
            ELSE (("taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_genus || ' '::text) || "taxon_scrub.scrubbed_unique_taxon_name.*".scrubbed_specific_epithet)
797 1196
        END AS scrubbed_morphospecies_binomial
798 1197
   FROM ("ValidMatchedTaxon"
......
832 1231
--
833 1232

  
834 1233
COPY "Source" ("*row_num", "sourceType", "datasetURL") FROM stdin;
835
1	aggregator	http://tnrs.iplantcollaborative.org/TNRSapp.html
1234
1	aggregator	http://[TNRS_dev_server].iplantcollaborative.org/TNRSapp.html
836 1235
\.
837 1236

  
838 1237

  
......
841 1240
--
842 1241

  
843 1242
COPY batch (id, id_by_time, time_submitted, client_version) FROM stdin;
844
2014-06-26 04:50:24.98378-07	2014-06-26 04:50:24.98378-07	2014-06-26 04:50:24.98378-07	\N
1243
2014-07-21 16:31:50.48692-07	2014-07-21 16:31:50.48692-07	2014-07-21 16:31:50.48692-07	\N
845 1244
\.
846 1245

  
847 1246

  
......
865 1264
-- Data for Name: taxon_match; Type: TABLE DATA; Schema: TNRS; Owner: bien
866 1265
--
867 1266

  
868
COPY taxon_match (batch, match_num, "Name_number", "Name_submitted", "Overall_score", "Name_matched", "Name_matched_rank", "Name_score", "Name_matched_author", "Name_matched_url", "Author_matched", "Author_score", "Family_matched", "Family_score", "Name_matched_accepted_family", "Genus_matched", "Genus_score", "Specific_epithet_matched", "Specific_epithet_score", "Infraspecific_rank", "Infraspecific_epithet_matched", "Infraspecific_epithet_score", "Infraspecific_rank_2", "Infraspecific_epithet_2_matched", "Infraspecific_epithet_2_score", "Annotations", "Unmatched_terms", "Taxonomic_status", "Accepted_name", "Accepted_name_author", "Accepted_name_rank", "Accepted_name_url", "Accepted_name_species", "Accepted_name_family", "Selected", "Source", "Warnings", "Accepted_name_lsid", is_valid_match, scrubbed_unique_taxon_name) FROM stdin;
869
2014-06-26 04:50:24.98378-07	0	0	Compositae indet. sp.1	0.900000000000000022	Compositae	family	1	\N	http://www.theplantlist.org/1.1/browse/A/Compositae/	\N	\N	Compositae	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	indet. sp.1	Accepted	Compositae	\N	family	http://www.theplantlist.org/1.1/browse/A/Compositae/	\N	\N	true	tpl	 [Ambiguous match] 	\N	t	Compositae
870
2014-06-26 04:50:24.98378-07	1	0	Compositae indet. sp.1	0.900000000000000022	Compositae	family	1	\N	\N	\N	\N	Compositae	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	indet. sp.1	Accepted	Compositae	\N	family	\N	\N	\N	false	tpl	 [Ambiguous match] 	\N	t	Compositae
871
2014-06-26 04:50:24.98378-07	2	0	Compositae indet. sp.1	0.900000000000000022	Compositae	family	1	Giseke	http://www.tropicos.org/Name/50255940	\N	\N	Compositae	1	Compositae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	indet. sp.1	Synonym	Asteraceae	Bercht. & J. Presl	family	http://www.tropicos.org/Name/50307371	\N	Asteraceae	false	tropicos	 	\N	t	Asteraceae Bercht. & J. Presl
872
2014-06-26 04:50:24.98378-07	3	1	Fabaceae Boyle#6500	0.839999999999999969	Fagaceae	family	0.939999999999999947	\N	;http://plants.usda.gov/java/nameSearch	\N	\N	Fagaceae	0.880000000000000004	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	Accepted	Fagaceae	\N	family	;http://plants.usda.gov/java/nameSearch	\N	\N	true	tpl;usda	 	\N	f	Fagaceae
873
2014-06-26 04:50:24.98378-07	4	1	Fabaceae Boyle#6500	0.900000000000000022	Fabaceae	family	1	Lindl.	http://www.tropicos.org/Name/42000184	\N	\N	Fabaceae	1	Fabaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	Accepted	Fabaceae	Lindl.	family	http://www.tropicos.org/Name/42000184	\N	Fabaceae	false	tropicos	 	\N	t	Fabaceae Lindl.
874
2014-06-26 04:50:24.98378-07	5	1	Fabaceae Boyle#6500	0.839999999999999969	Fagaceae	family	0.939999999999999947	Dumort.	http://www.tropicos.org/Name/42000062	\N	\N	Fagaceae	0.880000000000000004	Fagaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	Accepted	Fagaceae	Dumort.	family	http://www.tropicos.org/Name/42000062	\N	Fagaceae	false	tropicos	 	\N	f	Fagaceae Dumort.
875
2014-06-26 04:50:24.98378-07	6	1	Fabaceae Boyle#6500	0.67000000000000004	Ficaceae	family	0.770000000000000018	Bercht. & J. Presl	http://www.tropicos.org/Name/100353631	\N	\N	Ficaceae	0.75	Ficaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	No opinion	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	f	Ficaceae Bercht. & J. Presl
876
2014-06-26 04:50:24.98378-07	7	1	Fabaceae Boyle#6500	0.67000000000000004	Fucaceae	family	0.770000000000000018	\N	http://www.tropicos.org/Name/100371040	\N	\N	Fucaceae	0.75	Fucaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	No opinion	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	f	Fucaceae
877
2014-06-26 04:50:24.98378-07	8	1	Fabaceae Boyle#6500	0.900000000000000022	Fabaceae	family	1	\N	http://plants.usda.gov/java/nameSearch	\N	\N	Fabaceae	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	Accepted	Fabaceae	\N	family	http://plants.usda.gov/java/nameSearch	\N	\N	false	usda	 	\N	t	Fabaceae
878
2014-06-26 04:50:24.98378-07	9	2	Fabaceae Inga "fuzzy leaf"	0.900000000000000022	Inga	genus	1	\N	http://www.theplantlist.org/1.1/browse/A/Leguminosae/Inga/;http://plants.usda.gov/java/profile?symbol=INGA	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	"fuzzy leaf"	Accepted	Inga	\N	genus	http://www.theplantlist.org/1.1/browse/A/Leguminosae/Inga/;http://plants.usda.gov/java/profile?symbol=INGA	\N	Fabaceae	true	tpl;usda	 	\N	t	Fabaceae Inga
879
2014-06-26 04:50:24.98378-07	10	2	Fabaceae Inga "fuzzy leaf"	0.900000000000000022	Inga	genus	1	Mill.	http://www.tropicos.org/Name/40031040	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	"fuzzy leaf"	Accepted	Inga	Mill.	genus	http://www.tropicos.org/Name/40031040	\N	Fabaceae	false	tropicos	 	\N	t	Fabaceae Inga Mill.
880
2014-06-26 04:50:24.98378-07	11	2	Fabaceae Inga "fuzzy leaf"	0.900000000000000022	Inga	genus	1	Scop.	http://www.tropicos.org/Name/50215121	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	"fuzzy leaf"	Illegitimate	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	t	Fabaceae Inga Scop.
881
2014-06-26 04:50:24.98378-07	12	3	Fabaceae Inga sp.3	0.900000000000000022	Inga	genus	1	\N	http://www.theplantlist.org/1.1/browse/A/Leguminosae/Inga/;http://plants.usda.gov/java/profile?symbol=INGA	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	sp.3	Accepted	Inga	\N	genus	http://www.theplantlist.org/1.1/browse/A/Leguminosae/Inga/;http://plants.usda.gov/java/profile?symbol=INGA	\N	Fabaceae	true	tpl;usda	 	\N	t	Fabaceae Inga
882
2014-06-26 04:50:24.98378-07	13	3	Fabaceae Inga sp.3	0.900000000000000022	Inga	genus	1	Mill.	http://www.tropicos.org/Name/40031040	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	sp.3	Accepted	Inga	Mill.	genus	http://www.tropicos.org/Name/40031040	\N	Fabaceae	false	tropicos	 	\N	t	Fabaceae Inga Mill.
883
2014-06-26 04:50:24.98378-07	14	3	Fabaceae Inga sp.3	0.900000000000000022	Inga	genus	1	Scop.	http://www.tropicos.org/Name/50215121	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	sp.3	Illegitimate	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	t	Fabaceae Inga Scop.
884
2014-06-26 04:50:24.98378-07	15	4	Fabaceae unknown #2	0.839999999999999969	Fagaceae	family	0.939999999999999947	\N	;http://plants.usda.gov/java/nameSearch	\N	\N	Fagaceae	0.880000000000000004	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	Accepted	Fagaceae	\N	family	;http://plants.usda.gov/java/nameSearch	\N	\N	true	tpl;usda	 	\N	f	Fagaceae
885
2014-06-26 04:50:24.98378-07	16	4	Fabaceae unknown #2	0.900000000000000022	Fabaceae	family	1	Lindl.	http://www.tropicos.org/Name/42000184	\N	\N	Fabaceae	1	Fabaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	Accepted	Fabaceae	Lindl.	family	http://www.tropicos.org/Name/42000184	\N	Fabaceae	false	tropicos	 	\N	t	Fabaceae Lindl.
886
2014-06-26 04:50:24.98378-07	17	4	Fabaceae unknown #2	0.839999999999999969	Fagaceae	family	0.939999999999999947	Dumort.	http://www.tropicos.org/Name/42000062	\N	\N	Fagaceae	0.880000000000000004	Fagaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	Accepted	Fagaceae	Dumort.	family	http://www.tropicos.org/Name/42000062	\N	Fagaceae	false	tropicos	 	\N	f	Fagaceae Dumort.
887
2014-06-26 04:50:24.98378-07	18	4	Fabaceae unknown #2	0.67000000000000004	Ficaceae	family	0.770000000000000018	Bercht. & J. Presl	http://www.tropicos.org/Name/100353631	\N	\N	Ficaceae	0.75	Ficaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	No opinion	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	f	Ficaceae Bercht. & J. Presl
888
2014-06-26 04:50:24.98378-07	19	4	Fabaceae unknown #2	0.67000000000000004	Fucaceae	family	0.770000000000000018	\N	http://www.tropicos.org/Name/100371040	\N	\N	Fucaceae	0.75	Fucaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	No opinion	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	f	Fucaceae
889
2014-06-26 04:50:24.98378-07	20	4	Fabaceae unknown #2	0.900000000000000022	Fabaceae	family	1	\N	http://plants.usda.gov/java/nameSearch	\N	\N	Fabaceae	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	Accepted	Fabaceae	\N	family	http://plants.usda.gov/java/nameSearch	\N	\N	false	usda	 	\N	t	Fabaceae
890
2014-06-26 04:50:24.98378-07	21	5	Fam_indet. Boyle#6501	0	No suitable matches found.	\N	0	\N	\N	\N	0	\N	0	\N	\N	0	\N	0	\N	\N	0	\N	\N	0	\N	\N	\N	\N	\N	\N	\N	\N	\N	true	\N	 	\N	f	\N
891
2014-06-26 04:50:24.98378-07	22	6	Poa annua	1	Poa annua	species	1	L.	http://www.theplantlist.org/tpl1.1/record/kew-435194;http://www.tropicos.org/Name/25509881;http://plants.usda.gov/java/profile?symbol=POAN	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	\N	\N	\N	\N	\N	\N	\N	\N	Accepted	Poa annua	L.	species	http://www.theplantlist.org/tpl1.1/record/kew-435194;http://www.tropicos.org/Name/25509881;http://plants.usda.gov/java/profile?symbol=POAN	Poa annua	Poaceae	true	tpl;tropicos;usda	 	\N	t	Poaceae Poa annua L.
892
2014-06-26 04:50:24.98378-07	23	6	Poa annua	1	Poa annua	species	1	Cham. & Schltdl.	http://www.theplantlist.org/tpl1.1/record/kew-435195	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	\N	\N	\N	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.theplantlist.org/tpl1.1/record/kew-436189	Poa infirma	Poaceae	false	tpl	 	\N	t	Poaceae Poa infirma Kunth
893
2014-06-26 04:50:24.98378-07	24	7	Poa annua L.	1	Poa annua	species	1	L.	http://www.theplantlist.org/tpl1.1/record/kew-435194;http://www.tropicos.org/Name/25509881;http://plants.usda.gov/java/profile?symbol=POAN	L.	1	\N	\N	Poaceae	Poa	1	annua	1	\N	\N	\N	\N	\N	\N	\N	\N	Accepted	Poa annua	L.	species	http://www.theplantlist.org/tpl1.1/record/kew-435194;http://www.tropicos.org/Name/25509881;http://plants.usda.gov/java/profile?symbol=POAN	Poa annua	Poaceae	true	tpl;tropicos;usda	 	\N	t	Poaceae Poa annua L.
894
2014-06-26 04:50:24.98378-07	25	7	Poa annua L.	0.800000000000000044	Poa annua	species	1	Cham. & Schltdl.	http://www.theplantlist.org/tpl1.1/record/kew-435195	Cham. & Schltdl.	0	\N	\N	Poaceae	Poa	1	annua	1	\N	\N	\N	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.theplantlist.org/tpl1.1/record/kew-436189	Poa infirma	Poaceae	false	tpl	 	\N	t	Poaceae Poa infirma Kunth
895
2014-06-26 04:50:24.98378-07	26	8	Poa annua fo. lanuginosa	1	Poa annua fo. lanuginosa	fo.	1	Sennen	http://www.theplantlist.org/tpl1.1/record/tro-50267771	\N	\N	\N	\N	\N	Poa	1	annua	1	fo.	lanuginosa	1	\N	\N	\N	\N	\N	Synonym	Poa annua	L.	species	http://www.theplantlist.org/tpl1.1/record/kew-435194	Poa annua	Poaceae	true	tpl	 	\N	t	Poaceae Poa annua L.
896
2014-06-26 04:50:24.98378-07	27	8	Poa annua fo. lanuginosa	1	Poa annua fo. lanuginosa	forma	1	Sennen	http://www.tropicos.org/Name/50267771	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	fo.	lanuginosa	1	\N	\N	\N	\N	\N	Synonym	Poa annua var. annua	\N	variety	http://www.tropicos.org/Name/25517736	Poa annua	Poaceae	false	tropicos	 	\N	t	Poaceae Poa annua var. annua
897
2014-06-26 04:50:24.98378-07	28	9	Poa annua ssp. exilis	1	Poa annua subsp. exilis	subspecies	1	(Tomm. ex Freyn) Asch. & Graebn.	http://www.tropicos.org/Name/50063800	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	subsp.	exilis	1	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.tropicos.org/Name/25514158	Poa infirma	Poaceae	true	tropicos	 	\N	t	Poaceae Poa infirma Kunth
898
2014-06-26 04:50:24.98378-07	29	9	Poa annua ssp. exilis	0.959999999999999964	Poa annua var. exilis	variety	0.959999999999999964	Tomm. ex Freyn	http://www.tropicos.org/Name/25547854	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	var.	exilis	0.699999999999999956	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.tropicos.org/Name/25514158	Poa infirma	Poaceae	false	tropicos	 	\N	t	Poaceae Poa infirma Kunth
899
2014-06-26 04:50:24.98378-07	30	10	Poa annua subsp. exilis	1	Poa annua subsp. exilis	subsp.	1	(Tomm. ex Freyn.) Asch. & Graebn.	http://www.theplantlist.org/tpl1.1/record/kew-435202	\N	\N	\N	\N	\N	Poa	1	annua	1	subsp.	exilis	1	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.theplantlist.org/tpl1.1/record/kew-436189	Poa infirma	Poaceae	true	tpl	 	\N	t	Poaceae Poa infirma Kunth
900
2014-06-26 04:50:24.98378-07	31	10	Poa annua subsp. exilis	1	Poa annua subsp. exilis	subspecies	1	(Tomm. ex Freyn) Asch. & Graebn.	http://www.tropicos.org/Name/50063800	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	subsp.	exilis	1	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.tropicos.org/Name/25514158	Poa infirma	Poaceae	false	tropicos	 	\N	t	Poaceae Poa infirma Kunth
901
2014-06-26 04:50:24.98378-07	32	11	Poa annua subvar. minima	1	Poa annua subvar. minima	subvariety	1	(Schur) Asch. & Graebn.	http://www.tropicos.org/Name/50158097	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	subvar.	minima	1	\N	\N	\N	\N	\N	Accepted	Poa annua subvar. minima	(Schur) Asch. & Graebn.	subvariety	http://www.tropicos.org/Name/50158097	Poa annua	Poaceae	true	tropicos	 	\N	t	Poaceae Poa annua subvar. minima (Schur) Asch. & Graebn.
902
2014-06-26 04:50:24.98378-07	33	12	Poa annua var. eriolepis	1	Poa annua var. eriolepis	var.	1	̉ۡ.Desv.	http://www.theplantlist.org/tpl1.1/record/kew-435206	\N	\N	\N	\N	\N	Poa	1	annua	1	var.	eriolepis	1	\N	\N	\N	\N	\N	Synonym	Poa annua	L.	species	http://www.theplantlist.org/tpl1.1/record/kew-435194	Poa annua	Poaceae	true	tpl	 	\N	t	Poaceae Poa annua L.
903
2014-06-26 04:50:24.98378-07	34	12	Poa annua var. eriolepis	1	Poa annua var. eriolepis	variety	1	E. Desv.	http://www.tropicos.org/Name/50119145	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	var.	eriolepis	1	\N	\N	\N	\N	\N	Synonym	Poa annua	L.	species	http://www.tropicos.org/Name/25509881	Poa annua	Poaceae	false	tropicos	 	\N	t	Poaceae Poa annua L.
904
2014-06-26 04:50:24.98378-07	35	13	Silene scouleri Hook. subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subsp.	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://www.theplantlist.org/tpl1.1/record/tro-6303627	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri subsp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subsp.	http://www.theplantlist.org/tpl1.1/record/tro-6303627	Silene scouleri	Caryophyllaceae	true	tpl	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire
905
2014-06-26 04:50:24.98378-07	36	13	Silene scouleri Hook. subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subspecies	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://www.tropicos.org/Name/6303627	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri subsp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subspecies	http://www.tropicos.org/Name/6303627	Silene scouleri	Caryophyllaceae	false	tropicos	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire
906
2014-06-26 04:50:24.98378-07	37	13	Silene scouleri Hook. subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subspecies	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://plants.usda.gov/java/profile?symbol=SISCP	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri ssp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subspecies	http://plants.usda.gov/java/profile?symbol=SISCP	Silene scouleri	Caryophyllaceae	false	usda	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri ssp. pringlei (S. Watson) C.L. Hitchc. & Maguire
907
2014-06-26 04:50:24.98378-07	38	14	Silene scouleri subsp. pringlei var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subsp.	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://www.theplantlist.org/tpl1.1/record/tro-6303627	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri subsp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subsp.	http://www.theplantlist.org/tpl1.1/record/tro-6303627	Silene scouleri	Caryophyllaceae	true	tpl	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire
908
2014-06-26 04:50:24.98378-07	39	14	Silene scouleri subsp. pringlei var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subspecies	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://www.tropicos.org/Name/6303627	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri subsp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subspecies	http://www.tropicos.org/Name/6303627	Silene scouleri	Caryophyllaceae	false	tropicos	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire
909
2014-06-26 04:50:24.98378-07	40	14	Silene scouleri subsp. pringlei var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subspecies	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://plants.usda.gov/java/profile?symbol=SISCP	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri ssp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subspecies	http://plants.usda.gov/java/profile?symbol=SISCP	Silene scouleri	Caryophyllaceae	false	usda	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri ssp. pringlei (S. Watson) C.L. Hitchc. & Maguire
1267
COPY taxon_match (batch, match_num, "*Name_number", "*Name_submitted", "*Overall_score", "*Name_matched", "*Name_matched_rank", "*Name_score", "*Name_matched_author", "*Name_matched_url", "*Author_matched", "*Author_score", "*Family_matched", "*Family_score", "*Name_matched_accepted_family", "*Genus_matched", "*Genus_score", "*Specific_epithet_matched", "*Specific_epithet_score", "*Infraspecific_rank", "*Infraspecific_epithet_matched", "*Infraspecific_epithet_score", "*Infraspecific_rank_2", "*Infraspecific_epithet_2_matched", "*Infraspecific_epithet_2_score", "*Annotations", "*Unmatched_terms", "*Taxonomic_status", "*Accepted_name", "*Accepted_name_author", "*Accepted_name_rank", "*Accepted_name_url", "*Accepted_name_species", "*Accepted_name_family", "*Selected", "*Source", "*Warnings", "*Accepted_name_lsid", is_valid_match, scrubbed_unique_taxon_name, "[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org", "[matched_]scientificName[_with_author]__@DwC__@vegpath.org", matched_has_accepted, "__accepted_{genus,specific_epithet}", "[accepted_]genus__@DwC__@vegpath.org", "[accepted_]specificEpithet__@DwC__@vegpath.org", __accepted_infraspecific_label, "__accepted_infraspecific_{rank,epithet}", "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org", "[accepted_]infraspecificEpithet__@DwC__@vegpath.org", "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org") FROM stdin;
1268
2014-07-21 16:31:50.48692-07	0	0	Compositae indet. sp.1	0.900000000000000022	Compositae	family	1	\N	http://www.theplantlist.org/1.1/browse/A/Compositae/	\N	\N	Compositae	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	indet. sp.1	Accepted	Compositae	\N	family	http://www.theplantlist.org/1.1/browse/A/Compositae/	\N	\N	true	tpl	 [Ambiguous match] 	\N	t	Compositae	\N	Compositae	t	\N	\N	\N	\N	\N	\N	\N	Compositae
1269
2014-07-21 16:31:50.48692-07	1	0	Compositae indet. sp.1	0.900000000000000022	Compositae	family	1	\N	\N	\N	\N	Compositae	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	indet. sp.1	Accepted	Compositae	\N	family	\N	\N	\N	false	tpl	 [Ambiguous match] 	\N	t	Compositae	\N	Compositae	t	\N	\N	\N	\N	\N	\N	\N	Compositae
1270
2014-07-21 16:31:50.48692-07	2	0	Compositae indet. sp.1	0.900000000000000022	Compositae	family	1	Giseke	http://www.tropicos.org/Name/50255940	\N	\N	Compositae	1	Compositae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	indet. sp.1	Synonym	Asteraceae	Bercht. & J. Presl	family	http://www.tropicos.org/Name/50307371	\N	Asteraceae	false	tropicos	 	\N	t	Asteraceae Bercht. & J. Presl	\N	Compositae Giseke	t	\N	\N	\N	\N	\N	\N	\N	Asteraceae Bercht. & J. Presl
1271
2014-07-21 16:31:50.48692-07	3	1	Fabaceae Boyle#6500	0.839999999999999969	Fagaceae	family	0.939999999999999947	\N	;http://plants.usda.gov/java/nameSearch	\N	\N	Fagaceae	0.880000000000000004	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	Accepted	Fagaceae	\N	family	;http://plants.usda.gov/java/nameSearch	\N	\N	true	tpl;usda	 	\N	f	Fagaceae	\N	Fagaceae	t	\N	\N	\N	\N	\N	\N	\N	Fagaceae
1272
2014-07-21 16:31:50.48692-07	4	1	Fabaceae Boyle#6500	0.900000000000000022	Fabaceae	family	1	Lindl.	http://www.tropicos.org/Name/42000184	\N	\N	Fabaceae	1	Fabaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	Accepted	Fabaceae	Lindl.	family	http://www.tropicos.org/Name/42000184	\N	Fabaceae	false	tropicos	 	\N	t	Fabaceae Lindl.	\N	Fabaceae Lindl.	t	\N	\N	\N	\N	\N	\N	\N	Fabaceae Lindl.
1273
2014-07-21 16:31:50.48692-07	5	1	Fabaceae Boyle#6500	0.839999999999999969	Fagaceae	family	0.939999999999999947	Dumort.	http://www.tropicos.org/Name/42000062	\N	\N	Fagaceae	0.880000000000000004	Fagaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	Accepted	Fagaceae	Dumort.	family	http://www.tropicos.org/Name/42000062	\N	Fagaceae	false	tropicos	 	\N	f	Fagaceae Dumort.	\N	Fagaceae Dumort.	t	\N	\N	\N	\N	\N	\N	\N	Fagaceae Dumort.
1274
2014-07-21 16:31:50.48692-07	6	1	Fabaceae Boyle#6500	0.67000000000000004	Ficaceae	family	0.770000000000000018	Bercht. & J. Presl	http://www.tropicos.org/Name/100353631	\N	\N	Ficaceae	0.75	Ficaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	No opinion	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	f	Ficaceae Bercht. & J. Presl	\N	Ficaceae Bercht. & J. Presl	f	\N	\N	\N	\N	\N	\N	\N	\N
1275
2014-07-21 16:31:50.48692-07	7	1	Fabaceae Boyle#6500	0.67000000000000004	Fucaceae	family	0.770000000000000018	\N	http://www.tropicos.org/Name/100371040	\N	\N	Fucaceae	0.75	Fucaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	No opinion	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	f	Fucaceae	\N	Fucaceae	f	\N	\N	\N	\N	\N	\N	\N	\N
1276
2014-07-21 16:31:50.48692-07	8	1	Fabaceae Boyle#6500	0.900000000000000022	Fabaceae	family	1	\N	http://plants.usda.gov/java/nameSearch	\N	\N	Fabaceae	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	Boyle#6500	Accepted	Fabaceae	\N	family	http://plants.usda.gov/java/nameSearch	\N	\N	false	usda	 	\N	t	Fabaceae	\N	Fabaceae	t	\N	\N	\N	\N	\N	\N	\N	Fabaceae
1277
2014-07-21 16:31:50.48692-07	9	2	Fabaceae Inga "fuzzy leaf"	0.900000000000000022	Inga	genus	1	\N	http://www.theplantlist.org/1.1/browse/A/Leguminosae/Inga/;http://plants.usda.gov/java/profile?symbol=INGA	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	"fuzzy leaf"	Accepted	Inga	\N	genus	http://www.theplantlist.org/1.1/browse/A/Leguminosae/Inga/;http://plants.usda.gov/java/profile?symbol=INGA	\N	Fabaceae	true	tpl;usda	 	\N	t	Fabaceae Inga	\N	Inga	t	\N	\N	\N	\N	\N	\N	\N	Inga
1278
2014-07-21 16:31:50.48692-07	10	2	Fabaceae Inga "fuzzy leaf"	0.900000000000000022	Inga	genus	1	Mill.	http://www.tropicos.org/Name/40031040	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	"fuzzy leaf"	Accepted	Inga	Mill.	genus	http://www.tropicos.org/Name/40031040	\N	Fabaceae	false	tropicos	 	\N	t	Fabaceae Inga Mill.	\N	Inga Mill.	t	\N	\N	\N	\N	\N	\N	\N	Inga Mill.
1279
2014-07-21 16:31:50.48692-07	11	2	Fabaceae Inga "fuzzy leaf"	0.900000000000000022	Inga	genus	1	Scop.	http://www.tropicos.org/Name/50215121	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	"fuzzy leaf"	Illegitimate	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	t	Fabaceae Inga Scop.	\N	Inga Scop.	f	\N	\N	\N	\N	\N	\N	\N	\N
1280
2014-07-21 16:31:50.48692-07	12	3	Fabaceae Inga sp.3	0.900000000000000022	Inga	genus	1	\N	http://www.theplantlist.org/1.1/browse/A/Leguminosae/Inga/;http://plants.usda.gov/java/profile?symbol=INGA	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	sp.3	Accepted	Inga	\N	genus	http://www.theplantlist.org/1.1/browse/A/Leguminosae/Inga/;http://plants.usda.gov/java/profile?symbol=INGA	\N	Fabaceae	true	tpl;usda	 	\N	t	Fabaceae Inga	\N	Inga	t	\N	\N	\N	\N	\N	\N	\N	Inga
1281
2014-07-21 16:31:50.48692-07	13	3	Fabaceae Inga sp.3	0.900000000000000022	Inga	genus	1	Mill.	http://www.tropicos.org/Name/40031040	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	sp.3	Accepted	Inga	Mill.	genus	http://www.tropicos.org/Name/40031040	\N	Fabaceae	false	tropicos	 	\N	t	Fabaceae Inga Mill.	\N	Inga Mill.	t	\N	\N	\N	\N	\N	\N	\N	Inga Mill.
1282
2014-07-21 16:31:50.48692-07	14	3	Fabaceae Inga sp.3	0.900000000000000022	Inga	genus	1	Scop.	http://www.tropicos.org/Name/50215121	\N	\N	Fabaceae	1	Fabaceae	Inga	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	sp.3	Illegitimate	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	t	Fabaceae Inga Scop.	\N	Inga Scop.	f	\N	\N	\N	\N	\N	\N	\N	\N
1283
2014-07-21 16:31:50.48692-07	15	4	Fabaceae unknown #2	0.839999999999999969	Fagaceae	family	0.939999999999999947	\N	;http://plants.usda.gov/java/nameSearch	\N	\N	Fagaceae	0.880000000000000004	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	Accepted	Fagaceae	\N	family	;http://plants.usda.gov/java/nameSearch	\N	\N	true	tpl;usda	 	\N	f	Fagaceae	\N	Fagaceae	t	\N	\N	\N	\N	\N	\N	\N	Fagaceae
1284
2014-07-21 16:31:50.48692-07	16	4	Fabaceae unknown #2	0.900000000000000022	Fabaceae	family	1	Lindl.	http://www.tropicos.org/Name/42000184	\N	\N	Fabaceae	1	Fabaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	Accepted	Fabaceae	Lindl.	family	http://www.tropicos.org/Name/42000184	\N	Fabaceae	false	tropicos	 	\N	t	Fabaceae Lindl.	\N	Fabaceae Lindl.	t	\N	\N	\N	\N	\N	\N	\N	Fabaceae Lindl.
1285
2014-07-21 16:31:50.48692-07	17	4	Fabaceae unknown #2	0.839999999999999969	Fagaceae	family	0.939999999999999947	Dumort.	http://www.tropicos.org/Name/42000062	\N	\N	Fagaceae	0.880000000000000004	Fagaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	Accepted	Fagaceae	Dumort.	family	http://www.tropicos.org/Name/42000062	\N	Fagaceae	false	tropicos	 	\N	f	Fagaceae Dumort.	\N	Fagaceae Dumort.	t	\N	\N	\N	\N	\N	\N	\N	Fagaceae Dumort.
1286
2014-07-21 16:31:50.48692-07	18	4	Fabaceae unknown #2	0.67000000000000004	Ficaceae	family	0.770000000000000018	Bercht. & J. Presl	http://www.tropicos.org/Name/100353631	\N	\N	Ficaceae	0.75	Ficaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	No opinion	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	f	Ficaceae Bercht. & J. Presl	\N	Ficaceae Bercht. & J. Presl	f	\N	\N	\N	\N	\N	\N	\N	\N
1287
2014-07-21 16:31:50.48692-07	19	4	Fabaceae unknown #2	0.67000000000000004	Fucaceae	family	0.770000000000000018	\N	http://www.tropicos.org/Name/100371040	\N	\N	Fucaceae	0.75	Fucaceae	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	No opinion	\N	\N	\N	\N	\N	\N	false	tropicos	 	\N	f	Fucaceae	\N	Fucaceae	f	\N	\N	\N	\N	\N	\N	\N	\N
1288
2014-07-21 16:31:50.48692-07	20	4	Fabaceae unknown #2	0.900000000000000022	Fabaceae	family	1	\N	http://plants.usda.gov/java/nameSearch	\N	\N	Fabaceae	1	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	unknown #2	Accepted	Fabaceae	\N	family	http://plants.usda.gov/java/nameSearch	\N	\N	false	usda	 	\N	t	Fabaceae	\N	Fabaceae	t	\N	\N	\N	\N	\N	\N	\N	Fabaceae
1289
2014-07-21 16:31:50.48692-07	21	5	Fam_indet. Boyle#6501	0	No suitable matches found.	\N	0	\N	\N	\N	0	\N	0	\N	\N	0	\N	0	\N	\N	0	\N	\N	0	\N	\N	\N	\N	\N	\N	\N	\N	\N	true	\N	 	\N	f	\N	\N	No suitable matches found.	f	\N	\N	\N	\N	\N	\N	\N	\N
1290
2014-07-21 16:31:50.48692-07	22	6	Poa annua	1	Poa annua	species	1	L.	http://www.theplantlist.org/tpl1.1/record/kew-435194;http://www.tropicos.org/Name/25509881;http://plants.usda.gov/java/profile?symbol=POAN	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	\N	\N	\N	\N	\N	\N	\N	\N	Accepted	Poa annua	L.	species	http://www.theplantlist.org/tpl1.1/record/kew-435194;http://www.tropicos.org/Name/25509881;http://plants.usda.gov/java/profile?symbol=POAN	Poa annua	Poaceae	true	tpl;tropicos;usda	 	\N	t	Poaceae Poa annua L.	Poa annua	Poa annua L.	t	{Poa,annua}	Poa	annua	\N	\N	\N	\N	Poa annua L.
1291
2014-07-21 16:31:50.48692-07	23	6	Poa annua	1	Poa annua	species	1	Cham. & Schltdl.	http://www.theplantlist.org/tpl1.1/record/kew-435195	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	\N	\N	\N	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.theplantlist.org/tpl1.1/record/kew-436189	Poa infirma	Poaceae	false	tpl	 	\N	t	Poaceae Poa infirma Kunth	Poa annua	Poa annua Cham. & Schltdl.	t	{Poa,infirma}	Poa	infirma	\N	\N	\N	\N	Poa infirma Kunth
1292
2014-07-21 16:31:50.48692-07	24	7	Poa annua L.	1	Poa annua	species	1	L.	http://www.theplantlist.org/tpl1.1/record/kew-435194;http://www.tropicos.org/Name/25509881;http://plants.usda.gov/java/profile?symbol=POAN	L.	1	\N	\N	Poaceae	Poa	1	annua	1	\N	\N	\N	\N	\N	\N	\N	\N	Accepted	Poa annua	L.	species	http://www.theplantlist.org/tpl1.1/record/kew-435194;http://www.tropicos.org/Name/25509881;http://plants.usda.gov/java/profile?symbol=POAN	Poa annua	Poaceae	true	tpl;tropicos;usda	 	\N	t	Poaceae Poa annua L.	Poa annua	Poa annua L.	t	{Poa,annua}	Poa	annua	\N	\N	\N	\N	Poa annua L.
1293
2014-07-21 16:31:50.48692-07	25	7	Poa annua L.	0.800000000000000044	Poa annua	species	1	Cham. & Schltdl.	http://www.theplantlist.org/tpl1.1/record/kew-435195	Cham. & Schltdl.	0	\N	\N	Poaceae	Poa	1	annua	1	\N	\N	\N	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.theplantlist.org/tpl1.1/record/kew-436189	Poa infirma	Poaceae	false	tpl	 	\N	t	Poaceae Poa infirma Kunth	Poa annua	Poa annua Cham. & Schltdl.	t	{Poa,infirma}	Poa	infirma	\N	\N	\N	\N	Poa infirma Kunth
1294
2014-07-21 16:31:50.48692-07	26	8	Poa annua fo. lanuginosa	1	Poa annua fo. lanuginosa	fo.	1	Sennen	http://www.theplantlist.org/tpl1.1/record/tro-50267771	\N	\N	\N	\N	\N	Poa	1	annua	1	fo.	lanuginosa	1	\N	\N	\N	\N	\N	Synonym	Poa annua	L.	species	http://www.theplantlist.org/tpl1.1/record/kew-435194	Poa annua	Poaceae	true	tpl	 	\N	t	Poaceae Poa annua L.	Poa annua	Poa annua fo. lanuginosa Sennen	t	{Poa,annua}	Poa	annua	\N	\N	\N	\N	Poa annua L.
1295
2014-07-21 16:31:50.48692-07	27	8	Poa annua fo. lanuginosa	1	Poa annua fo. lanuginosa	forma	1	Sennen	http://www.tropicos.org/Name/50267771	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	fo.	lanuginosa	1	\N	\N	\N	\N	\N	Synonym	Poa annua var. annua	\N	variety	http://www.tropicos.org/Name/25517736	Poa annua	Poaceae	false	tropicos	 	\N	t	Poaceae Poa annua var. annua	Poa annua	Poa annua fo. lanuginosa Sennen	t	{Poa,annua}	Poa	annua	var. annua	{var.,annua}	var.	annua	Poa annua var. annua
1296
2014-07-21 16:31:50.48692-07	28	9	Poa annua ssp. exilis	1	Poa annua subsp. exilis	subspecies	1	(Tomm. ex Freyn) Asch. & Graebn.	http://www.tropicos.org/Name/50063800	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	subsp.	exilis	1	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.tropicos.org/Name/25514158	Poa infirma	Poaceae	true	tropicos	 	\N	t	Poaceae Poa infirma Kunth	Poa annua	Poa annua subsp. exilis (Tomm. ex Freyn) Asch. & Graebn.	t	{Poa,infirma}	Poa	infirma	\N	\N	\N	\N	Poa infirma Kunth
1297
2014-07-21 16:31:50.48692-07	29	9	Poa annua ssp. exilis	0.959999999999999964	Poa annua var. exilis	variety	0.959999999999999964	Tomm. ex Freyn	http://www.tropicos.org/Name/25547854	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	var.	exilis	0.699999999999999956	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.tropicos.org/Name/25514158	Poa infirma	Poaceae	false	tropicos	 	\N	t	Poaceae Poa infirma Kunth	Poa annua	Poa annua var. exilis Tomm. ex Freyn	t	{Poa,infirma}	Poa	infirma	\N	\N	\N	\N	Poa infirma Kunth
1298
2014-07-21 16:31:50.48692-07	30	10	Poa annua subsp. exilis	1	Poa annua subsp. exilis	subsp.	1	(Tomm. ex Freyn.) Asch. & Graebn.	http://www.theplantlist.org/tpl1.1/record/kew-435202	\N	\N	\N	\N	\N	Poa	1	annua	1	subsp.	exilis	1	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.theplantlist.org/tpl1.1/record/kew-436189	Poa infirma	Poaceae	true	tpl	 	\N	t	Poaceae Poa infirma Kunth	Poa annua	Poa annua subsp. exilis (Tomm. ex Freyn.) Asch. & Graebn.	t	{Poa,infirma}	Poa	infirma	\N	\N	\N	\N	Poa infirma Kunth
1299
2014-07-21 16:31:50.48692-07	31	10	Poa annua subsp. exilis	1	Poa annua subsp. exilis	subspecies	1	(Tomm. ex Freyn) Asch. & Graebn.	http://www.tropicos.org/Name/50063800	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	subsp.	exilis	1	\N	\N	\N	\N	\N	Synonym	Poa infirma	Kunth	species	http://www.tropicos.org/Name/25514158	Poa infirma	Poaceae	false	tropicos	 	\N	t	Poaceae Poa infirma Kunth	Poa annua	Poa annua subsp. exilis (Tomm. ex Freyn) Asch. & Graebn.	t	{Poa,infirma}	Poa	infirma	\N	\N	\N	\N	Poa infirma Kunth
1300
2014-07-21 16:31:50.48692-07	32	11	Poa annua subvar. minima	1	Poa annua subvar. minima	subvariety	1	(Schur) Asch. & Graebn.	http://www.tropicos.org/Name/50158097	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	subvar.	minima	1	\N	\N	\N	\N	\N	Accepted	Poa annua subvar. minima	(Schur) Asch. & Graebn.	subvariety	http://www.tropicos.org/Name/50158097	Poa annua	Poaceae	true	tropicos	 	\N	t	Poaceae Poa annua subvar. minima (Schur) Asch. & Graebn.	Poa annua	Poa annua subvar. minima (Schur) Asch. & Graebn.	t	{Poa,annua}	Poa	annua	subvar. minima	{subvar.,minima}	subvar.	minima	Poa annua subvar. minima (Schur) Asch. & Graebn.
1301
2014-07-21 16:31:50.48692-07	33	12	Poa annua var. eriolepis	1	Poa annua var. eriolepis	var.	1	̉ۡ.Desv.	http://www.theplantlist.org/tpl1.1/record/kew-435206	\N	\N	\N	\N	\N	Poa	1	annua	1	var.	eriolepis	1	\N	\N	\N	\N	\N	Synonym	Poa annua	L.	species	http://www.theplantlist.org/tpl1.1/record/kew-435194	Poa annua	Poaceae	true	tpl	 	\N	t	Poaceae Poa annua L.	Poa annua	Poa annua var. eriolepis ̉ۡ.Desv.	t	{Poa,annua}	Poa	annua	\N	\N	\N	\N	Poa annua L.
1302
2014-07-21 16:31:50.48692-07	34	12	Poa annua var. eriolepis	1	Poa annua var. eriolepis	variety	1	E. Desv.	http://www.tropicos.org/Name/50119145	\N	\N	\N	\N	Poaceae	Poa	1	annua	1	var.	eriolepis	1	\N	\N	\N	\N	\N	Synonym	Poa annua	L.	species	http://www.tropicos.org/Name/25509881	Poa annua	Poaceae	false	tropicos	 	\N	t	Poaceae Poa annua L.	Poa annua	Poa annua var. eriolepis E. Desv.	t	{Poa,annua}	Poa	annua	\N	\N	\N	\N	Poa annua L.
1303
2014-07-21 16:31:50.48692-07	35	13	Silene scouleri Hook. subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subsp.	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://www.theplantlist.org/tpl1.1/record/tro-6303627	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri subsp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subsp.	http://www.theplantlist.org/tpl1.1/record/tro-6303627	Silene scouleri	Caryophyllaceae	true	tpl	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire	Silene scouleri	Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire	t	{Silene,scouleri}	Silene	scouleri	subsp. pringlei	{subsp.,pringlei}	subsp.	pringlei	Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire
1304
2014-07-21 16:31:50.48692-07	36	13	Silene scouleri Hook. subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subspecies	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://www.tropicos.org/Name/6303627	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri subsp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subspecies	http://www.tropicos.org/Name/6303627	Silene scouleri	Caryophyllaceae	false	tropicos	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire	Silene scouleri	Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire	t	{Silene,scouleri}	Silene	scouleri	subsp. pringlei	{subsp.,pringlei}	subsp.	pringlei	Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire
1305
2014-07-21 16:31:50.48692-07	37	13	Silene scouleri Hook. subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subspecies	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://plants.usda.gov/java/profile?symbol=SISCP	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri ssp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subspecies	http://plants.usda.gov/java/profile?symbol=SISCP	Silene scouleri	Caryophyllaceae	false	usda	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri ssp. pringlei (S. Watson) C.L. Hitchc. & Maguire	Silene scouleri	Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire	t	{Silene,scouleri}	Silene	scouleri	ssp. pringlei	{ssp.,pringlei}	ssp.	pringlei	Silene scouleri ssp. pringlei (S. Watson) C.L. Hitchc. & Maguire
1306
2014-07-21 16:31:50.48692-07	38	14	Silene scouleri subsp. pringlei var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subsp.	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://www.theplantlist.org/tpl1.1/record/tro-6303627	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri subsp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subsp.	http://www.theplantlist.org/tpl1.1/record/tro-6303627	Silene scouleri	Caryophyllaceae	true	tpl	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire	Silene scouleri	Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire	t	{Silene,scouleri}	Silene	scouleri	subsp. pringlei	{subsp.,pringlei}	subsp.	pringlei	Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire
1307
2014-07-21 16:31:50.48692-07	39	14	Silene scouleri subsp. pringlei var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subspecies	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://www.tropicos.org/Name/6303627	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri subsp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subspecies	http://www.tropicos.org/Name/6303627	Silene scouleri	Caryophyllaceae	false	tropicos	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire	Silene scouleri	Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire	t	{Silene,scouleri}	Silene	scouleri	subsp. pringlei	{subsp.,pringlei}	subsp.	pringlei	Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire
1308
2014-07-21 16:31:50.48692-07	40	14	Silene scouleri subsp. pringlei var. grisea C.L. Hitchc. & Maguire	0.770000000000000018	Silene scouleri subsp. pringlei	subspecies	0.770000000000000018	(S. Watson) C.L. Hitchc. & Maguire	http://plants.usda.gov/java/profile?symbol=SISCP	\N	\N	\N	\N	Caryophyllaceae	Silene	1	scouleri	1	subsp.	pringlei	1	\N	\N	\N	\N	var. grisea	Accepted	Silene scouleri ssp. pringlei	(S. Watson) C.L. Hitchc. & Maguire	subspecies	http://plants.usda.gov/java/profile?symbol=SISCP	Silene scouleri	Caryophyllaceae	false	usda	 [Partial match] 	\N	t	Caryophyllaceae Silene scouleri ssp. pringlei (S. Watson) C.L. Hitchc. & Maguire	Silene scouleri	Silene scouleri subsp. pringlei (S. Watson) C.L. Hitchc. & Maguire	t	{Silene,scouleri}	Silene	scouleri	ssp. pringlei	{ssp.,pringlei}	ssp.	pringlei	Silene scouleri ssp. pringlei (S. Watson) C.L. Hitchc. & Maguire
910 1309
\.
911 1310

  
912 1311

  
......
925 1324
COPY "~Source.map" ("from", "to", filter, notes) FROM stdin;
926 1325
row_num	*row_num	\N	\N
927 1326
:aggregator	sourceType	\N	\N
928
:http://tnrs.iplantcollaborative.org/TNRSapp.html	datasetURL	\N	\N
1327
:http://[TNRS_dev_server].iplantcollaborative.org/TNRSapp.html	datasetURL	\N	\N
929 1328
\.
930 1329

  
931 1330

  
......
976 1375
ALTER TABLE ONLY taxon_match
977 1376
    ADD CONSTRAINT taxon_match_pkey PRIMARY KEY (batch, match_num);
978 1377

  
1378
ALTER TABLE taxon_match CLUSTER ON taxon_match_pkey;
979 1379

  
1380

  
980 1381
--
981 1382
-- Name: ~Source.map_from_key; Type: CONSTRAINT; Schema: TNRS; Owner: bien; Tablespace: 
982 1383
--
......
1001 1402

  
1002 1403

  
1003 1404
--
1405
-- Name: taxon_best_match__valid_match; Type: INDEX; Schema: TNRS; Owner: bien; Tablespace: 
1406
--
1407

  
1408
CREATE INDEX taxon_best_match__valid_match ON taxon_match USING btree ("*Name_submitted") WHERE (("*Selected" = 'true'::text) AND is_valid_match);
1409

  
1410

  
1411
--
1004 1412
-- Name: taxon_match_Name_submitted_idx; Type: INDEX; Schema: TNRS; Owner: bien; Tablespace: 
1005 1413
--
1006 1414

  
1007
CREATE INDEX "taxon_match_Name_submitted_idx" ON taxon_match USING btree ("Name_submitted");
1415
CREATE INDEX "taxon_match_Name_submitted_idx" ON taxon_match USING btree ("*Name_submitted");
1008 1416

  
1009 1417

  
1010 1418
--
1011
-- Name: taxon_match__valid_match; Type: INDEX; Schema: TNRS; Owner: bien; Tablespace: 
1419
-- Name: taxon_match__one_selected_match; Type: INDEX; Schema: TNRS; Owner: bien; Tablespace: 
1012 1420
--
1013 1421

  
1014
CREATE INDEX taxon_match__valid_match ON taxon_match USING btree ("Name_submitted") WHERE is_valid_match;
1422
CREATE UNIQUE INDEX taxon_match__one_selected_match ON taxon_match USING btree (batch, "*Name_number") WHERE ("*Selected" = 'true'::text);
1015 1423

  
1016 1424

  
1017 1425
--
......
1045 1453

  
1046 1454

  
1047 1455
--
1456
-- Name: taxon_match__fill_derived; Type: TRIGGER; Schema: TNRS; Owner: bien
1457
--
1458

  
1459
CREATE TRIGGER taxon_match__fill_derived BEFORE INSERT OR UPDATE ON taxon_match FOR EACH ROW EXECUTE PROCEDURE taxon_match__fill_derived();
1460

  
1461

  
1462
--
1048 1463
-- Name: taxon_match__match_num__fill; Type: TRIGGER; Schema: TNRS; Owner: bien
1049 1464
--
1050 1465

  
......
1103 1518

  
1104 1519

  
1105 1520
--
1521
-- Name: taxon_best_match; Type: ACL; Schema: TNRS; Owner: bien
1522
--
1523

  
1524
REVOKE ALL ON TABLE taxon_best_match FROM PUBLIC;
1525
REVOKE ALL ON TABLE taxon_best_match FROM bien;
1526
GRANT ALL ON TABLE taxon_best_match TO bien;
1527
GRANT SELECT ON TABLE taxon_best_match TO bien_read;
1528

  
1529

  
1530
--
1106 1531
-- Name: MatchedTaxon; Type: ACL; Schema: TNRS; Owner: bien
1107 1532
--
1108 1533

  
......
1123 1548

  
1124 1549

  
1125 1550
--
1551
-- Name: taxon_match_input; Type: ACL; Schema: TNRS; Owner: bien
1552
--
1553

  
1554
REVOKE ALL ON TABLE taxon_match_input FROM PUBLIC;
1555
REVOKE ALL ON TABLE taxon_match_input FROM bien;
1556
GRANT ALL ON TABLE taxon_match_input TO bien;
1557
GRANT SELECT ON TABLE taxon_match_input TO bien_read;
1558

  
1559

  
1560
--
1126 1561
-- Name: taxon_scrub.scrubbed_unique_taxon_name.*; Type: ACL; Schema: TNRS; Owner: bien
1127 1562
--
1128 1563

  
trunk/inputs/test_taxonomic_names/_scrub/public.test_taxonomic_names.sql
22 22
-- Name: SCHEMA "public.test_taxonomic_names"; Type: COMMENT; Schema: -; Owner: bien
23 23
--
24 24

  
25
COMMENT ON SCHEMA "public.test_taxonomic_names" IS 'Version: public (2014-6-26 4:50:32 PDT)';
25
COMMENT ON SCHEMA "public.test_taxonomic_names" IS 'Version: public (2014-7-21 16:32:02 PDT)';
26 26

  
27 27

  
28 28
SET search_path = "public.test_taxonomic_names", pg_catalog;
......
773 773
DROP TABLE IF EXISTS analytical_stem;
774 774
SELECT util.copy('analytical_stem_view', 'analytical_stem');
775 775
ALTER TABLE analytical_stem ADD COLUMN "TAXONOBSERVATION_ID__@VegBank__.taxonObservation@vegpath.org" serial PRIMARY KEY;
776
COMMENT ON COLUMN analytical_stem."TAXONOBSERVATION_ID__@VegBank__.taxonObservation@vegpath.org" IS 'VegBIEN-autogenerated "identifier assigned to each unique observation of a taxon in a plot"';
776 777

  
777 778
GRANT SELECT ON TABLE analytical_stem TO bien_read;
778 779
GRANT SELECT ON TABLE analytical_stem_view TO bien_read;
......
977 978
ALTER FUNCTION "public.test_taxonomic_names".geoscrub_input_view_modify() OWNER TO bien;
978 979

  
979 980
--
980
-- Name: lat_long_in_new_world(double precision, double precision); Type: FUNCTION; Schema: public.test_taxonomic_names; Owner: bien
981
-- Name: in_iucn_red_list(text, text, anyelement); Type: FUNCTION; Schema: public.test_taxonomic_names; Owner: bien
981 982
--
982 983

  
983
CREATE FUNCTION lat_long_in_new_world(latitude_deg double precision, longitude_deg double precision) RETURNS boolean
984
CREATE FUNCTION in_iucn_red_list(accepted_family text, accepted_species_binomial text, schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS boolean
985
    LANGUAGE plpgsql STABLE
986
    SET client_min_messages TO 'warning'
987
    SET search_path TO pg_temp
988
    AS $$
989
/* must use LANGUAGE plpgsql because LANGUAGE sql does not support runtime
990
changes of search_path (schema elements are bound at inline time rather than
991
runtime) */
992
/* function option search_path is needed to limit the effects of
993
`SET LOCAL search_path` to the current function */
994
DECLARE
995
	accepted_family_ text = accepted_family;
996
	accepted_species_binomial_ text = accepted_species_binomial;
997
BEGIN
998
	PERFORM util.use_schema(schema_anchor);
999
	
1000
	RETURN EXISTS(
1001
		SELECT NULL FROM iucn_red_list t
1002
		WHERE
1003
			t.accepted_family = accepted_family_
1004
		AND	t.accepted_species_binomial = accepted_species_binomial_
1005
	);
1006
END;
1007
$$;
1008

  
1009

  
1010
ALTER FUNCTION "public.test_taxonomic_names".in_iucn_red_list(accepted_family text, accepted_species_binomial text, schema_anchor anyelement) OWNER TO bien;
1011

  
1012
--
1013
-- Name: in_new_world(double precision, double precision); Type: FUNCTION; Schema: public.test_taxonomic_names; Owner: bien
1014
--
1015

  
1016
CREATE FUNCTION in_new_world(latitude_deg double precision, longitude_deg double precision) RETURNS boolean
984 1017
    LANGUAGE sql IMMUTABLE
985 1018
    AS $_$
986
SELECT util.lat_long_in_new_world($1, $2)
1019
SELECT util.in_new_world(($1, $2))
987 1020
$_$;
988 1021

  
989 1022

  
990
ALTER FUNCTION "public.test_taxonomic_names".lat_long_in_new_world(latitude_deg double precision, longitude_deg double precision) OWNER TO bien;
1023
ALTER FUNCTION "public.test_taxonomic_names".in_new_world(latitude_deg double precision, longitude_deg double precision) OWNER TO bien;
991 1024

  
992 1025
--
993
-- Name: FUNCTION lat_long_in_new_world(latitude_deg double precision, longitude_deg double precision); Type: COMMENT; Schema: public.test_taxonomic_names; Owner: bien
1026
-- Name: FUNCTION in_new_world(latitude_deg double precision, longitude_deg double precision); Type: COMMENT; Schema: public.test_taxonomic_names; Owner: bien
994 1027
--
995 1028

  
996
COMMENT ON FUNCTION lat_long_in_new_world(latitude_deg double precision, longitude_deg double precision) IS '
1029
COMMENT ON FUNCTION in_new_world(latitude_deg double precision, longitude_deg double precision) IS '
997 1030
wrapper that prevents views from getting dropped when the util schema is reinstalled
998 1031
';
999 1032

  
1000 1033

  
1001 1034
--
1035
-- Name: in_south_america(double precision, double precision); Type: FUNCTION; Schema: public.test_taxonomic_names; Owner: bien
1036
--
1037

  
1038
CREATE FUNCTION in_south_america(latitude_deg double precision, longitude_deg double precision) RETURNS boolean
1039
    LANGUAGE sql IMMUTABLE
1040
    AS $_$
1041
SELECT util.in_south_america(($1, $2))
1042
$_$;
1043

  
1044

  
1045
ALTER FUNCTION "public.test_taxonomic_names".in_south_america(latitude_deg double precision, longitude_deg double precision) OWNER TO bien;
1046

  
1047
--
1048
-- Name: FUNCTION in_south_america(latitude_deg double precision, longitude_deg double precision); Type: COMMENT; Schema: public.test_taxonomic_names; Owner: bien
1049
--
1050

  
1051
COMMENT ON FUNCTION in_south_america(latitude_deg double precision, longitude_deg double precision) IS '
1052
wrapper that prevents views from getting dropped when the util schema is reinstalled
1053
';
1054

  
1055

  
1056
--
1057
-- Name: iucn_red_list_view_modify(); Type: FUNCTION; Schema: public.test_taxonomic_names; Owner: bien
1058
--
1059

  
1060
CREATE FUNCTION iucn_red_list_view_modify() RETURNS void
1061
    LANGUAGE sql
1062
    AS $$
1063
SELECT util.rematerialize_view('iucn_red_list', 'iucn_red_list_view');
1064

  
1065
ALTER TABLE iucn_red_list ADD PRIMARY KEY(accepted_family, accepted_species_binomial);
1066
$$;
1067

  
1068

  
1069
ALTER FUNCTION "public.test_taxonomic_names".iucn_red_list_view_modify() OWNER TO bien;
1070

  
1071
--
1002 1072
-- Name: location__pull_forward_from_parent(); Type: FUNCTION; Schema: public.test_taxonomic_names; Owner: bien
1003 1073
--
1004 1074

  
......
1711 1781
ALTER FUNCTION "public.test_taxonomic_names".rm_version_suffix(name text) OWNER TO bien;
1712 1782

  
1713 1783
--
1784
-- Name: source__observation_type(text, anyelement); Type: FUNCTION; Schema: public.test_taxonomic_names; Owner: bien
1785
--
1786

  
1787
CREATE FUNCTION source__observation_type(shortname text, schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS text
1788
    LANGUAGE plpgsql STABLE
1789
    SET client_min_messages TO 'warning'
1790
    SET search_path TO pg_temp
1791
    AS $$
1792
/* must use LANGUAGE plpgsql because LANGUAGE sql does not support runtime
1793
changes of search_path (schema elements are bound at inline time rather than
1794
runtime) */
1795
/* function option search_path is needed to limit the effects of
1796
`SET LOCAL search_path` to the current function */
1797
DECLARE
1798
	shortname_ text = shortname;
1799
BEGIN
1800
	PERFORM util.use_schema(schema_anchor);
1801
	
1802
	RETURN (SELECT observationtype FROM source
1803
		WHERE source.shortname = shortname_);
1804
END;
1805
$$;
1806

  
1807

  
1808
ALTER FUNCTION "public.test_taxonomic_names".source__observation_type(shortname text, schema_anchor anyelement) OWNER TO bien;
1809

  
1810
--
1714 1811
-- Name: source_by_shortname(text, anyelement); Type: FUNCTION; Schema: public.test_taxonomic_names; Owner: bien
1715 1812
--
1716 1813

  
......
1781 1878
ALTER FUNCTION "public.test_taxonomic_names".sourcename_set_matched_source_id() OWNER TO bien;
1782 1879

  
1783 1880
--
1881
-- Name: subspecies(text); Type: FUNCTION; Schema: public.test_taxonomic_names; Owner: bien
1882
--
1883

  
1884
CREATE FUNCTION subspecies(taxon_name text) RETURNS text
1885
    LANGUAGE sql IMMUTABLE
1886
    AS $_$
1887
SELECT util.subspecies($1)
1888
$_$;
1889

  
1890

  
1891
ALTER FUNCTION "public.test_taxonomic_names".subspecies(taxon_name text) OWNER TO bien;
1892

  
1893
--
1894
-- Name: FUNCTION subspecies(taxon_name text); Type: COMMENT; Schema: public.test_taxonomic_names; Owner: bien
1895
--
1896

  
1897
COMMENT ON FUNCTION subspecies(taxon_name text) IS '
1898
wrapper that prevents views from getting dropped when the util schema is reinstalled
1899
';
1900

  
1901

  
1902
--
1784 1903
-- Name: taxon_trait_view_modify(); Type: FUNCTION; Schema: public.test_taxonomic_names; Owner: bien
1785 1904
--
1786 1905

  
......
2882 3001
    analytical_stem.scrubbed_species_binomial AS "speciesBinomial",
2883 3002
    analytical_stem.scrubbed_taxon_name_with_author AS "scientificName"
2884 3003
   FROM analytical_stem
2885
  WHERE ((((((COALESCE((analytical_stem.geovalid_bien)::boolean, true) AND (COALESCE((analytical_stem."isNewWorld_bien")::boolean, false) OR lat_long_in_new_world(analytical_stem."decimalLatitude__@DwC__@vegpath.org", analytical_stem."decimalLongitude__@DwC__@vegpath.org"))) AND (NOT COALESCE((analytical_stem.cultivated_bien)::boolean, false))) AND (analytical_stem.scrubbed_family IS NOT NULL)) AND (analytical_stem."decimalLatitude__@DwC__@vegpath.org" IS NOT NULL)) AND (analytical_stem."decimalLongitude__@DwC__@vegpath.org" IS NOT NULL)) AND COALESCE((analytical_stem."coordinateUncertaintyInMeters__@DwC__@vegpath.org" <= _km_to_m((10)::double precision)), true));
3004
  WHERE ((((((COALESCE((analytical_stem.geovalid_bien)::boolean, true) AND (COALESCE((analytical_stem."isNewWorld_bien")::boolean, false) OR in_new_world(analytical_stem."decimalLatitude__@DwC__@vegpath.org", analytical_stem."decimalLongitude__@DwC__@vegpath.org"))) AND (NOT COALESCE((analytical_stem.cultivated_bien)::boolean, false))) AND (analytical_stem.scrubbed_family IS NOT NULL)) AND (analytical_stem."decimalLatitude__@DwC__@vegpath.org" IS NOT NULL)) AND (analytical_stem."decimalLongitude__@DwC__@vegpath.org" IS NOT NULL)) AND COALESCE((analytical_stem."coordinateUncertaintyInMeters__@DwC__@vegpath.org" <= _km_to_m((10)::double precision)), true));
2886 3005

  
2887 3006

  
2888 3007
ALTER TABLE "public.test_taxonomic_names"."2014-6-12.Jeff_Ott.climatic_range_determinants" OWNER TO bien;
2889 3008

  
2890 3009
--
3010
-- Name: iucn_red_list; Type: TABLE; Schema: public.test_taxonomic_names; Owner: bien; Tablespace: 
3011
--
3012

  
3013
CREATE TABLE iucn_red_list (
3014
    accepted_family text NOT NULL,
3015
    accepted_species_binomial text NOT NULL
3016
);
3017

  
3018

  
3019
ALTER TABLE "public.test_taxonomic_names".iucn_red_list OWNER TO bien;
3020

  
3021
--
3022
-- Name: source; Type: TABLE; Schema: public.test_taxonomic_names; Owner: bien; Tablespace: 
3023
--
3024

  
3025
CREATE TABLE source (
3026
    source_id integer NOT NULL,
3027
    matched_source_id integer,
3028
    parent_id integer,
3029
    shortname text NOT NULL,
3030
    citation text,
3031
    sourcetype sourcetype,
3032
    accesslevel accesslevel,
3033
    accessconditions text,
3034
    observationtype observationtype,
3035
    title text,
3036
    titlesuperior text,
3037
    volume text,
3038
    issue text,
3039
    pagerange text,
3040
    totalpages integer,
3041
    publisher text,
3042
    publicationplace text,
3043
    isbn text,
3044
    edition text,
3045
    numberofvolumes integer,
3046
    chapternumber integer,
3047
    reportnumber integer,
3048
    communicationtype text,
3049
    degree text,
3050
    url text,
3051
    doi text,
3052
    additionalinfo text,
3053
    pubdate date,
3054
    accessdate date,
3055
    conferencedate date,
3056
    datecreated date DEFAULT now() NOT NULL,
3057
    createdby text,
3058
    datelastmodified date DEFAULT now() NOT NULL,
3059
    lastmodifiedby text,
3060
    import_revision text
3061
);
3062

  
3063

  
3064
ALTER TABLE "public.test_taxonomic_names".source OWNER TO bien;
3065

  
3066
--
2891 3067
-- Name: 2014-6-4.Iara_Lacher.reserve_prioritization; Type: VIEW; Schema: public.test_taxonomic_names; Owner: bien
2892 3068
--
2893 3069

  
......
2896 3072
    analytical_stem."decimalLatitude__@DwC__@vegpath.org" AS "decimalLatitude",
2897 3073
    analytical_stem."decimalLongitude__@DwC__@vegpath.org" AS "decimalLongitude",
2898 3074
    analytical_stem."(-Earliest-)DateCollected__-2007-04-17__@DwC__.hist@vegpath.org" AS "dateCollected",
3075
    source.observationtype AS collection_type,
2899 3076
    COALESCE(analytical_stem."[custodial_]institutionCode[s]__@DwC__@vegpath.org", analytical_stem."datasource__@Brad__.identifier_examples@vegpath.org") AS orig_datasource,
2900 3077
    analytical_stem.scrubbed_family AS accepted_family,
2901 3078
    analytical_stem.scrubbed_genus AS accepted_genus,
2902 3079
    analytical_stem.scrubbed_species_binomial AS accepted_species_binomial,
2903
    analytical_stem.scrubbed_taxon_name_with_author AS accepted_taxon_name_with_author,
2904
    analytical_stem."[growth_form=]habit__@SALVIAS__.Plot_data@vegpath.org" AS lifeform
2905
   FROM analytical_stem
2906
  WHERE ((COALESCE((analytical_stem.geovalid_bien)::boolean, true) AND (NOT COALESCE((analytical_stem.cultivated_bien)::boolean, false))) AND COALESCE((analytical_stem."taxonomicStatus__@DwC__@vegpath.org" = 'accepted'::text), false));
3080
    subspecies(analytical_stem.scrubbed_taxon_name_no_author) AS accepted_subspecies,
3081
    analytical_stem."stem_dbh[_cm]__@SALVIAS__.Plot_data@vegpath.org" AS dbh_cm,
3082
    analytical_stem."stemHeight[_m]__@VegBank__.stemCount@vegpath.org" AS height_m,
3083
    analytical_stem."[growth_form=]habit__@SALVIAS__.Plot_data@vegpath.org" AS lifeform,
3084
    (iucn_red_list.accepted_family IS NOT NULL) AS is_threatened_iucn
3085
   FROM ((analytical_stem
3086
   LEFT JOIN source ON ((source.shortname = analytical_stem."datasource__@Brad__.identifier_examples@vegpath.org")))
3087
   LEFT JOIN iucn_red_list ON (((iucn_red_list.accepted_family = analytical_stem.scrubbed_family) AND (iucn_red_list.accepted_species_binomial = analytical_stem.scrubbed_species_binomial))))
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff