Project

General

Profile

Statistics
| Revision:

# Date Author Comment
5038 09/27/2012 03:35 AM Aaron Marcuse-Kubitza

with_all: Support additional command-line args for the make target, such as vars

5037 09/27/2012 03:11 AM Aaron Marcuse-Kubitza

sql_io.py: append_csv(): Check that the CSV's header matches the table's columns

5036 09/27/2012 03:08 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: Added tnrs table to hold contents of TNRS response

5035 09/27/2012 02:20 AM Aaron Marcuse-Kubitza

input.Makefile: Existing maps discovery: $(anyMap): Inlined patterns used because they are only used here

5034 09/27/2012 01:27 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath_canon_taxonpath_id_self_ref(), placepath_canon_placepath_id_self_ref(): Fixed bug where the pkey could only be prepopulated if it was not already set, in order to support UPDATE as well as INSERT statements

5033 09/27/2012 01:15 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath.canon_taxonpath_id, placepath.canon_placepath_id: Fixed comment describing that the special value 0 creates an automatic self-reference

5032 09/27/2012 01:09 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath.canon_taxonpath_id, placepath.canon_placepath_id: Added trigger to automatically create a self-reference (indicating a scrubbed name) when set to the special value 0

5031 09/27/2012 12:33 AM Aaron Marcuse-Kubitza

input.Makefile: Staging tables installation: `%/install: %/create.sql`: Don't add a row number column to the created table because it is now added automatically to the temp table by column-based import (row-based import now also does not require a pkey for DB inputs)

5030 09/27/2012 12:28 AM Aaron Marcuse-Kubitza

bin/map, db_xml.put_table() (row-based and column-based import): Don't sort the input table by its pkey, in order to support input tables with no pkey. Note that reading the input table in table order and having this match the input flat file's order is only possible with sql_io.import_csv()'s truncation of the table on a failed import, which ensures that the rows will be stored in inserted order.

5029 09/27/2012 12:19 AM Aaron Marcuse-Kubitza

input.Makefile: Staging tables installation: Removed no longer used $(isJoinedTable). Note that it is no longer necessary for joined tables to be suffixed with ".src" to prevent the creation of a row_num column, which collided during joins.

5028 09/27/2012 12:17 AM Aaron Marcuse-Kubitza

csv2db: Removed no longer used has_row_num param

5027 09/27/2012 12:14 AM Aaron Marcuse-Kubitza

sql_io.py: import_csv(): Don't add a row number column to the created table because it is now added automatically to the temp table by column-based import (row-based import now also does not require a pkey for DB inputs)

5026 09/26/2012 11:49 PM Aaron Marcuse-Kubitza

bin/map, db_xml.put_table() (row-based and column-based import): Don't sort the input table by its pkey, in order to support input tables with no pkey. Note that reading the input table in table order and having this match the input flat file's order is only possible with sql_io.import_csv()'s truncation of the table on a failed import, which ensures that the rows will be stored in inserted order.

5025 09/26/2012 11:34 PM Aaron Marcuse-Kubitza

sql_io.py: import_csv(): Only do the import in a savepoint if using COPY FROM, to allow autocommits after each insert and thus make rows visible immediately after they are inserted

5024 09/26/2012 10:53 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Subsetting in_table: Add a row number column if in_table does not already have a pkey

5023 09/26/2012 10:48 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Subsetting in_table: Copy all of in_table's structure, rather than just the column types, by using sql.copy_table_struct() and sql.insert_select(). This preserves pkeys and NOT NULL constraints, which are useful for column-based import.

5022 09/26/2012 10:47 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Subsetting in_table: Create in_table as a completely new sql_gen.Table instead of copying full_in_table and relying on sql.run_query_into() to set is_temp and remove the schema

5021 09/26/2012 10:40 PM Aaron Marcuse-Kubitza

sql.py: add_row_num(): Use if_not_exists in order to abort if the column already exists rather than adding a version #

5020 09/26/2012 10:36 PM Aaron Marcuse-Kubitza

sql.py: add_col(): Added if_not_exists param to abort if the column already exists rather than adding a version #

5019 09/26/2012 10:14 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Removed no longer accurate comment that full_in_table will be shadowed (hidden) by the created temp table. (The temp table is now named differently, so the shadowing does not occur.)

5018 09/26/2012 10:02 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Replaced no longer accurate Recurse comment with Import data. Rewrapped lines.

5017 09/26/2012 09:12 PM Aaron Marcuse-Kubitza

sql_io.py: import_csv(): Factored insertion code out into new append_csv()

5016 09/26/2012 08:47 PM Aaron Marcuse-Kubitza

README.TXT: Data import: `make test by_col=1`: Replaced errors explanation with pointer to updated explanation in the Testing section

5015 09/26/2012 08:31 PM Aaron Marcuse-Kubitza

xml_func.py: Removed no longer used _name(). Use _join_words() instead.

5014 09/26/2012 08:30 PM Aaron Marcuse-Kubitza

mappings/VegCore-VegBIEN.csv: Use new, more general _join_words() instead of _name()

5013 09/26/2012 08:22 PM Aaron Marcuse-Kubitza

mappings/Veg+-VegCore.csv: Prefix ambiguous terms' VegCore replacement with "?" so it's visually flagged in map.csv, in the same way that unmatched terms are flagged with a "*" prefix

5012 09/26/2012 08:19 PM Aaron Marcuse-Kubitza

mappings/VegCore-VegBIEN.csv: Taxonomic terms: Also join terms together in taxonomicnamewithauthor if scientificNameWithAuthorship is not provided, for use by TNRS

5011 09/26/2012 08:15 PM Aaron Marcuse-Kubitza

xml_func.py: Simplifying functions: Merging: Added _join_words()

5010 09/26/2012 07:57 PM Aaron Marcuse-Kubitza

inputs/ARIZ/Specimen/map.csv: Remapped ScientificNameAuthor to scientificNameWithAuthorship because it contains the binomial in addition to the authority

5009 09/26/2012 07:39 PM Aaron Marcuse-Kubitza

schemas/functions.sql: Added _join_words()

5008 09/26/2012 07:33 PM Aaron Marcuse-Kubitza

input.Makefile: Paths: $(datasrc): Remove any "." prefix from the subdir name. The "." prefix allows a subdir to be hidden from the normal import process.

5007 09/26/2012 06:56 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Allow caller to specify custom partition_size

5006 09/26/2012 06:45 PM Aaron Marcuse-Kubitza

tnrs.py: tnrs_request(): Return the CSV stream directly instead of reading it into a string

5005 09/26/2012 06:42 PM Aaron Marcuse-Kubitza

tnrs.py: tnrs_request(): Moved CSV-download-specific functionality from do_request() to the Download section

5004 09/26/2012 06:34 PM Aaron Marcuse-Kubitza

inputs/import.stats.xls: Updated import times

5003 09/25/2012 11:13 PM Aaron Marcuse-Kubitza

tnrs.py: tnrs_request(): Return the response instead of printing it to stdout

5002 09/25/2012 10:59 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _namePart(): Fixed bug where it was returning the empty string instead of NULL

5001 09/25/2012 10:46 PM Aaron Marcuse-Kubitza

sql_io.py: import_csv(): Documented that sql.truncate() MUST be run so that the rows will be stored in inserted order, and the row_num added after import will match up with the CSV's row order

5000 09/25/2012 10:35 PM Aaron Marcuse-Kubitza

sql.py: add_row_num(): Add distinguishing comment to ADD COLUMN statement so that it will be cached. The distinguishing comment is required because sometimes column names are truncated, leading to unwanted collisions with previously-cached ADD COLUMN statements. It provides a way of distinguishing the full column name behind a particular ADD COLUMN statement.

4999 09/25/2012 10:24 PM Aaron Marcuse-Kubitza

sql_io.py: import_csv(): Free memory used by deleted rows from any failed import. Documented that sql.create_table() is not rolled back if the import fails, but instead is cached, and will not be re-run if the import is retried.

4998 09/25/2012 09:37 PM Aaron Marcuse-Kubitza

sql_io.py: import_csv(): Fixed bug where the added row number column needed to be named row_num instead of _row_num to be autodetected as the pkey column (sql.pkey_col) by sql.pkey() and to avoid name collisions with the row number column added in column-based import

4997 09/25/2012 09:34 PM Aaron Marcuse-Kubitza

sql.py: add_row_num(): Support custom row number column name

4996 09/25/2012 09:12 PM Aaron Marcuse-Kubitza

csv2db: Use new sql_io.import_csv()

4995 09/25/2012 09:10 PM Aaron Marcuse-Kubitza

sql_io.py: Added import_csv()

4994 09/25/2012 09:05 PM Aaron Marcuse-Kubitza

csv2db: Don't truncate the table before loading rows because it has just been created, and is therefore empty. This statement may be left over from a time when the table was created only once, and its creation was not rolled back if the import fails.

4993 09/25/2012 08:44 PM Aaron Marcuse-Kubitza

sql_io.py: cleanup_table(): Print 'Cleaning up table' log message

4992 09/25/2012 08:41 PM Aaron Marcuse-Kubitza

sql_io.py: cleanup_table(): Also vacuum and reanalyze table

4991 09/25/2012 07:43 PM Aaron Marcuse-Kubitza

tnrs_client: Use new tnrs.tnrs_request()

4990 09/25/2012 07:43 PM Aaron Marcuse-Kubitza

Added tnrs.py

4989 09/25/2012 07:34 PM Aaron Marcuse-Kubitza

tnrs_client: Factored TNRS request code into separate function tnrs_request()

4988 09/25/2012 07:23 PM Aaron Marcuse-Kubitza

inputs/VegBank/taxonimportance/map.csv: Documented that taxonimportance is not 1:1 with taxonobservation

4987 09/25/2012 07:22 PM Aaron Marcuse-Kubitza

mappings/VegCore-VegBIEN.csv: Removed unnecessary /_first/# suffix for multiple terms in the same _exists expression, because _exists() only checks whether its node is non-empty, and it does not matter how many child nodes it contains

4986 09/25/2012 06:57 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonoccurrence: taxonoccurrence_unique_within_locationevent unique index: Fixed bug where locationevent_id needed to be enclosed in COALESCE so that the unique constraint also applies to rows with NULL locationevent_ids (there is no other unique constraint handling these rows)

4985 09/25/2012 06:52 PM Aaron Marcuse-Kubitza

README.TXT: Documented that if the row-based and column-based imports produce different inserted row counts, this usually means that a table is underconstrained (the unique indexes don't cover all possible rows). The inserted row count difference occurs because column-based import collapses empty table rows into one insert, while row-based import performs an insert of the empty row for each input row. Without a unique index to combine multiple row-based inserts, extra rows will be added.

4984 09/25/2012 06:48 PM Aaron Marcuse-Kubitza

sql_io.py: put_table(): Warn if inserting empty table rows

4983 09/25/2012 06:13 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _namePart(): Fixed bug where it was returning the empty string instead of NULL

4982 09/25/2012 05:57 PM Aaron Marcuse-Kubitza

schemas/functions.sql, py_functions.sql: Added schema comment that functions must always return NULL in place of the empty string, to ensure that empty strings do not find their way into VegBIEN. Note that row-based import automatically removes empty strings because the intermediate values are stored in XML and our XML DOM traversing code auto-replaces the empty string with NULL. Column-based import, on the other hand, does not, because the intermediate data is stored in database temp tables instead of a DOM tree.

4981 09/25/2012 05:31 PM Aaron Marcuse-Kubitza

root map: Fixed custom public schema override to work with schemas lists that include public, by replacing public with the new public schema instead of just appending it

4980 09/25/2012 04:53 PM Aaron Marcuse-Kubitza

inputs/*/*/map.csv: Prefix a * to every term that's not in Veg+ for easy identification of unmapped terms when editing map.csv. Note that canon will remove the * when it finds a matching Veg+ term.

4979 09/25/2012 04:52 PM Aaron Marcuse-Kubitza

inputs/*/*/map.csv: Prefix a * to every term that's not in Veg+ for easy identification of unmapped terms when editing map.csv. Note that canon will remove the * when it finds a matching Veg+ term.

4978 09/25/2012 04:36 PM Aaron Marcuse-Kubitza

ins_col: Added column fill value param

4977 09/25/2012 04:16 PM Aaron Marcuse-Kubitza

inputs/VegBank/stemcount/map.csv: Fixed bug where taxonimportance_id needed to point to aggregateOccurrenceID instead of taxonOccurrenceID

4976 09/25/2012 04:15 PM Aaron Marcuse-Kubitza

mappings/VegCore-VegBIEN.csv: Don't forward individualID to taxonoccurrence.sourceaccessioncode when aggregateOccurrenceID is present

4975 09/25/2012 03:52 PM Aaron Marcuse-Kubitza

inputs/import.stats.xls: Updated import times

4974 09/24/2012 06:45 PM Aaron Marcuse-Kubitza

Regenerated vegbien.ERD exports

4973 09/24/2012 06:33 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: placepath.otherranks comment: Added analogous text from taxonpath.otherranks

4972 09/24/2012 06:31 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath.author comment: Added equivalent Darwin Core term

4971 09/24/2012 06:27 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxon columns: Added descriptive comments for data dictionary

4970 09/24/2012 06:15 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: placepath: Added canon_placepath_id, analogous to taxonpath.canon_taxonpath_id

4969 09/24/2012 06:09 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: place, placepath descriptive comments: Added analogous text from taxon/taxonpath

4968 09/24/2012 06:05 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath: descriptive comment: Changed "applicable taxon" to "identified taxon"

4967 09/24/2012 05:58 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxon: descriptive comment: Reworded to emphasize that this stores only one rank (e.g. family) of the full taxonomic name, in contrast to taxonpath, which stores all of them

4966 09/24/2012 05:54 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath: descriptive comment: Clarified that this is the full path to a taxon, including all components of the taxonomic name

4965 09/24/2012 05:48 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: Replaced "scientific name" with "taxonomic name" for schema-wide consistency and for consistency with the taxon/taxonomic name vocabulary

4964 09/24/2012 05:38 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath named ranks: Added descriptive comments for data dictionary

4963 09/24/2012 05:34 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath columns other than named ranks: Added descriptive comments for data dictionary

4962 09/24/2012 05:14 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonscope: descriptive comment: Reworded to make the first sentence a noun, for consistency with other descriptive table comments

4961 09/24/2012 05:13 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxon: descriptive comment: Added note that the taxonname stores only one rank (e.g. family) of the full identifying name

4960 09/24/2012 05:07 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath: descriptive comment: Reworded to make the first sentence a noun, for consistency with other descriptive table comments. The convention is for the first "sentence" to be a noun which describes the entity that the table models.

4959 09/24/2012 05:00 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: comments: Removed units from comments on fields which already have a units suffix, to avoid having to keep the units in sync between the suffix and the comment. Note that the units were abbreviated equally in the suffixes and comments, so this did not result in a loss of information other than the ^ for a quantity squared (but it's obvious enough that m2 is m^2).

4958 09/24/2012 04:54 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonscope: descriptive comment: Added period for consistency with other descriptive table comments

4957 09/24/2012 04:50 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxon: Added descriptive comment for data dictionary

4956 09/24/2012 04:48 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: VegBank-equivalent tables comments: Prepended "Equivalent to" before VegBank, so the equivalent tables statement can fit grammatically after a description of the table instead of having to be the first phrase in the descriptive table comment

4955 09/24/2012 04:41 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxon: VegBank-equivalent tables comment: Added plantName and applicable columns from plantStatus, which are also part of the taxon table

4954 09/24/2012 04:37 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: placepath: Added otherranks field, analogous to taxonpath.otherranks

4953 09/24/2012 04:26 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath: Added descriptive comment for data dictionary

4952 09/24/2012 03:36 PM Aaron Marcuse-Kubitza

inputs/import.stats.xls: Updated import times

4951 09/24/2012 02:58 PM Aaron Marcuse-Kubitza

inputs/UNCC/Specimen/map.csv: accession: Documented that it's globally unique, although occasionally duplicated

4950 09/24/2012 02:54 PM Aaron Marcuse-Kubitza

inputs/REMIB/Specimen/map.csv: Remapped accession_number to catalogNumber because it is not globally unique, only (usually) unique within the institution providing the data ("acronym"). Note that there are nevertheless 11,869 rows where an accession_number appears multiple times within the same institution.

4949 09/24/2012 02:45 PM Aaron Marcuse-Kubitza

mappings/VegCore-VegBIEN.csv: Only use institutionCode+collectionCode+catalogNumber as the authorlocationcode (location-scoping ID) if there is actually a catalogNumber. Otherwise, the mapping process would attempt to create one location for each collection in the datasource, when there should be one location for each specimen.

4948 09/24/2012 02:36 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _namePart(): Slice the first name from the beginning of the string to one word before the end, instead of one after the beginning, in order to avoid overlap with the last name, which starts one before the end, when there is only one word. Note that only one word means the name is assumed to be a last name. This assumption may not always be true, but when a datasource provides the name concatenated, an assumption must be made when not all name components are present.

4947 09/24/2012 02:30 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: party: Added check constraint to require at least an organizationname or surname. Previously, NULL entries for the collector or identifier incorrectly caused the creation of an empty party entry, hence the lower inserted row counts now that this is no longer created.

4946 09/24/2012 02:17 PM Aaron Marcuse-Kubitza

inputs/REMIB/Specimen/map.csv: Remapped acronym to institutionCode because this is an aggregator, and the field lists the datasource each record was aggregated from. Note that the inserted row count changes because of different duplicate elimination strategies in specimenreplicate and party (which institutionCode is placed in).

4945 09/24/2012 02:11 PM Aaron Marcuse-Kubitza

inputs/REMIB/Specimen/create.sql: Also filter out rows where acronym (collectionCode) is NULL because this is a required field for valid records

4944 09/24/2012 01:28 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath: Renamed scientificnameauthor to author so the column name doesn't have "scientificname" in it, which made the term look confusingly like scientificname itself. Added descriptive comment that this is the author of the scientific name.

4943 09/24/2012 01:19 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath: Renamed canon_id to canon_taxonpath_id to clarify that this is a recursive fkey. The convention is that a recursive fkey includes the table name plus a descriptive prefix.

4942 09/24/2012 01:14 PM Aaron Marcuse-Kubitza

schemas/filter_ERD.csv: Don't filter out fkeys from taxonpath to itself

4941 09/24/2012 11:32 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath: Added canon_id for the canonical (scrubbed) taxonpath determined by TNRS

4940 09/24/2012 11:24 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: taxonpath: taxonpath_unique_within_datasource_by_name unique index: Added otherranks, so that ranks without a named column will be used in uniquely identifying the taxonpath

4939 09/24/2012 11:22 AM Aaron Marcuse-Kubitza

sql.py: DbConn.col_info(): Parse array types as sql_gen.ArrayType