当前位置:   article > 正文

neo4j入门实例(电影和演员的例子)_neo4j电影演员的例子

neo4j电影演员的例子

neo4j入门实例(电影和演员的例子)

neo4j安装好后,在http://localhost:7474/browser/界面输入:play movie graph 就可以直接能看到电影的知识图谱例子

:play movie graph

到第二页,灰色框就是所有实体和关系的代码,点那个小播放键,所有代码会自动填入输入框。

 

展示出所有创建的代码如下:有400多行

 

  1. CREATE (TheMatrix:Movie {title:'The Matrix', released:1999, tagline:'Welcome to the Real World'})
  2. CREATE (Keanu:Person {name:'Keanu Reeves', born:1964})
  3. CREATE (Carrie:Person {name:'Carrie-Anne Moss', born:1967})
  4. CREATE (Laurence:Person {name:'Laurence Fishburne', born:1961})
  5. CREATE (Hugo:Person {name:'Hugo Weaving', born:1960})
  6. CREATE (LillyW:Person {name:'Lilly Wachowski', born:1967})
  7. CREATE (LanaW:Person {name:'Lana Wachowski', born:1965})
  8. CREATE (JoelS:Person {name:'Joel Silver', born:1952})
  9. CREATE
  10. (Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrix),
  11. (Carrie)-[:ACTED_IN {roles:['Trinity']}]->(TheMatrix),
  12. (Laurence)-[:ACTED_IN {roles:['Morpheus']}]->(TheMatrix),
  13. (Hugo)-[:ACTED_IN {roles:['Agent Smith']}]->(TheMatrix),
  14. (LillyW)-[:DIRECTED]->(TheMatrix),
  15. (LanaW)-[:DIRECTED]->(TheMatrix),
  16. (JoelS)-[:PRODUCED]->(TheMatrix)
  17. CREATE (Emil:Person {name:"Emil Eifrem", born:1978})
  18. CREATE (Emil)-[:ACTED_IN {roles:["Emil"]}]->(TheMatrix)
  19. CREATE (TheMatrixReloaded:Movie {title:'The Matrix Reloaded', released:2003, tagline:'Free your mind'})
  20. CREATE
  21. (Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrixReloaded),
  22. (Carrie)-[:ACTED_IN {roles:['Trinity']}]->(TheMatrixReloaded),
  23. (Laurence)-[:ACTED_IN {roles:['Morpheus']}]->(TheMatrixReloaded),
  24. (Hugo)-[:ACTED_IN {roles:['Agent Smith']}]->(TheMatrixReloaded),
  25. (LillyW)-[:DIRECTED]->(TheMatrixReloaded),
  26. (LanaW)-[:DIRECTED]->(TheMatrixReloaded),
  27. (JoelS)-[:PRODUCED]->(TheMatrixReloaded)
  28. CREATE (TheMatrixRevolutions:Movie {title:'The Matrix Revolutions', released:2003, tagline:'Everything that has a beginning has an end'})
  29. CREATE
  30. (Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrixRevolutions),
  31. (Carrie)-[:ACTED_IN {roles:['Trinity']}]->(TheMatrixRevolutions),
  32. (Laurence)-[:ACTED_IN {roles:['Morpheus']}]->(TheMatrixRevolutions),
  33. (Hugo)-[:ACTED_IN {roles:['Agent Smith']}]->(TheMatrixRevolutions),
  34. (LillyW)-[:DIRECTED]->(TheMatrixRevolutions),
  35. (LanaW)-[:DIRECTED]->(TheMatrixRevolutions),
  36. (JoelS)-[:PRODUCED]->(TheMatrixRevolutions)
  37. CREATE (TheDevilsAdvocate:Movie {title:"The Devil's Advocate", released:1997, tagline:'Evil has its winning ways'})
  38. CREATE (Charlize:Person {name:'Charlize Theron', born:1975})
  39. CREATE (Al:Person {name:'Al Pacino', born:1940})
  40. CREATE (Taylor:Person {name:'Taylor Hackford', born:1944})
  41. CREATE
  42. (Keanu)-[:ACTED_IN {roles:['Kevin Lomax']}]->(TheDevilsAdvocate),
  43. (Charlize)-[:ACTED_IN {roles:['Mary Ann Lomax']}]->(TheDevilsAdvocate),
  44. (Al)-[:ACTED_IN {roles:['John Milton']}]->(TheDevilsAdvocate),
  45. (Taylor)-[:DIRECTED]->(TheDevilsAdvocate)
  46. 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."})
  47. CREATE (TomC:Person {name:'Tom Cruise', born:1962})
  48. CREATE (JackN:Person {name:'Jack Nicholson', born:1937})
  49. CREATE (DemiM:Person {name:'Demi Moore', born:1962})
  50. CREATE (KevinB:Person {name:'Kevin Bacon', born:1958})
  51. CREATE (KieferS:Person {name:'Kiefer Sutherland', born:1966})
  52. CREATE (NoahW:Person {name:'Noah Wyle', born:1971})
  53. CREATE (CubaG:Person {name:'Cuba Gooding Jr.', born:1968})
  54. CREATE (KevinP:Person {name:'Kevin Pollak', born:1957})
  55. CREATE (JTW:Person {name:'J.T. Walsh', born:1943})
  56. CREATE (JamesM:Person {name:'James Marshall', born:1967})
  57. CREATE (ChristopherG:Person {name:'Christopher Guest', born:1948})
  58. CREATE (RobR:Person {name:'Rob Reiner', born:1947})
  59. CREATE (AaronS:Person {name:'Aaron Sorkin', born:1961})
  60. CREATE
  61. (TomC)-[:ACTED_IN {roles:['Lt. Daniel Kaffee']}]->(AFewGoodMen),
  62. (JackN)-[:ACTED_IN {roles:['Col. Nathan R. Jessup']}]->(AFewGoodMen),
  63. (DemiM)-[:ACTED_IN {roles:['Lt. Cdr. JoAnne Galloway']}]->(AFewGoodMen),
  64. (KevinB)-[:ACTED_IN {roles:['Capt. Jack Ross']}]->(AFewGoodMen),
  65. (KieferS)-[:ACTED_IN {roles:['Lt. Jonathan Kendrick']}]->(AFewGoodMen),
  66. (NoahW)-[:ACTED_IN {roles:['Cpl. Jeffrey Barnes']}]->(AFewGoodMen),
  67. (CubaG)-[:ACTED_IN {roles:['Cpl. Carl Hammaker']}]->(AFewGoodMen),
  68. (KevinP)-[:ACTED_IN {roles:['Lt. Sam Weinberg']}]->(AFewGoodMen),
  69. (JTW)-[:ACTED_IN {roles:['Lt. Col. Matthew Andrew Markinson']}]->(AFewGoodMen),
  70. (JamesM)-[:ACTED_IN {roles:['Pfc. Louden Downey']}]->(AFewGoodMen),
  71. (ChristopherG)-[:ACTED_IN {roles:['Dr. Stone']}]->(AFewGoodMen),
  72. (AaronS)-[:ACTED_IN {roles:['Man in Bar']}]->(AFewGoodMen),
  73. (RobR)-[:DIRECTED]->(AFewGoodMen),
  74. (AaronS)-[:WROTE]->(AFewGoodMen)
  75. CREATE (TopGun:Movie {title:"Top Gun", released:1986, tagline:'I feel the need, the need for speed.'})
  76. CREATE (KellyM:Person {name:'Kelly McGillis', born:1957})
  77. CREATE (ValK:Person {name:'Val Kilmer', born:1959})
  78. CREATE (AnthonyE:Person {name:'Anthony Edwards', born:1962})
  79. CREATE (TomS:Person {name:'Tom Skerritt', born:1933})
  80. CREATE (MegR:Person {name:'Meg Ryan', born:1961})
  81. CREATE (TonyS:Person {name:'Tony Scott', born:1944})
  82. CREATE (JimC:Person {name:'Jim Cash', born:1941})
  83. CREATE
  84. (TomC)-[:ACTED_IN {roles:['Maverick']}]->(TopGun),
  85. (KellyM)-[:ACTED_IN {roles:['Charlie']}]->(TopGun),
  86. (ValK)-[:ACTED_IN {roles:['Iceman']}]->(TopGun),
  87. (AnthonyE)-[:ACTED_IN {roles:['Goose']}]->(TopGun),
  88. (TomS)-[:ACTED_IN {roles:['Viper']}]->(TopGun),
  89. (MegR)-[:ACTED_IN {roles:['Carole']}]->(TopGun),
  90. (TonyS)-[:DIRECTED]->(TopGun),
  91. (JimC)-[:WROTE]->(TopGun)
  92. CREATE (JerryMaguire:Movie {title:'Jerry Maguire', released:2000, tagline:'The rest of his life begins now.'})
  93. CREATE (ReneeZ:Person {name:'Renee Zellweger', born:1969})
  94. CREATE (KellyP:Person {name:'Kelly Preston', born:1962})
  95. CREATE (JerryO:Person {name:"Jerry O'Connell", born:1974})
  96. CREATE (JayM:Person {name:'Jay Mohr', born:1970})
  97. CREATE (BonnieH:Person {name:'Bonnie Hunt', born:1961})
  98. CREATE (ReginaK:Person {name:'Regina King', born:1971})
  99. CREATE (JonathanL:Person {name:'Jonathan Lipnicki', born:1996})
  100. CREATE (CameronC:Person {name:'Cameron Crowe', born:1957})
  101. CREATE
  102. (TomC)-[:ACTED_IN {roles:['Jerry Maguire']}]->(JerryMaguire),
  103. (CubaG)-[:ACTED_IN {roles:['Rod Tidwell']}]->(JerryMaguire),
  104. (ReneeZ)-[:ACTED_IN {roles:['Dorothy Boyd']}]->(JerryMaguire),
  105. (KellyP)-[:ACTED_IN {roles:['Avery Bishop']}]->(JerryMaguire),
  106. (JerryO)-[:ACTED_IN {roles:['Frank Cushman']}]->(JerryMaguire),
  107. (JayM)-[:ACTED_IN {roles:['Bob Sugar']}]->(JerryMaguire),
  108. (BonnieH)-[:ACTED_IN {roles:['Laurel Boyd']}]->(JerryMaguire),
  109. (ReginaK)-[:ACTED_IN {roles:['Marcee Tidwell']}]->(JerryMaguire),
  110. (JonathanL)-[:ACTED_IN {roles:['Ray Boyd']}]->(JerryMaguire),
  111. (CameronC)-[:DIRECTED]->(JerryMaguire),
  112. (CameronC)-[:PRODUCED]->(JerryMaguire),
  113. (CameronC)-[:WROTE]->(JerryMaguire)
  114. 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."})
  115. CREATE (RiverP:Person {name:'River Phoenix', born:1970})
  116. CREATE (CoreyF:Person {name:'Corey Feldman', born:1971})
  117. CREATE (WilW:Person {name:'Wil Wheaton', born:1972})
  118. CREATE (JohnC:Person {name:'John Cusack', born:1966})
  119. CREATE (MarshallB:Person {name:'Marshall Bell', born:1942})
  120. CREATE
  121. (WilW)-[:ACTED_IN {roles:['Gordie Lachance']}]->(StandByMe),
  122. (RiverP)-[:ACTED_IN {roles:['Chris Chambers']}]->(StandByMe),
  123. (JerryO)-[:ACTED_IN {roles:['Vern Tessio']}]->(StandByMe),
  124. (CoreyF)-[:ACTED_IN {roles:['Teddy Duchamp']}]->(StandByMe),
  125. (JohnC)-[:ACTED_IN {roles:['Denny Lachance']}]->(StandByMe),
  126. (KieferS)-[:ACTED_IN {roles:['Ace Merrill']}]->(StandByMe),
  127. (MarshallB)-[:ACTED_IN {roles:['Mr. Lachance']}]->(StandByMe),
  128. (RobR)-[:DIRECTED]->(StandByMe)
  129. CREATE (AsGoodAsItGets:Movie {title:'As Good as It Gets', released:1997, tagline:'A comedy from the heart that goes for the throat.'})
  130. CREATE (HelenH:Person {name:'Helen Hunt', born:1963})
  131. CREATE (GregK:Person {name:'Greg Kinnear', born:1963})
  132. CREATE (JamesB:Person {name:'James L. Brooks', born:1940})
  133. CREATE
  134. (JackN)-[:ACTED_IN {roles:['Melvin Udall']}]->(AsGoodAsItGets),
  135. (HelenH)-[:ACTED_IN {roles:['Carol Connelly']}]->(AsGoodAsItGets),
  136. (GregK)-[:ACTED_IN {roles:['Simon Bishop']}]->(AsGoodAsItGets),
  137. (CubaG)-[:ACTED_IN {roles:['Frank Sachs']}]->(AsGoodAsItGets),
  138. (JamesB)-[:DIRECTED]->(AsGoodAsItGets)
  139. CREATE (WhatDreamsMayCome:Movie {title:'What Dreams May Come', released:1998, tagline:'After life there is more. The end is just the beginning.'})
  140. CREATE (AnnabellaS:Person {name:'Annabella Sciorra', born:1960})
  141. CREATE (MaxS:Person {name:'Max von Sydow', born:1929})
  142. CREATE (WernerH:Person {name:'Werner Herzog', born:1942})
  143. CREATE (Robin:Person {name:'Robin Williams', born:1951})
  144. CREATE (VincentW:Person {name:'Vincent Ward', born:1956})
  145. CREATE
  146. (Robin)-[:ACTED_IN {roles:['Chris Nielsen']}]->(WhatDreamsMayCome),
  147. (CubaG)-[:ACTED_IN {roles:['Albert Lewis']}]->(WhatDreamsMayCome),
  148. (AnnabellaS)-[:ACTED_IN {roles:['Annie Collins-Nielsen']}]->(WhatDreamsMayCome),
  149. (MaxS)-[:ACTED_IN {roles:['The Tracker']}]->(WhatDreamsMayCome),
  150. (WernerH)-[:ACTED_IN {roles:['The Face']}]->(WhatDreamsMayCome),
  151. (VincentW)-[:DIRECTED]->(WhatDreamsMayCome)
  152. CREATE (SnowFallingonCedars:Movie {title:'Snow Falling on Cedars', released:1999, tagline:'First loves last. Forever.'})
  153. CREATE (EthanH:Person {name:'Ethan Hawke', born:1970})
  154. CREATE (RickY:Person {name:'Rick Yune', born:1971})
  155. CREATE (JamesC:Person {name:'James Cromwell', born:1940})
  156. CREATE (ScottH:Person {name:'Scott Hicks', born:1953})
  157. CREATE
  158. (EthanH)-[:ACTED_IN {roles:['Ishmael Chambers']}]->(SnowFallingonCedars),
  159. (RickY)-[:ACTED_IN {roles:['Kazuo Miyamoto']}]->(SnowFallingonCedars),
  160. (MaxS)-[:ACTED_IN {roles:['Nels Gudmundsson']}]->(SnowFallingonCedars),
  161. (JamesC)-[:ACTED_IN {roles:['Judge Fielding']}]->(SnowFallingonCedars),
  162. (ScottH)-[:DIRECTED]->(SnowFallingonCedars)
  163. CREATE (YouveGotMail:Movie {title:"You've Got Mail", released:1998, tagline:'At odds in life... in love on-line.'})
  164. CREATE (ParkerP:Person {name:'Parker Posey', born:1968})
  165. CREATE (DaveC:Person {name:'Dave Chappelle', born:1973})
  166. CREATE (SteveZ:Person {name:'Steve Zahn', born:1967})
  167. CREATE (TomH:Person {name:'Tom Hanks', born:1956})
  168. CREATE (NoraE:Person {name:'Nora Ephron', born:1941})
  169. CREATE
  170. (TomH)-[:ACTED_IN {roles:['Joe Fox']}]->(YouveGotMail),
  171. (MegR)-[:ACTED_IN {roles:['Kathleen Kelly']}]->(YouveGotMail),
  172. (GregK)-[:ACTED_IN {roles:['Frank Navasky']}]->(YouveGotMail),
  173. (ParkerP)-[:ACTED_IN {roles:['Patricia Eden']}]->(YouveGotMail),
  174. (DaveC)-[:ACTED_IN {roles:['Kevin Jackson']}]->(YouveGotMail),
  175. (SteveZ)-[:ACTED_IN {roles:['George Pappas']}]->(YouveGotMail),
  176. (NoraE)-[:DIRECTED]->(YouveGotMail)
  177. 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?'})
  178. CREATE (RitaW:Person {name:'Rita Wilson', born:1956})
  179. CREATE (BillPull:Person {name:'Bill Pullman', born:1953})
  180. CREATE (VictorG:Person {name:'Victor Garber', born:1949})
  181. CREATE (RosieO:Person {name:"Rosie O'Donnell", born:1962})
  182. CREATE
  183. (TomH)-[:ACTED_IN {roles:['Sam Baldwin']}]->(SleeplessInSeattle),
  184. (MegR)-[:ACTED_IN {roles:['Annie Reed']}]->(SleeplessInSeattle),
  185. (RitaW)-[:ACTED_IN {roles:['Suzy']}]->(SleeplessInSeattle),
  186. (BillPull)-[:ACTED_IN {roles:['Walter']}]->(SleeplessInSeattle),
  187. (VictorG)-[:ACTED_IN {roles:['Greg']}]->(SleeplessInSeattle),
  188. (RosieO)-[:ACTED_IN {roles:['Becky']}]->(SleeplessInSeattle),
  189. (NoraE)-[:DIRECTED]->(SleeplessInSeattle)
  190. CREATE (JoeVersustheVolcano:Movie {title:'Joe Versus the Volcano', released:1990, tagline:'A story of love, lava and burning desire.'})
  191. CREATE (JohnS:Person {name:'John Patrick Stanley', born:1950})
  192. CREATE (Nathan:Person {name:'Nathan Lane', born:1956})
  193. CREATE
  194. (TomH)-[:ACTED_IN {roles:['Joe Banks']}]->(JoeVersustheVolcano),
  195. (MegR)-[:ACTED_IN {roles:['DeDe', 'Angelica Graynamore', 'Patricia Graynamore']}]->(JoeVersustheVolcano),
  196. (Nathan)-[:ACTED_IN {roles:['Baw']}]->(JoeVersustheVolcano),
  197. (JohnS)-[:DIRECTED]->(JoeVersustheVolcano)
  198. CREATE (WhenHarryMetSally:Movie {title:'When Harry Met Sally', released:1998, tagline:'Can two friends sleep together and still love each other in the morning?'})
  199. CREATE (BillyC:Person {name:'Billy Crystal', born:1948})
  200. CREATE (CarrieF:Person {name:'Carrie Fisher', born:1956})
  201. CREATE (BrunoK:Person {name:'Bruno Kirby', born:1949})
  202. CREATE
  203. (BillyC)-[:ACTED_IN {roles:['Harry Burns']}]->(WhenHarryMetSally),
  204. (MegR)-[:ACTED_IN {roles:['Sally Albright']}]->(WhenHarryMetSally),
  205. (CarrieF)-[:ACTED_IN {roles:['Marie']}]->(WhenHarryMetSally),
  206. (BrunoK)-[:ACTED_IN {roles:['Jess']}]->(WhenHarryMetSally),
  207. (RobR)-[:DIRECTED]->(WhenHarryMetSally),
  208. (RobR)-[:PRODUCED]->(WhenHarryMetSally),
  209. (NoraE)-[:PRODUCED]->(WhenHarryMetSally),
  210. (NoraE)-[:WROTE]->(WhenHarryMetSally)
  211. 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'})
  212. CREATE (LivT:Person {name:'Liv Tyler', born:1977})
  213. CREATE
  214. (TomH)-[:ACTED_IN {roles:['Mr. White']}]->(ThatThingYouDo),
  215. (LivT)-[:ACTED_IN {roles:['Faye Dolan']}]->(ThatThingYouDo),
  216. (Charlize)-[:ACTED_IN {roles:['Tina']}]->(ThatThingYouDo),
  217. (TomH)-[:DIRECTED]->(ThatThingYouDo)
  218. CREATE (TheReplacements:Movie {title:'The Replacements', released:2000, tagline:'Pain heals, Chicks dig scars... Glory lasts forever'})
  219. CREATE (Brooke:Person {name:'Brooke Langton', born:1970})
  220. CREATE (Gene:Person {name:'Gene Hackman', born:1930})
  221. CREATE (Orlando:Person {name:'Orlando Jones', born:1968})
  222. CREATE (Howard:Person {name:'Howard Deutch', born:1950})
  223. CREATE
  224. (Keanu)-[:ACTED_IN {roles:['Shane Falco']}]->(TheReplacements),
  225. (Brooke)-[:ACTED_IN {roles:['Annabelle Farrell']}]->(TheReplacements),
  226. (Gene)-[:ACTED_IN {roles:['Jimmy McGinty']}]->(TheReplacements),
  227. (Orlando)-[:ACTED_IN {roles:['Clifford Franklin']}]->(TheReplacements),
  228. (Howard)-[:DIRECTED]->(TheReplacements)
  229. CREATE (RescueDawn:Movie {title:'RescueDawn', released:2006, tagline:"Based on the extraordinary true story of one man's fight for freedom"})
  230. CREATE (ChristianB:Person {name:'Christian Bale', born:1974})
  231. CREATE (ZachG:Person {name:'Zach Grenier', born:1954})
  232. CREATE
  233. (MarshallB)-[:ACTED_IN {roles:['Admiral']}]->(RescueDawn),
  234. (ChristianB)-[:ACTED_IN {roles:['Dieter Dengler']}]->(RescueDawn),
  235. (ZachG)-[:ACTED_IN {roles:['Squad Leader']}]->(RescueDawn),
  236. (SteveZ)-[:ACTED_IN {roles:['Duane']}]->(RescueDawn),
  237. (WernerH)-[:DIRECTED]->(RescueDawn)
  238. CREATE (TheBirdcage:Movie {title:'The Birdcage', released:1996, tagline:'Come as you are'})
  239. CREATE (MikeN:Person {name:'Mike Nichols', born:1931})
  240. CREATE
  241. (Robin)-[:ACTED_IN {roles:['Armand Goldman']}]->(TheBirdcage),
  242. (Nathan)-[:ACTED_IN {roles:['Albert Goldman']}]->(TheBirdcage),
  243. (Gene)-[:ACTED_IN {roles:['Sen. Kevin Keeley']}]->(TheBirdcage),
  244. (MikeN)-[:DIRECTED]->(TheBirdcage)
  245. CREATE (Unforgiven:Movie {title:'Unforgiven', released:1992, tagline:"It's a hell of a thing, killing a man"})
  246. CREATE (RichardH:Person {name:'Richard Harris', born:1930})
  247. CREATE (ClintE:Person {name:'Clint Eastwood', born:1930})
  248. CREATE
  249. (RichardH)-[:ACTED_IN {roles:['English Bob']}]->(Unforgiven),
  250. (ClintE)-[:ACTED_IN {roles:['Bill Munny']}]->(Unforgiven),
  251. (Gene)-[:ACTED_IN {roles:['Little Bill Daggett']}]->(Unforgiven),
  252. (ClintE)-[:DIRECTED]->(Unforgiven)
  253. CREATE (JohnnyMnemonic:Movie {title:'Johnny Mnemonic', released:1995, tagline:'The hottest data on earth. In the coolest head in town'})
  254. CREATE (Takeshi:Person {name:'Takeshi Kitano', born:1947})
  255. CREATE (Dina:Person {name:'Dina Meyer', born:1968})
  256. CREATE (IceT:Person {name:'Ice-T', born:1958})
  257. CREATE (RobertL:Person {name:'Robert Longo', born:1953})
  258. CREATE
  259. (Keanu)-[:ACTED_IN {roles:['Johnny Mnemonic']}]->(JohnnyMnemonic),
  260. (Takeshi)-[:ACTED_IN {roles:['Takahashi']}]->(JohnnyMnemonic),
  261. (Dina)-[:ACTED_IN {roles:['Jane']}]->(JohnnyMnemonic),
  262. (IceT)-[:ACTED_IN {roles:['J-Bone']}]->(JohnnyMnemonic),
  263. (RobertL)-[:DIRECTED]->(JohnnyMnemonic)
  264. CREATE (CloudAtlas:Movie {title:'Cloud Atlas', released:2012, tagline:'Everything is connected'})
  265. CREATE (HalleB:Person {name:'Halle Berry', born:1966})
  266. CREATE (JimB:Person {name:'Jim Broadbent', born:1949})
  267. CREATE (TomT:Person {name:'Tom Tykwer', born:1965})
  268. CREATE (DavidMitchell:Person {name:'David Mitchell', born:1969})
  269. CREATE (StefanArndt:Person {name:'Stefan Arndt', born:1961})
  270. CREATE
  271. (TomH)-[:ACTED_IN {roles:['Zachry', 'Dr. Henry Goose', 'Isaac Sachs', 'Dermot Hoggins']}]->(CloudAtlas),
  272. (Hugo)-[:ACTED_IN {roles:['Bill Smoke', 'Haskell Moore', 'Tadeusz Kesselring', 'Nurse Noakes', 'Boardman Mephi', 'Old Georgie']}]->(CloudAtlas),
  273. (HalleB)-[:ACTED_IN {roles:['Luisa Rey', 'Jocasta Ayrs', 'Ovid', 'Meronym']}]->(CloudAtlas),
  274. (JimB)-[:ACTED_IN {roles:['Vyvyan Ayrs', 'Captain Molyneux', 'Timothy Cavendish']}]->(CloudAtlas),
  275. (TomT)-[:DIRECTED]->(CloudAtlas),
  276. (LillyW)-[:DIRECTED]->(CloudAtlas),
  277. (LanaW)-[:DIRECTED]->(CloudAtlas),
  278. (DavidMitchell)-[:WROTE]->(CloudAtlas),
  279. (StefanArndt)-[:PRODUCED]->(CloudAtlas)
  280. CREATE (TheDaVinciCode:Movie {title:'The Da Vinci Code', released:2006, tagline:'Break The Codes'})
  281. CREATE (IanM:Person {name:'Ian McKellen', born:1939})
  282. CREATE (AudreyT:Person {name:'Audrey Tautou', born:1976})
  283. CREATE (PaulB:Person {name:'Paul Bettany', born:1971})
  284. CREATE (RonH:Person {name:'Ron Howard', born:1954})
  285. CREATE
  286. (TomH)-[:ACTED_IN {roles:['Dr. Robert Langdon']}]->(TheDaVinciCode),
  287. (IanM)-[:ACTED_IN {roles:['Sir Leight Teabing']}]->(TheDaVinciCode),
  288. (AudreyT)-[:ACTED_IN {roles:['Sophie Neveu']}]->(TheDaVinciCode),
  289. (PaulB)-[:ACTED_IN {roles:['Silas']}]->(TheDaVinciCode),
  290. (RonH)-[:DIRECTED]->(TheDaVinciCode)
  291. CREATE (VforVendetta:Movie {title:'V for Vendetta', released:2006, tagline:'Freedom! Forever!'})
  292. CREATE (NatalieP:Person {name:'Natalie Portman', born:1981})
  293. CREATE (StephenR:Person {name:'Stephen Rea', born:1946})
  294. CREATE (JohnH:Person {name:'John Hurt', born:1940})
  295. CREATE (BenM:Person {name: 'Ben Miles', born:1967})
  296. CREATE
  297. (Hugo)-[:ACTED_IN {roles:['V']}]->(VforVendetta),
  298. (NatalieP)-[:ACTED_IN {roles:['Evey Hammond']}]->(VforVendetta),
  299. (StephenR)-[:ACTED_IN {roles:['Eric Finch']}]->(VforVendetta),
  300. (JohnH)-[:ACTED_IN {roles:['High Chancellor Adam Sutler']}]->(VforVendetta),
  301. (BenM)-[:ACTED_IN {roles:['Dascomb']}]->(VforVendetta),
  302. (JamesM)-[:DIRECTED]->(VforVendetta),
  303. (LillyW)-[:PRODUCED]->(VforVendetta),
  304. (LanaW)-[:PRODUCED]->(VforVendetta),
  305. (JoelS)-[:PRODUCED]->(VforVendetta),
  306. (LillyW)-[:WROTE]->(VforVendetta),
  307. (LanaW)-[:WROTE]->(VforVendetta)
  308. CREATE (SpeedRacer:Movie {title:'Speed Racer', released:2008, tagline:'Speed has no limits'})
  309. CREATE (EmileH:Person {name:'Emile Hirsch', born:1985})
  310. CREATE (JohnG:Person {name:'John Goodman', born:1960})
  311. CREATE (SusanS:Person {name:'Susan Sarandon', born:1946})
  312. CREATE (MatthewF:Person {name:'Matthew Fox', born:1966})
  313. CREATE (ChristinaR:Person {name:'Christina Ricci', born:1980})
  314. CREATE (Rain:Person {name:'Rain', born:1982})
  315. CREATE
  316. (EmileH)-[:ACTED_IN {roles:['Speed Racer']}]->(SpeedRacer),
  317. (JohnG)-[:ACTED_IN {roles:['Pops']}]->(SpeedRacer),
  318. (SusanS)-[:ACTED_IN {roles:['Mom']}]->(SpeedRacer),
  319. (MatthewF)-[:ACTED_IN {roles:['Racer X']}]->(SpeedRacer),
  320. (ChristinaR)-[:ACTED_IN {roles:['Trixie']}]->(SpeedRacer),
  321. (Rain)-[:ACTED_IN {roles:['Taejo Togokahn']}]->(SpeedRacer),
  322. (BenM)-[:ACTED_IN {roles:['Cass Jones']}]->(SpeedRacer),
  323. (LillyW)-[:DIRECTED]->(SpeedRacer),
  324. (LanaW)-[:DIRECTED]->(SpeedRacer),
  325. (LillyW)-[:WROTE]->(SpeedRacer),
  326. (LanaW)-[:WROTE]->(SpeedRacer),
  327. (JoelS)-[:PRODUCED]->(SpeedRacer)
  328. CREATE (NinjaAssassin:Movie {title:'Ninja Assassin', released:2009, tagline:'Prepare to enter a secret world of assassins'})
  329. CREATE (NaomieH:Person {name:'Naomie Harris'})
  330. CREATE
  331. (Rain)-[:ACTED_IN {roles:['Raizo']}]->(NinjaAssassin),
  332. (NaomieH)-[:ACTED_IN {roles:['Mika Coretti']}]->(NinjaAssassin),
  333. (RickY)-[:ACTED_IN {roles:['Takeshi']}]->(NinjaAssassin),
  334. (BenM)-[:ACTED_IN {roles:['Ryan Maslow']}]->(NinjaAssassin),
  335. (JamesM)-[:DIRECTED]->(NinjaAssassin),
  336. (LillyW)-[:PRODUCED]->(NinjaAssassin),
  337. (LanaW)-[:PRODUCED]->(NinjaAssassin),
  338. (JoelS)-[:PRODUCED]->(NinjaAssassin)
  339. CREATE (TheGreenMile:Movie {title:'The Green Mile', released:1999, tagline:"Walk a mile you'll never forget."})
  340. CREATE (MichaelD:Person {name:'Michael Clarke Duncan', born:1957})
  341. CREATE (DavidM:Person {name:'David Morse', born:1953})
  342. CREATE (SamR:Person {name:'Sam Rockwell', born:1968})
  343. CREATE (GaryS:Person {name:'Gary Sinise', born:1955})
  344. CREATE (PatriciaC:Person {name:'Patricia Clarkson', born:1959})
  345. CREATE (FrankD:Person {name:'Frank Darabont', born:1959})
  346. CREATE
  347. (TomH)-[:ACTED_IN {roles:['Paul Edgecomb']}]->(TheGreenMile),
  348. (MichaelD)-[:ACTED_IN {roles:['John Coffey']}]->(TheGreenMile),
  349. (DavidM)-[:ACTED_IN {roles:['Brutus "Brutal" Howell']}]->(TheGreenMile),
  350. (BonnieH)-[:ACTED_IN {roles:['Jan Edgecomb']}]->(TheGreenMile),
  351. (JamesC)-[:ACTED_IN {roles:['Warden Hal Moores']}]->(TheGreenMile),
  352. (SamR)-[:ACTED_IN {roles:['"Wild Bill" Wharton']}]->(TheGreenMile),
  353. (GaryS)-[:ACTED_IN {roles:['Burt Hammersmith']}]->(TheGreenMile),
  354. (PatriciaC)-[:ACTED_IN {roles:['Melinda Moores']}]->(TheGreenMile),
  355. (FrankD)-[:DIRECTED]->(TheGreenMile)
  356. CREATE (FrostNixon:Movie {title:'Frost/Nixon', released:2008, tagline:'400 million people were waiting for the truth.'})
  357. CREATE (FrankL:Person {name:'Frank Langella', born:1938})
  358. CREATE (MichaelS:Person {name:'Michael Sheen', born:1969})
  359. CREATE (OliverP:Person {name:'Oliver Platt', born:1960})
  360. CREATE
  361. (FrankL)-[:ACTED_IN {roles:['Richard Nixon']}]->(FrostNixon),
  362. (MichaelS)-[:ACTED_IN {roles:['David Frost']}]->(FrostNixon),
  363. (KevinB)-[:ACTED_IN {roles:['Jack Brennan']}]->(FrostNixon),
  364. (OliverP)-[:ACTED_IN {roles:['Bob Zelnick']}]->(FrostNixon),
  365. (SamR)-[:ACTED_IN {roles:['James Reston, Jr.']}]->(FrostNixon),
  366. (RonH)-[:DIRECTED]->(FrostNixon)
  367. CREATE (Hoffa:Movie {title:'Hoffa', released:1992, tagline:"He didn't want law. He wanted justice."})
  368. CREATE (DannyD:Person {name:'Danny DeVito', born:1944})
  369. CREATE (JohnR:Person {name:'John C. Reilly', born:1965})
  370. CREATE
  371. (JackN)-[:ACTED_IN {roles:['Hoffa']}]->(Hoffa),
  372. (DannyD)-[:ACTED_IN {roles:['Robert "Bobby" Ciaro']}]->(Hoffa),
  373. (JTW)-[:ACTED_IN {roles:['Frank Fitzsimmons']}]->(Hoffa),
  374. (JohnR)-[:ACTED_IN {roles:['Peter "Pete" Connelly']}]->(Hoffa),
  375. (DannyD)-[:DIRECTED]->(Hoffa)
  376. CREATE (Apollo13:Movie {title:'Apollo 13', released:1995, tagline:'Houston, we have a problem.'})
  377. CREATE (EdH:Person {name:'Ed Harris', born:1950})
  378. CREATE (BillPax:Person {name:'Bill Paxton', born:1955})
  379. CREATE
  380. (TomH)-[:ACTED_IN {roles:['Jim Lovell']}]->(Apollo13),
  381. (KevinB)-[:ACTED_IN {roles:['Jack Swigert']}]->(Apollo13),
  382. (EdH)-[:ACTED_IN {roles:['Gene Kranz']}]->(Apollo13),
  383. (BillPax)-[:ACTED_IN {roles:['Fred Haise']}]->(Apollo13),
  384. (GaryS)-[:ACTED_IN {roles:['Ken Mattingly']}]->(Apollo13),
  385. (RonH)-[:DIRECTED]->(Apollo13)
  386. CREATE (Twister:Movie {title:'Twister', released:1996, tagline:"Don't Breathe. Don't Look Back."})
  387. CREATE (PhilipH:Person {name:'Philip Seymour Hoffman', born:1967})
  388. CREATE (JanB:Person {name:'Jan de Bont', born:1943})
  389. CREATE
  390. (BillPax)-[:ACTED_IN {roles:['Bill Harding']}]->(Twister),
  391. (HelenH)-[:ACTED_IN {roles:['Dr. Jo Harding']}]->(Twister),
  392. (ZachG)-[:ACTED_IN {roles:['Eddie']}]->(Twister),
  393. (PhilipH)-[:ACTED_IN {roles:['Dustin "Dusty" Davis']}]->(Twister),
  394. (JanB)-[:DIRECTED]->(Twister)
  395. CREATE (CastAway:Movie {title:'Cast Away', released:2000, tagline:'At the edge of the world, his journey begins.'})
  396. CREATE (RobertZ:Person {name:'Robert Zemeckis', born:1951})
  397. CREATE
  398. (TomH)-[:ACTED_IN {roles:['Chuck Noland']}]->(CastAway),
  399. (HelenH)-[:ACTED_IN {roles:['Kelly Frears']}]->(CastAway),
  400. (RobertZ)-[:DIRECTED]->(CastAway)
  401. CREATE (OneFlewOvertheCuckoosNest:Movie {title:"One Flew Over the Cuckoo's Nest", released:1975, tagline:"If he's crazy, what does that make you?"})
  402. CREATE (MilosF:Person {name:'Milos Forman', born:1932})
  403. CREATE
  404. (JackN)-[:ACTED_IN {roles:['Randle McMurphy']}]->(OneFlewOvertheCuckoosNest),
  405. (DannyD)-[:ACTED_IN {roles:['Martini']}]->(OneFlewOvertheCuckoosNest),
  406. (MilosF)-[:DIRECTED]->(OneFlewOvertheCuckoosNest)
  407. CREATE (SomethingsGottaGive:Movie {title:"Something's Gotta Give", released:2003})
  408. CREATE (DianeK:Person {name:'Diane Keaton', born:1946})
  409. CREATE (NancyM:Person {name:'Nancy Meyers', born:1949})
  410. CREATE
  411. (JackN)-[:ACTED_IN {roles:['Harry Sanborn']}]->(SomethingsGottaGive),
  412. (DianeK)-[:ACTED_IN {roles:['Erica Barry']}]->(SomethingsGottaGive),
  413. (Keanu)-[:ACTED_IN {roles:['Julian Mercer']}]->(SomethingsGottaGive),
  414. (NancyM)-[:DIRECTED]->(SomethingsGottaGive),
  415. (NancyM)-[:PRODUCED]->(SomethingsGottaGive),
  416. (NancyM)-[:WROTE]->(SomethingsGottaGive)
  417. CREATE (BicentennialMan:Movie {title:'Bicentennial Man', released:1999, tagline:"One robot's 200 year journey to become an ordinary man."})
  418. CREATE (ChrisC:Person {name:'Chris Columbus', born:1958})
  419. CREATE
  420. (Robin)-[:ACTED_IN {roles:['Andrew Marin']}]->(BicentennialMan),
  421. (OliverP)-[:ACTED_IN {roles:['Rupert Burns']}]->(BicentennialMan),
  422. (ChrisC)-[:DIRECTED]->(BicentennialMan)
  423. 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."})
  424. CREATE (JuliaR:Person {name:'Julia Roberts', born:1967})
  425. CREATE
  426. (TomH)-[:ACTED_IN {roles:['Rep. Charlie Wilson']}]->(CharlieWilsonsWar),
  427. (JuliaR)-[:ACTED_IN {roles:['Joanne Herring']}]->(CharlieWilsonsWar),
  428. (PhilipH)-[:ACTED_IN {roles:['Gust Avrakotos']}]->(CharlieWilsonsWar),
  429. (MikeN)-[:DIRECTED]->(CharlieWilsonsWar)
  430. CREATE (ThePolarExpress:Movie {title:'The Polar Express', released:2004, tagline:'This Holiday Season... Believe'})
  431. CREATE
  432. (TomH)-[:ACTED_IN {roles:['Hero Boy', 'Father', 'Conductor', 'Hobo', 'Scrooge', 'Santa Claus']}]->(ThePolarExpress),
  433. (RobertZ)-[:DIRECTED]->(ThePolarExpress)
  434. CREATE (ALeagueofTheirOwn:Movie {title:'A League of Their Own', released:1992, tagline:'Once in a lifetime you get a chance to do something different.'})
  435. CREATE (Madonna:Person {name:'Madonna', born:1954})
  436. CREATE (GeenaD:Person {name:'Geena Davis', born:1956})
  437. CREATE (LoriP:Person {name:'Lori Petty', born:1963})
  438. CREATE (PennyM:Person {name:'Penny Marshall', born:1943})
  439. CREATE
  440. (TomH)-[:ACTED_IN {roles:['Jimmy Dugan']}]->(ALeagueofTheirOwn),
  441. (GeenaD)-[:ACTED_IN {roles:['Dottie Hinson']}]->(ALeagueofTheirOwn),
  442. (LoriP)-[:ACTED_IN {roles:['Kit Keller']}]->(ALeagueofTheirOwn),
  443. (RosieO)-[:ACTED_IN {roles:['Doris Murphy']}]->(ALeagueofTheirOwn),
  444. (Madonna)-[:ACTED_IN {roles:['"All the Way" Mae Mordabito']}]->(ALeagueofTheirOwn),
  445. (BillPax)-[:ACTED_IN {roles:['Bob Hinson']}]->(ALeagueofTheirOwn),
  446. (PennyM)-[:DIRECTED]->(ALeagueofTheirOwn)
  447. CREATE (PaulBlythe:Person {name:'Paul Blythe'})
  448. CREATE (AngelaScope:Person {name:'Angela Scope'})
  449. CREATE (JessicaThompson:Person {name:'Jessica Thompson'})
  450. CREATE (JamesThompson:Person {name:'James Thompson'})
  451. CREATE
  452. (JamesThompson)-[:FOLLOWS]->(JessicaThompson),
  453. (AngelaScope)-[:FOLLOWS]->(JessicaThompson),
  454. (PaulBlythe)-[:FOLLOWS]->(AngelaScope)
  455. CREATE
  456. (JessicaThompson)-[:REVIEWED {summary:'An amazing journey', rating:95}]->(CloudAtlas),
  457. (JessicaThompson)-[:REVIEWED {summary:'Silly, but fun', rating:65}]->(TheReplacements),
  458. (JamesThompson)-[:REVIEWED {summary:'The coolest football movie ever', rating:100}]->(TheReplacements),
  459. (AngelaScope)-[:REVIEWED {summary:'Pretty funny at times', rating:62}]->(TheReplacements),
  460. (JessicaThompson)-[:REVIEWED {summary:'Dark, but compelling', rating:85}]->(Unforgiven),
  461. (JessicaThompson)-[:REVIEWED {summary:"Slapstick redeemed only by the Robin Williams and Gene Hackman's stellar performances", rating:45}]->(TheBirdcage),
  462. (JessicaThompson)-[:REVIEWED {summary:'A solid romp', rating:68}]->(TheDaVinciCode),
  463. (JamesThompson)-[:REVIEWED {summary:'Fun, but a little far fetched', rating:65}]->(TheDaVinciCode),
  464. (JessicaThompson)-[:REVIEWED {summary:'You had me at Jerry', rating:92}]->(JerryMaguire)
  465. WITH TomH as a
  466. MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d) RETURN a,m,d LIMIT 10;

创建完成后的效果如下:

有171个实体,200多条关系

查询一下

  1. MATCH (people:Person)-[relatedTo]-(:Movie {title: "The Matrix"}) RETURN people.name as name, Type(relatedTo) as relation
  2. //查询所有人和电影The Matrix有关系的人和关系

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/369781
推荐阅读
相关标签
  

闽ICP备14008679号