Linux环境下部署Neo4J数据库
neo4j环境部署及使用
·
1、软件下载
官网:Neo4j Graph Database & Analytics | Graph Database Management System
中国官方代理网址:Neo4j,代理,销售,服务,咨询,图数据库,知识图谱,微云数聚,领英,LinkedIn - 微云数聚
软件下载地址:
ftp://neo4j.55555.io/neo4j-chs/
2、软件解压
将软件上传到Linux服务器上
cd /usr/local/soft/
tar -zxvf neo4j-community-3.5.8-unix-chs-3.0.0.tar.gz
3、环境变量配置
vi /etc/profile
文件中添加如下内容
export NEO4J_HOME=/usr/local/soft/neo4j-community-3.5.8-unix-chs-3.0.0
export PATH=$PATH:$NEO4J/bin
source /etc/profile
4、启动
cd /usr/local/soft/neo4j-community-3.5.8-unix-chs-3.0.0/bin/
后台启动:./neo4j start
前台启动:./neo4j console
查看状态:./neo4j status
停止:./neo4j stop
重启:./neo4j restart
5、验证
http://hadoop100:7474/browser/
编程
create (wcj:Person {name:"superjean",age:"30"})
match(wcj:Person) where wcj.name="superjean" return wcj
创建多个
MATCH (wcj:Person) WHERE wcj.name = "superjean"
CREATE
(liudi:Person { name: "刘迪", learn: "softengine" }),
(lgs:Person { name: "刘国诗", age: "20" }),
(lubin:Person { name: "鲁斌" }),
(fjj:Person { name: "樊嘉杰" ,favor:"王者"}),
(byp:Person { name: "包银萍" }),
(tww:Person { name: "田文伟" ,favor:"王者"}),
(zcw:Person { name: "张超伟",favor:"吃鸡" }),
(tgy:Person { name: "唐国云" }),
(wcj)-[:KNOWS {since: 2019}]->(liudi),
(wcj)-[:KNOWS {since: 2019}]->(lgs),
(wcj)-[:KNOWS {since: 2019}]->(lubin),
(wcj)-[:KNOWS {since: 2019}]->(fjj),
(wcj)-[:KNOWS {since: 2019}]->(byp),
(wcj)-[:KNOWS {since: 2019}]->(tww),
(wcj)-[:KNOWS {since: 2019}]->(zcw),
(wcj)-[:KNOWS {since: 2019}]->(tgy),
(lubin)-[:KNOWS]->(fjj),
(lubin)-[:KNOWS]->(byp),
(fjj)-[:KNOWS]->(lubin),
(fjj)-[:KNOWS]->(byp),
(byp)-[:KNOWS]->(lubin),
(byp)-[:KNOWS]->(fjj),
(tww)-[:KNOWS]->(zcw),
(zcw)-[:KNOWS]->(tww)
模式匹配
MATCH (wcj:Person)-[:KNOWS]-(students)
WHERE wcj.name = "superjean" RETURN wcj, students
推荐
MATCH (fjj:Person)-[:KNOWS]-()-[:KNOWS]-(friend)
WHERE fjj.name = "樊嘉杰" AND friend.favor = "王者"
RETURN DISTINCT friend
执行计划
EXPLAIN MATCH (fjj:Person)-[:KNOWS]-()-[:KNOWS]-(friend)
WHERE fjj.name = "樊嘉杰" AND friend.favor = "王者"
RETURN DISTINCT friend
更多推荐
已为社区贡献5条内容
所有评论(0)