简体   繁体   中英

Creating a parameter in neo4j through R driver

I am trying to generate a graph using the neo4r R driver. I have no problems preforming standard queries such as

"MATCH (n:Node {nodeName: ‘A Name’}) RETURN COUNT(n)” %>% call_neo4j(con)

However when I try to create a parameter with the following query

":params {Testnode: {testNodeName: 'Node Name'}}" %>% call_neo4j(con)

I get the following syntax error

$error_code
[1] "Neo.ClientError.Statement.SyntaxError"

$error_message
[1] "Invalid input ':': expected <init> (line 1, column 1 (offset: 0))\n\":params {Testnode: {testNodeName: 'Node Name'}}\"\n ^"

The parameter query works fine when I run it directly in the neo4j browser so I do not understand how there is a syntax error?

Any ideas on how to fix this greatly accepted!

:params only works in the Neo4j Browser, it's not really Cypher.

Worse, the R Neo4j driver doesn't seem to support passing parameters - there's an open Github issue that points to a fork that contains relevant changes, but that fork also has other changes that make it deviate from the main driver.

I'd try either using the fork to see if it gets you anywhere, and if it does either create the relevant PR to the project or maintain a local fork that track the main driver but just contains that parameter change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM