Retrieve Relationships with Cypher Queries

Description

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

Usage

1
getSingleRel(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 relationship object.

See Also

getRels

Examples

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

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

getSingleRel(graph, query)

query = "MATCH (:Person {name:{start}})-[r:KNOWS]->(:Person {name:{end}})
         RETURN r"

getSingleRel(graph, query, start = "Bob", end = "Charles")

## End(Not run)

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