Skip to content

Instantly share code, notes, and snippets.

@nikhilakki
Created December 2, 2023 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhilakki/66a5409ecfb7a27f01295266dd0b3d55 to your computer and use it in GitHub Desktop.
Save nikhilakki/66a5409ecfb7a27f01295266dd0b3d55 to your computer and use it in GitHub Desktop.
Seed data for Neo4j blog article on nikhilakki.in
// Create sample Person nodes
CREATE (arun:Person {name:"Arun"})
CREATE (nisha:Person {name:"Nisha"})
// Create KNOWS relationships
MATCH (arun:Person), (nisha:Person)
CREATE (arun)-[:KNOWS]->(nisha)
// Add more Person nodes
CREATE (neil:Person {name:"Neil"})
CREATE (abhishek:Person {name: "Abhishek"})
CREATE (neil)-[:KNOWS]->(arun)
CREATE (abhishek)-[:KNOWS]->(abhishek)
// Create Movie nodes and RATED relationships
CREATE (user1:User {name:"Rohit"})
CREATE (movie1:Movie {title:"RRR"})
CREATE (movie2:Movie {title:"Kantara"})
CREATE (user1)-[:RATED {rating: 10}]->(movie1)
CREATE (user1)-[:RATED {rating: 9}]->(movie2)
// Create Article nodes and CLICKED relationships
CREATE (article1:Article {title:"Graph Databases in India"})
CREATE (article2:Article {title:"Connecting Indian Businesses"})
CREATE (user1)-[:CLICKED]->(article1)
CREATE (user1)-[:CLICKED]->(article2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment