neo4j入门教程
1.进入官网下载http://neo4j.com/developer/get-started/
2.下完后点击安装就可以了
3.开启软件
4.点击链接进入
5.进入后就可以看到如下界面
6.在界面的顶部就是neo4j的查询语言的编辑窗口,在这里你可以编辑你的代码,当然用的是cypher语言,这里简单写个例子:
7.代码如下
CREATE (shakespeare:Author {firstname:’William’, lastname:’Shakespeare’}),
(juliusCaesar:Play {title:’Julius Caesar’}),
(shakespeare)-[:WROTE_PLAY {year:1599}]->(juliusCaesar),
(theTempest:Play {title:’The Tempest’}),
(shakespeare)-[:WROTE_PLAY {year:1610}]->(theTempest),
(rsc:Company {name:’RSC’}),
(production1:Production {name:’Julius Caesar’}),
(rsc)-[:PRODUCED]->(production1),
(production1)-[:PRODUCTION_OF]->(juliusCaesar),
(performance1:Performance {date:20120729}),
(performance1)-[:PERFORMANCE_OF]->(production1),
(production2:Production {name:’The Tempest’}),
(rsc)-[:PRODUCED]->(production2),
(production2)-[:PRODUCTION_OF]->(theTempest),
(performance2:Performance {date:20061121}),
(performance2)-[:PERFORMANCE_OF]->(production2),
(performance3:Performance {date:20120730}),
(performance3)-[:PERFORMANCE_OF]->(production1),
(billy:User {name:’Billy’}),
(review:Review {rating:5, review:’This was awesome!’}),
(billy)-[:WROTE_REVIEW]->(review),
(review)-[:RATED]->(performance1),
(theatreRoyal:Venue {name:’Theatre Royal’}),
(performance1)-[:VENUE]->(theatreRoyal),
(performance2)-[:VENUE]->(theatreRoyal),
(performance3)-[:VENUE]->(theatreRoyal),
(greyStreet:Street {name:’Grey Street’}),
(theatreRoyal)-[:STREET]->(greyStreet),
(newcastle:City {name:’Newcastle’}),
(greyStreet)-[:CITY]->(newcastle),
(tyneAndWear:County {name:’Tyne and Wear’}),
(newcastle)-[:COUNTY]->(tyneAndWear),
(england:Country {name:’England’}),
(tyneAndWear)-[:COUNTRY]->(england),
(stratford:City {name:’Stratford upon Avon’}),
(stratford)-[:COUNTRY]->(england),
(rsc)-[:BASED_IN]->(stratford),
(shakespeare)-[:BORN_IN]->stratford
neo4j入门教程
1.进入官网下载http://neo4j.com/developer/get-started/
2.下完后点击安装就可以了
3.开启软件
4.点击链接进入
5.进入后就可以看到如下界面
6.在界面的顶部就是neo4j的查询语言的编辑窗口,在这里你可以编辑你的代码,当然用的是cypher语言,这里简单写个例子:
7.代码如下
CREATE (shakespeare:Author {firstname:’William’, lastname:’Shakespeare’}),
(juliusCaesar:Play {title:’Julius Caesar’}),
(shakespeare)-[:WROTE_PLAY {year:1599}]->(juliusCaesar),
(theTempest:Play {title:’The Tempest’}),
(shakespeare)-[:WROTE_PLAY {year:1610}]->(theTempest),
(rsc:Company {name:’RSC’}),
(production1:Production {name:’Julius Caesar’}),
(rsc)-[:PRODUCED]->(production1),
(production1)-[:PRODUCTION_OF]->(juliusCaesar),
(performance1:Performance {date:20120729}),
(performance1)-[:PERFORMANCE_OF]->(production1),
(production2:Production {name:’The Tempest’}),
(rsc)-[:PRODUCED]->(production2),
(production2)-[:PRODUCTION_OF]->(theTempest),
(performance2:Performance {date:20061121}),
(performance2)-[:PERFORMANCE_OF]->(production2),
(performance3:Performance {date:20120730}),
(performance3)-[:PERFORMANCE_OF]->(production1),
(billy:User {name:’Billy’}),
(review:Review {rating:5, review:’This was awesome!’}),
(billy)-[:WROTE_REVIEW]->(review),
(review)-[:RATED]->(performance1),
(theatreRoyal:Venue {name:’Theatre Royal’}),
(performance1)-[:VENUE]->(theatreRoyal),
(performance2)-[:VENUE]->(theatreRoyal),
(performance3)-[:VENUE]->(theatreRoyal),
(greyStreet:Street {name:’Grey Street’}),
(theatreRoyal)-[:STREET]->(greyStreet),
(newcastle:City {name:’Newcastle’}),
(greyStreet)-[:CITY]->(newcastle),
(tyneAndWear:County {name:’Tyne and Wear’}),
(newcastle)-[:COUNTY]->(tyneAndWear),
(england:Country {name:’England’}),
(tyneAndWear)-[:COUNTRY]->(england),
(stratford:City {name:’Stratford upon Avon’}),
(stratford)-[:COUNTRY]->(england),
(rsc)-[:BASED_IN]->(stratford),
(shakespeare)-[:BORN_IN]->stratford