createRel: Relationships

Description Usage Arguments Value Examples

View source: R/createRel.R

Description

Create a relationship between two nodes with the given type and properties.

Usage

1
createRel(.fromNode, .relType, .toNode, ...)

Arguments

.fromNode

A node object.

.relType

A character string.

.toNode

A node object.

...

A named list. Relationship properties in the form key = value.

Value

A relationship object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
graph = startGraph("http://localhost:7474/db/data/")
clear(graph)

alice = createNode(graph, "Person", name = "Alice")
bob = createNode(graph, "Person", name = "Bob")
charles = createNode(graph, "Person", name = "Charles")

createRel(alice, "WORKS_WITH", bob)
createRel(bob, "KNOWS", charles, since = 2000, through = "Work")

props = list(since = 2001, through = "School")
createRel(alice, "KNOWS", charles, props)

## End(Not run)

RNeo4j documentation built on May 29, 2017, 4:01 p.m.