0

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 appendCypherfunction 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.

Community
  • 1
  • 1
Javier
  • 1,530
  • 4
  • 21
  • 48
  • It was a bug. I fixed it: https://github.com/nicolewhite/RNeo4j/issues/23 – Nicole White May 14 '15 at 10:45
  • Hi Nicole, I now get a different error: `Error in appendCypher.transaction(t, query, origin_name = origin_name, : Neo.DatabaseError.Statement.ExecutionFailure Could not create token` . Do I have to type the auth_token into the `startGraph` function? as explained here https://github.com/nicolewhite/RNeo4j/issues/20 . I read here that token approach does not apply anymore : http://stackoverflow.com/questions/29434079/how-to-get-neo4j-2-2-auth-api-token . But the error message suggest that I need to supply this info. – Javier May 14 '15 at 11:12
  • That is not related to auth tokens, I don't think. I also can't reproduce the error. Can you tell me if you see the same error with Neo4j version 2.2.0? I haven't added 2.2.1 to my tests yet. Will do that when I get on better wifi. – Nicole White May 14 '15 at 11:34
  • Also let's move this convo to the github issue page; will you reopen with your most recent error message? – Nicole White May 14 '15 at 11:37
  • yes of course! , lets go there. No problem at all :) – Javier May 14 '15 at 11:38

0 Answers0