add_or_update_nodes: Add or Update nodes in neo4j from a dataframe

Description Usage Arguments Examples

View source: R/rneo4_functions.R

Description

This function Checks to see if a node already exists with the label/id combination; if not, it adds the node to Neo4j; if so, it attempts update the node based on the properties in the row. The neo4j graph must be called "graph". In order for the update portion to work, a constraint must be set on the label/id combination. Example: addConstraint(graph, "vendor", "DUNSNumber")

Usage

1
add_or_update_nodes(df, label, id, props = NULL, verbose = FALSE, na.act = F)

Arguments

label:

The label to assign to each node (takes a character value)

id:

column name in dataframe required for a node to be created (takes a character value)

props:

column names(s) in dataframe of node properties (takes a character vector); defaults to NULL

verbose:

if TRUE, returns information about each node being added to the graph DB; defaults to False

na.act:

not currently used...maybe in the future; defaults to False

Examples

1
add_or_update_nodes(awarded_contracts, "contract", "DUNSNumber", props = names(awarded_contracts), verbose = T)

zbeaver4/beavR documentation built on May 4, 2019, 9:12 p.m.