cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Is the query right?

Can someone confirm if the above query right at line 9, if so can someone explain me what does "i" here mean, like what does it represent or point?

The above code was a part of Turn a Harry Potter Book into a Knowledge Graph | by Tomaz Bratanic | Neo4j Developer Blog | Jul, 20... this article.

I know it's setting property weight to nodes, but where did that "i" come from, because we are using "row" as the pointer.

Thanks in advance.

1 ACCEPTED SOLUTION

andreperez
Graph Buddy

MERGE (a)-[i:RELATIONSHIP]->(b)
When you pass a string or char followed by a : like this you're declaring a variable. If you doesn't do this, like: MERGE (a)-[:RELATIONSHIP]-(b) you would need to set the relationship properties within the MERGE query.

View solution in original post

1 REPLY 1

andreperez
Graph Buddy

MERGE (a)-[i:RELATIONSHIP]->(b)
When you pass a string or char followed by a : like this you're declaring a variable. If you doesn't do this, like: MERGE (a)-[:RELATIONSHIP]-(b) you would need to set the relationship properties within the MERGE query.