cypher
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM 'file:///data_file.csv' AS row
MERGE (n:Entity {id: row.id, name: row.name})
MATCH (from:Entity {id: row.from_id})
MATCH (to:Entity {id: row.to_id})
MERGE (from)-[:RELATION {type: row.relation_type}]->(to)
cypher
MATCH (n:Entity {name: 'John'})-[r:RELATION]->(m:Entity)
RETURN n, r, m
cypher
MATCH (n:Entity {name: 'John'})-[:RELATION]->(m:Entity)
RETURN m
cypher
MATCH shortestPath((n:Entity {name: 'John'})-[*]->(m:Entity {name: 'Mary'}))
RETURN shortestPath