Cypheris Neo4j's graph query Language, which provides sql-like clause, here is an example of friends:
--Note: () Node,ee is a variable, person is label,{} is the property list. CREATE(ee:person{name: "Emil", from: "Sweden", Kclout: About})--2--Note: Match matches, where is conditional, return is returned. MATCH (Ee:person)WHEREEe.name="Emil"RETURNee;--3--Comment:-[:]-> is the direction of relationship, knows is the name of relationship, {} is the property list. CREATE(Js:person {name: "Johan", from: "Sweden", Learn: "surfing"}), (Ir:person {name: "Ian", from: "England", Title: "Author"}), (Rvb:person {name: "Rik", from: "Belgium", Pet: "Orval"}), (Ally:person {name: "Allison", from: "California", Hobby: "Surfing"}), (EE)-[: KNOWS {since:2001}] -(JS), (EE)-[: KNOWS {rating:5}] -(IR), (JS)-[: KNOWS] -(IR), (JS)-[: KNOWS] -(RVB), (IR)-[: KNOWS] -(JS), (IR)-[: KNOWS] -(ally), (RVB)-[: KNOWS] -(ally)--4--Note:-[:]-is relationship bidirectional. MATCH (Ee:person)-[: KNOWS]-(Friends)WHEREEe.name="Emil"RETURNEe,friends--5--Note: () to ignore node,distinct to prevent more than one path matching. MATCH (Js:person)-[: KNOWS]-()-[: KNOWS]-(surfer)WHEREJs.name="Johan" andSurfer.hobby="Surfing"RETURN DISTINCTSurfer