Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
= Roosevelt Family Geneaology
:neo4j-version: 2.1.0
:author: Suellen Stringer-Hye
:twitter: @suellenshye
:tags: domain:education, use-case:geneaology
== Purpose of Graph
This very simple graph was used to help introduce students to graphing concepts. We started the class with a powerpoint presentation covering the nature of networks and graphs and basic coding for Cypher so that they would be prepared to work on a Neo4j GraphGist on their own by the end of the hour class. Since everyone intuitively understands that family trees are derived from a set of relationships, the class was assigned to fork the below graph.
[source, cypher]
(eleanor:Person{name:'Eleanor Roosevelt'}),
(franklin:Person{name:'Franklin D. Roosevelt'}),
(theodore:Person{name:'Theodore Roosevelt'}),
(teddyjr:Person{name:'Teddy Jr.'}),
(oyster:Location{name:'Oyster Bay'}),
(hyde:Location{name:'Hyde Park'}),
== Class Assignment
We then handed out the following assignment and asked everyone to add additional elements to the family tree.
== Final Graph
Many students added details from the assignment but many filled in connections from their own knowledge base or just made up fictional details.
[source, cypher]
(eleanor:Person{name:'Eleanor Roosevelt'}),
(franklin:Person{name:'Franklin D. Roosevelt'}),
(theodore:Person{name:'Theodore Roosevelt'})
(jenny:Person{name:'Jennifer R'}),
(nicholas:Person{name:'Nicholas Roosevelt'}),
(johannes:Person{name:'Johannes Roosevelt'}),
(jacobus:Person{name:'Jacobus Roosevelt'}),
(james:Person{name:'James Roosevelt'}),
(claus:Person{name:'Claus Martenszen Van Rosenvelt'}),
=== Sometime in the Future: Next Class
Now to write some queries!
=== What locations are associated with a Roosevelt?
[source, cypher]
MATCH (person)-[:WAS_FROM]->(location)
RETURN AS Name, AS Location;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.