Skip to content

Instantly share code, notes, and snippets.

@emibloque
Last active January 11, 2016 21:27
Show Gist options
  • Save emibloque/f2b42cbd3bd5d4a3a00a to your computer and use it in GitHub Desktop.
Save emibloque/f2b42cbd3bd5d4a3a00a to your computer and use it in GitHub Desktop.
Liquid Democracy implementation in Neo4J

Water Democracy, Liquid Democracy Graph

Introduction

Water Democracy, is a graph that represents a liquid democracy application alongside citizen participation. Each citizen can propose and vote proposals. As this is liquid democracy, each person can delegate her vote to anyone in whatever issue.

All the data was extracted from these APIs:

Model

Model

Creation of the graph

This initializate the whole graph.

CREATE (_0:Issues {name:'Agriculture'})
CREATE (_1:Issues {name:'Arts and Humanities'})
CREATE (_2:Issues {name:'Budget and Taxes'})
CREATE (_3:Issues {name:'Civil Rights and Liberties'})
CREATE (_4:Issues {name:'Climate Change'})
CREATE (_5:Issues {name:'Consumer Protections'})
CREATE (_6:Issues {name:'Criminal Justice and Law Enforcement'})
CREATE (_7:Issues {name:'Defense'})
CREATE (_8:Issues {name:'Disabilities'})
CREATE (_9:Issues {name:'Economy'})
CREATE (_10:Issues {name:'Education'})
CREATE (_11:Issues {name:'Energy'})
CREATE (_12:Issues {name:'Environment'})
CREATE (_13:Issues {name:'Family'})
CREATE (_14:Issues {name:'Firearms'})
CREATE (_15:Issues {name:'Foreign Policy'})
CREATE (_16:Issues {name:'Government Reform'})
CREATE (_17:Issues {name:'Health Care'})
CREATE (_18:Issues {name:'Homeland Security and Disaster Relief'})
CREATE (_19:Issues {name:'Housing'})
CREATE (_20:Issues {name:'Human Rights'})
CREATE (_21:Issues {name:'Immigration'})
CREATE (_22:Issues {name:'Innovation'})
CREATE (_23:Issues {name:'Job Creation'})
CREATE (_24:Issues {name:'Labor'})
CREATE (_25:Issues {name:'Natural Resources'})
CREATE (_26:Issues {name:'Postal Service'})
CREATE (_27:Issues {name:'Poverty'})
CREATE (_28:Issues {name:'Regulatory Reform'})
CREATE (_29:Issues {name:'Rural Policy'})
CREATE (_30:Issues {name:'Science and Space Policy'})
CREATE (_31:Issues {name:'Small Business'})
CREATE (_32:Issues {name:'Social Security'})
CREATE (_33:Issues {name:'Technology and Telecommunications'})
CREATE (_34:Issues {name:'Trade'})
CREATE (_35:Issues {name:'Transportation and Infrastructure'})
CREATE (_36:Issues {name:'Urban Policy'})
CREATE (_37:Issues {name:'Veterans and Military Families'})
CREATE (_38:Issues {name:'Women\'s Issues'})

CREATE (_39:Petition {title:'issue a statement demanding the restoration of Milo Yiannopoulos\'s Twitter verification badge.', body:'On Friday 8 January 2016, Twitter unverified the account of Breitbart technology editor Milo Yiannopoulos, effectively declaring war on libertarian and millennial voices by punishing the outspoken commentator for his views. This comes despite CEO Jack Dorsey declaring that Twitter xstands for freedom of expressionx just a few months ago.\n\nThe Obama Administration should issue a strong statement of support for freedom of speech. Give Milo back his badge! #JeSuisMilo\n\nhttp://money.cnn.com/2016/01/10/technology/twitter-hate-speech-crackdown-milo-yiannopoulos/\n\nhttp://www.buzzfeed.com/alexkantrowitz/twitter-unverifies-milo-yiannopoulos-leading-to-speech-polic?utm_term=.ek52Aqxl0#.hdezgBypm\n\nhttp://www.mediaite.com/online/twitter-punishment-of-breitbart-journalist-sparks-revolt/'})
CREATE (_39)-[:CATEGORIZED]->(_1)
CREATE (_39)-[:CATEGORIZED]->(_20)
CREATE (_39)-[:CATEGORIZED]->(_33)
CREATE (_40:Petition {title:'Explode a nuclear bomb over Raqqa, Syria to completely deter ISIL threat', body:'This Petition calls for the Federal Government to conduct a High Altitude Nuclear Explosion (HANE) of a Hiroshima type atomic bomb over Raqqa, Syria in order to completely and totally deter all threats posed by the ISIL terrorist group, and to Make America Great Again.'})
CREATE (_40)-[:CATEGORIZED]->(_7)
CREATE (_40)-[:CATEGORIZED]->(_15)
CREATE (_40)-[:CATEGORIZED]->(_18)
CREATE (_41:Petition {title:'Grant individuals with Down\'s syndrome monthly disability benefits, regardless of parents income (up to 100k yearly).', body:'We believe individuals with Down\'s syndrome are entitled to their benefits regardless of their parents income. Individuals with Down\'s syndrome are disabled, their parents income should not determine how disabled they are, it should not determine how much help, insurance and benefits they can receive. Benefits should be granted until the individuals with the disability reach adulthood. At which their level of disability can be determined.Parents of children with Down\'s syndrome, some of which have heart disease, should not have to worry about their medical bills and exspenses. They are disabled and entitled to their benefits, a number shouldnt determine how disabled they are.There is a wide range of disability with Down\'s syndrome and the severity can not be determined until adult age.'})
CREATE (_41)-[:CATEGORIZED]->(_8)
CREATE (_41)-[:CATEGORIZED]->(_20)
CREATE (_41)-[:CATEGORIZED]->(_32)
CREATE (_42:Petition {title:'Arrest Ammon Bundy and the armed occupiers of the Malheur Wildlife Refuge.', body:'President Obama,\nWe respectfully request that you end the armed occupation of the Malheur Wildlife Refuge immediately. At the very least, you owe the American people an explanation as to why the area has not been isolated. Members of their organization can come and go as they please, members of the community can visit the occupied facility, and other right-wing extremist groups such as the Idaho III% can show their support. \nLaw enforcement inaction up to this point is an egregious violation of public safety and emboldens their erroneous assertions that the US Government has no Constitutional Authority. \nPlease end the siege of the refuge and arraign Ammon Bundy as soon as possible. '})
CREATE (_42)-[:CATEGORIZED]->(_12)
CREATE (_42)-[:CATEGORIZED]->(_25)
CREATE (_42)-[:CATEGORIZED]->(_29)
CREATE (_43:Petition {title:'Provide Secret Service protection to Bernie Sanders', body:'On Friday, January 8, police in Las Vegas responded to a bullet hole which had been fired through the window of Presidential hopeful and lifelong Independent, Senator Bernie Sanders\' campaign office.\n  \nDespite their apparent initial confusion of the bullet hole\'s source and basic ballistics, it is obvious to thinking American Citizens that guns are where bullet holes come from.\n\nSecret Service protection is normally provided to candidates at 120 days prior to the general election.  However, Ben Carson and Donald Trump have been protected since October of 2015.\n\nThis is the first and only such event of the campaign, and Mr. Sanders is obviously the one who needs the most protection, as he is the most credible threat to establishment politics and gun nuts.  \n\nPlease protect Mr. Sanders!! \n '})
CREATE (_43)-[:CATEGORIZED]->(_6)
CREATE (_43)-[:CATEGORIZED]->(_14)
CREATE (_43)-[:CATEGORIZED]->(_18)
CREATE (_44:Petition {title:'Provide food and medical aid to starving civilians in Madaya, Syria.', body:'We must help the starving children and families in Madaya, Syria who have been besieged for months. The Syrian government has prevented the entry of food and aid.  And the civilians are prevented from leaving, trapped in a mountainous region, surrounded by land mines and snipers. Doctors without Borders reports that at least 23 have died in December alone, and many more will likely be at risk of death and severe illness as winter sets in.  \n\nWe the People implore our administration to immediately provide food & access to medical care to the 30,000 civilians who are being starved to death. We also need to ensure that there are safe passages for ongoing humanitarian aid.   '})
CREATE (_44)-[:CATEGORIZED]->(_15)
CREATE (_44)-[:CATEGORIZED]->(_18)
CREATE (_44)-[:CATEGORIZED]->(_20)
CREATE (_45:Petition {title:'Federally Investigate the Manitowoc County Sheriffs Department and the County Court System for Criminal Behavior.', body:'It is our belief that the Manitowoc County Sheriff\'s department, the entire Manitowoc County Judicial System & the Calumet County DA office should be federally investigated for criminal misconduct. These entities have a history of making wrongful arrests & wrongful convictions of crimes together while operating unchecked outside the boundaries of law - Unjustly depriving Americans of life, liberty & their pursuit of happiness.\n\nThe series "Making a Murderer" revealed said parties have wrongfully prosecuted Steven Avery. Further concerns include the suspicious death of Teresa Halbach, strong evidence pointing to tampering in the case, coercing a confession from a juvenile special ed student & a taped admittance of considering a homicide strategy to eliminate a plaintiff in a civil lawsuit.'})
CREATE (_45)-[:CATEGORIZED]->(_3)
CREATE (_45)-[:CATEGORIZED]->(_6)
CREATE (_45)-[:CATEGORIZED]->(_20)
CREATE (_46:Petition {title:'Enforce Presidential Executive Order 12072, and select North St. Louis City as the home of the new NGA West Headquarters', body:'In the 1970\'s, HUD demolished the Pruitt-Igoe Housing Project in North St. Louis. Since then, North St. Louis and North St. Louis County have experienced continuous deterioration and disinvestment. Residents of North St. Louis and North St. Louis County have suffered through these steadily worsening conditions for more than forty years, resulting in the tragedy of Ferguson, viewed by millions.\nThe National Geospatial Agency (NGA)  needs a new headquarters and must choose between North St. Louis and a site 35 miles outside of St. Louis. Executive Order 12072 requires that we give priority to urban areas when we move federal facilities. North St. Louis and North St. Louis County are in the Promise Zone. Locating NGA in the urban core will spur unprecedented private and public investment.'})
CREATE (_46)-[:CATEGORIZED]->(_7)
CREATE (_46)-[:CATEGORIZED]->(_23)
CREATE (_46)-[:CATEGORIZED]->(_36)
CREATE (_47:Petition {title:'Immediately release Dwight Lincoln Hammond, Jr. and his son, Steven Dwight Hammond from prison for time served.', body:'Since Dwight Lincoln Hammond, Jr., and his son, Steven Dwight Hammond already served their original sentence and were released from prison, we see no reason for them to have to serve an additional length of time. \n\nThe original judge in the trial (Judge Hogan) overruled the minimum terrorist sentence that is now being used as the justification for their reimprisonment. He wrote that if the full five years were required, it would be a violation of the 8th amendment (cruel and unusual punishment).'})
CREATE (_47)-[:CATEGORIZED]->(_3)
CREATE (_47)-[:CATEGORIZED]->(_6)
CREATE (_47)-[:CATEGORIZED]->(_20)

CREATE (_48:Person {name:'Catherine', surname:'Pierce', email:'catherine.pierce@example.com', gender:'female'})
CREATE (_49:Person {name:'Heather', surname:'Brown', email:'heather.brown@example.com', gender:'female'})
CREATE (_50:Person {name:'Carter', surname:'Walker', email:'carter.walker@example.com', gender:'male'})
CREATE (_51:Person {name:'Felicia', surname:'Coleman', email:'felicia.coleman@example.com', gender:'female'})
CREATE (_52:Person {name:'Taylor', surname:'Bailey', email:'taylor.bailey@example.com', gender:'female'})
CREATE (_53:Person {name:'Calvin', surname:'Reynolds', email:'calvin.reynolds@example.com', gender:'male'})
CREATE (_54:Person {name:'Daisy', surname:'Ramirez', email:'daisy.ramirez@example.com', gender:'female'})
CREATE (_55:Person {name:'Brennan', surname:'Lopez', email:'brennan.lopez@example.com', gender:'male'})
CREATE (_56:Person {name:'Dolores', surname:'Medina', email:'dolores.medina@example.com', gender:'female'})
CREATE (_57:Person {name:'Stella', surname:'Arnold', email:'stella.arnold@example.com', gender:'female'})
CREATE (_58:Person {name:'Courtney', surname:'Larson', email:'courtney.larson@example.com', gender:'female'})
CREATE (_59:Person {name:'Mathew', surname:'Perez', email:'mathew.perez@example.com', gender:'male'})
CREATE (_60:Person {name:'Herminia', surname:'Brown', email:'herminia.brown@example.com', gender:'female'})
CREATE (_61:Person {name:'Wallace', surname:'Larson', email:'wallace.larson@example.com', gender:'male'})
CREATE (_62:Person {name:'Claudia', surname:'Bates', email:'claudia.bates@example.com', gender:'female'})
CREATE (_63:Person {name:'Kurt', surname:'Clark', email:'kurt.clark@example.com', gender:'male'})
CREATE (_64:Person {name:'Franklin', surname:'Lee', email:'franklin.lee@example.com', gender:'male'})
CREATE (_65:Person {name:'Misty', surname:'Williamson', email:'misty.williamson@example.com', gender:'female'})
CREATE (_66:Person {name:'Salvador', surname:'Price', email:'salvador.price@example.com', gender:'male'})
CREATE (_67:Person {name:'Derek', surname:'Long', email:'derek.long@example.com', gender:'male'})
CREATE (_68:Person {name:'Ethan', surname:'Arnold', email:'ethan.arnold@example.com', gender:'male'})
CREATE (_69:Person {name:'Darrell', surname:'Rice', email:'darrell.rice@example.com', gender:'male'})
CREATE (_70:Person {name:'Jose', surname:'Griffin', email:'jose.griffin@example.com', gender:'male'})
CREATE (_71:Person {name:'Marion', surname:'Garcia', email:'marion.garcia@example.com', gender:'male'})
CREATE (_72:Person {name:'Terry', surname:'Kennedy', email:'terry.kennedy@example.com', gender:'male'})
CREATE (_73:Person {name:'Marc', surname:'Ryan', email:'marc.ryan@example.com', gender:'male'})
CREATE (_74:Person {name:'Louella', surname:'Barrett', email:'louella.barrett@example.com', gender:'female'})
CREATE (_75:Person {name:'Hilda', surname:'Baker', email:'hilda.baker@example.com', gender:'female'})
CREATE (_76:Person {name:'Leona', surname:'Moreno', email:'leona.moreno@example.com', gender:'female'})
CREATE (_77:Person {name:'Rosa', surname:'Mckinney', email:'rosa.mckinney@example.com', gender:'female'})
CREATE (_78:Person {name:'Carrie', surname:'Castro', email:'carrie.castro@example.com', gender:'female'})
CREATE (_79:Person {name:'Bernard', surname:'Walker', email:'bernard.walker@example.com', gender:'male'})
CREATE (_80:Person {name:'Mark', surname:'Franklin', email:'mark.franklin@example.com', gender:'male'})
CREATE (_81:Person {name:'Peyton', surname:'Thompson', email:'peyton.thompson@example.com', gender:'female'})
CREATE (_82:Person {name:'Sandra', surname:'Little', email:'sandra.little@example.com', gender:'female'})
CREATE (_83:Person {name:'George', surname:'Martin', email:'george.martin@example.com', gender:'male'})
CREATE (_84:Person {name:'Pedro', surname:'Wheeler', email:'pedro.wheeler@example.com', gender:'male'})
CREATE (_85:Person {name:'Ruben', surname:'Barnes', email:'ruben.barnes@example.com', gender:'male'})
CREATE (_86:Person {name:'Mae', surname:'Green', email:'mae.green@example.com', gender:'female'})
CREATE (_87:Person {name:'Zoe', surname:'Kennedy', email:'zoe.kennedy@example.com', gender:'female'})
CREATE (_88:Person {name:'Laurie', surname:'Jackson', email:'laurie.jackson@example.com', gender:'female'})
CREATE (_89:Person {name:'Debbie', surname:'Robinson', email:'debbie.robinson@example.com', gender:'female'})
CREATE (_90:Person {name:'Minnie', surname:'Ray', email:'minnie.ray@example.com', gender:'female'})
CREATE (_91:Person {name:'Ken', surname:'Armstrong', email:'ken.armstrong@example.com', gender:'male'})
CREATE (_92:Person {name:'Francisco', surname:'Jennings', email:'francisco.jennings@example.com', gender:'male'})
CREATE (_93:Person {name:'Patsy', surname:'Brooks', email:'patsy.brooks@example.com', gender:'female'})
CREATE (_94:Person {name:'Tammy', surname:'Moreno', email:'tammy.moreno@example.com', gender:'female'})
CREATE (_95:Person {name:'Bernard', surname:'Diaz', email:'bernard.diaz@example.com', gender:'male'})
CREATE (_96:Person {name:'Tracy', surname:'Black', email:'tracy.black@example.com', gender:'female'})
CREATE (_97:Person {name:'Stephanie', surname:'Fisher', email:'stephanie.fisher@example.com', gender:'female'})
CREATE (_98:Person {name:'Emma', surname:'Montgomery', email:'emma.montgomery@example.com', gender:'female'})
CREATE (_99:Person {name:'Marshall', surname:'Snyder', email:'marshall.snyder@example.com', gender:'male'})
CREATE (_100:Person {name:'Joan', surname:'Medina', email:'joan.medina@example.com', gender:'female'})
CREATE (_101:Person {name:'Jeffrey', surname:'King', email:'jeffrey.king@example.com', gender:'male'})
CREATE (_102:Person {name:'Peter', surname:'Rivera', email:'peter.rivera@example.com', gender:'male'})
CREATE (_103:Person {name:'Fernando', surname:'Chapman', email:'fernando.chapman@example.com', gender:'male'})
CREATE (_104:Person {name:'Oscar', surname:'Nelson', email:'oscar.nelson@example.com', gender:'male'})
CREATE (_105:Person {name:'Julie', surname:'Anderson', email:'julie.anderson@example.com', gender:'female'})
CREATE (_106:Person {name:'Donald', surname:'Lopez', email:'donald.lopez@example.com', gender:'male'})
CREATE (_107:Person {name:'Amber', surname:'Patterson', email:'amber.patterson@example.com', gender:'female'})
CREATE (_108:Person {name:'Alfredo', surname:'Flores', email:'alfredo.flores@example.com', gender:'male'})
CREATE (_109:Person {name:'Bruce', surname:'Garcia', email:'bruce.garcia@example.com', gender:'male'})
CREATE (_110:Person {name:'Michele', surname:'Baker', email:'michele.baker@example.com', gender:'female'})
CREATE (_111:Person {name:'Joanne', surname:'Montgomery', email:'joanne.montgomery@example.com', gender:'female'})
CREATE (_112:Person {name:'Daniel', surname:'Ramirez', email:'daniel.ramirez@example.com', gender:'male'})
CREATE (_113:Person {name:'Carolyn', surname:'Simmons', email:'carolyn.simmons@example.com', gender:'female'})
CREATE (_114:Person {name:'Norman', surname:'Wells', email:'norman.wells@example.com', gender:'male'})
CREATE (_115:Person {name:'Rene', surname:'Ruiz', email:'rene.ruiz@example.com', gender:'male'})
CREATE (_116:Person {name:'Billie', surname:'Long', email:'billie.long@example.com', gender:'female'})
CREATE (_117:Person {name:'Lloyd', surname:'Sullivan', email:'lloyd.sullivan@example.com', gender:'male'})
CREATE (_118:Person {name:'Leona', surname:'Miles', email:'leona.miles@example.com', gender:'female'})
CREATE (_119:Person {name:'Jesus', surname:'George', email:'jesus.george@example.com', gender:'male'})
CREATE (_120:Person {name:'Claudia', surname:'Knight', email:'claudia.knight@example.com', gender:'female'})
CREATE (_121:Person {name:'Ethan', surname:'Simpson', email:'ethan.simpson@example.com', gender:'male'})
CREATE (_122:Person {name:'Debra', surname:'Mitchell', email:'debra.mitchell@example.com', gender:'female'})
CREATE (_123:Person {name:'Claudia', surname:'Harvey', email:'claudia.harvey@example.com', gender:'female'})
CREATE (_124:Person {name:'Raymond', surname:'Morales', email:'raymond.morales@example.com', gender:'male'})
CREATE (_125:Person {name:'Terry', surname:'Harrison', email:'terry.harrison@example.com', gender:'female'})
CREATE (_126:Person {name:'Clifton', surname:'Miles', email:'clifton.miles@example.com', gender:'male'})
CREATE (_127:Person {name:'Lisa', surname:'Ortiz', email:'lisa.ortiz@example.com', gender:'female'})
CREATE (_128:Person {name:'Dylan', surname:'Steward', email:'dylan.steward@example.com', gender:'male'})
CREATE (_129:Person {name:'Annie', surname:'Hayes', email:'annie.hayes@example.com', gender:'female'})
CREATE (_130:Person {name:'Mary', surname:'Hawkins', email:'mary.hawkins@example.com', gender:'female'})
CREATE (_131:Person {name:'Alfredo', surname:'Alvarez', email:'alfredo.alvarez@example.com', gender:'male'})
CREATE (_132:Person {name:'Paula', surname:'Williamson', email:'paula.williamson@example.com', gender:'female'})
CREATE (_133:Person {name:'Byron', surname:'Morrison', email:'byron.morrison@example.com', gender:'male'})
CREATE (_134:Person {name:'Darryl', surname:'Gonzalez', email:'darryl.gonzalez@example.com', gender:'male'})
CREATE (_135:Person {name:'Jennie', surname:'Warren', email:'jennie.warren@example.com', gender:'female'})
CREATE (_136:Person {name:'Alex', surname:'Reyes', email:'alex.reyes@example.com', gender:'male'})
CREATE (_137:Person {name:'Marshall', surname:'Montgomery', email:'marshall.montgomery@example.com', gender:'male'})
CREATE (_138:Person {name:'Matthew', surname:'White', email:'matthew.white@example.com', gender:'male'})
CREATE (_139:Person {name:'Alexis', surname:'Reed', email:'alexis.reed@example.com', gender:'female'})
CREATE (_140:Person {name:'Wallace', surname:'Bowman', email:'wallace.bowman@example.com', gender:'male'})
CREATE (_141:Person {name:'Joanne', surname:'Arnold', email:'joanne.arnold@example.com', gender:'female'})
CREATE (_142:Person {name:'Rene', surname:'Morris', email:'rene.morris@example.com', gender:'male'})
CREATE (_143:Person {name:'Leslie', surname:'Peters', email:'leslie.peters@example.com', gender:'female'})
CREATE (_144:Person {name:'Janet', surname:'Griffin', email:'janet.griffin@example.com', gender:'female'})
CREATE (_145:Person {name:'Travis', surname:'Gibson', email:'travis.gibson@example.com', gender:'male'})
CREATE (_146:Person {name:'Lesa', surname:'Cruz', email:'lesa.cruz@example.com', gender:'female'})
CREATE (_147:Person {name:'Charlie', surname:'Simpson', email:'charlie.simpson@example.com', gender:'male'})

CREATE (_89)-[:PROPOSES]->(_39)
CREATE (_107)-[:PROPOSES]->(_40)
CREATE (_106)-[:PROPOSES]->(_41)
CREATE (_147)-[:PROPOSES]->(_42)
CREATE (_62)-[:PROPOSES]->(_43)
CREATE (_66)-[:PROPOSES]->(_44)
CREATE (_104)-[:PROPOSES]->(_45)
CREATE (_133)-[:PROPOSES]->(_46)
CREATE (_75)-[:PROPOSES]->(_47)


CREATE (_108)-[:DELEGATES{issue: 'Criminal Justice and Law Enforcement'}]->(_134)
CREATE (_104)-[:DELEGATES{issue: 'Foreign Policy'}]->(_124)
CREATE (_108)-[:DELEGATES{issue: 'Economy'}]->(_103)
CREATE (_63)-[:DELEGATES{issue: 'Transportation and Infrastructure'}]->(_121)
CREATE (_67)-[:DELEGATES{issue: 'Small Business'}]->(_99)
CREATE (_119)-[:DELEGATES{issue: 'Regulatory Reform'}]->(_60)
CREATE (_84)-[:DELEGATES{issue: 'Education'}]->(_108)
CREATE (_88)-[:DELEGATES{issue: 'Regulatory Reform'}]->(_89)
CREATE (_118)-[:DELEGATES{issue: 'Natural Resources'}]->(_89)
CREATE (_104)-[:DELEGATES{issue: 'Homeland Security and Disaster Relief'}]->(_145)
CREATE (_52)-[:DELEGATES{issue: 'Disabilities'}]->(_110)
CREATE (_124)-[:DELEGATES{issue: 'Postal Service'}]->(_113)
CREATE (_138)-[:DELEGATES{issue: 'Economy'}]->(_108)
CREATE (_85)-[:DELEGATES{issue: 'Energy'}]->(_147)
CREATE (_122)-[:DELEGATES{issue: 'Firearms'}]->(_141)
CREATE (_120)-[:DELEGATES{issue: 'Education'}]->(_100)
CREATE (_131)-[:DELEGATES{issue: 'Foreign Policy'}]->(_109)
CREATE (_95)-[:DELEGATES{issue: 'Climate Change'}]->(_144)
CREATE (_99)-[:DELEGATES{issue: 'Family'}]->(_77)
CREATE (_90)-[:DELEGATES{issue: 'Disabilities'}]->(_52)
CREATE (_57)-[:DELEGATES{issue: 'Family'}]->(_139)
CREATE (_77)-[:DELEGATES{issue: 'Rural Policy'}]->(_114)
CREATE (_78)-[:DELEGATES{issue: 'Foreign Policy'}]->(_89)
CREATE (_118)-[:DELEGATES{issue: 'Government Reform'}]->(_105)
CREATE (_136)-[:DELEGATES{issue: 'Job Creation'}]->(_143)
CREATE (_118)-[:DELEGATES{issue: 'Postal Service'}]->(_133)
CREATE (_89)-[:DELEGATES{issue: 'Disabilities'}]->(_145)
CREATE (_106)-[:DELEGATES{issue: 'Urban Policy'}]->(_122)
CREATE (_109)-[:DELEGATES{issue: 'Small Business'}]->(_103)
CREATE (_124)-[:DELEGATES{issue: 'Immigration'}]->(_142)
CREATE (_139)-[:DELEGATES{issue: 'Civil Rights and Liberties'}]->(_146)
CREATE (_71)-[:DELEGATES{issue: 'Education'}]->(_145)
CREATE (_120)-[:DELEGATES{issue: 'Innovation'}]->(_70)
CREATE (_70)-[:DELEGATES{issue: 'Budget and Taxes'}]->(_81)
CREATE (_142)-[:DELEGATES{issue: 'Disabilities'}]->(_141)
CREATE (_55)-[:DELEGATES{issue: 'Postal Service'}]->(_131)
CREATE (_132)-[:DELEGATES{issue: 'Family'}]->(_64)
CREATE (_98)-[:DELEGATES{issue: 'Innovation'}]->(_95)
CREATE (_109)-[:DELEGATES{issue: 'Transportation and Infrastructure'}]->(_64)
CREATE (_58)-[:DELEGATES{issue: 'Immigration'}]->(_107)
CREATE (_120)-[:DELEGATES{issue: 'Defense'}]->(_131)
CREATE (_49)-[:DELEGATES{issue: 'Education'}]->(_52)
CREATE (_105)-[:DELEGATES{issue: 'Health Care'}]->(_87)
CREATE (_86)-[:DELEGATES{issue: 'Budget and Taxes'}]->(_104)
CREATE (_127)-[:DELEGATES{issue: 'Foreign Policy'}]->(_54)
CREATE (_93)-[:DELEGATES{issue: 'Transportation and Infrastructure'}]->(_98)
CREATE (_115)-[:DELEGATES{issue: 'Defense'}]->(_121)
CREATE (_137)-[:DELEGATES{issue: 'Family'}]->(_122)
CREATE (_59)-[:DELEGATES{issue: 'Family'}]->(_74)
CREATE (_139)-[:DELEGATES{issue: 'Arts and Humanities'}]->(_99)


CREATE (_84)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_104)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_50)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_134)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_62)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_126)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_59)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_127)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_69)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_89)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_54)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_49)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_106)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_110)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_83)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_91)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_99)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_86)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_64)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_130)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_109)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_145)-[:VOTES{choice: 'no'}]->(_39)
CREATE (_143)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_97)-[:VOTES{choice: 'yes'}]->(_39)
CREATE (_101)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_58)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_130)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_84)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_119)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_133)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_76)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_135)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_137)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_82)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_121)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_54)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_111)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_139)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_108)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_96)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_134)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_55)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_105)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_131)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_109)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_92)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_95)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_125)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_140)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_81)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_67)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_110)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_142)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_52)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_66)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_106)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_97)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_56)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_99)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_53)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_136)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_127)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_65)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_147)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_100)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_124)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_114)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_120)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_69)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_122)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_71)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_98)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_61)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_88)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_73)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_132)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_138)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_48)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_87)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_79)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_49)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_89)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_50)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_70)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_60)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_117)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_90)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_93)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_94)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_51)-[:VOTES{choice: 'no'}]->(_40)
CREATE (_91)-[:VOTES{choice: 'yes'}]->(_40)
CREATE (_130)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_113)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_76)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_57)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_94)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_146)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_136)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_138)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_48)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_52)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_51)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_65)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_86)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_66)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_74)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_131)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_142)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_129)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_88)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_58)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_109)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_60)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_67)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_117)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_84)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_144)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_97)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_108)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_124)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_145)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_121)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_133)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_78)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_75)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_85)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_81)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_107)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_110)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_71)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_115)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_55)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_82)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_89)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_112)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_95)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_61)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_69)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_90)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_139)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_50)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_62)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_141)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_98)-[:VOTES{choice: 'yes'}]->(_41)
CREATE (_99)-[:VOTES{choice: 'no'}]->(_41)
CREATE (_110)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_134)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_60)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_74)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_131)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_138)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_132)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_94)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_81)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_136)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_96)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_108)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_111)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_126)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_61)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_135)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_122)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_130)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_112)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_73)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_51)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_139)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_140)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_70)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_88)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_117)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_68)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_48)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_84)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_101)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_91)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_92)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_115)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_113)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_144)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_69)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_116)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_55)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_49)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_103)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_128)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_71)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_118)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_107)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_124)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_83)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_146)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_109)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_89)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_97)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_99)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_100)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_147)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_145)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_119)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_125)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_127)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_102)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_106)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_65)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_76)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_75)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_137)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_142)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_80)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_98)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_90)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_95)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_114)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_64)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_87)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_141)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_58)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_78)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_62)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_52)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_121)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_54)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_120)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_105)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_143)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_72)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_85)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_57)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_63)-[:VOTES{choice: 'no'}]->(_42)
CREATE (_133)-[:VOTES{choice: 'yes'}]->(_42)
CREATE (_137)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_120)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_115)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_86)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_111)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_92)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_72)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_135)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_119)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_48)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_69)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_64)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_87)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_50)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_101)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_66)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_60)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_51)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_109)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_139)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_107)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_118)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_91)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_84)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_138)-[:VOTES{choice: 'yes'}]->(_43)
CREATE (_112)-[:VOTES{choice: 'no'}]->(_43)
CREATE (_96)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_130)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_89)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_80)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_85)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_101)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_79)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_62)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_76)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_142)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_97)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_126)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_129)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_146)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_121)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_135)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_143)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_118)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_88)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_123)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_58)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_147)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_140)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_111)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_70)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_133)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_86)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_73)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_65)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_92)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_104)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_64)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_56)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_102)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_48)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_50)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_59)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_57)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_55)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_120)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_61)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_69)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_112)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_95)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_71)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_105)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_138)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_68)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_91)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_122)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_51)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_82)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_116)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_106)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_139)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_131)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_90)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_125)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_77)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_72)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_108)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_124)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_75)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_134)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_54)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_84)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_103)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_100)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_110)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_109)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_66)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_136)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_78)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_98)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_119)-[:VOTES{choice: 'yes'}]->(_44)
CREATE (_127)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_132)-[:VOTES{choice: 'no'}]->(_44)
CREATE (_101)-[:VOTES{choice: 'no'}]->(_45)
CREATE (_116)-[:VOTES{choice: 'yes'}]->(_45)
CREATE (_127)-[:VOTES{choice: 'yes'}]->(_45)
CREATE (_68)-[:VOTES{choice: 'yes'}]->(_45)
CREATE (_125)-[:VOTES{choice: 'no'}]->(_45)
CREATE (_91)-[:VOTES{choice: 'yes'}]->(_45)
CREATE (_107)-[:VOTES{choice: 'no'}]->(_45)
CREATE (_121)-[:VOTES{choice: 'no'}]->(_45)
CREATE (_139)-[:VOTES{choice: 'yes'}]->(_45)
CREATE (_75)-[:VOTES{choice: 'no'}]->(_45)
CREATE (_70)-[:VOTES{choice: 'yes'}]->(_45)
CREATE (_117)-[:VOTES{choice: 'yes'}]->(_45)
CREATE (_57)-[:VOTES{choice: 'yes'}]->(_45)
CREATE (_64)-[:VOTES{choice: 'yes'}]->(_45)
CREATE (_100)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_58)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_121)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_86)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_73)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_85)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_84)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_116)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_108)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_135)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_111)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_109)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_138)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_60)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_124)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_142)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_137)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_66)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_125)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_77)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_65)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_51)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_81)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_144)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_96)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_75)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_103)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_70)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_50)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_90)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_72)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_68)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_136)-[:VOTES{choice: 'no'}]->(_46)
CREATE (_126)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_59)-[:VOTES{choice: 'yes'}]->(_46)
CREATE (_79)-[:VOTES{choice: 'yes'}]->(_47)
CREATE (_135)-[:VOTES{choice: 'no'}]->(_47)
CREATE (_105)-[:VOTES{choice: 'yes'}]->(_47)
CREATE (_126)-[:VOTES{choice: 'yes'}]->(_47)
CREATE (_128)-[:VOTES{choice: 'no'}]->(_47)
CREATE (_144)-[:VOTES{choice: 'yes'}]->(_47)
CREATE (_54)-[:VOTES{choice: 'no'}]->(_47)
CREATE (_80)-[:VOTES{choice: 'no'}]->(_47)
CREATE (_78)-[:VOTES{choice: 'yes'}]->(_47)
CREATE (_49)-[:VOTES{choice: 'no'}]->(_47)
CREATE (_131)-[:VOTES{choice: 'yes'}]->(_47)
CREATE (_130)-[:VOTES{choice: 'yes'}]->(_47)
CREATE (_70)-[:VOTES{choice: 'yes'}]->(_47)
CREATE (_75)-[:VOTES{choice: 'no'}]->(_47)
CREATE (_117)-[:VOTES{choice: 'yes'}]->(_47)
CREATE (_107)-[:VOTES{choice: 'yes'}]->(_47)
CREATE (_62)-[:VOTES{choice: 'no'}]->(_47)
CREATE (_89)-[:VOTES{choice: 'no'}]->(_47)
;

Queries

Active issues

MATCH (p:Petition)-[:CATEGORIZED]->(i:Issues)
RETURN count(p) as Petitions, i.name as Issue
ORDER BY Petitions DESC

Top 5 delegates with direct delegation

MATCH (p:Person)-[:DELEGATES]->(d:Person)
RETURN count(p) as Delegators, d.name + " " + d.surname as Delegate
ORDER BY Delegators DESC
LIMIT 5

Top 5 most influent delegates

MATCH (p:Person)-[:DELEGATES*]->(d:Person)
RETURN count(p) as Delegators, d.name + " " + d.surname as Delegate
ORDER BY Delegators DESC
LIMIT 5

Direct votes for petitions and its issues

MATCH (v:Person)-[:VOTES]->(p:Petition)-[:CATEGORIZED]->(i:Issues)
RETURN count(distinct v) as TotalVotes, p.title as Petition, collect(distinct i.name) as Issues
ORDER BY TotalVotes DESC

All votes (direct and delegates) for petitions and its issues

MATCH (v:Person)-[:VOTES]->(p:Petition)-[:CATEGORIZED]->(i:Issues)
OPTIONAL MATCH (d:Person)-[:DELEGATES*{issue: i.name}]->(v)
WHERE NOT (d)-[:VOTES]->(p)
RETURN count(DISTINCT d) + count(DISTINCT v) AS TotalVotes, p.title AS Petition, collect(DISTINCT i.name) AS Issues
ORDER BY TotalVotes DESC

The first petition is approved?

MATCH (p:Petition{title:'Arrest Ammon Bundy and the armed occupiers of the Malheur Wildlife Refuge.'})-[:CATEGORIZED]->(i:Issues),
	(vy:Person)-[:VOTES{choice:'yes'}]->(p),
	(vn:Person)-[:VOTES{choice:'no'}]->(p)
OPTIONAL MATCH  (dy:Person)-[:DELEGATES*{issue: i.name}]->(vy)
WHERE NOT (dy)-[:VOTES]->(p)
OPTIONAL MATCH  (dn:Person)-[:DELEGATES*{issue: i.name}]->(vn)
WHERE NOT (dn)-[:VOTES]->(p)
RETURN count(distinct dy) + count(distinct vy) as Yes, count(distinct dn) + count(distinct vn) as No, p.title as Petition

Let see the approved ones

MATCH (p:Petition)-[:CATEGORIZED]->(i:Issues),
	(vy:Person)-[:VOTES{choice:'yes'}]->(p),
	(vn:Person)-[:VOTES{choice:'no'}]->(p)
OPTIONAL MATCH  (dy:Person)-[:DELEGATES*{issue: i.name}]->(vy)
WHERE NOT (dy)-[:VOTES]->(p)
OPTIONAL MATCH  (dn:Person)-[:DELEGATES*{issue: i.name}]->(vn)
WHERE NOT (dn)-[:VOTES]->(p)
WITH count(distinct dy) + count(distinct vy) as Yes,
	 count(distinct dn) + count(distinct vn) as No,
	 p
WHERE Yes > No
RETURN Yes, No, p.title as Petition

You are Leona, what petitions have been proposed near to you?

MATCH (leona:Person {name:'Leona'})-[*]->(p:Person)-[:PROPOSES]->(petition:Petition)
RETURN petition.title as Title, petition.body as Body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment