createNode: Create a node with its property keys in Neo4j database

View source: R/Creation_Functions.R

createNodeR Documentation

Create a node with its property keys in Neo4j database

Description

Create a single node with its property keys, passed as arguments, in a Neo4j database.

Usage

createNode(connection, node_label, property_keys = NULL)

Arguments

connection

The Neo4j connection object.

node_label

The node label.

property_keys

The node property keys, in the form of dataframe.

Value

The result from the Neo4j call.

Examples

## Not run: 
#Get the dataframe of nodes to be created
nodes = prepareNodesDataframeToCreate(wntBiopax,wntmully)

#Create all nodes in the Neo4j database
for(row in 1:nrow(nodes)){
 node_property_keys = nodes[row, names(nodes) != "label"]

 na_cells = which(is.na(node_property_keys))
 names_not_na = names(node_property_keys)[-na_cells]
 node_property_keys = as.data.frame(node_property_keys[,-na_cells])
 colnames(node_property_keys) = names_not_na

 createNode(connection,nodes[row,'label'],node_property_keys)
}

## End(Not run)

frankkramer-lab/Multipath2Neo4j documentation built on July 20, 2023, 11:43 p.m.