使用python将数据保存回neo4j

djmepvbi  于 2021-07-14  发布在  Spark
关注(0)|答案(0)|浏览(237)

我将pagerank数据保存回neo4j,但是发生了一个错误。
我的代码如下:

import org.neo4j.spark._ 
import org.apache.spark.graphx._
import org.apache.spark.graphx.lib._
val neo = Neo4j(sc)
val g = Neo4jGraph.loadGraph(sc, label1="node", relTypes=Seq("connect"),  label2="node")
val g2 = PageRank.run(g, numIter = 9)
val v = g2.vertices.take(9)
Neo4jGraph.saveGraph(sc, g2,"rank")

错误:org.neo4j.driver.exceptions.clientexception:不允许以读访问模式写入。试图写入内部图形0(neo4j)
注意:在最后一行代码之前,一切都运行良好。
这是 val v = g2.vertices.take(9) ```
v: Array[(org.apache.spark.graphx.VertexId, Double)] = Array((40,0.5279655760274328), (41,0.5279655760274328), (33,0.5279655760274328), (34,0.5279655760274328), (35,1.0028162618334502), (36,4.134772368123669), (37,0.6946179138782844), (38,0.5279655760274328), (39,0.5279655760274328))

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题