Insert new annotation

db_annotate(db, object, annotationtext = NULL, type = "Site group",
  annotationcode = NULL)

Arguments

db

database connecton object

object

An existing object in the database to annotate such as a site or specimen code.

annotationtext

Text of annotation

type

annotation type from controlled vocab

annotationcode

Optionally, a unique codename for the annotation

Value

TRUE if successful

Details

This function adds an existing annotation to an existing feature in the database such as a site code, sampling feature, or action. Once objects are annotated, they can be more easily queried as a group based on these labels or tags that are not otherwise represented in the database structure. Either an annotation code or annotation text must be provided to identify the annotation

Examples

db <- rodm2::create_sqlite(connect = TRUE) db_describe_annotation(db, annotationtypecv = "Site group", annotationtext = "Riparian wells")
#> Riparian wells has been entered into the Annotations table. #> Use db_annotate to tag items with annotations.
db_describe_site(db, site_code = "Site 001")
#> Site Site 001 has been entered into the samplingfeatures table.
db_annotate(db, object = "Site 001", annotationtext = "Riparian wells")
#> Site 001 has been labeled with annotation text Riparian wells