multicypher: Run a multiple cypher queriers

View source: R/cypher.R

multicypherR Documentation

Run a multiple cypher queriers

Description

Run a multiple cypher queriers

Usage

multicypher(
  graph,
  queries,
  parameters = NULL,
  result = c("row", "graph"),
  arraysAsStrings = TRUE,
  eltSep = " || "
)

Arguments

graph

the neo4j connection

queries

queries to submit. It can be either a character vector for which each element corresponds to a cypher query. Or it can be a list of lists with the following slots:

  • query (mandatory): A single character corresponding to the cypher query.

  • parameters (optional): A set of parameters specific for this query. If not provided, the parameters parameter of the function is used (see below).

  • result (optional): The specific way to return the results of this query. If not provided, the result parameter of the function is used (see below).

parameters

default parameters for the cypher queries.

result

default way to return results. "row" will return a data frame and "graph" will return a list of nodes, a list of relationships and a list of paths (vectors of relationships identifiers).

arraysAsStrings

if result="row" and arraysAsStrings is TRUE (default) array from neo4j are converted to strings and array elements are separated by eltSep.

eltSep

if result="row" and arraysAsStrings is TRUE (default) array from neo4j are converted to strings and array elementes are separated by eltSep.

Value

A list of "result" of the queries (invisible). See the "result" param.

See Also

cypher(), startGraph(), prepCql(), readCql() and graphRequest()

Examples

## Not run: 
result <- multicypher(
   graph,
   queries=list(
      q1="match (n) return n.value limit 5",
      q2=list(
         query="match (f {value:$val})-[r]->(t) return f, r, t limit 5",
         result="graph",
         parameters=list(val=100)
      )
   )
)

## End(Not run)


neo2R documentation built on Feb. 16, 2023, 10:39 p.m.

Related to multicypher in neo2R...