Writing the Cypher syntax
I like short examples to set the mind in a good direction, so I'll start with this. If I want to write Romeo loves Juliet in Cypher, the Cypher syntax will be as follows:
(romeo:Person{name: "Romeo"})-[:LOVES]->(juliet:Person{name:"Juliet"})
See, this is almost ASCII-Art. Do you see the pattern?
(NODE1)-[:RELATION]->(NODE2)
Now, should you want to create those nodes and relations in your database, type the following in the prompt in the upper part of the Neo4j browser (available at localhost:7474
if you have started your server):
CREATE (romeo:Person{name: "Romeo"})-[:LOVES]->(juliet:Person{name:"Juliet"})
Then, you are greeted with a message telling you about counts of created nodes and relations.
There you are; you have just created data! Did you just say wow? Yes, that was easy. Indeed, every person I show Cypher to is impressed. Some students even swear!
As you have just inserted data into a fresh database, use this query if you want to see it:
MATCH (n) RETURN...