Skip to content

Instantly share code, notes, and snippets.

@Allison-E
Last active July 20, 2023 17:23
Show Gist options
  • Save Allison-E/bcae7622087c51e4a40105852cca974d to your computer and use it in GitHub Desktop.
Save Allison-E/bcae7622087c51e4a40105852cca974d to your computer and use it in GitHub Desktop.
SELECT * from cypher('social_network', $$
CREATE (:Person {name: 'Joseph'}),
(:Person {name: 'Alice'}),
(:Person {name: 'Ade'}),
(:Person {name: 'Mariam'}),
(:Person {name: 'Ryan'}),
(:Person {name: 'Fred'})
$$) AS (v agtype);
SELECT * from cypher('social_network', $$
MATCH (x:Person), (y:Person) WHERE x.name = 'Joseph' AND y.name = 'Alice'
CREATE (x)-[:Is_friends_with]->(y)-[:Is_friends_with]->(x)
$$) AS (e agtype);
SELECT * from cypher('social_network', $$
MATCH (x:Person), (y:Person) WHERE x.name = 'Alice' AND y.name = 'Ryan'
CREATE (x)-[:Is_friends_with]->(y)-[:Is_friends_with]->(x)
$$) AS (e agtype);
SELECT * from cypher('social_network', $$
MATCH (x:Person), (y:Person) WHERE x.name = 'Alice' AND y.name = 'Mariam'
CREATE (x)-[:Is_friends_with]->(y)-[:Is_friends_with]->(x)
$$) AS (e agtype);
SELECT * from cypher('social_network', $$
MATCH (x:Person), (y:Person) WHERE x.name = 'Joseph' AND y.name = 'Fred'
CREATE (x)-[:Is_friends_with]->(y)-[:Is_friends_with]->(x)
$$) AS (e agtype);
SELECT * from cypher('social_network', $$
MATCH (x:Person), (y:Person) WHERE x.name = 'Fred' AND y.name = 'Mariam'
CREATE (x)-[:Is_friends_with]->(y)-[:Is_friends_with]->(x)
$$) AS (e agtype);
SELECT * from cypher('social_network', $$
MATCH (x:Person), (y:Person) WHERE x.name = 'Fred' AND y.name = 'Ryan'
CREATE (x)-[:Is_friends_with]->(y)-[:Is_friends_with]->(x)
$$) AS (e agtype);
SELECT * from cypher('social_network', $$
MATCH (x:Person), (y:Person) WHERE x.name = 'Ryan' AND y.name = 'Ade'
CREATE (x)-[:Is_friends_with]->(y)-[:Is_friends_with]->(x)
$$) AS (e agtype);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment