Add relationships to related features table

db_add_relations(db, edgelist, from_column = "SamplingFeatureCode",
  to_column = "RelatedFeatureCode", relationtype_column = NULL,
  relationtype = "isChildOf")

Arguments

db

database connection object.

edgelist

dataframe with new relationships to add. see details

from_column

name of first column with feature codes to relate

to_column

name of second column with feature codes to relate

relationtype_column

name of column with relationship type from controlled vocabulary

relationtype

relationship type to use if no relationship type column. defaults to "isChildOf"

Value

message with how many rows added

Details

Edgelist should be a data frame with 3 columns and one row for each new relationship to establish with the features to connect and the type of relationship. Specify the names of columns corresponding to the features using the 'from_column' and 'to_column' arguments, and the name of the column with relationship types with 'relationtype_column'. A two column data frame can be supplied along with a relationtype to use for all of the new relationships. Site codes must already be in database.

Examples

# df <- data.frame( # "SamplingFeatureCode" = "subsite1", # "RelatedFeatureCode" = "site1") # db_add_relation(db, edgelist = df)