rels: Retrieve Relationships from Paths

Description Usage Arguments Value See Also Examples

View source: R/rels.R

Description

Retrieve all relationships from a path object.

Usage

1
rels(path)

Arguments

path

A path object.

Value

A list of relationship objects.

See Also

nodes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## 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, "WORKS_WITH", charles)

query = "
MATCH p = (:Person {name:'Alice'})-[:WORKS_WITH*]->(:Person {name:'Charles'})
RETURN p
"

path = cypherToList(graph, query)[[1]]$p

rels(path)

## End(Not run)

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

Related to rels in RNeo4j...