Last active
December 20, 2015 08:09
-
-
Save quagly/6098897 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 Neo4jCypherSameSchoolTypeInfluence.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' }) | |
, ( philo_tradition:SchoolType { name: 'Philosophical traditions', uri: 'http://dbpedia.org/class/yago/PhilosophicalTraditions' }) | |
, ( philo_movement:SchoolType { name: 'Philosophical movements', uri: 'http://dbpedia.org/class/yago/PhilosophicalMovements' }) | |
, ( philo_ancient_school:SchoolType { name: 'Ancient philosophical schools and traditions', uri: 'http://dbpedia.org/class/yago/AncientPhilosophicalSchoolsAndTraditions' }) | |
, plato-[:INFLUENCES]->aristotle | |
, plato-[:MEMBER_OF]->platonism_school | |
, aristotle-[:MEMBER_OF]->peripatetic_school | |
, platonism_school-[:TYPE_OF]->philo_tradition | |
, platonism_school-[:TYPE_OF]->philo_movement | |
, peripatetic_school-[:TYPE_OF]->philo_movement | |
, peripatetic_school-[:TYPE_OF]->philo_ancient_school | |
---- | |
//table | |
query for influential philosophers from the same school type | |
[source,cypher] | |
---- | |
MATCH st2:SchoolType<-[:TYPE_OF]-s2:School<-[:MEMBER_OF]-p2:Philosopher<-[:INFLUENCES]-p1:Philosopher-[:MEMBER_OF]->s1:School-[:TYPE_OF]->st1:SchoolType | |
WHERE st2 = st1 // node equality | |
RETURN p1.name as p1Name, s1.name as s1Name, st1.name as st1Name, p2.name as p2Name, s2.name as s2Name, st2.name as st2Name | |
---- | |
//table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there, maybe the
= title
could be a bit more descriptive as it is used as the page title, h1 and title for the tweet shares? Otherwise, coolio!