图数据库Neo4j安装及入门:

Neo4j 官网:https://neo4j.com/
windows下载桌面安装包后安装注册账号登录
第一次使用流程:
1.创建新数据库,选择Local,输入名称Test,选择默认数据库版本。
这里写图片描述
2.点击启动按钮,然后在浏览器打开,输入网址 localhost:7474/
这里写图片描述
3.创建一个电影数据库(Create、Find、Query、Solve)
1)Create

CREATE (TheMatrix:Movie {
   title:'The Matrix', released:1999, tagline:'Welcome to the Real World'})
CREATE (Keanu:Person {
   name:'Keanu Reeves', born:1964})
CREATE (Carrie:Person {
   name:'Carrie-Anne Moss', born:1967})
CREATE (Laurence:Person {
   name:'Laurence Fishburne', born:1961})
CREATE (Hugo:Person {
   name:'Hugo Weaving', born:1960})
CREATE (LillyW:Person {
   name:'Lilly Wachowski', born:1967})
CREATE (LanaW:Person {
   name:'Lana Wachowski', born:1965})
CREATE (JoelS:Person {
   name:'Joel Silver', born:1952})
CREATE
  (Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrix),
  (Carrie)-[:ACTED_IN {roles:['Trinity']}]->(TheMatrix),
  (Laurence)-[:ACTED_IN {roles:['Morpheus']}]->(TheMatrix),
  (Hugo)-[:ACTED_IN {roles:['Agent Smith']}]->(TheMatrix),
  (LillyW)-[:DIRECTED]->(TheMatrix),
  (LanaW)-[:DIRECTED]->(TheMatrix),
  (JoelS)-[:PRODUCED]->(TheMatrix)

CREATE (Emil:Person {
   name:"Emil Eifrem", born:1978})
CREATE (Emil)-[:ACTED_IN {roles:["Emil"]}]->(TheMatrix)

CREATE (TheMatrixReloaded:Movie {
   title:'The Matrix Reloaded', released:2003, tagline:'Free your mind'})
CREATE
  (Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrixReloaded),
  (Carrie)-[:ACTED_IN {roles:['Trinity']}]->(TheMatrixReloaded),
  (Laurence)-[:ACTED_IN {roles:['Morpheus']}]->(TheMatrixReloaded),
  (Hugo)-[:ACTED_IN {roles:['Agent Smith']}]->(TheMatrixReloaded),
  (LillyW)-[:DIRECTED]->(TheMatrixReloaded),
  (LanaW)-[:DIRECTED]->(TheMatrixReloaded),
  (JoelS)-[:PRODUCED]->(TheMatrixReloaded)

CREATE (TheMatrixRevolutions:Movie {
   title:'The Matrix Revolutions', released:2003, tagline:'Everything that has a beginning has an end'})
CREATE
  (Keanu)-[:ACTED_IN {roles:['Neo']}]->(TheMatrixRevolutions),
  (Carrie)-[:ACTED_IN {roles:['Trinity']}]->(TheMatrixRevolutions),
  (Laurence)-[:ACTED_IN {roles:['Morpheus']}]->(TheMatrixRevolutions),
  (Hugo)-[:ACTED_IN {roles:['Agent Smith']}]->(TheMatrixRevolutions),
  (LillyW)-[:DIRECTED]->(TheMatrixRevolutions),
  (LanaW)-[:DIRECTED]->(TheMatrixRevolutions),
  (JoelS)-[:PRODUCED]->(TheMatrixRevolutions)

CREATE (TheDevilsAdvocate:Movie {
   title:"The Devil's Advocate", released:1997, tagline:'Evil has its winning ways'})
CREATE (Charlize:Person {
   name:'Charlize Theron', born:1975})
CREATE (Al:Person {
   name:'Al Pacino', born:1940})
CREATE (Taylor:Person {
   name:'Taylor Hackford', born:1944})
CREATE
  (Keanu)-[:ACTED_IN {roles:['Kevin Lomax']}]->(TheDevilsAdvocate),
  (Charlize)-[:ACTED_IN {roles:['Mary Ann Lomax']}]->(TheDevilsAdvocate),
  (Al)-[:ACTED_IN {roles:['John Milton']}]->(TheDevilsAdvocate),
  (Taylor)-[:DIRECTED]->(TheDevilsAdvocate)

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."})
CREATE (TomC:Person {
   name:'Tom Cruise', born:1962})
CREATE (JackN:Person {
   name:'Jack Nicholson', born:1937})
CREATE (DemiM:Person {
   name:'Demi Moore', born:1962})
CREATE (KevinB:Person {
   name:'Kevin Bacon', born:1958})
CREATE (KieferS:Person {
   name:'Kiefer Sutherland', born:1966})
CREATE (NoahW:Person {
   name:'Noah Wyle', born:1971})
CREATE (CubaG:Person {
   name:'Cuba Gooding Jr.', born:1968})
CREATE (KevinP:Person {
   name:'Kevin Pollak', born:1957})
CREATE (JTW:Person {
   name:'J.T. Walsh', born:1943})
CREATE (JamesM:Person {
   name:'James Marshall', born:1967})
CREATE (ChristopherG:Person {
   name:'Christopher Guest', born:1948})
CREATE (RobR:Person {
   name:'Rob Reiner', born:1947})
CREATE (AaronS:Person {
   name:'Aaron Sorkin', born:1961})
CREATE
  (TomC)-[:ACTED_IN {roles:['Lt. Daniel Kaffee']}]->(AFewGoodMen),
  (JackN)-[:ACTED_IN {roles:['Col. Nathan R. Jessup']}]->(AFewGoodMen),
  (DemiM)-[:ACTED_IN {roles:['Lt. Cdr. JoAnne Galloway']}]->(AFewGoodMen),
  (KevinB)-[:ACTED_IN {roles:['Capt. Jack Ross']}]->(AFewGoodMen),
  (KieferS)-[:ACTED_IN {roles:['Lt. Jonathan Kendrick']}]->(AFewGoodMen),
  (NoahW)-[:ACTED_IN {roles:['Cpl. Jeffrey Barnes']}]->(AFewGoodMen),
  (CubaG)-[:ACTED_IN {roles:['Cpl. Carl Hammaker']}]->(AFewGoodMen),
  (KevinP)-[:ACTED_IN {roles:['Lt. Sam Weinberg']}]->(AFewGoodMen),
  (JTW)-[:ACTED_IN {roles:['Lt. Col. Matthew Andrew Markinson']}]->(AFewGoodMen),
  (JamesM)-[:ACTED_IN {roles:['Pfc. Louden Downey']}]->(AFewGoodMen),
  (ChristopherG)-[:ACTED_IN {roles:['Dr. Stone']}]->(AFewGoodMen),
  (AaronS)-[:ACTED_IN {roles:['Man in Bar']}]->(AFewGoodMen),
  (RobR)-[:DIRECTED]->(AFewGoodMen),
  (AaronS)-[:WROTE]->(AFewGoodMen)

CREATE (TopGun:Movie {
   title:"Top Gun", released:1986, tagline:'I feel the need, the need for speed.'})
CREATE (KellyM:Person {
   name:'Kelly McGillis', born:1957})
CREATE (ValK:Person {
   name:'Val Kilmer', born:1959})
CREATE (AnthonyE:Person {
   name:'Anthony Edwards', born:1962})
CREATE (TomS:Person {
   name:'Tom Skerritt', born:1933})
CREATE (MegR:Person {
   name:'Meg Ryan', born:1961})
CREATE (TonyS:Person {
   name:'Tony Scott', born:1944})
CREATE (JimC:Person {
   name:'Jim Cash', born:1941})
CREATE
  (TomC)-[:ACTED_IN {roles:['Maverick']}]->(TopGun),
  (KellyM)-[:ACTED_IN {roles:['Charlie']}]->(TopGun),
  (ValK)-[:ACTED_IN {roles:['Iceman']}]->(TopGun),
  (AnthonyE)-[:ACTED_IN {roles:['Goose']}]->(TopGun),
  (TomS)-[:ACTED_IN {roles:['Viper']}]->(TopGun),
  (MegR)-[:ACTED_IN {roles:['Carole']}]->(TopGun),
  (TonyS)-[:DIRECTED]->(TopGun),
  (JimC)-[:WROTE]->(TopGun)

CREATE (JerryMaguire:Movie {
   title:'Jerry Maguire', released:2000, tagline:'The rest of his life begins now.'})
CREATE (ReneeZ:Person {
   name:'Renee Zellweger', born:1969})
CREATE (KellyP:Person {
   name:'Kelly Preston', born:1962})
CREATE (JerryO:Person {
   name:"Jerry O'Connell", born:1974})
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值