This question is related to Creating nodes in RNeo4j.
I also posted this question at Nicole White's github appendCypher error. The two reasons to also post this question here at stackoverflow are 1) maybe someone other than Nicole White, the creator of the package, knows the solution to this problem. 2) Perhaps here reaches more RNeo4j users.
I am basically using the same code detailed here Transactional Endpoint:
graph = startGraph("http://localhost:7474/db/data/", username = "neo4j", password= "mypassword")
clear(graph)
data = data.frame(Origin = c("SFO", "AUS", "MCI"),
FlightNum = c(1, 2, 3),
Destination = c("PDX", "MCI", "LGA"))
query = "
MERGE (origin:Airport {name:{origin_name}})
MERGE (destination:Airport {name:{dest_name}})
CREATE (origin)<-[:ORIGIN]-(:Flight {number:{flight_num}})-[:DESTINATION]->(destination)
"
t = newTransaction(graph)
for (i in 1:nrow(data)) {
origin_name = data[i, ]$Origin
dest_name = data[i, ]$Dest
flight_num = data[i, ]$FlightNum
appendCypher(t,
query,
origin_name = origin_name,
dest_name = dest_name,
flight_num = flight_num)
}
commit(t)
cypher(graph, "MATCH (o:Airport)<-[:ORIGIN]-(f:Flight)-[:DESTINATION]->(d:Airport)
RETURN o.name, f.number, d.name")
However when I reach the appendCypher
function I get the error:
{
"errors" : [ {
"code" : "Neo.ClientError.Security.AuthorizationFailed",
"message" : "No authorization header supplied."
} ]
}
which I do not understand, since I already identified myself when I created the graph
object. Note that the arguments username
and password
within the function startGraph
are not included in the original code, but if I do not specify these when calling startGraph
I get the same error message (i.e. "Error: 401 Unauthorized"...
) at that stage.
I have been told that this might have to do with the new neo4j version 2.2.1(?).
I am going to be uploading data to the a neo4j data base from an R data table, so I do need appendCypher
to make it functional. I guess the ultimate option would be moving to python (py2neo), my colleagues here in the office are using it with no problem at all. But all my code is in R, so I would really like to use RNeo4j.
We have been for some time trying to understand/fix it but at this stage any help would be extremely appreciated.
thanks in advance for your time.