#
# This R-script has been generated by createRDatabaseInterface
# at: Thu Mar 02 15:46:55 2017
#
# odm_Categories_create --------------------------------------------------------
odm_Categories_create <- function # insert one record into table 'Categories'
### insert one record into table 'Categories'
(
DataValue = NA,
### value for table field \emph{DataValue}: Numeric value that defines the category
CategoryDescription = NA,
### value for table field \emph{CategoryDescription}: Definition of categorical variable value,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
DataValue = DataValue,
CategoryDescription = CategoryDescription
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="categories",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_CensorCodeCV_create ------------------------------------------------------
odm_CensorCodeCV_create <- function # insert one record into table 'CensorCodeCV'
### insert one record into table 'CensorCodeCV'
(
Term = NA,
### value for table field \emph{Term}: Controlled vocabulary for CensorCode
Definition = NA,
### value for table field \emph{Definition}: Definition of CensorCode controlled vocabulary term. The Definition is optional if the term is self explanatory.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Term = Term,
Definition = Definition
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="censorcodecv",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_DataTypeCV_create --------------------------------------------------------
odm_DataTypeCV_create <- function # insert one record into table 'DataTypeCV'
### insert one record into table 'DataTypeCV'
(
Term = NA,
### value for table field \emph{Term}: Controlled vocabulary for DataType
Definition = NA,
### value for table field \emph{Definition}: Definition of DataType controlled vocabulary term. The Definition is optional if the term is self explanatory.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Term = Term,
Definition = Definition
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="datatypecv",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_DataValues_create --------------------------------------------------------
odm_DataValues_create <- function # insert one record into table 'DataValues'
### insert one record into table 'DataValues'
(
DataValue = NA,
### value for table field \emph{DataValue}: The numeric value of the observation. For Categorical variables, a number is stored her. The Variables table has DataType as Categorical and the Categories table maps from the DataValue onto Category Description
ValueAccuracy = NA,
### value for table field \emph{ValueAccuracy}: Numeric value that describes the measurement accuracy of the data value. If not given, it is interpreted as unknown.
LocalDateTime = NA,
### value for table field \emph{LocalDateTime}: Local date and time at which the data value was observed. Represented in an implementation specific format.
UTCOffset = NA,
### value for table field \emph{UTCOffset}: Offset in hours from UTC time of the corresponding LocalDateTime value.
DateTimeUTC = NA,
### value for table field \emph{DateTimeUTC}: Universal UTC date and time at which the data value was observed. Represented in an implementation specific format.
SiteID = NA,
### value for table field \emph{SiteID}: Integer identifier that references the site at which the observation was measured. This links data values to their locations in the Sites table.
VariableID = NA,
### value for table field \emph{VariableID}: Integer identifier that references the variable that was measured. This links data values to their variable in the Variables table.
OffsetValue = NA,
### value for table field \emph{OffsetValue}: Distance from a datum or control point to the point at which a data value was observed. If not given the OffsetValue is inferred to be 0, or not relevant/necessary.
OffsetTypeID = NA,
### value for table field \emph{OffsetTypeID}: Integer identifier that references the measurement offset type in the OffsetTypes table.
CensorCode = NA,
### value for table field \emph{CensorCode}: Text indication of whether the data value is censored from the CensorCodeCV controlled vocabulary.
QualifierID = NA,
### value for table field \emph{QualifierID}: Integer identifier that references the Qualifiers table. If Null, the data value is inferred to not be qualified.
MethodID = NA,
### value for table field \emph{MethodID}: Integer identifier that references method used to generate the data value in the Methods table.
SourceID = NA,
### value for table field \emph{SourceID}: Integer identifier that references the record in the Sources table giving the source of the data value.
SampleID = NA,
### value for table field \emph{SampleID}: Integer identifier that references into the Samples table. This is required only if the data value resulted from a physical sample processed in a lab.
DerivedFromID = NA,
### value for table field \emph{DerivedFromID}: Integer identifier for the derived from group of data values that the current data value is derived from. This refers to a group of derived from records in the DerivedFrom table. If NULL, the data value is inferred to not be derived from another data value.
QualityControlLevelID = NA,
### value for table field \emph{QualityControlLevelID}: Integer identifier giving the level of quality control that the value has been subjected to. This references the QualityControlLevels table.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
DataValue = DataValue,
ValueAccuracy = ValueAccuracy,
LocalDateTime = LocalDateTime,
UTCOffset = UTCOffset,
DateTimeUTC = DateTimeUTC,
SiteID = SiteID,
VariableID = VariableID,
OffsetValue = OffsetValue,
OffsetTypeID = OffsetTypeID,
CensorCode = CensorCode,
QualifierID = QualifierID,
MethodID = MethodID,
SourceID = SourceID,
SampleID = SampleID,
DerivedFromID = DerivedFromID,
QualityControlLevelID = QualityControlLevelID
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="datavalues",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_DerivedFrom_create -------------------------------------------------------
odm_DerivedFrom_create <- function # insert one record into table 'DerivedFrom'
### insert one record into table 'DerivedFrom'
(
ValueID = NA,
### value for table field \emph{ValueID}: Integer identifier referencing data values that comprise a group from which a quantity is derived. This corresponds to ValueID in the DataValues table.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
ValueID = ValueID
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="derivedfrom",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_GeneralCategoryCV_create -------------------------------------------------
odm_GeneralCategoryCV_create <- function # insert one record into table 'GeneralCategoryCV'
### insert one record into table 'GeneralCategoryCV'
(
Term = NA,
### value for table field \emph{Term}: Controlled vocabulary for GeneralCategory.
Definition = NA,
### value for table field \emph{Definition}: Definition of GeneralCategory controlled vocabulary term. The definition is optional if the term is self explanatory.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Term = Term,
Definition = Definition
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="generalcategorycv",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_GroupDescriptions_create -------------------------------------------------
odm_GroupDescriptions_create <- function # insert one record into table 'GroupDescriptions'
### insert one record into table 'GroupDescriptions'
(
GroupDescription = NA,
### value for table field \emph{GroupDescription}: Text description of the group.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
GroupDescription = GroupDescription
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="groupdescriptions",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_Groups_create ------------------------------------------------------------
odm_Groups_create <- function # insert one record into table 'Groups'
### insert one record into table 'Groups'
(
ValueID = NA,
### value for table field \emph{ValueID}: Integer identifier for each data value that belongs to a group. This corresponds to ValueID in the DataValues table,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
ValueID = ValueID
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="groups",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_ISOMetadata_create -------------------------------------------------------
odm_ISOMetadata_create <- function # insert one record into table 'ISOMetadata'
### insert one record into table 'ISOMetadata'
(
TopicCategory = NA,
### value for table field \emph{TopicCategory}: Topic category keyword that gives the broad ISO19115 metadata topic category for data from this source. The controlled vocabulary of topic category keywords is given in the TopicCategoryCV table.
Title = NA,
### value for table field \emph{Title}: Title of data from a specific data source.
Abstract = NA,
### value for table field \emph{Abstract}: Abstract of data from a specific data source.
ProfileVersion = NA,
### value for table field \emph{ProfileVersion}: Name of metadata profile used by the data source
MetadataLink = NA,
### value for table field \emph{MetadataLink}: Link to additional metadata reference material.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
TopicCategory = TopicCategory,
Title = Title,
Abstract = Abstract,
ProfileVersion = ProfileVersion,
MetadataLink = MetadataLink
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="isometadata",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_LabMethods_create --------------------------------------------------------
odm_LabMethods_create <- function # insert one record into table 'LabMethods'
### insert one record into table 'LabMethods'
(
LabName = NA,
### value for table field \emph{LabName}: Name of the laboratory responsible for processing the sample.
LabOrganization = NA,
### value for table field \emph{LabOrganization}: Organization responsible for sample analysis.
LabMethodName = NA,
### value for table field \emph{LabMethodName}: Name of the method and protocols used for sample analysis.
LabMethodDescription = NA,
### value for table field \emph{LabMethodDescription}: Description of the method and protocols used for sample analysis.
LabMethodLink = NA,
### value for table field \emph{LabMethodLink}: Link to additional reference material on the analysis method.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
LabName = LabName,
LabOrganization = LabOrganization,
LabMethodName = LabMethodName,
LabMethodDescription = LabMethodDescription,
LabMethodLink = LabMethodLink
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="labmethods",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_Methods_create -----------------------------------------------------------
odm_Methods_create <- function # insert one record into table 'Methods'
### insert one record into table 'Methods'
(
MethodDescription = NA,
### value for table field \emph{MethodDescription}: Text description of each method.
MethodLink = NA,
### value for table field \emph{MethodLink}: Link to additional reference material on the method.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
MethodDescription = MethodDescription,
MethodLink = MethodLink
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="methods",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_ODMVersion_create --------------------------------------------------------
odm_ODMVersion_create <- function # insert one record into table 'ODMVersion'
### insert one record into table 'ODMVersion'
(
VersionNumber = NA,
### value for table field \emph{VersionNumber}: String that lists the version of the ODM database.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
VersionNumber = VersionNumber
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="odmversion",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_OffsetTypes_create -------------------------------------------------------
odm_OffsetTypes_create <- function # insert one record into table 'OffsetTypes'
### insert one record into table 'OffsetTypes'
(
OffsetUnitsID = NA,
### value for table field \emph{OffsetUnitsID}: Integer identifier that references the record in the Units table giving the Units of the OffsetValue.
OffsetDescription = NA,
### value for table field \emph{OffsetDescription}: Full text description of the offset type.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
OffsetUnitsID = OffsetUnitsID,
OffsetDescription = OffsetDescription
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="offsettypes",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_Qualifiers_create --------------------------------------------------------
odm_Qualifiers_create <- function # insert one record into table 'Qualifiers'
### insert one record into table 'Qualifiers'
(
QualifierCode = NA,
### value for table field \emph{QualifierCode}: Text code used by organization that collects the data.
QualifierDescription = NA,
### value for table field \emph{QualifierDescription}: Text of the data qualifying comment.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
QualifierCode = QualifierCode,
QualifierDescription = QualifierDescription
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="qualifiers",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_QualityControlLevels_create ----------------------------------------------
odm_QualityControlLevels_create <- function # insert one record into table 'QualityControlLevels'
### insert one record into table 'QualityControlLevels'
(
QualityControlLevelCode = NA,
### value for table field \emph{QualityControlLevelCode}: Code used to identify the level of quality control to which data values have been subjected.
Definition = NA,
### value for table field \emph{Definition}: Definition of Quality Control Level.
Explanation = NA,
### value for table field \emph{Explanation}: Explanation of Quality Control Level,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
QualityControlLevelCode = QualityControlLevelCode,
Definition = Definition,
Explanation = Explanation
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="qualitycontrollevels",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_SampleMediumCV_create ----------------------------------------------------
odm_SampleMediumCV_create <- function # insert one record into table 'SampleMediumCV'
### insert one record into table 'SampleMediumCV'
(
Term = NA,
### value for table field \emph{Term}: Controlled vocabulary forsample media.
Definition = NA,
### value for table field \emph{Definition}: Definition of sample mediacontrolled vocabulary term. Thedefinition is optional if the termis self explanatory.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Term = Term,
Definition = Definition
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="samplemediumcv",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_Samples_create -----------------------------------------------------------
odm_Samples_create <- function # insert one record into table 'Samples'
### insert one record into table 'Samples'
(
SampleType = NA,
### value for table field \emph{SampleType}: Controlled vocabulary specifying the sample type from the SampleTypeCV table.
LabSampleCode = NA,
### value for table field \emph{LabSampleCode}: Code or label used to identify and track lab sample or sample container (e.g. bottle) during lab analysis.
LabMethodID = NA,
### value for table field \emph{LabMethodID}: Unique identifier for the laboratory method used to process the sample. This references the LabMethods table.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
SampleType = SampleType,
LabSampleCode = LabSampleCode,
LabMethodID = LabMethodID
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="samples",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_SampleTypeCV_create ------------------------------------------------------
odm_SampleTypeCV_create <- function # insert one record into table 'SampleTypeCV'
### insert one record into table 'SampleTypeCV'
(
Term = NA,
### value for table field \emph{Term}: Controlled vocabulary for sample type.
Definition = NA,
### value for table field \emph{Definition}: Definition of sample type controlled vocabulary term. The definition is optional if the term is self explanatory.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Term = Term,
Definition = Definition
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="sampletypecv",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_SeriesCatalog_create -----------------------------------------------------
odm_SeriesCatalog_create <- function # insert one record into table 'SeriesCatalog'
### insert one record into table 'SeriesCatalog'
(
SiteID = NA,
### value for table field \emph{SiteID}: Site identifier from the Sites table.
SiteCode = NA,
### value for table field \emph{SiteCode}: Site code used by organization that collects the data.
SiteName = NA,
### value for table field \emph{SiteName}: Full text name of sampling site.
VariableID = NA,
### value for table field \emph{VariableID}: Integer identifier for each Variable that references the Variables table.
VariableCode = NA,
### value for table field \emph{VariableCode}: Variable code used by the organization that collects the data.
VariableName = NA,
### value for table field \emph{VariableName}: Name of the variable from the variables table.
Speciation = NA,
### value for table field \emph{Speciation}: Code used to identify how the data value is expressed (i.e., total phosphorus concentration expressed as P). This should be from the SpeciationCV controlled vocabulary table.
VariableUnitsID = NA,
### value for table field \emph{VariableUnitsID}: Integer identifier that references the record in the Units table giving the Units of the data value.
VariableUnitsName = NA,
### value for table field \emph{VariableUnitsName}: Full text name of the variable units from the UnitsName field in the Units table.
SampleMedium = NA,
### value for table field \emph{SampleMedium}: The medium of the sample. This should be from the SampleMediumCV controlled vocabulary table.
ValueType = NA,
### value for table field \emph{ValueType}: Text value indicating what type of data value is being recorded. This should be from the ValueTypeCV controlled vocabulary table.
TimeSupport = NA,
### value for table field \emph{TimeSupport}: Numerical value that indicates the time support (or temporal footprint) of the data values. 0 is used to indicate data values that are instantaneous. Other values indicate the time over which the data values are implicitly or explicitly averaged or aggregated.
TimeUnitsID = NA,
### value for table field \emph{TimeUnitsID}: Integer identifier that references the record in the Units table giving the Units of the time support. If TimeSupport is 0, indicating an instantaneous observation, a unit needs to still be given for completeness, although it is somewhat arbitrary.
TimeUnitsName = NA,
### value for table field \emph{TimeUnitsName}: Full text name of the time support units from the UnitsName field in the Units table.
DataType = NA,
### value for table field \emph{DataType}: Text value that identifies the data as one of several types from the DataTypeCV controlled vocabulary table.
GeneralCategory = NA,
### value for table field \emph{GeneralCategory}: General category of the variable from the GeneralCategoryCV table.
MethodID = NA,
### value for table field \emph{MethodID}: Integer identifier that identifies the method used to generate the data values and references the Methods table.
MethodDescription = NA,
### value for table field \emph{MethodDescription}: Full text description of the method used to generate the data values.
SourceID = NA,
### value for table field \emph{SourceID}: Integer identifier that identifies the source of the data values and references the Sources table.
Organization = NA,
### value for table field \emph{Organization}: Text description of the source organization from the Sources table.
SourceDescription = NA,
### value for table field \emph{SourceDescription}: Text description of the data source from the Sources table.
Citation = NA,
### value for table field \emph{Citation}: Text string that give the citation to be used when the data from each source are referenced.
QualityControlLevelID = NA,
### value for table field \emph{QualityControlLevelID}: Integer identifier that indicates the level of quality control that the data values have been subjected to.
QualityControlLevelCode = NA,
### value for table field \emph{QualityControlLevelCode}: Code used to identify the level of quality control to which data values have been subjected.
BeginDateTime = NA,
### value for table field \emph{BeginDateTime}: Date of the first data value in the series. To be programmatically updated if new records are added.
EndDateTime = NA,
### value for table field \emph{EndDateTime}: Date of the last data value in the series. To be programmatically updated if new records are added.
BeginDateTimeUTC = NA,
### value for table field \emph{BeginDateTimeUTC}: Date of the first data value in the series in UTC. To be programmatically updated if new records are added.
EndDateTimeUTC = NA,
### value for table field \emph{EndDateTimeUTC}: Date of the last data value in the series in UTC. To be programmatically updated if new records are added.
ValueCount = NA,
### value for table field \emph{ValueCount}: The number of data values in the series identified by the combination of the SiteID, VariableID, MethodID, SourceID and QualityControlLevelID fields. To be programmatically updated if new records are added.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
SiteID = SiteID,
SiteCode = SiteCode,
SiteName = SiteName,
VariableID = VariableID,
VariableCode = VariableCode,
VariableName = VariableName,
Speciation = Speciation,
VariableUnitsID = VariableUnitsID,
VariableUnitsName = VariableUnitsName,
SampleMedium = SampleMedium,
ValueType = ValueType,
TimeSupport = TimeSupport,
TimeUnitsID = TimeUnitsID,
TimeUnitsName = TimeUnitsName,
DataType = DataType,
GeneralCategory = GeneralCategory,
MethodID = MethodID,
MethodDescription = MethodDescription,
SourceID = SourceID,
Organization = Organization,
SourceDescription = SourceDescription,
Citation = Citation,
QualityControlLevelID = QualityControlLevelID,
QualityControlLevelCode = QualityControlLevelCode,
BeginDateTime = BeginDateTime,
EndDateTime = EndDateTime,
BeginDateTimeUTC = BeginDateTimeUTC,
EndDateTimeUTC = EndDateTimeUTC,
ValueCount = ValueCount
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="seriescatalog",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_Sites_create -------------------------------------------------------------
odm_Sites_create <- function # insert one record into table 'Sites'
### insert one record into table 'Sites'
(
SiteCode = NA,
### value for table field \emph{SiteCode}: Code used by organization that collects the data to identify the site
SiteName = NA,
### value for table field \emph{SiteName}: SiteName
Latitude = NA,
### value for table field \emph{Latitude}: Latitude in decimal degrees.
Longitude = NA,
### value for table field \emph{Longitude}: Longitude in decimal degrees. East positive, West negative.
LatLongDatumID = NA,
### value for table field \emph{LatLongDatumID}: Identifier that references the Spatial Reference System of the latitude and longitude coordinates in the SpatialReferences table.
Elevation_m = NA,
### value for table field \emph{Elevation_m}: Elevation of sampling location (in m). If this is not provided it needs to be obtained programmatically from a DEM based on location information.
VerticalDatum = NA,
### value for table field \emph{VerticalDatum}: Vertical datum of the elevation. Controlled Vocabulary from VerticalDatumCV.
LocalX = NA,
### value for table field \emph{LocalX}: Local Projection X coordinate.
LocalY = NA,
### value for table field \emph{LocalY}: Local Projection Y Coordinate.
LocalProjectionID = NA,
### value for table field \emph{LocalProjectionID}: Identifier that references the Spatial Reference System of the local coordinates in the SpatialReferences table. This field is required if local coordinates are given.
PosAccuracy_m = NA,
### value for table field \emph{PosAccuracy_m}: Value giving the accuracy with which the positional information is specified in meters.
State = NA,
### value for table field \emph{State}: Name of state in which the monitoring site is located.
County = NA,
### value for table field \emph{County}: Name of county in which the monitoring site is located.
Comments = NA,
### value for table field \emph{Comments}: Comments related to the site.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
SiteCode = SiteCode,
SiteName = SiteName,
Latitude = Latitude,
Longitude = Longitude,
LatLongDatumID = LatLongDatumID,
Elevation_m = Elevation_m,
VerticalDatum = VerticalDatum,
LocalX = LocalX,
LocalY = LocalY,
LocalProjectionID = LocalProjectionID,
PosAccuracy_m = PosAccuracy_m,
State = State,
County = County,
Comments = Comments
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="sites",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_Sources_create -----------------------------------------------------------
odm_Sources_create <- function # insert one record into table 'Sources'
### insert one record into table 'Sources'
(
Organization = NA,
### value for table field \emph{Organization}: Name of the organization that collected the data. This should be the agency or organization that collected the data, even if it came out of a database consolidated from many sources such as STORET.
SourceDescription = NA,
### value for table field \emph{SourceDescription}: Full text description of the source of the data.
SourceLink = NA,
### value for table field \emph{SourceLink}: Link that can be pointed at the original data file and/or associated metadata stored in the digital library or URL of data source.
ContactName = NA,
### value for table field \emph{ContactName}: Name of the contact person for the data source.
Phone = NA,
### value for table field \emph{Phone}: Phone number for the contact person.
Email = NA,
### value for table field \emph{Email}: Email address for the contact person.
Address = NA,
### value for table field \emph{Address}: Street address for the contact person.
City = NA,
### value for table field \emph{City}: City in which the contact person is located.
State = NA,
### value for table field \emph{State}: State in which the contact person is located. Use two letter abbreviations for US. For other countries give the full country name.
ZipCode = NA,
### value for table field \emph{ZipCode}: US Zip Code or country postal code.
Citation = NA,
### value for table field \emph{Citation}: Text string that give the citation to be used when the data from each source are referenced.
MetadataID = NA,
### value for table field \emph{MetadataID}: Integer identifier referencing the record in the ISOMetadata table for this source.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Organization = Organization,
SourceDescription = SourceDescription,
SourceLink = SourceLink,
ContactName = ContactName,
Phone = Phone,
Email = Email,
Address = Address,
City = City,
State = State,
ZipCode = ZipCode,
Citation = Citation,
MetadataID = MetadataID
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="sources",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_SpatialReferences_create -------------------------------------------------
odm_SpatialReferences_create <- function # insert one record into table 'SpatialReferences'
### insert one record into table 'SpatialReferences'
(
SRSID = NA,
### value for table field \emph{SRSID}: Integer identifier for the Spatial Reference System from http://www.epsg.org/.
SRSName = NA,
### value for table field \emph{SRSName}: Name of the Spatial Reference System.
IsGeographic = NA,
### value for table field \emph{IsGeographic}: Value that indicates whether the spatial reference system uses geographic coordinates (i.e. latitude and longitude) or not.
Notes = NA,
### value for table field \emph{Notes}: Descriptive information about the Spatial Reference System. This field would be used to define a non-standard study area specific system if necessary and would contain a description of the local projection information. Where possible, this should refer to a standard projection, in which case latitude and longitude can be determined from local projection information. If the local grid system is non-standard then latitude and longitude need to be included too.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
SRSID = SRSID,
SRSName = SRSName,
IsGeographic = IsGeographic,
Notes = Notes
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="spatialreferences",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_SpeciationCV_create ------------------------------------------------------
odm_SpeciationCV_create <- function # insert one record into table 'SpeciationCV'
### insert one record into table 'SpeciationCV'
(
Term = NA,
### value for table field \emph{Term}: Controlled vocabulary for TopicCategory.
Definition = NA,
### value for table field \emph{Definition}: Definition of TopicCategory controlled vocabulary term. The definition is optional if the term is self explanatory.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Term = Term,
Definition = Definition
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="speciationcv",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_SpeciationCV_create ------------------------------------------------------
odm_SpeciationCV_create <- function # insert one record into table 'SpeciationCV'
### insert one record into table 'SpeciationCV'
(
Term = NA,
### value for table field \emph{Term}: Controlled vocabulary for TopicCategory.
Definition = NA,
### value for table field \emph{Definition}: Definition of TopicCategory controlled vocabulary term. The definition is optional if the term is self explanatory.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Term = Term,
Definition = Definition
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="speciationcv",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_Units_create -------------------------------------------------------------
odm_Units_create <- function # insert one record into table 'Units'
### insert one record into table 'Units'
(
UnitsName = NA,
### value for table field \emph{UnitsName}: Full text name of the units.
UnitsType = NA,
### value for table field \emph{UnitsType}: Text value that specifies the dimensions of the units.
UnitsAbbreviation = NA,
### value for table field \emph{UnitsAbbreviation}: Text abbreviation for the units.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
UnitsName = UnitsName,
UnitsType = UnitsType,
UnitsAbbreviation = UnitsAbbreviation
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="units",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_ValueTypeCV_create -------------------------------------------------------
odm_ValueTypeCV_create <- function # insert one record into table 'ValueTypeCV'
### insert one record into table 'ValueTypeCV'
(
Term = NA,
### value for table field \emph{Term}: Controlled vocabulary for ValueType.
Definition = NA,
### value for table field \emph{Definition}: Definition of the ValueType controlled vocabulary term. The definition is optional if the term is self explanatory.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Term = Term,
Definition = Definition
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="valuetypecv",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_VariableNameCV_create ----------------------------------------------------
odm_VariableNameCV_create <- function # insert one record into table 'VariableNameCV'
### insert one record into table 'VariableNameCV'
(
Term = NA,
### value for table field \emph{Term}: Controlled vocabulary for Variable names.
Definition = NA,
### value for table field \emph{Definition}: Definition of the VariableName controlled vocabulary term. The definition is optional if the term is self explanatory.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Term = Term,
Definition = Definition
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="variablenamecv",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_Variables_create ---------------------------------------------------------
odm_Variables_create <- function # insert one record into table 'Variables'
### insert one record into table 'Variables'
(
VariableCode = NA,
### value for table field \emph{VariableCode}: Text code used by the organization that collects the data to identify the variable.
VariableName = NA,
### value for table field \emph{VariableName}: Full text name of the variable that was measured, observed, modeled, etc. This should be from the VariableNameCV controlled vocabulary table.
Speciation = NA,
### value for table field \emph{Speciation}: Text code used to identify how the data value is expressed (i.e., total phosphorus concentration expressed as P). This should be from the SpeciationCV controlled vocabulary table.
VariableUnitsID = NA,
### value for table field \emph{VariableUnitsID}: Integer identifier that references the record in the Units table giving the units of the data values associated with the variable.
SampleMedium = NA,
### value for table field \emph{SampleMedium}: The medium in which the sample or observation was taken or made. This should be from the SampleMediumCV controlled vocabulary table.
ValueType = NA,
### value for table field \emph{ValueType}: Text value indicating what type of data value is being recorded. This should be from the ValueTypeCV controlled vocabulary table.
IsRegular = NA,
### value for table field \emph{IsRegular}: Value that indicates whether the data values are from a regularly sampled time series.
TimeSupport = NA,
### value for table field \emph{TimeSupport}: Numerical value that indicates the time support (or temporal footprint) of the data values. 0 is used to indicate data values that are instantaneous. Other values indicate the time over which the data values are implicitly or explicitly averaged or aggregated.
TimeUnitsID = NA,
### value for table field \emph{TimeUnitsID}: Integer identifier that references the record in the Units table giving the Units of the time support. If TimeSupport is 0, indicating an instantaneous observation, a unit needs to still be given for completeness, although it is somewhat arbitrary.
DataType = NA,
### value for table field \emph{DataType}: Text value that identifies the data values as one of several types from the DataTypeCV controlled vocabulary table.
GeneralCategory = NA,
### value for table field \emph{GeneralCategory}: General category of the data values from the GeneralCategoryCV controlled vocabulary table.
NoDataValue = NA,
### value for table field \emph{NoDataValue}: Numeric value used to encode no data values for this variable.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
VariableCode = VariableCode,
VariableName = VariableName,
Speciation = Speciation,
VariableUnitsID = VariableUnitsID,
SampleMedium = SampleMedium,
ValueType = ValueType,
IsRegular = IsRegular,
TimeSupport = TimeSupport,
TimeUnitsID = TimeUnitsID,
DataType = DataType,
GeneralCategory = GeneralCategory,
NoDataValue = NoDataValue
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="variables",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
# odm_VerticalDatumCV_create ---------------------------------------------------
odm_VerticalDatumCV_create <- function # insert one record into table 'VerticalDatumCV'
### insert one record into table 'VerticalDatumCV'
(
Term = NA,
### value for table field \emph{Term}: Controlled vocabulary for VerticalDatum.
Definition = NA,
### value for table field \emph{Definition}: Definition of the VerticalDatum controlled vocabulary. The definition is optional if the term is self explanatory.,
db = currentDb(),
run = TRUE,
### if \code{TRUE} the SQL query is performed, otherwise the SQL
### code that would be performed is returned
...
### additional arguments passed to \code{\link{hsSqlQuery}}
)
{
keyValues <- list(
Term = Term,
Definition = Definition
)
sqlExpressions <- keyValuesToSqlAssignment2(keyValues)
sql <- sqlForInsert(
tablename ="verticaldatumcv",
fields = sqlExpressions$fieldList,
sqlSource = paste("(", sqlExpressions$valueList, ")")
)
if (run) {
hsSqlQuery(db, sql = sql, ...)
} else {
sql
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.