cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Enhance Test Drive Neo4j with Cypher - Data Load Social

bbrown
Node

The great examples shown here (https://neo4j.com/developer/#sample-social) don't have a way to load the data into your Neo4j Desktop Browser. Just copy and paste this into the Browser command line to load the nodes and relationships into the property graph so you can then execute the example queries:
[Friends of Friends]
[Common Friends]
[Connecting Paths]

UNWIND
[["Jim","Mike"],["Jim","Billy"],["Anna","Jim"],
["Anna","Mike"],["Sally","Anna"],["Joe","Sally"],
["Joe","Bob"],["Bob","Sally"]]
AS pair
MERGE (p1:Person {name:pair[0]})
MERGE (p2:Person {name:pair[1]})
MERGE (p1)-[:KNOWS]-(p2)

1 REPLY 1

For small examples such as this, it is not beneficial to have these statements in files for folks to download.

Elaine

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online