Revision 5703
Added by Aaron Marcuse-Kubitza about 12 years ago
inputs/.NCBI/higher_taxa/create.sql | ||
---|---|---|
1 |
SELECT * |
|
2 |
FROM nodes |
|
3 |
JOIN names USING (tax_id) |
|
4 |
WHERE "name class" = 'scientific name' |
|
5 |
; |
|
6 |
|
|
7 |
ALTER TABLE :table ALTER COLUMN tax_id TYPE integer |
|
8 |
USING tax_id::integer; |
|
9 |
ALTER TABLE :table ALTER COLUMN "parent tax_id" TYPE integer |
|
10 |
USING "parent tax_id"::integer; |
|
11 |
|
|
12 |
ALTER TABLE :table ADD PRIMARY KEY (tax_id); |
inputs/.NCBI/higher_taxa/header.csv | ||
---|---|---|
1 |
tax_id,parent tax_id,rank,embl code,4,5,6,7,8,9,name_txt,unique name,name class |
inputs/.NCBI/higher_taxa/map.csv | ||
---|---|---|
1 |
NCBI,VegCore,Filter,Comments |
|
2 |
tax_id,taxonID,, |
|
3 |
parent tax_id,parentTaxonID,, |
|
4 |
rank,taxonRank,, |
|
5 |
embl code,*embl code,, |
|
6 |
4,*4,, |
|
7 |
5,*5,, |
|
8 |
6,*6,, |
|
9 |
7,*7,, |
|
10 |
8,*8,, |
|
11 |
9,*9,, |
|
12 |
name_txt,taxonName,, |
|
13 |
unique name,*unique name,, |
|
14 |
name class,*name class,, |
inputs/.NCBI/higher_taxa/test.xml.ref | ||
---|---|---|
1 |
Put template: |
|
2 |
<VegBIEN> |
|
3 |
<_simplifyPath id="-1"> |
|
4 |
<next>parent_id</next> |
|
5 |
<path> |
|
6 |
<location> |
|
7 |
<locationevent> |
|
8 |
<taxonoccurrence> |
|
9 |
<taxondetermination> |
|
10 |
<taxonverbatim_id> |
|
11 |
<taxonverbatim> |
|
12 |
<taxonlabel_id> |
|
13 |
<taxonlabel> |
|
14 |
<matched_label_id> |
|
15 |
<taxonlabel> |
|
16 |
<creator_id> |
|
17 |
<party> |
|
18 |
<creator_id>0</creator_id> |
|
19 |
<organizationname>TNRS</organizationname> |
|
20 |
</party> |
|
21 |
</creator_id> |
|
22 |
<taxonomicname>$name_txt</taxonomicname> |
|
23 |
</taxonlabel> |
|
24 |
</matched_label_id> |
|
25 |
<_taxonlabel_set_parent_id><parent_id><taxonlabel><sourceaccessioncode>$parent tax_id</sourceaccessioncode></taxonlabel></parent_id></_taxonlabel_set_parent_id> |
|
26 |
<rank>$rank</rank> |
|
27 |
<sourceaccessioncode>$tax_id</sourceaccessioncode> |
|
28 |
<taxonepithet> |
|
29 |
<_if name="if is higher taxon"> |
|
30 |
<cond><_is_higher_taxon><rank>$rank</rank></_is_higher_taxon></cond> |
|
31 |
<then>$name_txt</then> |
|
32 |
</_if> |
|
33 |
</taxonepithet> |
|
34 |
<taxonomicname> |
|
35 |
<_if name="if is higher taxon"> |
|
36 |
<cond><_is_higher_taxon><rank>$rank</rank></_is_higher_taxon></cond> |
|
37 |
<else>$name_txt</else> |
|
38 |
</_if> |
|
39 |
</taxonomicname> |
|
40 |
</taxonlabel> |
|
41 |
</taxonlabel_id> |
|
42 |
<verbatimrank>$rank</verbatimrank> |
|
43 |
</taxonverbatim> |
|
44 |
</taxonverbatim_id> |
|
45 |
</taxondetermination> |
|
46 |
</taxonoccurrence> |
|
47 |
</locationevent> |
|
48 |
</location> |
|
49 |
</path> |
|
50 |
</_simplifyPath> |
|
51 |
</VegBIEN> |
|
52 |
Inserted 11 new rows into database |
inputs/.NCBI/higher_taxa/VegBIEN.csv | ||
---|---|---|
1 |
NCBI,VegBIEN:/_simplifyPath:[next=parent_id]/path,Comments |
|
2 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/_if[@name=""if has verbatim name""]/else/matched_label_id/taxonlabel:[creator_id/party:[creator_id=0]/organizationname=TNRS]/taxonomicname/_alt/2/_join_words/1/_alt/2/_join_words/5/_join_words/1/_if[@name=""if has infraspecificEpithet""]/then", |
|
3 |
name_txt,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/_if[@name=""if has verbatim name""]/else/matched_label_id/taxonlabel:[creator_id/party:[creator_id=0]/organizationname=TNRS]/taxonomicname/_alt/2/_join_words/1/_alt/2/_join_words/6", |
|
4 |
parent tax_id,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/_taxonlabel_set_parent_id/parent_id/taxonlabel/sourceaccessioncode, |
|
5 |
parent tax_id,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/_if[@name=""if has explicit parent""]/cond/_exists", |
|
6 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/_if[@name=""if has explicit parent""]/else/rank", |
|
7 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/_if[@name=""if has explicit parent""]/else/taxonverbatim/verbatimrank", |
|
8 |
rank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/rank, |
|
9 |
tax_id,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/sourceaccessioncode, |
|
10 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonepithet/_if[@name=""if is higher taxon""]/cond/_is_higher_taxon/rank", |
|
11 |
name_txt,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonepithet/_if[@name=""if is higher taxon""]/then", |
|
12 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_alt/2/_join_words/1/_alt/2/_join_words/5/_join_words/1/_if[@name=""if has infraspecificEpithet""]/then", |
|
13 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_alt/3/_if[@name=""if is higher taxon""]/cond/_is_higher_taxon/rank", |
|
14 |
name_txt,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_alt/3/_if[@name=""if is higher taxon""]/else", |
|
15 |
rank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/verbatimrank, |
|
16 |
4,,** No join mapping for *4 ** |
|
17 |
5,,** No join mapping for *5 ** |
|
18 |
6,,** No join mapping for *6 ** |
|
19 |
7,,** No join mapping for *7 ** |
|
20 |
8,,** No join mapping for *8 ** |
|
21 |
9,,** No join mapping for *9 ** |
|
22 |
embl code,,** No join mapping for *embl code ** |
|
23 |
name class,,** No join mapping for *name class ** |
|
24 |
unique name,,** No join mapping for *unique name ** |
inputs/.NCBI/higher_taxa/new_terms.csv | ||
---|---|---|
1 |
tax_id,taxonID,, |
|
2 |
parent tax_id,parentTaxonID,, |
|
3 |
rank,taxonRank,, |
|
4 |
name_txt,taxonName,, |
inputs/.NCBI/higher_taxa/unmapped_terms.csv | ||
---|---|---|
1 |
*embl code |
|
2 |
*4 |
|
3 |
*5 |
|
4 |
*6 |
|
5 |
*7 |
|
6 |
*8 |
|
7 |
*9 |
|
8 |
*unique name |
|
9 |
*name class |
inputs/.NCBI/nodes/VegBIEN.csv | ||
---|---|---|
1 |
NCBI,VegBIEN:/_simplifyPath:[next=parent_id]/path,Comments |
|
2 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/_if[@name=""if has verbatim name""]/else/matched_label_id/taxonlabel:[creator_id/party:[creator_id=0]/organizationname=TNRS]/taxonomicname/_alt/2/_join_words/1/_alt/2/_join_words/5/_join_words/1/_if[@name=""if has infraspecificEpithet""]/then", |
|
3 |
name_txt,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/_if[@name=""if has verbatim name""]/else/matched_label_id/taxonlabel:[creator_id/party:[creator_id=0]/organizationname=TNRS]/taxonomicname/_alt/2/_join_words/1/_alt/2/_join_words/6", |
|
4 |
parent tax_id,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/_taxonlabel_set_parent_id/parent_id/taxonlabel/sourceaccessioncode, |
|
5 |
parent tax_id,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/_if[@name=""if has explicit parent""]/cond/_exists", |
|
6 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/_if[@name=""if has explicit parent""]/else/rank", |
|
7 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/_if[@name=""if has explicit parent""]/else/taxonverbatim/verbatimrank", |
|
8 |
rank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/rank, |
|
9 |
tax_id,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/sourceaccessioncode, |
|
10 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonepithet/_if[@name=""if is higher taxon""]/cond/_is_higher_taxon/rank", |
|
11 |
name_txt,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonepithet/_if[@name=""if is higher taxon""]/then", |
|
12 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_alt/2/_join_words/1/_alt/2/_join_words/5/_join_words/1/_if[@name=""if has infraspecificEpithet""]/then", |
|
13 |
rank,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_alt/3/_if[@name=""if is higher taxon""]/cond/_is_higher_taxon/rank", |
|
14 |
name_txt,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_alt/3/_if[@name=""if is higher taxon""]/else", |
|
15 |
rank,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/verbatimrank, |
|
16 |
4,,** No join mapping for *4 ** |
|
17 |
5,,** No join mapping for *5 ** |
|
18 |
6,,** No join mapping for *6 ** |
|
19 |
7,,** No join mapping for *7 ** |
|
20 |
8,,** No join mapping for *8 ** |
|
21 |
9,,** No join mapping for *9 ** |
|
22 |
embl code,,** No join mapping for *embl code ** |
|
23 |
name class,,** No join mapping for *name class ** |
|
24 |
unique name,,** No join mapping for *unique name ** |
inputs/.NCBI/nodes/test.xml.ref | ||
---|---|---|
1 |
Put template: |
|
2 |
<VegBIEN> |
|
3 |
<_simplifyPath id="-1"> |
|
4 |
<next>parent_id</next> |
|
5 |
<path> |
|
6 |
<location> |
|
7 |
<locationevent> |
|
8 |
<taxonoccurrence> |
|
9 |
<taxondetermination> |
|
10 |
<taxonverbatim_id> |
|
11 |
<taxonverbatim> |
|
12 |
<taxonlabel_id> |
|
13 |
<taxonlabel> |
|
14 |
<matched_label_id> |
|
15 |
<taxonlabel> |
|
16 |
<creator_id> |
|
17 |
<party> |
|
18 |
<creator_id>0</creator_id> |
|
19 |
<organizationname>TNRS</organizationname> |
|
20 |
</party> |
|
21 |
</creator_id> |
|
22 |
<taxonomicname>$name_txt</taxonomicname> |
|
23 |
</taxonlabel> |
|
24 |
</matched_label_id> |
|
25 |
<_taxonlabel_set_parent_id><parent_id><taxonlabel><sourceaccessioncode>$parent tax_id</sourceaccessioncode></taxonlabel></parent_id></_taxonlabel_set_parent_id> |
|
26 |
<rank>$rank</rank> |
|
27 |
<sourceaccessioncode>$tax_id</sourceaccessioncode> |
|
28 |
<taxonepithet> |
|
29 |
<_if name="if is higher taxon"> |
|
30 |
<cond><_is_higher_taxon><rank>$rank</rank></_is_higher_taxon></cond> |
|
31 |
<then>$name_txt</then> |
|
32 |
</_if> |
|
33 |
</taxonepithet> |
|
34 |
<taxonomicname> |
|
35 |
<_if name="if is higher taxon"> |
|
36 |
<cond><_is_higher_taxon><rank>$rank</rank></_is_higher_taxon></cond> |
|
37 |
<else>$name_txt</else> |
|
38 |
</_if> |
|
39 |
</taxonomicname> |
|
40 |
</taxonlabel> |
|
41 |
</taxonlabel_id> |
|
42 |
<verbatimrank>$rank</verbatimrank> |
|
43 |
</taxonverbatim> |
|
44 |
</taxonverbatim_id> |
|
45 |
</taxondetermination> |
|
46 |
</taxonoccurrence> |
|
47 |
</locationevent> |
|
48 |
</location> |
|
49 |
</path> |
|
50 |
</_simplifyPath> |
|
51 |
</VegBIEN> |
|
52 |
Inserted 11 new rows into database |
inputs/.NCBI/nodes/create.sql | ||
---|---|---|
1 |
SELECT * |
|
2 |
FROM nodes |
|
3 |
JOIN names USING (tax_id) |
|
4 |
WHERE "name class" = 'scientific name' |
|
5 |
; |
|
6 |
|
|
7 |
ALTER TABLE :table ALTER COLUMN tax_id TYPE integer |
|
8 |
USING tax_id::integer; |
|
9 |
ALTER TABLE :table ALTER COLUMN "parent tax_id" TYPE integer |
|
10 |
USING "parent tax_id"::integer; |
|
11 |
|
|
12 |
ALTER TABLE :table ADD PRIMARY KEY (tax_id); |
inputs/.NCBI/nodes/header.csv | ||
---|---|---|
1 |
tax_id,parent tax_id,rank,embl code,4,5,6,7,8,9,name_txt,unique name,name class |
inputs/.NCBI/nodes/map.csv | ||
---|---|---|
1 |
NCBI,VegCore,Filter,Comments |
|
2 |
tax_id,taxonID,, |
|
3 |
parent tax_id,parentTaxonID,, |
|
4 |
rank,taxonRank,, |
|
5 |
embl code,*embl code,, |
|
6 |
4,*4,, |
|
7 |
5,*5,, |
|
8 |
6,*6,, |
|
9 |
7,*7,, |
|
10 |
8,*8,, |
|
11 |
9,*9,, |
|
12 |
name_txt,taxonName,, |
|
13 |
unique name,*unique name,, |
|
14 |
name class,*name class,, |
inputs/.NCBI/nodes/new_terms.csv | ||
---|---|---|
1 |
tax_id,taxonID,, |
|
2 |
parent tax_id,parentTaxonID,, |
|
3 |
rank,taxonRank,, |
|
4 |
name_txt,taxonName,, |
inputs/.NCBI/nodes/unmapped_terms.csv | ||
---|---|---|
1 |
*embl code |
|
2 |
*4 |
|
3 |
*5 |
|
4 |
*6 |
|
5 |
*7 |
|
6 |
*8 |
|
7 |
*9 |
|
8 |
*unique name |
|
9 |
*name class |
Also available in: Unified diff
inputs/.NCBI/: Renamed higher_taxa to nodes because it currently doesn't just contain the higher taxa