Cypher
Nodes typically represent entities, such as concepts, events, places, and so on. Relationships connect the nodes that represent the context of how those two nodes are related. They can be considered as building blocks of the graph. The real strength of a property graph lies in its simplicity when it comes to representing and traversing patterns in graphs in an efficient manner.
Cypher is a query language based on graph traversal descriptions. These patterns are used to match the desired graph paths. When the matching pattern has been found, it can be used for further processing.
A simple pattern in Cypher is shown as follows:
(p:Person {name: "Tom"})–[:LIVES_IN]-> (city:City {name: "Edison"})–[:PART_OF]-> (country:Country {name: "United States"} )
The pattern here is self-explanatory and human-readable. A person named Tom lives in a city named Edison, which is a part of the country named the United States. You can see here that nouns represent the nodes and verbs represent the relationships.
We will take a deeper look at Cypher syntax in the coming chapters.