Skip to content

Instantly share code, notes, and snippets.

@quagly
Last active December 20, 2015 08:09
Show Gist options
  • Save quagly/6098912 to your computer and use it in GitHub Desktop.
Save quagly/6098912 to your computer and use it in GitHub Desktop.
= graphGist generated from spock test Neo4jCypherSameSchoolInfluence.groovy
graphGist asciiDoc file for use at http://gist.neo4j.org/ [GitHub Gist]
Generated on Sun Jul 28 08:03:44 PDT 2013
//console
Initialize Graph
[source,cypher]
----
CREATE
( plato:Philosopher {name:'Plato', uri: 'http://dbpedia.org/resource/Plato' })
, ( aristotle:Philosopher { name: 'Aristotle' , uri: 'http://dbpedia.org/resource/Aristotle' })
, ( platonism_school:School { name: 'Platonism', uri: 'http://dbpedia.org/resource/Platonism' })
, ( peripatetic_school:School { name: 'Peripatetic school', uri: 'http://dbpedia.org/resource/Peripatetic_school' })
, ( ancient_greek_school:School { name: 'Ancient Greek philosophy', uri: 'http://dbpedia.org/resource/Ancient_Greek_philosophy' })
, plato-[:INFLUENCES]->aristotle
, plato-[:MEMBER_OF]->platonism_school
, plato-[:MEMBER_OF]->ancient_greek_school
, aristotle-[:MEMBER_OF]->peripatetic_school
, aristotle-[:MEMBER_OF]->ancient_greek_school
----
//table
query for movements that influenced with philosophers
[source,cypher]
----
MATCH s2:School<-[:MEMBER_OF]-p2:Philosopher<-[:INFLUENCES]-p1:Philosopher-[:MEMBER_OF]->s1:School
WHERE s2 = s1 // node equality
RETURN p1.name as p1Name, s1.name as s1Name, p2.name as p2Name, s2.name as s2Name
----
//table
@cleishm
Copy link

cleishm commented Nov 5, 2013

Hi @quagly! This GraphGist no longer works with the latest Neo4j 2.0 milestone build. I've updated it here: https://gist.github.com/cleishm/7313389. Could you update this copy also? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment