normalized VegCore to-dos¶
place.name
: make it optional: there can be coordinate-only places with no nametaxon_scrub
: rename totaxon_match
taxon_name.formal_name
: rename toname_with_author
taxon_name.taxon_name
: rename toname_no_author
taxon_match.parsed_taxon_assertion
: rename toparsed_taxon
taxon_match.matched_taxon_concept
: rename tomatched_taxon
taxon_concept.accepted_taxon_concept
: rename toaccepted_taxon
- rename all unique constraints to
[table_abbr]_by_[field_abbrs]
(removing_unique
and abbreviating the table and fields)event_by_subject__date__participants
->evt_by_date
(laterobs_by_date
)event_by_subject__name
->evt_by_name
(laterobs_by_name
)
evt_by_date
: document that this constraint is used for eg. a plot sampling event, which uses place, time, and collectors to define an event and scope itscollector_numbers
evt_by_name
: document that this constraint is used for eg. differentiating identification and collection events for the samespecimen
traceable.id_by_source
: document that collisions will most often happen on this field, notid
(which stores the natural key).id
collisions are rare and usually indicate inter-datasource duplication.individual_observation.specimenholder_institutions
: rename tospecimen_duplicate_institutions
source.url
: rename touri
as not allsources
are locatable on the internet- this is instead a globally unique identifier for the record, which has a structure similar to a URL
- automate the creation of the hyperlinked image map from the coordinates in the MySQL Workbench document
- this will avoid the need to manually update the positions of tables for the following changes, which will require moving tables around to make room
- add
taxon_path.species_binomial
stem
: remove inheritance fromindividual
(an individual is a grouping of stems, and thus is a fundamentally separate entity from a stem)stem_observation
: remove inheritance fromindividual_observation
individual
: move all fields tostem
(individuals only have anid_within_dataset
to identify the grouping of stems)- add required
identifying_stem
that points to the stem that has the individual's identifying tag oridentifying_place
- for SALVIAS, this requires figuring out for each individual, which stem has the same tag #s as the individual
- add required
individual
: remove inheritance fromreobservable
(only astem
is identifiable to a physical location or tagged stem)stem
should extendreobservable
instead
taxon_concept
HAS-MANY instead of IS-Ataxon_name
(ie.taxon_name
HAS-AN optionaltaxon_concept
)taxon_concept
: rename totaxon
because this table is used to store any kind of taxonomic group (including TNRS results and higher taxa), not just formally-described taxon conceptsaccording_to
: rename todefined_by
because this is more general
- add
taxon_concept
table, which extendstaxon
- stores only formally-described taxon concepts
- adds
according_to
, which stores the literature reference that contains the description (this is also populated indefined_by
)
- add
observation
table, which extendsevent
- applicable
event
subclasses should inherit from it instead
- applicable
- move
event.subject
toobservation
and make it required- also move associated unique constraints, and pull forward inherited fields used in them
- add
event.type
, needed to form a full event text ID- use it in every
event
unique constraint that usesname
- subclasses that want to use this must set
type
to their table name- this prevents
event
's unique constraints from inadvertently being used when the subclass's unique constraints usename
together with some other info
- this prevents
- note that this field is not used in
obs_by_name
, because for observations, the type is alwaysobservation
- use it in every
- add
taxon_observation_by_collector
(tax_obs_by_coll()
) unique constraint on columnssampling_event
,primary_collector
,collector_number
- add
traceable.permalink
, a URL which links directly to thetraceable
record itself- this should be the phpPgAdmin URL, or an abbreviated redirect to it (eg. starting with
vegbiendev.nceas.ucsb.edu
)
- this should be the phpPgAdmin URL, or an abbreviated redirect to it (eg. starting with
- add
traceable.id_by_natural_key
, autopopulated fromid
, which distinguishes any natural key fromid_by_source
traceable
: add optionalsource_record
fkey torecord
- use this instead of
source
in formingid_by_source
- use this instead of
traceable.id_within_source
: rename tosource_record_section
traceable.source
: rename todataset
and make it an fkey todataset
- this also distinguishes it from
dataset_source
when this field is inherited bydataset
- note that
dataset.dataset
(the dataset record's dataset) would be eg. Index Herbariorum, not the parent dataset (which is stored indataset.parent
)
- note that
- note that this change makes
traceable
mutually recursive withdataset
. becausedataset
is required, populating the rootdataset
node requires deferring fkeys (usingSET CONSTRAINTS DEFERRED
) untiltraceable::dataset
has been set todataset.id
. - an entity that consists only of manually-entered data should point to a
dataset
which contains information about the person who populated it- the root
dataset
is for the database owner who populated the dataset metadata (eg. BIEN, which is the rootdataset
and populated the rootdataset
)
- the root
dataset
is autopopulated fromsource_record.attribution_dataset
- this also distinguishes it from
source
: extendtraceable
- move
source.uri
totraceable
and rename tosource_uri
dataset.dataset_source
: rename to justsource
now thattraceable
no longer has a conflictingsource
fieldrecord.scoping_dataset
: rename toid_scoping_dataset
record.attribution_dataset
: document that it can be set to a subset of theid_scoping_dataset
when finer-grained attribution is availableproject
: document that it is not a type ofdataset
, for the reasons described in r11221project.dataset
: make it required- add
dataset_indexed
, which extendstraceable
project.dataset
: document that this is thedataset
which defined the project (a project is actually an event, which is dataset-independent; multiple datasets may refer to the same project)project
: extenddataset_indexed
- use
name
together with inheriteddataset
in theproj_by_name
unique constraint
- use
person
: extenddataset_indexed
- use
name
together with inheriteddataset
in thepers_by_src
unique constraint
- use
place_visit
: extenddataset_indexed
to make locating theplace_visits
in a dataset easierdataset
is autopopulated fromproject.dataset
taxon_observation
: extenddataset_indexed
to make locating thetaxon_observations
in a dataset easierdataset
is autopopulated fromplace_visit.dataset
- for inheritance hierarchies with multiple unique constraints, add an
id_by_...
field for each unique constraint which contains the associated natural key- this shows in the ERD which natural keys are available
- it also allows querying on a specific natural key when several exist for the same record
- add
custom_place
, which extendsdataset_indexed
to make locating theplaces
in a dataset easier- used for specimen coordinates as well as plots
- contains optional
defining_project
- places can be part of projects in the same way that samplings of places can be part of projects
- pull inherited
name
field intocustom_place
so it can be used together withdefining_project
in the unique constraint
place.name
: make it optionalcustom_places
for specimen coordinates usually often do not have a name, just a numeric ID
plot
: rename tosampling_area
(plot/subplot)- a
sampling_area
is an area defined solely for the purpose of aggregatingtaxon_occurrences
(what some might call a plot) - note that a
sampling_area
is not the only type ofplace
which can directly containtaxon_occurrences
, because named places (regions) can contain these as well
- a
- add
outer_plot
, which extendssampling_area
andcustom_place
- an
outer_plot
is the outermost (largest possible)sampling_area
in which taxa were sampled
- an
subplot
: add comment that this is a plot subdivision, but is not considered a first-class plotsubplot
: addouter_plot
pointertaxa_sampling_event
: document that a sharedplace_visit
ties together all thesampling_areas
in the sameouter_plot
sampling_area.boundary_WKT
: rename toshape_def_WKT
subplace
: rename toplace_element
- can store anything located within a
place
, not just otherplaces
- derived classes:
individual
; anything that is a point within aplace
- can store anything located within a
- add
plot_element
table, which extendsplace_element
- derived classes:
subplot
parent
: fkey tosampling_area
(notouter_plot
, as this can be used for things insubplots
as well)
- derived classes:
- add
site
table, which stores aplace
defined by a locality description (i.e. directions to it)- extends
place
w/ rank=site - contains
locality_desc
- an
outer_plot
is contained within asite
, and is not a subclass of it - note that the CTFS Site table should actually be called
Plot
, and is not equivalent to this definition of a site. the CTFS usage is particularly confusing because some plots are named after the entire site they are within (eg. thebci
plot named after theBarro Colorado Island
site), even though they actually refer to a plot (the only plot) within that site.
- extends
- add
sampling_scope
table- has req.
place
; opt.stratum
,size_class
, taxon inclusion,subsetting_info
(hstore)place
doesn't have to be asampling_area
(plot/subplot), as eg. specimens are not located in a plot
- has req.
taxa_sampling_event
: add req.sampling_scope
place_visit
: document that usually only anouter_plot
has one of these, unless the subplots were treated like first-class plots with their own elevation, soil, etc.taxa_sampling_event.place_visit
: document that this is usually for anouter_plot
, not a subplottaxon_name
: addmorphospecies_suffix
- not in
taxon_path
because not globally unique
- not in
taxon_occurrence
extendstaxon_concept
taxon_determination
can be applied to anytaxon_concept
taxon_scrub
extendstaxon_determination
community
,geological_context
: add list tables