当前位置:网站首页>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】
- 相关组件安装以及其它参考资料请阅读原文
边栏推荐
- Blood cases caused by Lombok use
- Unity script introduction day01
- MySQL learning notes - data type (2)
- [book club issue 13] ffmpeg common methods for viewing media information and processing audio and video files
- Find numbers
- Can I "reverse" a Boolean value- Can I 'invert' a bool?
- @EnableAspectAutoJAutoProxy_ Exposeproxy property
- Scientific research cartoon | what else to do after connecting with the subjects?
- How can floating point numbers be compared with 0?
- A trap used by combinelatest and a debouncetime based solution
猜你喜欢

AI system content recommendation issue 24

PR FAQ: how to set PR vertical screen sequence?

Overview of convolutional neural network structure optimization

Vscode setting outline shortcut keys to improve efficiency

一图看懂ThreadLocal
![[hcie TAC] question 5 - 1](/img/e0/1b546de7628695ebed422ae57942e4.jpg)
[hcie TAC] question 5 - 1

Dry goods | fMRI standard reporting guidelines are fresh, come and increase your knowledge

对人胜率84%,DeepMind AI首次在西洋陆军棋中达到人类专家水平

Qt---error: ‘QObject‘ is an ambiguous base of ‘MyView‘
![[native JS] optimized text rotation effect](/img/50/3c09f223e821c14e7e9e0fb47622b6.jpg)
[native JS] optimized text rotation effect
随机推荐
Interface fonctionnelle, référence de méthode, Widget de tri de liste implémenté par lambda
Research Report on plastic recycling machine industry - market status analysis and development prospect forecast
Logstash ~ detailed explanation of logstash configuration (logstash.yml)
Web components series - detailed slides
Redis: SDS source code analysis
Vscode prompt Please install clang or check configuration 'clang executable‘
Stress, anxiety or depression? Correct diagnosis and retreatment
Actual combat | use composite material 3 in application
《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(2)-初识Fiddler让你理性认识一下
Hair and fuzz interceptor Industry Research Report - market status analysis and development prospect forecast
[book club issue 13] coding format of video files
Understand asp Net core - Authentication Based on jwtbearer
.Net 应用考虑x64生成
Proxifier global agent software, which provides cross platform port forwarding and agent functions
C language: implementation of daffodil number function
The vscode waveform curve prompts that the header file cannot be found (an error is reported if the header file exists)
TypeError: not enough arguments for format string
Anta is actually a technology company? These operations fool netizens
Book of night sky 53 "stone soup" of Apache open source community
Blood cases caused by Lombok use