当前位置:网站首页>ONgDB图数据库与Spark的集成
ONgDB图数据库与Spark的集成
2022-07-04 14:54:00 【马超的博客】
快速探索图数据与图计算
图计算是研究客观世界当中的任何事物和事物之间的关系,对其进行完整的刻划、计算和分析的一门技术。图计算依赖底于底层图数据模型,在图数据模型基础上计算分析Spark是一个非常流行且成熟稳定的计算引擎。下面文章从ONgDB与Spark的集成开始【使用TensorFlow等深度学习框架分析图数据的方案不在本文的讨论范围,仅从图数据库领域探讨与Spark的集成是一个比较流行的方案,可以做一些基础图数据的计算与预训练提交给TensorFlow】,介绍一下具体集成实施方案。下载案例项目源代码可以帮助新手快速开始探索,不必踩坑。大致流程是先在Spark集群集成图数据库插件,然后使用具体API构建图数据分析代码。
在Spark集群安装neo4j-spark插件
- 下载组件
https://github.com/ongdb-contrib/neo4j-spark-connector/releases/tag/2.4.1-M1
- 下载组件放在spark安装目录的jars文件夹
E:\software\ongdb-spark\spark-2.4.0-bin-hadoop2.7\jars
基础组件依赖信息
- 版本信息
Spark 2.4.0 http://archive.apache.org/dist/spark/spark-2.4.0/
ONgDB 3.5.x
Neo4j-Java-Driver 1.7.5
Scala 2.11
JDK 1.8
hadoop-2.7.7
https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/
neo4j-spark-connector-full-2.4.1-M1 https://github.com/neo4j-contrib/neo4j-spark-connector
- 下载的安装包
hadoop-2.7.7
spark-2.4.0-bin-hadoop2.7
winutils
neo4j-spark-connector-full-2.4.1-M1 【把jar包放到spark/jars文件夹里】
scala-2.11.12
创建测试数据
UNWIND range(1,100) as id
CREATE (p:Person {id:id}) WITH collect(p) as people
UNWIND people as p1
UNWIND range(1,10) as friend
WITH p1, people[(p1.id + friend) % size(people)] as p2
CREATE (p1)-[:KNOWS {years: abs(p2.id - p2.id)}]->(p2)
FOREACH (x in range(1,1000000) | CREATE (:Person {name:"name"+x, age: x%100}));
UNWIND range(1,1000000) as x
MATCH (n),(m) WHERE id(n) = x AND id(m)=toInt(rand()*1000000)
CREATE (n)-[:KNOWS]->(m);
备注
- 案例项目【为了避免踩坑下面这个Java-Scala混编案例项目可以参考一下】
https://github.com/ongdb-contrib/ongdb-spark-java-scala-example
下载依赖包如果出现问题请检查下面网址是否可以正常下载Spark相关的JAR包
http://dl.bintray.com/spark-packages/maven
- 案例项目截图【使用前在本地启动Spark】
- 相关组件安装以及其它参考资料请阅读原文
边栏推荐
- QT graphical view frame: element movement
- Market trend report, technical innovation and market forecast of taillight components in China
- 165 webmaster online toolbox website source code / hare online tool system v2.2.7 Chinese version
- What is torch NN?
- Statistical learning: logistic regression and cross entropy loss (pytoch Implementation)
- 《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(2)-初识Fiddler让你理性认识一下
- Rearrange array
- Salient map drawing based on OpenCV
- Overview of convolutional neural network structure optimization
- A trap used by combinelatest and a debouncetime based solution
猜你喜欢
@EnableAspectAutoJAutoProxy_ Exposeproxy property
~89 deformation translation
Principle and general steps of SQL injection
[North Asia data recovery] data recovery case of database data loss caused by HP DL380 server RAID disk failure
I let the database lock the table! Almost fired!
Communication mode based on stm32f1 single chip microcomputer
Vscode prompt Please install clang or check configuration 'clang executable‘
Stress, anxiety or depression? Correct diagnosis and retreatment
Neuf tendances et priorités du DPI en 2022
[native JS] optimized text rotation effect
随机推荐
[Chongqing Guangdong education] National Open University spring 2019 1396 pharmaceutical administration and regulations (version) reference questions
Unity script API - GameObject game object, object object
L1-072 scratch lottery
. Net delay queue
Understand Alibaba cloud's secret weapon "dragon architecture" in the article "science popularization talent"
Unity script API - component component
165 webmaster online toolbox website source code / hare online tool system v2.2.7 Chinese version
Market trend report, technical innovation and market forecast of taillight components in China
Model fusion -- stacking principle and Implementation
~89 deformation translation
What is torch NN?
JS to realize the countdown function
CMPSC311 Linear Device
The content of the source code crawled by the crawler is inconsistent with that in the developer mode
Review of Weibo hot search in 2021 and analysis of hot search in the beginning of the year
Research Report on market supply and demand and strategy of China's well completion equipment industry
[tutorial] yolov5_ DeepSort_ The whole process of pytoch target tracking and detection
TypeError: not enough arguments for format string
Interface test - knowledge points and common interview questions
std::shared_ ptr initialization: make_ shared< Foo> () vs shared_ ptr< T> (new Foo) [duplicate]