removeRelationship: Delete a relationship between 2 nodes in the Neo4j graph

View source: R/Removal_Functions.R

removeRelationshipR Documentation

Delete a relationship between 2 nodes in the Neo4j graph

Description

Delete a relationship between 2 nodes in the Neo4j graph. If no relationship property keys are given as argument, all relationships between the 2 nodes are deleted.

Usage

removeRelationship(
  connection,
  started_node_property,
  started_node_property_value,
  end_node_property,
  end_node_property_value,
  relationship_property_keys = NULL
)

Arguments

connection

The Neo4j connection object.

started_node_property

The started node property key name to be identified by.

started_node_property_value

The started node property key value to be found within.

end_node_property

The end node property key name to be identified by.

end_node_property_value

The end node property key value to be found within.

relationship_property_keys

The relationship property keys, in the form of dataframe.

Value

The result from the Neo4j call.

Examples

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

#Delete all relationships in the Neo4j database
for(row in 1:nrow(relationships)){
  removeRelationship(connection, "name", relationships[row,'V1'], "name", relationships[row,'V2'])
}

#Delete the relationships started from the node of name Complex10 and ended
in the node of name Protein1 in the Neo4j database
removeRelationship(connection, "name", "Complex10", "name", "Protein1")

## End(Not run)

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