Skip to content

Instantly share code, notes, and snippets.

@brownht1
Forked from Pimsepinnen/peoplebooksandcities
Last active May 22, 2018 23:41
Show Gist options
  • Save brownht1/2886a51790cabc778714 to your computer and use it in GitHub Desktop.
Save brownht1/2886a51790cabc778714 to your computer and use it in GitHub Desktop.
People, books and cities - recommend your book
= A Selection of Southern Pressed Books from the Vanderbilt University Special Collection
=== OUR DATASET
[source, cypher]
----
CREATE
//People
(peven:Person{name:'Michael Peven'}),
(smith:Person{name:'Keith Smith'}),
//Books
(cradle_of_civilization:Book{title:'Cradle of Civilization'}),
(slugs_and_roses:Book{title:'Slugs and roses : an Essay on Beauty and Survival'}),
(open_heart_surgery:Book{title:'Open-- heart surgery'}),
(scenes_from_the_trip:Book:Philosophy {title:'Scenes from the trip so far : a souvenir album of drive by shootings taken during travels throughout the United States of America in 2001 and 2003 : in colour!'}),
(manmade_wonders:Book{title:'Manmade wonders'}),
(birds_bar_mitzvah:Book{title:'Birds bar mitzvah, take 3 : [followed by] Birds bar mitzvah, take 4 : the album'}),
(bobby:Book{title:'Bobby book nr 100'}),
//Places
(illinois:Place{name:'Illinois'}),
(art_institute_of_chicago:Place{name:'Art Institute of Chicago'}),
(arkansas:Place{name:'Arkansas'}),
(georgia:Place{name:'Georgia'}),
(indiana:place{name:'Indiana'}),
(illinois_institute:place{name:'Illinois Institute of Technology'}),
(new_york:place{name:'New York'}),
//Publishers
(primitive:Publisher{name:'Primitive Press'}),
(nexus:publisher{name:'Nexus Press'}),
//Born_in
(peven)-[:born_in]->(illinois),
(smith)-[:born_in]->(indiana),
//LIVES_IN
(peven)-[:LIVES_IN]->(arkansas),
(smith)-[:lives_in]->(new_york),
//degree_from
(peven)-[:degree_from]->(art_institute_of_chicago),
(smith)-[:degree_from]->(illinois_institute),
//published_by
(cradle_of_civilization)-[:published_by]->(primitive),
(slugs_and_roses)-[:published_by]->(primitive),
(open_heart_surgery)-[:published_by]->(primitive),
(scenes_from_the_trip)-[:published_by]->(primitive),
(manmade_wonders)-[:published_by]->(primitive),
(birds_bar_mitzvah)-[:published_by]->(primitive),
(bobby)-[:published_by]->(nexus),
//published_in
(cradle_of_civilization)-[:published_in]->(arkansas),
(slugs_and_roses)-[:published_in]->(arkansas),
(open_heart_surgery)-[:published_in]->(arkansas),
(scenes_from_the_trip)-[:published_in]->(arkansas),
(manmade_wonders)-[:published_in]->(arkansas),
(birds_bar_mitzvah)-[:published_in]->(arkansas),
(bobby)-[:published_in]->(georgia),
//wrote
(peven)-[:wrote]->(cradle_of_civilization),
(peven)-[:wrote]->(slugs_and_roses),
(peven)-[:wrote]->(open_heart_surgery),
(peven)-[:wrote]->(scenes_from_the_trip),
(peven)-[:wrote]->(manmade_wonders),
(peven)-[:wrote]->(birds_bar_mitzvah),
(smith)-[:wrote]->(bobby)
----
//graph
//table
=== What books has Michael Peven written?
[source, cypher]
----
MATCH (person)-[:wrote]->(book)
RETURN person.name, book.title
----
//graph_result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment