Revision 14307
Added by Aaron Marcuse-Kubitza over 10 years ago
schema.sql | ||
---|---|---|
198 | 198 |
new."[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT |
199 | 199 |
("*Genus_matched" || ' '::text) || "*Specific_epithet_matched" |
200 | 200 |
FROM (SELECT new.*) new); |
201 |
|
|
202 | 201 |
new."[matched_]scientificName[_with_author]__@DwC__@vegpath.org" = (SELECT |
203 | 202 |
"*Name_matched" || COALESCE((' '::text || "*Name_matched_author"), ''::text) |
204 | 203 |
FROM (SELECT new.*) new); |
205 |
|
|
206 | 204 |
new.matched_has_accepted = (SELECT |
207 | 205 |
"*Accepted_name" IS NOT NULL |
208 | 206 |
FROM (SELECT new.*) new); |
209 |
|
|
210 | 207 |
new."__accepted_{genus,specific_epithet}" = (SELECT |
211 | 208 |
regexp_split_to_array("*Accepted_name_species", ' '::text) |
212 | 209 |
FROM (SELECT new.*) new); |
213 |
|
|
214 | 210 |
new."[accepted_]genus__@DwC__@vegpath.org" = (SELECT |
215 | 211 |
"__accepted_{genus,specific_epithet}"[1] |
216 | 212 |
FROM (SELECT new.*) new); |
217 |
|
|
218 | 213 |
new."[accepted_]specificEpithet__@DwC__@vegpath.org" = (SELECT |
219 | 214 |
"__accepted_{genus,specific_epithet}"[2] |
220 | 215 |
FROM (SELECT new.*) new); |
221 |
|
|
222 | 216 |
new.__accepted_infraspecific_label = (SELECT |
223 | 217 |
ltrim(NULLIF(util.remove_prefix("*Accepted_name_species", "*Accepted_name", require := true), ''::text), ' '::text) |
224 | 218 |
FROM (SELECT new.*) new); |
225 |
|
|
226 | 219 |
new."__accepted_infraspecific_{rank,epithet}" = (SELECT |
227 | 220 |
regexp_split_to_array(__accepted_infraspecific_label, ' '::text) |
228 | 221 |
FROM (SELECT new.*) new); |
229 |
|
|
230 | 222 |
new."[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" = (SELECT |
231 | 223 |
"__accepted_infraspecific_{rank,epithet}"[1] |
232 | 224 |
FROM (SELECT new.*) new); |
233 |
|
|
234 | 225 |
new."[accepted_]infraspecificEpithet__@DwC__@vegpath.org" = (SELECT |
235 | 226 |
"__accepted_infraspecific_{rank,epithet}"[2] |
236 | 227 |
FROM (SELECT new.*) new); |
237 |
|
|
238 | 228 |
new."[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" = (SELECT |
239 | 229 |
"*Accepted_name" || COALESCE((' '::text || "*Accepted_name_author"), ''::text) |
240 | 230 |
FROM (SELECT new.*) new); |
241 |
|
|
242 | 231 |
new."[scrubbed_]taxonRank__@DwC__@vegpath.org" = (SELECT |
243 | 232 |
CASE |
244 | 233 |
WHEN matched_has_accepted THEN "*Accepted_name_rank" |
245 | 234 |
ELSE "*Name_matched_rank" |
246 | 235 |
END |
247 | 236 |
FROM (SELECT new.*) new); |
248 |
|
|
249 | 237 |
new."[scrubbed_]family~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT |
250 | 238 |
CASE |
251 | 239 |
WHEN matched_has_accepted THEN "*Accepted_name_family" |
252 | 240 |
ELSE "*Name_matched_accepted_family" |
253 | 241 |
END |
254 | 242 |
FROM (SELECT new.*) new); |
255 |
|
|
256 | 243 |
new."[scrubbed_]genus__@DwC__@vegpath.org" = (SELECT |
257 | 244 |
CASE |
258 | 245 |
WHEN matched_has_accepted THEN "[accepted_]genus__@DwC__@vegpath.org" |
259 | 246 |
ELSE "*Genus_matched" |
260 | 247 |
END |
261 | 248 |
FROM (SELECT new.*) new); |
262 |
|
|
263 | 249 |
new."[scrubbed_]specificEpithet__@DwC__@vegpath.org" = (SELECT |
264 | 250 |
CASE |
265 | 251 |
WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org" |
266 | 252 |
ELSE "*Specific_epithet_matched" |
267 | 253 |
END |
268 | 254 |
FROM (SELECT new.*) new); |
269 |
|
|
270 | 255 |
new."[scrubbed_]species[_binom]~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT |
271 | 256 |
CASE |
272 | 257 |
WHEN matched_has_accepted THEN "*Accepted_name_species" |
273 | 258 |
ELSE "[matched_]species[_binomial]~(-Accepted_-)__@TNRS__@vegpath.org" |
274 | 259 |
END |
275 | 260 |
FROM (SELECT new.*) new); |
276 |
|
|
277 | 261 |
new."[scrubbed_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" = (SELECT |
278 | 262 |
CASE |
279 | 263 |
WHEN matched_has_accepted THEN "[accepted_]Infraspecific_rank[_abbr]__@TNRS__@vegpath.org" |
280 | 264 |
ELSE "*Infraspecific_rank" |
281 | 265 |
END |
282 | 266 |
FROM (SELECT new.*) new); |
283 |
|
|
284 | 267 |
new."[scrubbed_]infraspecificEpithet__@DwC__@vegpath.org" = (SELECT |
285 | 268 |
CASE |
286 | 269 |
WHEN matched_has_accepted THEN "[accepted_]specificEpithet__@DwC__@vegpath.org" |
287 | 270 |
ELSE "*Infraspecific_epithet_matched" |
288 | 271 |
END |
289 | 272 |
FROM (SELECT new.*) new); |
290 |
|
|
291 | 273 |
new."[scrubbed_]name[_no_author]~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT |
292 | 274 |
CASE |
293 | 275 |
WHEN matched_has_accepted THEN "*Accepted_name" |
294 | 276 |
ELSE "*Name_matched" |
295 | 277 |
END |
296 | 278 |
FROM (SELECT new.*) new); |
297 |
|
|
298 | 279 |
new."[scrubbed_]author~(-Accepted_-)__@TNRS__@vegpath.org" = (SELECT |
299 | 280 |
CASE |
300 | 281 |
WHEN matched_has_accepted THEN "*Accepted_name_author" |
301 | 282 |
ELSE "*Name_matched_author" |
302 | 283 |
END |
303 | 284 |
FROM (SELECT new.*) new); |
304 |
|
|
305 | 285 |
new."[scrubbed_]scientificName[_with_author]__@DwC__@vegpath.org" = (SELECT |
306 | 286 |
CASE |
307 | 287 |
WHEN matched_has_accepted THEN "[accepted_]scientificName[_with_author]__@DwC__@vegpath.org" |
308 | 288 |
ELSE "[matched_]scientificName[_with_author]__@DwC__@vegpath.org" |
309 | 289 |
END |
310 | 290 |
FROM (SELECT new.*) new); |
311 |
|
|
312 | 291 |
new."[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org" = (SELECT |
313 | 292 |
"*Unmatched_terms" |
314 | 293 |
FROM (SELECT new.*) new); |
315 |
|
|
316 | 294 |
new."[accepted_]morphospecies[_binomial]__@Brad__.TNRS@vegpath.org" = (SELECT |
317 | 295 |
CASE |
318 | 296 |
WHEN ("*Accepted_name_rank" = 'family'::text) THEN concat_ws(' '::text, "*Accepted_name_family", "[parsed_]morphospecies[_suffix]__@Brad__.morphosp@vegpath.org") |
Also available in: Unified diff
inputs/.TNRS/schema.sql: derived_cols_trigger_update(): removed lines between statements, which add too much space