cypherToList: Cypher Queries to Lists

Description Usage Arguments Value See Also Examples

View source: R/cypherToList.R

Description

Retrieve Cypher query results as a list.

Usage

1
cypherToList(graph, query, ...)

Arguments

graph

A graph object.

query

A character string.

...

A named list. Parameters to pass to the query in the form key = value, if applicable.

Value

A list.

See Also

cypher

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
graph = startGraph("http://localhost:7474/db/data/")
clear(graph)

alice = createNode(graph, "Person", name = "Alice", age = 23)
bob = createNode(graph, "Person", name = "Bob", age = 22)
charles = createNode(graph, "Person", name = "Charles", age = 25)
david = createNode(graph, "Person", name = "David", age = 20)

createRel(alice, "KNOWS", bob)
createRel(alice, "KNOWS", charles)
createRel(charles, "KNOWS", david)

cypherToList(graph, "MATCH n RETURN n, n.age")

cypherToList(graph, "MATCH (n)-[:KNOWS]-(m)
                     RETURN n, COLLECT(m) AS friends, COUNT(m) AS num_friends")

cypherToList(graph, "MATCH p = (n)-[:KNOWS]-(m) RETURN p")

cypherToList(graph, "MATCH p = (n)-[:KNOWS]-(m)
                     WHERE n.name = {name}
                     RETURN p", name="Alice")

## End(Not run)

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

Related to cypherToList in RNeo4j...