I am trying to create relationship between existing nodes read from a csv 
file using py2neo. The column has to be read and  matched then a relation 
has to
be created, so that nodes are not duplicated. Thus, a variable has to be 
assigned in the matching condition, which gives an error.

Below is the code:


graph= Graph("http://localhost:7474/db/data/";)

graph.run=.run("""MATCH (au{name:review.loc[review_index, 
'authorname']}),(ai{name:review.loc[review_index, 'airlinename']}) 
                WITH au, ai
                CREATE (au)-[:RATED{authorcountry: review.loc[review_index, 
'authorcountry'], 
                                    aircraft: review.loc[review_index, 
'aircraft'],
                                    route: review.loc[review_index, 
'route'] }->(ai)



Error:
py2neo.database.status.CypherSyntaxError: Invalid input ',' 

--( in the variabl  review.loc[review_index, 'authorname'] (which loops to 
fetch each column and compares with existing node) )--

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to