Retrieve Paths with Cypher Queries

Share:

Description

Deprecated. Use cypherToList. Retrieve a single path from the graph with a Cypher query.

Usage

1
getSinglePath(graph, query, ...)

Arguments

graph

A graph object.

query

A character string.

...

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

Value

A path object.

See Also

getPaths

Examples

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

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

query = "MATCH p = (:Person {name:'Alice'})-[:KNOWS]->(:Person {name:'Bob'}) RETURN p"

getSinglePath(graph, query)

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

getSinglePath(graph, query, name = "Charles")

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.