Skip to content

Instantly share code, notes, and snippets.

@ZeccaLehn
Last active December 19, 2018 01:32
Show Gist options
  • Save ZeccaLehn/f1b207880d8c307afd6c195a9a759512 to your computer and use it in GitHub Desktop.
Save ZeccaLehn/f1b207880d8c307afd6c195a9a759512 to your computer and use it in GitHub Desktop.
Booting-Up Your Network with GrapheneDB using Neo4j and Python
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Graph uri='https://hobby-lmbknhfokccegbkemfognhcl.dbs.graphenedb.com:24780/db/data/'>"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"### To work with Neo4j graphenedb.com\n",
"### pip install py2neo==3.0.0 \n",
"\n",
"from py2neo import Graph, authenticate\n",
"\n",
"# Login credentials\n",
"user = \"neoawesomeuser\"\n",
"password = \"b.HqxHNjEsYJoc.Qwon6odZ0CxcBEkf\"\n",
"address = \"hobby-lmbknhfokccegbkemfognhcl.dbs.graphenedb.com:24780\"\n",
"\n",
"## Connecting via https in Python https://docs.graphenedb.com/docs/python\n",
"authenticate(address, user, password)\n",
"graph = Graph(\"https://\" + address, bolt = False)\n",
"\n",
"graph"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"graph.delete_all() # Caution!! Deletes data in database"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# Adapted from # https://nicolewhite.github.io/neo4j-jupyter/hello-world.html\n",
"\n",
"from py2neo import Node\n",
"from py2neo import Relationship\n",
"\n",
"## Create Graph nodes\n",
"nicole = Node(\"Person\", name=\"Nicole\", age=24)\n",
"drew = Node(\"Person\", name=\"Drew\", age=20)\n",
"\n",
"mtdew = Node(\"Drink\", name=\"Mountain Dew\", calories=9000)\n",
"cokezero = Node(\"Drink\", name=\"Coke Zero\", calories=0)\n",
"\n",
"coke = Node(\"Manufacturer\", name=\"Coca Cola\")\n",
"pepsi = Node(\"Manufacturer\", name=\"Pepsi\")\n",
"\n",
"# Creates a subgraph of nodes\n",
"graph.create(nicole | drew | mtdew | cokezero | coke | pepsi)\n",
"\n",
"## Creates Relationships among nodes in subgraph\n",
"graph.create(Relationship(nicole, \"LIKES\", cokezero))\n",
"graph.create(Relationship(nicole, \"LIKES\", mtdew))\n",
"graph.create(Relationship(drew, \"LIKES\", mtdew))\n",
"graph.create(Relationship(coke, \"MAKES\", cokezero))\n",
"graph.create(Relationship(pepsi, \"MAKES\", mtdew))"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"frozenset({'Drink', 'Manufacturer', 'Person'})"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"graph.node_labels"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"frozenset({'LIKES', 'MAKES'})"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"graph.relationship_types"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Mountain Dew\n",
"Coke Zero\n"
]
}
],
"source": [
"# What does Nicole like?\n",
"for rel in graph.match(start_node=nicole, rel_type=\"LIKES\"):\n",
" print(rel.end_node()[\"name\"])"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"$(\"head\").append($(\"<link/>\").attr({\n",
" rel: \"stylesheet\",\n",
" type: \"text/css\",\n",
" href: \"https://cdnjs.cloudflare.com/ajax/libs/vis/4.8.2/vis.css\"\n",
"}));\n",
"require.config({ paths: { vis: '//cdnjs.cloudflare.com/ajax/libs/vis/4.8.2/vis.min' } }); require(['vis'], function(vis) { window.vis = vis; }); "
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div id=\"9700cf52-7b45-4401-9570-e74c35d0c9fc\" style=\"height: 400px;\"></div>\n",
"\n",
"<script type=\"text/javascript\">\n",
"\n",
" var nodes = [{\"group\": \"Manufacturer\", \"title\": \"{'name': 'Coca Cola'}\", \"id\": 24, \"label\": \"Coca Cola\"}, {\"group\": \"Drink\", \"title\": \"{'name': 'Coke Zero', 'calories': 0}\", \"id\": 22, \"label\": \"Coke Zero\"}, {\"group\": \"Person\", \"title\": \"{'name': 'Drew', 'age': 20}\", \"id\": 21, \"label\": \"Drew\"}, {\"group\": \"Drink\", \"title\": \"{'name': 'Mountain Dew', 'calories': 9000}\", \"id\": 20, \"label\": \"Mountain Dew\"}, {\"group\": \"Manufacturer\", \"title\": \"{'name': 'Pepsi'}\", \"id\": 25, \"label\": \"Pepsi\"}, {\"group\": \"Person\", \"title\": \"{'name': 'Nicole', 'age': 24}\", \"id\": 23, \"label\": \"Nicole\"}];\n",
" var edges = [{\"from\": 24, \"label\": \"MAKES\", \"to\": 22}, {\"from\": 21, \"label\": \"LIKES\", \"to\": 20}, {\"from\": 25, \"label\": \"MAKES\", \"to\": 20}, {\"from\": 23, \"label\": \"LIKES\", \"to\": 20}, {\"from\": 23, \"label\": \"LIKES\", \"to\": 22}];\n",
"\n",
" var container = document.getElementById(\"9700cf52-7b45-4401-9570-e74c35d0c9fc\");\n",
"\n",
" var data = {\n",
" nodes: nodes,\n",
" edges: edges\n",
" };\n",
"\n",
" var options = {\n",
" nodes: {\n",
" shape: 'dot',\n",
" size: 25,\n",
" font: {\n",
" size: 14\n",
" }\n",
" },\n",
" edges: {\n",
" font: {\n",
" size: 14,\n",
" align: 'middle'\n",
" },\n",
" color: 'gray',\n",
" arrows: {\n",
" to: {\n",
" enabled: true,\n",
" scaleFactor: 0.5\n",
" }\n",
" },\n",
" smooth: {\n",
" enabled: false\n",
" }\n",
" },\n",
" physics: {\n",
" enabled: true\n",
" }\n",
" };\n",
"\n",
" var network = new vis.Network(container, data, options);\n",
"\n",
"</script>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"## https://github.com/merqurio/neo4jupyter \n",
"## pip install neo4jupyter \n",
"import neo4jupyter\n",
"neo4jupyter.init_notebook_mode()\n",
"\n",
"options = {\"Person\": \"name\", \"Drink\": \"name\", \"Manufacturer\": \"name\"}\n",
"neo4jupyter.draw(graph, options)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"('name': 'Drew', 'drink': 'Mountain Dew', 'calories': 9000)\n",
"('name': 'Nicole', 'drink': 'Mountain Dew', 'calories': 9000)\n",
"('name': 'Nicole', 'drink': 'Coke Zero', 'calories': 0)\n"
]
}
],
"source": [
"query = \"\"\"\n",
"MATCH (person:Person)-[:LIKES]->(drink:Drink)\n",
"RETURN person.name AS name, drink.name AS drink, drink.calories AS calories\n",
"\"\"\"\n",
"# <class 'py2neo.database.Cursor'>\n",
"data = graph.run(query)\n",
"\n",
"for d in data:\n",
" print(d)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Movies"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"graph.delete_all() # Caution!! Deletes data in database"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<py2neo.database.Cursor at 0x18eb6b7f240>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"create = \"\"\"CREATE (TheMatrix:Movie {title:'The Matrix', released:1999, tagline:'Welcome to the Real World'})\n",
"CREATE (Keanu:Person {name:'Keanu Reeves', born:1964})\n",
"CREATE (Carrie:Person {name:'Carrie-Anne Moss', born:1967})\n",
"CREATE (Laurence:Person {name:'Laurence Fishburne', born:1961})\n",
"CREATE (Hugo:Person {name:'Hugo Weaving', born:1960})\n",
"CREATE (LillyW:Person {name:'Lilly Wachowski', born:1967})\n",
"CREATE (LanaW:Person {name:'Lana Wachowski', born:1965})\n",
"CREATE (JoelS:Person {name:'Joel Silver', born:1952})\n",
"CREATE\n",
" (Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrix),\n",
" (Carrie)-[:ACTED_IN {roles:['Trinity']}]->(TheMatrix),\n",
" (Laurence)-[:ACTED_IN {roles:['Morpheus']}]->(TheMatrix),\n",
" (Hugo)-[:ACTED_IN {roles:['Agent Smith']}]->(TheMatrix),\n",
" (LillyW)-[:DIRECTED]->(TheMatrix),\n",
" (LanaW)-[:DIRECTED]->(TheMatrix),\n",
" (JoelS)-[:PRODUCED]->(TheMatrix)\n",
"\n",
"CREATE (Emil:Person {name:\"Emil Eifrem\", born:1978})\n",
"CREATE (Emil)-[:ACTED_IN {roles:[\"Emil\"]}]->(TheMatrix)\n",
"\n",
"CREATE (TheMatrixReloaded:Movie {title:'The Matrix Reloaded', released:2003, tagline:'Free your mind'})\n",
"CREATE\n",
" (Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrixReloaded),\n",
" (Carrie)-[:ACTED_IN {roles:['Trinity']}]->(TheMatrixReloaded),\n",
" (Laurence)-[:ACTED_IN {roles:['Morpheus']}]->(TheMatrixReloaded),\n",
" (Hugo)-[:ACTED_IN {roles:['Agent Smith']}]->(TheMatrixReloaded),\n",
" (LillyW)-[:DIRECTED]->(TheMatrixReloaded),\n",
" (LanaW)-[:DIRECTED]->(TheMatrixReloaded),\n",
" (JoelS)-[:PRODUCED]->(TheMatrixReloaded)\n",
"\n",
"CREATE (TheMatrixRevolutions:Movie {title:'The Matrix Revolutions', released:2003, tagline:'Everything that has a beginning has an end'})\n",
"CREATE\n",
" (Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrixRevolutions),\n",
" (Carrie)-[:ACTED_IN {roles:['Trinity']}]->(TheMatrixRevolutions),\n",
" (Laurence)-[:ACTED_IN {roles:['Morpheus']}]->(TheMatrixRevolutions),\n",
" (Hugo)-[:ACTED_IN {roles:['Agent Smith']}]->(TheMatrixRevolutions),\n",
" (LillyW)-[:DIRECTED]->(TheMatrixRevolutions),\n",
" (LanaW)-[:DIRECTED]->(TheMatrixRevolutions),\n",
" (JoelS)-[:PRODUCED]->(TheMatrixRevolutions)\n",
"\n",
"CREATE (TheDevilsAdvocate:Movie {title:\"The Devil's Advocate\", released:1997, tagline:'Evil has its winning ways'})\n",
"CREATE (Charlize:Person {name:'Charlize Theron', born:1975})\n",
"CREATE (Al:Person {name:'Al Pacino', born:1940})\n",
"CREATE (Taylor:Person {name:'Taylor Hackford', born:1944})\n",
"CREATE\n",
" (Keanu)-[:ACTED_IN {roles:['Kevin Lomax']}]->(TheDevilsAdvocate),\n",
" (Charlize)-[:ACTED_IN {roles:['Mary Ann Lomax']}]->(TheDevilsAdvocate),\n",
" (Al)-[:ACTED_IN {roles:['John Milton']}]->(TheDevilsAdvocate),\n",
" (Taylor)-[:DIRECTED]->(TheDevilsAdvocate)\n",
"\n",
"CREATE (AFewGoodMen:Movie {title:\"A Few Good Men\", released:1992, tagline:\"In the heart of the nation's capital, in a courthouse of the U.S. government, one man will stop at nothing to keep his honor, and one will stop at nothing to find the truth.\"})\n",
"CREATE (TomC:Person {name:'Tom Cruise', born:1962})\n",
"CREATE (JackN:Person {name:'Jack Nicholson', born:1937})\n",
"CREATE (DemiM:Person {name:'Demi Moore', born:1962})\n",
"CREATE (KevinB:Person {name:'Kevin Bacon', born:1958})\n",
"CREATE (KieferS:Person {name:'Kiefer Sutherland', born:1966})\n",
"CREATE (NoahW:Person {name:'Noah Wyle', born:1971})\n",
"CREATE (CubaG:Person {name:'Cuba Gooding Jr.', born:1968})\n",
"CREATE (KevinP:Person {name:'Kevin Pollak', born:1957})\n",
"CREATE (JTW:Person {name:'J.T. Walsh', born:1943})\n",
"CREATE (JamesM:Person {name:'James Marshall', born:1967})\n",
"CREATE (ChristopherG:Person {name:'Christopher Guest', born:1948})\n",
"CREATE (RobR:Person {name:'Rob Reiner', born:1947})\n",
"CREATE (AaronS:Person {name:'Aaron Sorkin', born:1961})\n",
"CREATE\n",
" (TomC)-[:ACTED_IN {roles:['Lt. Daniel Kaffee']}]->(AFewGoodMen),\n",
" (JackN)-[:ACTED_IN {roles:['Col. Nathan R. Jessup']}]->(AFewGoodMen),\n",
" (DemiM)-[:ACTED_IN {roles:['Lt. Cdr. JoAnne Galloway']}]->(AFewGoodMen),\n",
" (KevinB)-[:ACTED_IN {roles:['Capt. Jack Ross']}]->(AFewGoodMen),\n",
" (KieferS)-[:ACTED_IN {roles:['Lt. Jonathan Kendrick']}]->(AFewGoodMen),\n",
" (NoahW)-[:ACTED_IN {roles:['Cpl. Jeffrey Barnes']}]->(AFewGoodMen),\n",
" (CubaG)-[:ACTED_IN {roles:['Cpl. Carl Hammaker']}]->(AFewGoodMen),\n",
" (KevinP)-[:ACTED_IN {roles:['Lt. Sam Weinberg']}]->(AFewGoodMen),\n",
" (JTW)-[:ACTED_IN {roles:['Lt. Col. Matthew Andrew Markinson']}]->(AFewGoodMen),\n",
" (JamesM)-[:ACTED_IN {roles:['Pfc. Louden Downey']}]->(AFewGoodMen),\n",
" (ChristopherG)-[:ACTED_IN {roles:['Dr. Stone']}]->(AFewGoodMen),\n",
" (AaronS)-[:ACTED_IN {roles:['Man in Bar']}]->(AFewGoodMen),\n",
" (RobR)-[:DIRECTED]->(AFewGoodMen),\n",
" (AaronS)-[:WROTE]->(AFewGoodMen)\n",
"\n",
"CREATE (TopGun:Movie {title:\"Top Gun\", released:1986, tagline:'I feel the need, the need for speed.'})\n",
"CREATE (KellyM:Person {name:'Kelly McGillis', born:1957})\n",
"CREATE (ValK:Person {name:'Val Kilmer', born:1959})\n",
"CREATE (AnthonyE:Person {name:'Anthony Edwards', born:1962})\n",
"CREATE (TomS:Person {name:'Tom Skerritt', born:1933})\n",
"CREATE (MegR:Person {name:'Meg Ryan', born:1961})\n",
"CREATE (TonyS:Person {name:'Tony Scott', born:1944})\n",
"CREATE (JimC:Person {name:'Jim Cash', born:1941})\n",
"CREATE\n",
" (TomC)-[:ACTED_IN {roles:['Maverick']}]->(TopGun),\n",
" (KellyM)-[:ACTED_IN {roles:['Charlie']}]->(TopGun),\n",
" (ValK)-[:ACTED_IN {roles:['Iceman']}]->(TopGun),\n",
" (AnthonyE)-[:ACTED_IN {roles:['Goose']}]->(TopGun),\n",
" (TomS)-[:ACTED_IN {roles:['Viper']}]->(TopGun),\n",
" (MegR)-[:ACTED_IN {roles:['Carole']}]->(TopGun),\n",
" (TonyS)-[:DIRECTED]->(TopGun),\n",
" (JimC)-[:WROTE]->(TopGun)\n",
"\n",
"CREATE (JerryMaguire:Movie {title:'Jerry Maguire', released:2000, tagline:'The rest of his life begins now.'})\n",
"CREATE (ReneeZ:Person {name:'Renee Zellweger', born:1969})\n",
"CREATE (KellyP:Person {name:'Kelly Preston', born:1962})\n",
"CREATE (JerryO:Person {name:\"Jerry O'Connell\", born:1974})\n",
"CREATE (JayM:Person {name:'Jay Mohr', born:1970})\n",
"CREATE (BonnieH:Person {name:'Bonnie Hunt', born:1961})\n",
"CREATE (ReginaK:Person {name:'Regina King', born:1971})\n",
"CREATE (JonathanL:Person {name:'Jonathan Lipnicki', born:1996})\n",
"CREATE (CameronC:Person {name:'Cameron Crowe', born:1957})\n",
"CREATE\n",
" (TomC)-[:ACTED_IN {roles:['Jerry Maguire']}]->(JerryMaguire),\n",
" (CubaG)-[:ACTED_IN {roles:['Rod Tidwell']}]->(JerryMaguire),\n",
" (ReneeZ)-[:ACTED_IN {roles:['Dorothy Boyd']}]->(JerryMaguire),\n",
" (KellyP)-[:ACTED_IN {roles:['Avery Bishop']}]->(JerryMaguire),\n",
" (JerryO)-[:ACTED_IN {roles:['Frank Cushman']}]->(JerryMaguire),\n",
" (JayM)-[:ACTED_IN {roles:['Bob Sugar']}]->(JerryMaguire),\n",
" (BonnieH)-[:ACTED_IN {roles:['Laurel Boyd']}]->(JerryMaguire),\n",
" (ReginaK)-[:ACTED_IN {roles:['Marcee Tidwell']}]->(JerryMaguire),\n",
" (JonathanL)-[:ACTED_IN {roles:['Ray Boyd']}]->(JerryMaguire),\n",
" (CameronC)-[:DIRECTED]->(JerryMaguire),\n",
" (CameronC)-[:PRODUCED]->(JerryMaguire),\n",
" (CameronC)-[:WROTE]->(JerryMaguire)\n",
"\n",
"CREATE (StandByMe:Movie {title:\"Stand By Me\", released:1986, tagline:\"For some, it's the last real taste of innocence, and the first real taste of life. But for everyone, it's the time that memories are made of.\"})\n",
"CREATE (RiverP:Person {name:'River Phoenix', born:1970})\n",
"CREATE (CoreyF:Person {name:'Corey Feldman', born:1971})\n",
"CREATE (WilW:Person {name:'Wil Wheaton', born:1972})\n",
"CREATE (JohnC:Person {name:'John Cusack', born:1966})\n",
"CREATE (MarshallB:Person {name:'Marshall Bell', born:1942})\n",
"CREATE\n",
" (WilW)-[:ACTED_IN {roles:['Gordie Lachance']}]->(StandByMe),\n",
" (RiverP)-[:ACTED_IN {roles:['Chris Chambers']}]->(StandByMe),\n",
" (JerryO)-[:ACTED_IN {roles:['Vern Tessio']}]->(StandByMe),\n",
" (CoreyF)-[:ACTED_IN {roles:['Teddy Duchamp']}]->(StandByMe),\n",
" (JohnC)-[:ACTED_IN {roles:['Denny Lachance']}]->(StandByMe),\n",
" (KieferS)-[:ACTED_IN {roles:['Ace Merrill']}]->(StandByMe),\n",
" (MarshallB)-[:ACTED_IN {roles:['Mr. Lachance']}]->(StandByMe),\n",
" (RobR)-[:DIRECTED]->(StandByMe)\n",
"\n",
"CREATE (AsGoodAsItGets:Movie {title:'As Good as It Gets', released:1997, tagline:'A comedy from the heart that goes for the throat.'})\n",
"CREATE (HelenH:Person {name:'Helen Hunt', born:1963})\n",
"CREATE (GregK:Person {name:'Greg Kinnear', born:1963})\n",
"CREATE (JamesB:Person {name:'James L. Brooks', born:1940})\n",
"CREATE\n",
" (JackN)-[:ACTED_IN {roles:['Melvin Udall']}]->(AsGoodAsItGets),\n",
" (HelenH)-[:ACTED_IN {roles:['Carol Connelly']}]->(AsGoodAsItGets),\n",
" (GregK)-[:ACTED_IN {roles:['Simon Bishop']}]->(AsGoodAsItGets),\n",
" (CubaG)-[:ACTED_IN {roles:['Frank Sachs']}]->(AsGoodAsItGets),\n",
" (JamesB)-[:DIRECTED]->(AsGoodAsItGets)\n",
"\n",
"CREATE (WhatDreamsMayCome:Movie {title:'What Dreams May Come', released:1998, tagline:'After life there is more. The end is just the beginning.'})\n",
"CREATE (AnnabellaS:Person {name:'Annabella Sciorra', born:1960})\n",
"CREATE (MaxS:Person {name:'Max von Sydow', born:1929})\n",
"CREATE (WernerH:Person {name:'Werner Herzog', born:1942})\n",
"CREATE (Robin:Person {name:'Robin Williams', born:1951})\n",
"CREATE (VincentW:Person {name:'Vincent Ward', born:1956})\n",
"CREATE\n",
" (Robin)-[:ACTED_IN {roles:['Chris Nielsen']}]->(WhatDreamsMayCome),\n",
" (CubaG)-[:ACTED_IN {roles:['Albert Lewis']}]->(WhatDreamsMayCome),\n",
" (AnnabellaS)-[:ACTED_IN {roles:['Annie Collins-Nielsen']}]->(WhatDreamsMayCome),\n",
" (MaxS)-[:ACTED_IN {roles:['The Tracker']}]->(WhatDreamsMayCome),\n",
" (WernerH)-[:ACTED_IN {roles:['The Face']}]->(WhatDreamsMayCome),\n",
" (VincentW)-[:DIRECTED]->(WhatDreamsMayCome)\n",
"\n",
"CREATE (SnowFallingonCedars:Movie {title:'Snow Falling on Cedars', released:1999, tagline:'First loves last. Forever.'})\n",
"CREATE (EthanH:Person {name:'Ethan Hawke', born:1970})\n",
"CREATE (RickY:Person {name:'Rick Yune', born:1971})\n",
"CREATE (JamesC:Person {name:'James Cromwell', born:1940})\n",
"CREATE (ScottH:Person {name:'Scott Hicks', born:1953})\n",
"CREATE\n",
" (EthanH)-[:ACTED_IN {roles:['Ishmael Chambers']}]->(SnowFallingonCedars),\n",
" (RickY)-[:ACTED_IN {roles:['Kazuo Miyamoto']}]->(SnowFallingonCedars),\n",
" (MaxS)-[:ACTED_IN {roles:['Nels Gudmundsson']}]->(SnowFallingonCedars),\n",
" (JamesC)-[:ACTED_IN {roles:['Judge Fielding']}]->(SnowFallingonCedars),\n",
" (ScottH)-[:DIRECTED]->(SnowFallingonCedars)\n",
"\n",
"CREATE (YouveGotMail:Movie {title:\"You've Got Mail\", released:1998, tagline:'At odds in life... in love on-line.'})\n",
"CREATE (ParkerP:Person {name:'Parker Posey', born:1968})\n",
"CREATE (DaveC:Person {name:'Dave Chappelle', born:1973})\n",
"CREATE (SteveZ:Person {name:'Steve Zahn', born:1967})\n",
"CREATE (TomH:Person {name:'Tom Hanks', born:1956})\n",
"CREATE (NoraE:Person {name:'Nora Ephron', born:1941})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Joe Fox']}]->(YouveGotMail),\n",
" (MegR)-[:ACTED_IN {roles:['Kathleen Kelly']}]->(YouveGotMail),\n",
" (GregK)-[:ACTED_IN {roles:['Frank Navasky']}]->(YouveGotMail),\n",
" (ParkerP)-[:ACTED_IN {roles:['Patricia Eden']}]->(YouveGotMail),\n",
" (DaveC)-[:ACTED_IN {roles:['Kevin Jackson']}]->(YouveGotMail),\n",
" (SteveZ)-[:ACTED_IN {roles:['George Pappas']}]->(YouveGotMail),\n",
" (NoraE)-[:DIRECTED]->(YouveGotMail)\n",
"\n",
"CREATE (SleeplessInSeattle:Movie {title:'Sleepless in Seattle', released:1993, tagline:'What if someone you never met, someone you never saw, someone you never knew was the only someone for you?'})\n",
"CREATE (RitaW:Person {name:'Rita Wilson', born:1956})\n",
"CREATE (BillPull:Person {name:'Bill Pullman', born:1953})\n",
"CREATE (VictorG:Person {name:'Victor Garber', born:1949})\n",
"CREATE (RosieO:Person {name:\"Rosie O'Donnell\", born:1962})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Sam Baldwin']}]->(SleeplessInSeattle),\n",
" (MegR)-[:ACTED_IN {roles:['Annie Reed']}]->(SleeplessInSeattle),\n",
" (RitaW)-[:ACTED_IN {roles:['Suzy']}]->(SleeplessInSeattle),\n",
" (BillPull)-[:ACTED_IN {roles:['Walter']}]->(SleeplessInSeattle),\n",
" (VictorG)-[:ACTED_IN {roles:['Greg']}]->(SleeplessInSeattle),\n",
" (RosieO)-[:ACTED_IN {roles:['Becky']}]->(SleeplessInSeattle),\n",
" (NoraE)-[:DIRECTED]->(SleeplessInSeattle)\n",
"\n",
"CREATE (JoeVersustheVolcano:Movie {title:'Joe Versus the Volcano', released:1990, tagline:'A story of love, lava and burning desire.'})\n",
"CREATE (JohnS:Person {name:'John Patrick Stanley', born:1950})\n",
"CREATE (Nathan:Person {name:'Nathan Lane', born:1956})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Joe Banks']}]->(JoeVersustheVolcano),\n",
" (MegR)-[:ACTED_IN {roles:['DeDe', 'Angelica Graynamore', 'Patricia Graynamore']}]->(JoeVersustheVolcano),\n",
" (Nathan)-[:ACTED_IN {roles:['Baw']}]->(JoeVersustheVolcano),\n",
" (JohnS)-[:DIRECTED]->(JoeVersustheVolcano)\n",
"\n",
"CREATE (WhenHarryMetSally:Movie {title:'When Harry Met Sally', released:1998, tagline:'At odds in life... in love on-line.'})\n",
"CREATE (BillyC:Person {name:'Billy Crystal', born:1948})\n",
"CREATE (CarrieF:Person {name:'Carrie Fisher', born:1956})\n",
"CREATE (BrunoK:Person {name:'Bruno Kirby', born:1949})\n",
"CREATE\n",
" (BillyC)-[:ACTED_IN {roles:['Harry Burns']}]->(WhenHarryMetSally),\n",
" (MegR)-[:ACTED_IN {roles:['Sally Albright']}]->(WhenHarryMetSally),\n",
" (CarrieF)-[:ACTED_IN {roles:['Marie']}]->(WhenHarryMetSally),\n",
" (BrunoK)-[:ACTED_IN {roles:['Jess']}]->(WhenHarryMetSally),\n",
" (RobR)-[:DIRECTED]->(WhenHarryMetSally),\n",
" (RobR)-[:PRODUCED]->(WhenHarryMetSally),\n",
" (NoraE)-[:PRODUCED]->(WhenHarryMetSally),\n",
" (NoraE)-[:WROTE]->(WhenHarryMetSally)\n",
"\n",
"CREATE (ThatThingYouDo:Movie {title:'That Thing You Do', released:1996, tagline:'In every life there comes a time when that thing you dream becomes that thing you do'})\n",
"CREATE (LivT:Person {name:'Liv Tyler', born:1977})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Mr. White']}]->(ThatThingYouDo),\n",
" (LivT)-[:ACTED_IN {roles:['Faye Dolan']}]->(ThatThingYouDo),\n",
" (Charlize)-[:ACTED_IN {roles:['Tina']}]->(ThatThingYouDo),\n",
" (TomH)-[:DIRECTED]->(ThatThingYouDo)\n",
"\n",
"CREATE (TheReplacements:Movie {title:'The Replacements', released:2000, tagline:'Pain heals, Chicks dig scars... Glory lasts forever'})\n",
"CREATE (Brooke:Person {name:'Brooke Langton', born:1970})\n",
"CREATE (Gene:Person {name:'Gene Hackman', born:1930})\n",
"CREATE (Orlando:Person {name:'Orlando Jones', born:1968})\n",
"CREATE (Howard:Person {name:'Howard Deutch', born:1950})\n",
"CREATE\n",
" (Keanu)-[:ACTED_IN {roles:['Shane Falco']}]->(TheReplacements),\n",
" (Brooke)-[:ACTED_IN {roles:['Annabelle Farrell']}]->(TheReplacements),\n",
" (Gene)-[:ACTED_IN {roles:['Jimmy McGinty']}]->(TheReplacements),\n",
" (Orlando)-[:ACTED_IN {roles:['Clifford Franklin']}]->(TheReplacements),\n",
" (Howard)-[:DIRECTED]->(TheReplacements)\n",
"\n",
"CREATE (RescueDawn:Movie {title:'RescueDawn', released:2006, tagline:\"Based on the extraordinary true story of one man's fight for freedom\"})\n",
"CREATE (ChristianB:Person {name:'Christian Bale', born:1974})\n",
"CREATE (ZachG:Person {name:'Zach Grenier', born:1954})\n",
"CREATE\n",
" (MarshallB)-[:ACTED_IN {roles:['Admiral']}]->(RescueDawn),\n",
" (ChristianB)-[:ACTED_IN {roles:['Dieter Dengler']}]->(RescueDawn),\n",
" (ZachG)-[:ACTED_IN {roles:['Squad Leader']}]->(RescueDawn),\n",
" (SteveZ)-[:ACTED_IN {roles:['Duane']}]->(RescueDawn),\n",
" (WernerH)-[:DIRECTED]->(RescueDawn)\n",
"\n",
"CREATE (TheBirdcage:Movie {title:'The Birdcage', released:1996, tagline:'Come as you are'})\n",
"CREATE (MikeN:Person {name:'Mike Nichols', born:1931})\n",
"CREATE\n",
" (Robin)-[:ACTED_IN {roles:['Armand Goldman']}]->(TheBirdcage),\n",
" (Nathan)-[:ACTED_IN {roles:['Albert Goldman']}]->(TheBirdcage),\n",
" (Gene)-[:ACTED_IN {roles:['Sen. Kevin Keeley']}]->(TheBirdcage),\n",
" (MikeN)-[:DIRECTED]->(TheBirdcage)\n",
"\n",
"CREATE (Unforgiven:Movie {title:'Unforgiven', released:1992, tagline:\"It's a hell of a thing, killing a man\"})\n",
"CREATE (RichardH:Person {name:'Richard Harris', born:1930})\n",
"CREATE (ClintE:Person {name:'Clint Eastwood', born:1930})\n",
"CREATE\n",
" (RichardH)-[:ACTED_IN {roles:['English Bob']}]->(Unforgiven),\n",
" (ClintE)-[:ACTED_IN {roles:['Bill Munny']}]->(Unforgiven),\n",
" (Gene)-[:ACTED_IN {roles:['Little Bill Daggett']}]->(Unforgiven),\n",
" (ClintE)-[:DIRECTED]->(Unforgiven)\n",
"\n",
"CREATE (JohnnyMnemonic:Movie {title:'Johnny Mnemonic', released:1995, tagline:'The hottest data on earth. In the coolest head in town'})\n",
"CREATE (Takeshi:Person {name:'Takeshi Kitano', born:1947})\n",
"CREATE (Dina:Person {name:'Dina Meyer', born:1968})\n",
"CREATE (IceT:Person {name:'Ice-T', born:1958})\n",
"CREATE (RobertL:Person {name:'Robert Longo', born:1953})\n",
"CREATE\n",
" (Keanu)-[:ACTED_IN {roles:['Johnny Mnemonic']}]->(JohnnyMnemonic),\n",
" (Takeshi)-[:ACTED_IN {roles:['Takahashi']}]->(JohnnyMnemonic),\n",
" (Dina)-[:ACTED_IN {roles:['Jane']}]->(JohnnyMnemonic),\n",
" (IceT)-[:ACTED_IN {roles:['J-Bone']}]->(JohnnyMnemonic),\n",
" (RobertL)-[:DIRECTED]->(JohnnyMnemonic)\n",
"\n",
"CREATE (CloudAtlas:Movie {title:'Cloud Atlas', released:2012, tagline:'Everything is connected'})\n",
"CREATE (HalleB:Person {name:'Halle Berry', born:1966})\n",
"CREATE (JimB:Person {name:'Jim Broadbent', born:1949})\n",
"CREATE (TomT:Person {name:'Tom Tykwer', born:1965})\n",
"CREATE (DavidMitchell:Person {name:'David Mitchell', born:1969})\n",
"CREATE (StefanArndt:Person {name:'Stefan Arndt', born:1961})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Zachry', 'Dr. Henry Goose', 'Isaac Sachs', 'Dermot Hoggins']}]->(CloudAtlas),\n",
" (Hugo)-[:ACTED_IN {roles:['Bill Smoke', 'Haskell Moore', 'Tadeusz Kesselring', 'Nurse Noakes', 'Boardman Mephi', 'Old Georgie']}]->(CloudAtlas),\n",
" (HalleB)-[:ACTED_IN {roles:['Luisa Rey', 'Jocasta Ayrs', 'Ovid', 'Meronym']}]->(CloudAtlas),\n",
" (JimB)-[:ACTED_IN {roles:['Vyvyan Ayrs', 'Captain Molyneux', 'Timothy Cavendish']}]->(CloudAtlas),\n",
" (TomT)-[:DIRECTED]->(CloudAtlas),\n",
" (LillyW)-[:DIRECTED]->(CloudAtlas),\n",
" (LanaW)-[:DIRECTED]->(CloudAtlas),\n",
" (DavidMitchell)-[:WROTE]->(CloudAtlas),\n",
" (StefanArndt)-[:PRODUCED]->(CloudAtlas)\n",
"\n",
"CREATE (TheDaVinciCode:Movie {title:'The Da Vinci Code', released:2006, tagline:'Break The Codes'})\n",
"CREATE (IanM:Person {name:'Ian McKellen', born:1939})\n",
"CREATE (AudreyT:Person {name:'Audrey Tautou', born:1976})\n",
"CREATE (PaulB:Person {name:'Paul Bettany', born:1971})\n",
"CREATE (RonH:Person {name:'Ron Howard', born:1954})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Dr. Robert Langdon']}]->(TheDaVinciCode),\n",
" (IanM)-[:ACTED_IN {roles:['Sir Leight Teabing']}]->(TheDaVinciCode),\n",
" (AudreyT)-[:ACTED_IN {roles:['Sophie Neveu']}]->(TheDaVinciCode),\n",
" (PaulB)-[:ACTED_IN {roles:['Silas']}]->(TheDaVinciCode),\n",
" (RonH)-[:DIRECTED]->(TheDaVinciCode)\n",
"\n",
"CREATE (VforVendetta:Movie {title:'V for Vendetta', released:2006, tagline:'Freedom! Forever!'})\n",
"CREATE (NatalieP:Person {name:'Natalie Portman', born:1981})\n",
"CREATE (StephenR:Person {name:'Stephen Rea', born:1946})\n",
"CREATE (JohnH:Person {name:'John Hurt', born:1940})\n",
"CREATE (BenM:Person {name: 'Ben Miles', born:1967})\n",
"CREATE\n",
" (Hugo)-[:ACTED_IN {roles:['V']}]->(VforVendetta),\n",
" (NatalieP)-[:ACTED_IN {roles:['Evey Hammond']}]->(VforVendetta),\n",
" (StephenR)-[:ACTED_IN {roles:['Eric Finch']}]->(VforVendetta),\n",
" (JohnH)-[:ACTED_IN {roles:['High Chancellor Adam Sutler']}]->(VforVendetta),\n",
" (BenM)-[:ACTED_IN {roles:['Dascomb']}]->(VforVendetta),\n",
" (JamesM)-[:DIRECTED]->(VforVendetta),\n",
" (LillyW)-[:PRODUCED]->(VforVendetta),\n",
" (LanaW)-[:PRODUCED]->(VforVendetta),\n",
" (JoelS)-[:PRODUCED]->(VforVendetta),\n",
" (LillyW)-[:WROTE]->(VforVendetta),\n",
" (LanaW)-[:WROTE]->(VforVendetta)\n",
"\n",
"CREATE (SpeedRacer:Movie {title:'Speed Racer', released:2008, tagline:'Speed has no limits'})\n",
"CREATE (EmileH:Person {name:'Emile Hirsch', born:1985})\n",
"CREATE (JohnG:Person {name:'John Goodman', born:1960})\n",
"CREATE (SusanS:Person {name:'Susan Sarandon', born:1946})\n",
"CREATE (MatthewF:Person {name:'Matthew Fox', born:1966})\n",
"CREATE (ChristinaR:Person {name:'Christina Ricci', born:1980})\n",
"CREATE (Rain:Person {name:'Rain', born:1982})\n",
"CREATE\n",
" (EmileH)-[:ACTED_IN {roles:['Speed Racer']}]->(SpeedRacer),\n",
" (JohnG)-[:ACTED_IN {roles:['Pops']}]->(SpeedRacer),\n",
" (SusanS)-[:ACTED_IN {roles:['Mom']}]->(SpeedRacer),\n",
" (MatthewF)-[:ACTED_IN {roles:['Racer X']}]->(SpeedRacer),\n",
" (ChristinaR)-[:ACTED_IN {roles:['Trixie']}]->(SpeedRacer),\n",
" (Rain)-[:ACTED_IN {roles:['Taejo Togokahn']}]->(SpeedRacer),\n",
" (BenM)-[:ACTED_IN {roles:['Cass Jones']}]->(SpeedRacer),\n",
" (LillyW)-[:DIRECTED]->(SpeedRacer),\n",
" (LanaW)-[:DIRECTED]->(SpeedRacer),\n",
" (LillyW)-[:WROTE]->(SpeedRacer),\n",
" (LanaW)-[:WROTE]->(SpeedRacer),\n",
" (JoelS)-[:PRODUCED]->(SpeedRacer)\n",
"\n",
"CREATE (NinjaAssassin:Movie {title:'Ninja Assassin', released:2009, tagline:'Prepare to enter a secret world of assassins'})\n",
"CREATE (NaomieH:Person {name:'Naomie Harris'})\n",
"CREATE\n",
" (Rain)-[:ACTED_IN {roles:['Raizo']}]->(NinjaAssassin),\n",
" (NaomieH)-[:ACTED_IN {roles:['Mika Coretti']}]->(NinjaAssassin),\n",
" (RickY)-[:ACTED_IN {roles:['Takeshi']}]->(NinjaAssassin),\n",
" (BenM)-[:ACTED_IN {roles:['Ryan Maslow']}]->(NinjaAssassin),\n",
" (JamesM)-[:DIRECTED]->(NinjaAssassin),\n",
" (LillyW)-[:PRODUCED]->(NinjaAssassin),\n",
" (LanaW)-[:PRODUCED]->(NinjaAssassin),\n",
" (JoelS)-[:PRODUCED]->(NinjaAssassin)\n",
"\n",
"CREATE (TheGreenMile:Movie {title:'The Green Mile', released:1999, tagline:\"Walk a mile you'll never forget.\"})\n",
"CREATE (MichaelD:Person {name:'Michael Clarke Duncan', born:1957})\n",
"CREATE (DavidM:Person {name:'David Morse', born:1953})\n",
"CREATE (SamR:Person {name:'Sam Rockwell', born:1968})\n",
"CREATE (GaryS:Person {name:'Gary Sinise', born:1955})\n",
"CREATE (PatriciaC:Person {name:'Patricia Clarkson', born:1959})\n",
"CREATE (FrankD:Person {name:'Frank Darabont', born:1959})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Paul Edgecomb']}]->(TheGreenMile),\n",
" (MichaelD)-[:ACTED_IN {roles:['John Coffey']}]->(TheGreenMile),\n",
" (DavidM)-[:ACTED_IN {roles:['Brutus \"Brutal\" Howell']}]->(TheGreenMile),\n",
" (BonnieH)-[:ACTED_IN {roles:['Jan Edgecomb']}]->(TheGreenMile),\n",
" (JamesC)-[:ACTED_IN {roles:['Warden Hal Moores']}]->(TheGreenMile),\n",
" (SamR)-[:ACTED_IN {roles:['\"Wild Bill\" Wharton']}]->(TheGreenMile),\n",
" (GaryS)-[:ACTED_IN {roles:['Burt Hammersmith']}]->(TheGreenMile),\n",
" (PatriciaC)-[:ACTED_IN {roles:['Melinda Moores']}]->(TheGreenMile),\n",
" (FrankD)-[:DIRECTED]->(TheGreenMile)\n",
"\n",
"CREATE (FrostNixon:Movie {title:'Frost/Nixon', released:2008, tagline:'400 million people were waiting for the truth.'})\n",
"CREATE (FrankL:Person {name:'Frank Langella', born:1938})\n",
"CREATE (MichaelS:Person {name:'Michael Sheen', born:1969})\n",
"CREATE (OliverP:Person {name:'Oliver Platt', born:1960})\n",
"CREATE\n",
" (FrankL)-[:ACTED_IN {roles:['Richard Nixon']}]->(FrostNixon),\n",
" (MichaelS)-[:ACTED_IN {roles:['David Frost']}]->(FrostNixon),\n",
" (KevinB)-[:ACTED_IN {roles:['Jack Brennan']}]->(FrostNixon),\n",
" (OliverP)-[:ACTED_IN {roles:['Bob Zelnick']}]->(FrostNixon),\n",
" (SamR)-[:ACTED_IN {roles:['James Reston, Jr.']}]->(FrostNixon),\n",
" (RonH)-[:DIRECTED]->(FrostNixon)\n",
"\n",
"CREATE (Hoffa:Movie {title:'Hoffa', released:1992, tagline:\"He didn't want law. He wanted justice.\"})\n",
"CREATE (DannyD:Person {name:'Danny DeVito', born:1944})\n",
"CREATE (JohnR:Person {name:'John C. Reilly', born:1965})\n",
"CREATE\n",
" (JackN)-[:ACTED_IN {roles:['Hoffa']}]->(Hoffa),\n",
" (DannyD)-[:ACTED_IN {roles:['Robert \"Bobby\" Ciaro']}]->(Hoffa),\n",
" (JTW)-[:ACTED_IN {roles:['Frank Fitzsimmons']}]->(Hoffa),\n",
" (JohnR)-[:ACTED_IN {roles:['Peter \"Pete\" Connelly']}]->(Hoffa),\n",
" (DannyD)-[:DIRECTED]->(Hoffa)\n",
"\n",
"CREATE (Apollo13:Movie {title:'Apollo 13', released:1995, tagline:'Houston, we have a problem.'})\n",
"CREATE (EdH:Person {name:'Ed Harris', born:1950})\n",
"CREATE (BillPax:Person {name:'Bill Paxton', born:1955})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Jim Lovell']}]->(Apollo13),\n",
" (KevinB)-[:ACTED_IN {roles:['Jack Swigert']}]->(Apollo13),\n",
" (EdH)-[:ACTED_IN {roles:['Gene Kranz']}]->(Apollo13),\n",
" (BillPax)-[:ACTED_IN {roles:['Fred Haise']}]->(Apollo13),\n",
" (GaryS)-[:ACTED_IN {roles:['Ken Mattingly']}]->(Apollo13),\n",
" (RonH)-[:DIRECTED]->(Apollo13)\n",
"\n",
"CREATE (Twister:Movie {title:'Twister', released:1996, tagline:\"Don't Breathe. Don't Look Back.\"})\n",
"CREATE (PhilipH:Person {name:'Philip Seymour Hoffman', born:1967})\n",
"CREATE (JanB:Person {name:'Jan de Bont', born:1943})\n",
"CREATE\n",
" (BillPax)-[:ACTED_IN {roles:['Bill Harding']}]->(Twister),\n",
" (HelenH)-[:ACTED_IN {roles:['Dr. Jo Harding']}]->(Twister),\n",
" (ZachG)-[:ACTED_IN {roles:['Eddie']}]->(Twister),\n",
" (PhilipH)-[:ACTED_IN {roles:['Dustin \"Dusty\" Davis']}]->(Twister),\n",
" (JanB)-[:DIRECTED]->(Twister)\n",
"\n",
"CREATE (CastAway:Movie {title:'Cast Away', released:2000, tagline:'At the edge of the world, his journey begins.'})\n",
"CREATE (RobertZ:Person {name:'Robert Zemeckis', born:1951})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Chuck Noland']}]->(CastAway),\n",
" (HelenH)-[:ACTED_IN {roles:['Kelly Frears']}]->(CastAway),\n",
" (RobertZ)-[:DIRECTED]->(CastAway)\n",
"\n",
"CREATE (OneFlewOvertheCuckoosNest:Movie {title:\"One Flew Over the Cuckoo's Nest\", released:1975, tagline:\"If he's crazy, what does that make you?\"})\n",
"CREATE (MilosF:Person {name:'Milos Forman', born:1932})\n",
"CREATE\n",
" (JackN)-[:ACTED_IN {roles:['Randle McMurphy']}]->(OneFlewOvertheCuckoosNest),\n",
" (DannyD)-[:ACTED_IN {roles:['Martini']}]->(OneFlewOvertheCuckoosNest),\n",
" (MilosF)-[:DIRECTED]->(OneFlewOvertheCuckoosNest)\n",
"\n",
"CREATE (SomethingsGottaGive:Movie {title:\"Something's Gotta Give\", released:2003})\n",
"CREATE (DianeK:Person {name:'Diane Keaton', born:1946})\n",
"CREATE (NancyM:Person {name:'Nancy Meyers', born:1949})\n",
"CREATE\n",
" (JackN)-[:ACTED_IN {roles:['Harry Sanborn']}]->(SomethingsGottaGive),\n",
" (DianeK)-[:ACTED_IN {roles:['Erica Barry']}]->(SomethingsGottaGive),\n",
" (Keanu)-[:ACTED_IN {roles:['Julian Mercer']}]->(SomethingsGottaGive),\n",
" (NancyM)-[:DIRECTED]->(SomethingsGottaGive),\n",
" (NancyM)-[:PRODUCED]->(SomethingsGottaGive),\n",
" (NancyM)-[:WROTE]->(SomethingsGottaGive)\n",
"\n",
"CREATE (BicentennialMan:Movie {title:'Bicentennial Man', released:1999, tagline:\"One robot's 200 year journey to become an ordinary man.\"})\n",
"CREATE (ChrisC:Person {name:'Chris Columbus', born:1958})\n",
"CREATE\n",
" (Robin)-[:ACTED_IN {roles:['Andrew Marin']}]->(BicentennialMan),\n",
" (OliverP)-[:ACTED_IN {roles:['Rupert Burns']}]->(BicentennialMan),\n",
" (ChrisC)-[:DIRECTED]->(BicentennialMan)\n",
"\n",
"CREATE (CharlieWilsonsWar:Movie {title:\"Charlie Wilson's War\", released:2007, tagline:\"A stiff drink. A little mascara. A lot of nerve. Who said they couldn't bring down the Soviet empire.\"})\n",
"CREATE (JuliaR:Person {name:'Julia Roberts', born:1967})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Rep. Charlie Wilson']}]->(CharlieWilsonsWar),\n",
" (JuliaR)-[:ACTED_IN {roles:['Joanne Herring']}]->(CharlieWilsonsWar),\n",
" (PhilipH)-[:ACTED_IN {roles:['Gust Avrakotos']}]->(CharlieWilsonsWar),\n",
" (MikeN)-[:DIRECTED]->(CharlieWilsonsWar)\n",
"\n",
"CREATE (ThePolarExpress:Movie {title:'The Polar Express', released:2004, tagline:'This Holiday Season… Believe'})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Hero Boy', 'Father', 'Conductor', 'Hobo', 'Scrooge', 'Santa Claus']}]->(ThePolarExpress),\n",
" (RobertZ)-[:DIRECTED]->(ThePolarExpress)\n",
"\n",
"CREATE (ALeagueofTheirOwn:Movie {title:'A League of Their Own', released:1992, tagline:'Once in a lifetime you get a chance to do something different.'})\n",
"CREATE (Madonna:Person {name:'Madonna', born:1954})\n",
"CREATE (GeenaD:Person {name:'Geena Davis', born:1956})\n",
"CREATE (LoriP:Person {name:'Lori Petty', born:1963})\n",
"CREATE (PennyM:Person {name:'Penny Marshall', born:1943})\n",
"CREATE\n",
" (TomH)-[:ACTED_IN {roles:['Jimmy Dugan']}]->(ALeagueofTheirOwn),\n",
" (GeenaD)-[:ACTED_IN {roles:['Dottie Hinson']}]->(ALeagueofTheirOwn),\n",
" (LoriP)-[:ACTED_IN {roles:['Kit Keller']}]->(ALeagueofTheirOwn),\n",
" (RosieO)-[:ACTED_IN {roles:['Doris Murphy']}]->(ALeagueofTheirOwn),\n",
" (Madonna)-[:ACTED_IN {roles:['\"All the Way\" Mae Mordabito']}]->(ALeagueofTheirOwn),\n",
" (BillPax)-[:ACTED_IN {roles:['Bob Hinson']}]->(ALeagueofTheirOwn),\n",
" (PennyM)-[:DIRECTED]->(ALeagueofTheirOwn)\n",
"\n",
"CREATE (PaulBlythe:Person {name:'Paul Blythe'})\n",
"CREATE (AngelaScope:Person {name:'Angela Scope'})\n",
"CREATE (JessicaThompson:Person {name:'Jessica Thompson'})\n",
"CREATE (JamesThompson:Person {name:'James Thompson'})\n",
"\n",
"CREATE\n",
" (JamesThompson)-[:FOLLOWS]->(JessicaThompson),\n",
" (AngelaScope)-[:FOLLOWS]->(JessicaThompson),\n",
" (PaulBlythe)-[:FOLLOWS]->(AngelaScope)\n",
"\n",
"CREATE\n",
" (JessicaThompson)-[:REVIEWED {summary:'An amazing journey', rating:95}]->(CloudAtlas),\n",
" (JessicaThompson)-[:REVIEWED {summary:'Silly, but fun', rating:65}]->(TheReplacements),\n",
" (JamesThompson)-[:REVIEWED {summary:'The coolest football movie ever', rating:100}]->(TheReplacements),\n",
" (AngelaScope)-[:REVIEWED {summary:'Pretty funny at times', rating:62}]->(TheReplacements),\n",
" (JessicaThompson)-[:REVIEWED {summary:'Dark, but compelling', rating:85}]->(Unforgiven),\n",
" (JessicaThompson)-[:REVIEWED {summary:\"Slapstick redeemed only by the Robin Williams and Gene Hackman's stellar performances\", rating:45}]->(TheBirdcage),\n",
" (JessicaThompson)-[:REVIEWED {summary:'A solid romp', rating:68}]->(TheDaVinciCode),\n",
" (JamesThompson)-[:REVIEWED {summary:'Fun, but a little far fetched', rating:65}]->(TheDaVinciCode),\n",
" (JessicaThompson)-[:REVIEWED {summary:'You had me at Jerry', rating:92}]->(JerryMaguire);\"\"\"\n",
"\n",
"graph.run(create)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"match = \"\"\"WITH TomH as a MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d) RETURN a,m,d LIMIT 10\"\"\"\n",
"\n",
"here = graph.match(match)\n",
"\n",
"# Not sure how to get this limited Tom Hanks set to plot inline..."
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"frozenset({'Movie', 'Person'})"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"graph.node_labels"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"frozenset({'ACTED_IN', 'DIRECTED', 'FOLLOWS', 'PRODUCED', 'REVIEWED', 'WROTE'})"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"graph.relationship_types"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"$(\"head\").append($(\"<link/>\").attr({\n",
" rel: \"stylesheet\",\n",
" type: \"text/css\",\n",
" href: \"https://cdnjs.cloudflare.com/ajax/libs/vis/4.8.2/vis.css\"\n",
"}));\n",
"require.config({ paths: { vis: '//cdnjs.cloudflare.com/ajax/libs/vis/4.8.2/vis.min' } }); require(['vis'], function(vis) { window.vis = vis; }); "
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div id=\"95996db3-c60c-4353-90c0-ef9a5d2a7bb7\" style=\"height: 400px;\"></div>\n",
"\n",
"<script type=\"text/javascript\">\n",
"\n",
" var nodes = [{\"group\": \"Person\", \"title\": \"{'born': 1967, 'name': 'James Marshall'}\", \"id\": 51, \"label\": \"James Marshall\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'V for Vendetta', 'tagline': 'Freedom! Forever!', 'released': 2006}\", \"id\": 142, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'A Few Good Men', 'tagline': \\\"In the heart of the nation's capital, in a courthouse of the U.S. government, one man will stop at nothing to keep his honor, and one will stop at nothing to find the truth.\\\", 'released': 1992}\", \"id\": 41, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Ninja Assassin', 'tagline': 'Prepare to enter a secret world of assassins', 'released': 2009}\", \"id\": 154, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1949, 'name': 'Bruno Kirby'}\", \"id\": 110, \"label\": \"Bruno Kirby\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'When Harry Met Sally', 'tagline': 'At odds in life... in love on-line.', 'released': 1998}\", \"id\": 107, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'name': 'Jessica Thompson'}\", \"id\": 4, \"label\": \"Jessica Thompson\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'The Birdcage', 'tagline': 'Come as you are', 'released': 1996}\", \"id\": 121, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Unforgiven', 'tagline': \\\"It's a hell of a thing, killing a man\\\", 'released': 1992}\", \"id\": 123, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Jerry Maguire', 'tagline': 'The rest of his life begins now.', 'released': 2000}\", \"id\": 63, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'The Da Vinci Code', 'tagline': 'Break The Codes', 'released': 2006}\", \"id\": 137, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'The Replacements', 'tagline': 'Pain heals, Chicks dig scars... Glory lasts forever', 'released': 2000}\", \"id\": 113, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Cloud Atlas', 'tagline': 'Everything is connected', 'released': 2012}\", \"id\": 131, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1940, 'name': 'Al Pacino'}\", \"id\": 39, \"label\": \"Al Pacino\"}, {\"group\": \"Movie\", \"title\": \"{'title': \\\"The Devil's Advocate\\\", 'tagline': 'Evil has its winning ways', 'released': 1997}\", \"id\": 37, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1969, 'name': 'Michael Sheen'}\", \"id\": 165, \"label\": \"Michael Sheen\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Frost/Nixon', 'tagline': '400 million people were waiting for the truth.', 'released': 2008}\", \"id\": 163, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'What Dreams May Come', 'tagline': 'After life there is more. The end is just the beginning.', 'released': 1998}\", \"id\": 82, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1944, 'name': 'Taylor Hackford'}\", \"id\": 40, \"label\": \"Taylor Hackford\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Johnny Mnemonic', 'tagline': 'The hottest data on earth. In the coolest head in town', 'released': 1995}\", \"id\": 126, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': \\\"One Flew Over the Cuckoo's Nest\\\", 'tagline': \\\"If he's crazy, what does that make you?\\\", 'released': 1975}\", \"id\": 178, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1961, 'name': 'Meg Ryan'}\", \"id\": 60, \"label\": \"Meg Ryan\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Sleepless in Seattle', 'tagline': 'What if someone you never met, someone you never saw, someone you never knew was the only someone for you?', 'released': 1993}\", \"id\": 99, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Joe Versus the Volcano', 'tagline': 'A story of love, lava and burning desire.', 'released': 1990}\", \"id\": 104, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': \\\"You've Got Mail\\\", 'tagline': 'At odds in life... in love on-line.', 'released': 1998}\", \"id\": 93, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Top Gun', 'tagline': 'I feel the need, the need for speed.', 'released': 1986}\", \"id\": 55, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1974, 'name': \\\"Jerry O'Connell\\\"}\", \"id\": 66, \"label\": \"Jerry O'Connell\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Stand By Me', 'tagline': \\\"For some, it's the last real taste of innocence, and the first real taste of life. But for everyone, it's the time that memories are made of.\\\", 'released': 1986}\", \"id\": 72, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1941, 'name': 'Jim Cash'}\", \"id\": 62, \"label\": \"Jim Cash\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'The Green Mile', 'tagline': \\\"Walk a mile you'll never forget.\\\", 'released': 1999}\", \"id\": 156, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1931, 'name': 'Mike Nichols'}\", \"id\": 122, \"label\": \"Mike Nichols\"}, {\"group\": \"Movie\", \"title\": \"{'title': \\\"Charlie Wilson's War\\\", 'tagline': \\\"A stiff drink. A little mascara. A lot of nerve. Who said they couldn't bring down the Soviet empire.\\\", 'released': 2007}\", \"id\": 185, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1946, 'name': 'Stephen Rea'}\", \"id\": 144, \"label\": \"Stephen Rea\"}, {\"group\": \"Person\", \"title\": \"{'born': 1962, 'name': 'Kelly Preston'}\", \"id\": 65, \"label\": \"Kelly Preston\"}, {\"group\": \"Person\", \"title\": \"{'born': 1996, 'name': 'Jonathan Lipnicki'}\", \"id\": 70, \"label\": \"Jonathan Lipnicki\"}, {\"group\": \"Person\", \"title\": \"{'born': 1971, 'name': 'Regina King'}\", \"id\": 69, \"label\": \"Regina King\"}, {\"group\": \"Person\", \"title\": \"{'born': 1954, 'name': 'Zach Grenier'}\", \"id\": 120, \"label\": \"Zach Grenier\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Twister', 'tagline': \\\"Don't Breathe. Don't Look Back.\\\", 'released': 1996}\", \"id\": 173, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'RescueDawn', 'tagline': \\\"Based on the extraordinary true story of one man's fight for freedom\\\", 'released': 2006}\", \"id\": 118, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1954, 'name': 'Ron Howard'}\", \"id\": 141, \"label\": \"Ron Howard\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Apollo 13', 'tagline': 'Houston, we have a problem.', 'released': 1995}\", \"id\": 170, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1952, 'name': 'Joel Silver'}\", \"id\": 33, \"label\": \"Joel Silver\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Speed Racer', 'tagline': 'Speed has no limits', 'released': 2008}\", \"id\": 147, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'The Matrix Revolutions', 'tagline': 'Everything that has a beginning has an end', 'released': 2003}\", \"id\": 36, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'The Matrix Reloaded', 'tagline': 'Free your mind', 'released': 2003}\", \"id\": 35, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'The Matrix', 'tagline': 'Welcome to the Real World', 'released': 1999}\", \"id\": 26, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1949, 'name': 'Jim Broadbent'}\", \"id\": 133, \"label\": \"Jim Broadbent\"}, {\"group\": \"Person\", \"title\": \"{'born': 1940, 'name': 'John Hurt'}\", \"id\": 145, \"label\": \"John Hurt\"}, {\"group\": \"Person\", \"title\": \"{'born': 1946, 'name': 'Diane Keaton'}\", \"id\": 181, \"label\": \"Diane Keaton\"}, {\"group\": \"Movie\", \"title\": \"{'title': \\\"Something's Gotta Give\\\", 'released': 2003}\", \"id\": 180, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1968, 'name': 'Dina Meyer'}\", \"id\": 128, \"label\": \"Dina Meyer\"}, {\"group\": \"Person\", \"title\": \"{'born': 1978, 'name': 'Emil Eifrem'}\", \"id\": 34, \"label\": \"Emil Eifrem\"}, {\"group\": \"Person\", \"title\": \"{'born': 1965, 'name': 'Tom Tykwer'}\", \"id\": 134, \"label\": \"Tom Tykwer\"}, {\"group\": \"Person\", \"title\": \"{'born': 1962, 'name': \\\"Rosie O'Donnell\\\"}\", \"id\": 103, \"label\": \"Rosie O'Donnell\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'A League of Their Own', 'tagline': 'Once in a lifetime you get a chance to do something different.', 'released': 1992}\", \"id\": 188, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1951, 'name': 'Robert Zemeckis'}\", \"id\": 177, \"label\": \"Robert Zemeckis\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Cast Away', 'tagline': 'At the edge of the world, his journey begins.', 'released': 2000}\", \"id\": 176, \"label\": \"\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'The Polar Express', 'tagline': 'This Holiday Season\\u2026 Believe', 'released': 2004}\", \"id\": 187, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1956, 'name': 'Carrie Fisher'}\", \"id\": 109, \"label\": \"Carrie Fisher\"}, {\"group\": \"Person\", \"title\": \"{'born': 1950, 'name': 'John Patrick Stanley'}\", \"id\": 105, \"label\": \"John Patrick Stanley\"}, {\"group\": \"Person\", \"title\": \"{'born': 1970, 'name': 'Ethan Hawke'}\", \"id\": 89, \"label\": \"Ethan Hawke\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Snow Falling on Cedars', 'tagline': 'First loves last. Forever.', 'released': 1999}\", \"id\": 88, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1929, 'name': 'Max von Sydow'}\", \"id\": 84, \"label\": \"Max von Sydow\"}, {\"group\": \"Person\", \"title\": \"{'born': 1955, 'name': 'Bill Paxton'}\", \"id\": 172, \"label\": \"Bill Paxton\"}, {\"group\": \"Person\", \"title\": \"{'born': 1933, 'name': 'Tom Skerritt'}\", \"id\": 59, \"label\": \"Tom Skerritt\"}, {\"group\": \"Person\", \"title\": \"{'born': 1948, 'name': 'Christopher Guest'}\", \"id\": 52, \"label\": \"Christopher Guest\"}, {\"group\": \"Person\", \"title\": \"{'born': 1956, 'name': 'Tom Hanks'}\", \"id\": 97, \"label\": \"Tom Hanks\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'That Thing You Do', 'tagline': 'In every life there comes a time when that thing you dream becomes that thing you do', 'released': 1996}\", \"id\": 111, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1940, 'name': 'James L. Brooks'}\", \"id\": 81, \"label\": \"James L. Brooks\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'As Good as It Gets', 'tagline': 'A comedy from the heart that goes for the throat.', 'released': 1997}\", \"id\": 78, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1970, 'name': 'Brooke Langton'}\", \"id\": 114, \"label\": \"Brooke Langton\"}, {\"group\": \"Person\", \"title\": \"{'born': 1974, 'name': 'Christian Bale'}\", \"id\": 119, \"label\": \"Christian Bale\"}, {\"group\": \"Person\", \"title\": \"{'born': 1964, 'name': 'Keanu Reeves'}\", \"id\": 27, \"label\": \"Keanu Reeves\"}, {\"group\": \"Person\", \"title\": \"{'born': 1961, 'name': 'Laurence Fishburne'}\", \"id\": 29, \"label\": \"Laurence Fishburne\"}, {\"group\": \"Person\", \"title\": \"{'born': 1930, 'name': 'Gene Hackman'}\", \"id\": 115, \"label\": \"Gene Hackman\"}, {\"group\": \"Person\", \"title\": \"{'born': 1963, 'name': 'Lori Petty'}\", \"id\": 0, \"label\": \"Lori Petty\"}, {\"group\": \"Person\", \"title\": \"{'born': 1954, 'name': 'Madonna'}\", \"id\": 189, \"label\": \"Madonna\"}, {\"group\": \"Person\", \"title\": \"{'name': 'Naomie Harris'}\", \"id\": 155, \"label\": \"Naomie Harris\"}, {\"group\": \"Person\", \"title\": \"{'born': 1985, 'name': 'Emile Hirsch'}\", \"id\": 148, \"label\": \"Emile Hirsch\"}, {\"group\": \"Person\", \"title\": \"{'born': 1959, 'name': 'Patricia Clarkson'}\", \"id\": 161, \"label\": \"Patricia Clarkson\"}, {\"group\": \"Person\", \"title\": \"{'name': 'James Thompson'}\", \"id\": 5, \"label\": \"James Thompson\"}, {\"group\": \"Person\", \"title\": \"{'born': 1953, 'name': 'Robert Longo'}\", \"id\": 130, \"label\": \"Robert Longo\"}, {\"group\": \"Person\", \"title\": \"{'born': 1961, 'name': 'Stefan Arndt'}\", \"id\": 136, \"label\": \"Stefan Arndt\"}, {\"group\": \"Person\", \"title\": \"{'born': 1965, 'name': 'Lana Wachowski'}\", \"id\": 32, \"label\": \"Lana Wachowski\"}, {\"group\": \"Person\", \"title\": \"{'born': 1963, 'name': 'Greg Kinnear'}\", \"id\": 80, \"label\": \"Greg Kinnear\"}, {\"group\": \"Person\", \"title\": \"{'born': 1959, 'name': 'Frank Darabont'}\", \"id\": 162, \"label\": \"Frank Darabont\"}, {\"group\": \"Person\", \"title\": \"{'born': 1932, 'name': 'Milos Forman'}\", \"id\": 179, \"label\": \"Milos Forman\"}, {\"group\": \"Person\", \"title\": \"{'born': 1944, 'name': 'Danny DeVito'}\", \"id\": 168, \"label\": \"Danny DeVito\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Hoffa', 'tagline': \\\"He didn't want law. He wanted justice.\\\", 'released': 1992}\", \"id\": 167, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1968, 'name': 'Cuba Gooding Jr.'}\", \"id\": 48, \"label\": \"Cuba Gooding Jr.\"}, {\"group\": \"Person\", \"title\": \"{'born': 1965, 'name': 'John C. Reilly'}\", \"id\": 169, \"label\": \"John C. Reilly\"}, {\"group\": \"Person\", \"title\": \"{'born': 1942, 'name': 'Werner Herzog'}\", \"id\": 85, \"label\": \"Werner Herzog\"}, {\"group\": \"Person\", \"title\": \"{'born': 1968, 'name': 'Sam Rockwell'}\", \"id\": 159, \"label\": \"Sam Rockwell\"}, {\"group\": \"Person\", \"title\": \"{'born': 1943, 'name': 'Jan de Bont'}\", \"id\": 175, \"label\": \"Jan de Bont\"}, {\"group\": \"Movie\", \"title\": \"{'title': 'Bicentennial Man', 'tagline': \\\"One robot's 200 year journey to become an ordinary man.\\\", 'released': 1999}\", \"id\": 183, \"label\": \"\"}, {\"group\": \"Person\", \"title\": \"{'born': 1972, 'name': 'Wil Wheaton'}\", \"id\": 75, \"label\": \"Wil Wheaton\"}, {\"group\": \"Person\", \"title\": \"{'born': 1957, 'name': 'Kelly McGillis'}\", \"id\": 56, \"label\": \"Kelly McGillis\"}, {\"group\": \"Person\", \"title\": \"{'born': 1937, 'name': 'Jack Nicholson'}\", \"id\": 43, \"label\": \"Jack Nicholson\"}, {\"group\": \"Person\", \"title\": \"{'born': 1960, 'name': 'Annabella Sciorra'}\", \"id\": 83, \"label\": \"Annabella Sciorra\"}, {\"group\": \"Person\", \"title\": \"{'born': 1966, 'name': 'Matthew Fox'}\", \"id\": 151, \"label\": \"Matthew Fox\"}, {\"group\": \"Person\", \"title\": \"{'born': 1969, 'name': 'David Mitchell'}\", \"id\": 135, \"label\": \"David Mitchell\"}, {\"group\": \"Person\", \"title\": \"{'born': 1970, 'name': 'River Phoenix'}\", \"id\": 73, \"label\": \"River Phoenix\"}, {\"group\": \"Person\", \"title\": \"{'born': 1956, 'name': 'Vincent Ward'}\", \"id\": 87, \"label\": \"Vincent Ward\"}, {\"group\": \"Person\", \"title\": \"{'born': 1958, 'name': 'Kevin Bacon'}\", \"id\": 45, \"label\": \"Kevin Bacon\"}, {\"group\": \"Person\", \"title\": \"{'born': 1966, 'name': 'John Cusack'}\", \"id\": 76, \"label\": \"John Cusack\"}, {\"group\": \"Person\", \"title\": \"{'born': 1939, 'name': 'Ian McKellen'}\", \"id\": 138, \"label\": \"Ian McKellen\"}, {\"group\": \"Person\", \"title\": \"{'born': 1953, 'name': 'Bill Pullman'}\", \"id\": 101, \"label\": \"Bill Pullman\"}, {\"group\": \"Person\", \"title\": \"{'born': 1949, 'name': 'Victor Garber'}\", \"id\": 102, \"label\": \"Victor Garber\"}, {\"group\": \"Person\", \"title\": \"{'born': 1955, 'name': 'Gary Sinise'}\", \"id\": 160, \"label\": \"Gary Sinise\"}, {\"group\": \"Person\", \"title\": \"{'born': 1956, 'name': 'Rita Wilson'}\", \"id\": 100, \"label\": \"Rita Wilson\"}, {\"group\": \"Person\", \"title\": \"{'born': 1930, 'name': 'Richard Harris'}\", \"id\": 124, \"label\": \"Richard Harris\"}, {\"group\": \"Person\", \"title\": \"{'born': 1962, 'name': 'Tom Cruise'}\", \"id\": 42, \"label\": \"Tom Cruise\"}];\n",
" var edges = [{\"from\": 51, \"label\": \"DIRECTED\", \"to\": 142}, {\"from\": 51, \"label\": \"ACTED_IN\", \"to\": 41}, {\"from\": 51, \"label\": \"DIRECTED\", \"to\": 154}, {\"from\": 110, \"label\": \"ACTED_IN\", \"to\": 107}, {\"from\": 4, \"label\": \"REVIEWED\", \"to\": 121}, {\"from\": 4, \"label\": \"REVIEWED\", \"to\": 123}, {\"from\": 4, \"label\": \"REVIEWED\", \"to\": 63}, {\"from\": 4, \"label\": \"REVIEWED\", \"to\": 137}, {\"from\": 4, \"label\": \"REVIEWED\", \"to\": 113}, {\"from\": 4, \"label\": \"REVIEWED\", \"to\": 131}, {\"from\": 39, \"label\": \"ACTED_IN\", \"to\": 37}, {\"from\": 165, \"label\": \"ACTED_IN\", \"to\": 163}, {\"from\": 40, \"label\": \"DIRECTED\", \"to\": 37}, {\"from\": 60, \"label\": \"ACTED_IN\", \"to\": 99}, {\"from\": 60, \"label\": \"ACTED_IN\", \"to\": 104}, {\"from\": 60, \"label\": \"ACTED_IN\", \"to\": 107}, {\"from\": 60, \"label\": \"ACTED_IN\", \"to\": 93}, {\"from\": 60, \"label\": \"ACTED_IN\", \"to\": 55}, {\"from\": 66, \"label\": \"ACTED_IN\", \"to\": 72}, {\"from\": 66, \"label\": \"ACTED_IN\", \"to\": 63}, {\"from\": 62, \"label\": \"WROTE\", \"to\": 55}, {\"from\": 122, \"label\": \"DIRECTED\", \"to\": 185}, {\"from\": 122, \"label\": \"DIRECTED\", \"to\": 121}, {\"from\": 144, \"label\": \"ACTED_IN\", \"to\": 142}, {\"from\": 65, \"label\": \"ACTED_IN\", \"to\": 63}, {\"from\": 70, \"label\": \"ACTED_IN\", \"to\": 63}, {\"from\": 69, \"label\": \"ACTED_IN\", \"to\": 63}, {\"from\": 120, \"label\": \"ACTED_IN\", \"to\": 173}, {\"from\": 120, \"label\": \"ACTED_IN\", \"to\": 118}, {\"from\": 141, \"label\": \"DIRECTED\", \"to\": 170}, {\"from\": 141, \"label\": \"DIRECTED\", \"to\": 163}, {\"from\": 141, \"label\": \"DIRECTED\", \"to\": 137}, {\"from\": 33, \"label\": \"PRODUCED\", \"to\": 147}, {\"from\": 33, \"label\": \"PRODUCED\", \"to\": 142}, {\"from\": 33, \"label\": \"PRODUCED\", \"to\": 36}, {\"from\": 33, \"label\": \"PRODUCED\", \"to\": 35}, {\"from\": 33, \"label\": \"PRODUCED\", \"to\": 26}, {\"from\": 33, \"label\": \"PRODUCED\", \"to\": 154}, {\"from\": 133, \"label\": \"ACTED_IN\", \"to\": 131}, {\"from\": 145, \"label\": \"ACTED_IN\", \"to\": 142}, {\"from\": 181, \"label\": \"ACTED_IN\", \"to\": 180}, {\"from\": 128, \"label\": \"ACTED_IN\", \"to\": 126}, {\"from\": 34, \"label\": \"ACTED_IN\", \"to\": 26}, {\"from\": 134, \"label\": \"DIRECTED\", \"to\": 131}, {\"from\": 103, \"label\": \"ACTED_IN\", \"to\": 188}, {\"from\": 103, \"label\": \"ACTED_IN\", \"to\": 99}, {\"from\": 177, \"label\": \"DIRECTED\", \"to\": 176}, {\"from\": 177, \"label\": \"DIRECTED\", \"to\": 187}, {\"from\": 109, \"label\": \"ACTED_IN\", \"to\": 107}, {\"from\": 105, \"label\": \"DIRECTED\", \"to\": 104}, {\"from\": 89, \"label\": \"ACTED_IN\", \"to\": 88}, {\"from\": 84, \"label\": \"ACTED_IN\", \"to\": 82}, {\"from\": 84, \"label\": \"ACTED_IN\", \"to\": 88}, {\"from\": 172, \"label\": \"ACTED_IN\", \"to\": 188}, {\"from\": 172, \"label\": \"ACTED_IN\", \"to\": 173}, {\"from\": 172, \"label\": \"ACTED_IN\", \"to\": 170}, {\"from\": 59, \"label\": \"ACTED_IN\", \"to\": 55}, {\"from\": 52, \"label\": \"ACTED_IN\", \"to\": 41}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 176}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 187}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 188}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 185}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 170}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 137}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 131}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 111}, {\"from\": 97, \"label\": \"DIRECTED\", \"to\": 111}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 99}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 104}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 93}, {\"from\": 97, \"label\": \"ACTED_IN\", \"to\": 156}, {\"from\": 81, \"label\": \"DIRECTED\", \"to\": 78}, {\"from\": 114, \"label\": \"ACTED_IN\", \"to\": 113}, {\"from\": 119, \"label\": \"ACTED_IN\", \"to\": 118}, {\"from\": 27, \"label\": \"ACTED_IN\", \"to\": 180}, {\"from\": 27, \"label\": \"ACTED_IN\", \"to\": 126}, {\"from\": 27, \"label\": \"ACTED_IN\", \"to\": 113}, {\"from\": 27, \"label\": \"ACTED_IN\", \"to\": 37}, {\"from\": 27, \"label\": \"ACTED_IN\", \"to\": 36}, {\"from\": 27, \"label\": \"ACTED_IN\", \"to\": 35}, {\"from\": 27, \"label\": \"ACTED_IN\", \"to\": 26}, {\"from\": 29, \"label\": \"ACTED_IN\", \"to\": 36}, {\"from\": 29, \"label\": \"ACTED_IN\", \"to\": 35}, {\"from\": 29, \"label\": \"ACTED_IN\", \"to\": 26}, {\"from\": 115, \"label\": \"ACTED_IN\", \"to\": 121}, {\"from\": 115, \"label\": \"ACTED_IN\", \"to\": 123}, {\"from\": 115, \"label\": \"ACTED_IN\", \"to\": 113}, {\"from\": 0, \"label\": \"ACTED_IN\", \"to\": 188}, {\"from\": 189, \"label\": \"ACTED_IN\", \"to\": 188}, {\"from\": 155, \"label\": \"ACTED_IN\", \"to\": 154}, {\"from\": 148, \"label\": \"ACTED_IN\", \"to\": 147}, {\"from\": 161, \"label\": \"ACTED_IN\", \"to\": 156}, {\"from\": 5, \"label\": \"REVIEWED\", \"to\": 113}, {\"from\": 5, \"label\": \"REVIEWED\", \"to\": 137}, {\"from\": 5, \"label\": \"FOLLOWS\", \"to\": 4}, {\"from\": 130, \"label\": \"DIRECTED\", \"to\": 126}, {\"from\": 136, \"label\": \"PRODUCED\", \"to\": 131}, {\"from\": 32, \"label\": \"PRODUCED\", \"to\": 154}, {\"from\": 32, \"label\": \"WROTE\", \"to\": 147}, {\"from\": 32, \"label\": \"DIRECTED\", \"to\": 147}, {\"from\": 32, \"label\": \"DIRECTED\", \"to\": 131}, {\"from\": 32, \"label\": \"WROTE\", \"to\": 142}, {\"from\": 32, \"label\": \"PRODUCED\", \"to\": 142}, {\"from\": 32, \"label\": \"DIRECTED\", \"to\": 36}, {\"from\": 32, \"label\": \"DIRECTED\", \"to\": 35}, {\"from\": 32, \"label\": \"DIRECTED\", \"to\": 26}, {\"from\": 80, \"label\": \"ACTED_IN\", \"to\": 93}, {\"from\": 80, \"label\": \"ACTED_IN\", \"to\": 78}, {\"from\": 162, \"label\": \"DIRECTED\", \"to\": 156}, {\"from\": 179, \"label\": \"DIRECTED\", \"to\": 178}, {\"from\": 168, \"label\": \"ACTED_IN\", \"to\": 178}, {\"from\": 168, \"label\": \"DIRECTED\", \"to\": 167}, {\"from\": 168, \"label\": \"ACTED_IN\", \"to\": 167}, {\"from\": 48, \"label\": \"ACTED_IN\", \"to\": 82}, {\"from\": 48, \"label\": \"ACTED_IN\", \"to\": 78}, {\"from\": 48, \"label\": \"ACTED_IN\", \"to\": 63}, {\"from\": 48, \"label\": \"ACTED_IN\", \"to\": 41}, {\"from\": 169, \"label\": \"ACTED_IN\", \"to\": 167}, {\"from\": 85, \"label\": \"DIRECTED\", \"to\": 118}, {\"from\": 85, \"label\": \"ACTED_IN\", \"to\": 82}, {\"from\": 159, \"label\": \"ACTED_IN\", \"to\": 156}, {\"from\": 159, \"label\": \"ACTED_IN\", \"to\": 163}, {\"from\": 175, \"label\": \"DIRECTED\", \"to\": 173}, {\"from\": 75, \"label\": \"ACTED_IN\", \"to\": 72}, {\"from\": 56, \"label\": \"ACTED_IN\", \"to\": 55}, {\"from\": 43, \"label\": \"ACTED_IN\", \"to\": 178}, {\"from\": 43, \"label\": \"ACTED_IN\", \"to\": 180}, {\"from\": 43, \"label\": \"ACTED_IN\", \"to\": 167}, {\"from\": 43, \"label\": \"ACTED_IN\", \"to\": 78}, {\"from\": 43, \"label\": \"ACTED_IN\", \"to\": 41}, {\"from\": 83, \"label\": \"ACTED_IN\", \"to\": 82}, {\"from\": 151, \"label\": \"ACTED_IN\", \"to\": 147}, {\"from\": 135, \"label\": \"WROTE\", \"to\": 131}, {\"from\": 73, \"label\": \"ACTED_IN\", \"to\": 72}, {\"from\": 87, \"label\": \"DIRECTED\", \"to\": 82}, {\"from\": 45, \"label\": \"ACTED_IN\", \"to\": 170}, {\"from\": 45, \"label\": \"ACTED_IN\", \"to\": 163}, {\"from\": 45, \"label\": \"ACTED_IN\", \"to\": 41}, {\"from\": 76, \"label\": \"ACTED_IN\", \"to\": 72}, {\"from\": 138, \"label\": \"ACTED_IN\", \"to\": 137}, {\"from\": 101, \"label\": \"ACTED_IN\", \"to\": 99}, {\"from\": 102, \"label\": \"ACTED_IN\", \"to\": 99}, {\"from\": 160, \"label\": \"ACTED_IN\", \"to\": 170}, {\"from\": 160, \"label\": \"ACTED_IN\", \"to\": 156}, {\"from\": 100, \"label\": \"ACTED_IN\", \"to\": 99}, {\"from\": 124, \"label\": \"ACTED_IN\", \"to\": 123}, {\"from\": 42, \"label\": \"ACTED_IN\", \"to\": 63}, {\"from\": 42, \"label\": \"ACTED_IN\", \"to\": 41}, {\"from\": 42, \"label\": \"ACTED_IN\", \"to\": 55}];\n",
"\n",
" var container = document.getElementById(\"95996db3-c60c-4353-90c0-ef9a5d2a7bb7\");\n",
"\n",
" var data = {\n",
" nodes: nodes,\n",
" edges: edges\n",
" };\n",
"\n",
" var options = {\n",
" nodes: {\n",
" shape: 'dot',\n",
" size: 25,\n",
" font: {\n",
" size: 14\n",
" }\n",
" },\n",
" edges: {\n",
" font: {\n",
" size: 14,\n",
" align: 'middle'\n",
" },\n",
" color: 'gray',\n",
" arrows: {\n",
" to: {\n",
" enabled: true,\n",
" scaleFactor: 0.5\n",
" }\n",
" },\n",
" smooth: {\n",
" enabled: false\n",
" }\n",
" },\n",
" physics: {\n",
" enabled: true\n",
" }\n",
" };\n",
"\n",
" var network = new vis.Network(container, data, options);\n",
"\n",
"</script>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"## https://github.com/merqurio/neo4jupyter \n",
"## pip install neo4jupyter \n",
"import neo4jupyter\n",
"neo4jupyter.init_notebook_mode()\n",
"\n",
"options = {'Movie':'name', 'Person':'name'}\n",
"neo4jupyter.draw(graph, options)\n",
"\n",
"# NOTE: Wasn't able to get the subgraph from matched Tom Hanks example to plot the limit 10 which Tom both directed and acted in\n",
"# NOTE: Turning off physics seems to mess up node structure"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment