cypher

0th

Percentile

Cypher Queries to Data Frames

Retrieve Cypher query results as a data frame.

Usage
cypher(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.
Details

If returning data, you can only query for tabular results. That is, you can't return node or relationship entities. See cypherToList for returning non-tabular data.

Value

A data.frame.

See Also

cypherToList

Aliases
  • cypher
Examples
## 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)
# 
# cypher(graph, "MATCH n RETURN n.name, n.age")
# 
# query = "MATCH n WHERE n.age < {age} RETURN n.name, n.age"
# cypher(graph, query, age = 24)
# 
# query = "MATCH n WHERE n.name IN {names} RETURN n.name, n.age"
# names = c("Alice", "Charles")
# cypher(graph, query, names = names)
# 
# query = "MATCH n WHERE n.age > {age1} AND n.age < {age2} RETURN n.name"
# cypher(graph, query, age1=22, age2=30)
# 
# params = list(age1=22, age2=30)
# cypher(graph, query, params)
# ## End(Not run)
Documentation reproduced from package RNeo4j, version 1.6.4, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.