-
-
Save cleishm/7313355 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= graphGist generated from spock test Neo4jCypherOneRelationship.groovy | |
graphGist asciiDoc file for use at http://gist.neo4j.org/ [GitHub Gist] | |
Generated on Mon Jul 29 07:11:04 PDT 2013 | |
//console | |
query to create plato with philosopher label | |
[source,cypher] | |
---- | |
CREATE (n:Philosopher { name : 'Plato' , url : 'http://dbpedia.org/resource/Plato' }) | |
---- | |
//table | |
query to create Aristotle with philosopher label | |
[source,cypher] | |
---- | |
CREATE (n:Philosopher { name : 'Aristotle' , url : 'http://dbpedia.org/resource/Aristotle' }) | |
---- | |
//table | |
query to get Aristotle and Plato and create influenced relationship | |
[source,cypher] | |
---- | |
MATCH (p:Philosopher), (a:Philosopher) | |
WHERE p.name = 'Plato' AND a.name = 'Aristotle' | |
CREATE p-[r:INFLUENCED]->a | |
RETURN r | |
---- | |
//table | |
query to delete INFLUENCED relationship between Aristotle and Plato | |
[source,cypher] | |
---- | |
MATCH (p:Philosopher)-[r:INFLUENCED]->(a:Philosopher) | |
WHERE p.name = 'Plato' AND a.name = 'Aristotle' | |
DELETE r | |
---- | |
//table | |
query to delete all philosopher Nodes | |
[source,cypher] | |
---- | |
MATCH (p:Philosopher) | |
DELETE p | |
---- | |
//table | |
query to create Plato influenced Aristotle in one statement | |
[source,cypher] | |
---- | |
CREATE path = (p:Philosopher {name:'Plato', url : 'http://dbpedia.org/resource/Plato' }) | |
-[:INFLUENCES]-> | |
( a:Philosopher { name : 'Aristotle' , url : 'http://dbpedia.org/resource/Aristotle' }) | |
---- | |
//table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment