在neo4j上使用RandomWalk
发布于 5 年前 作者 byn12345 4135 次浏览 来自 问答

环境:neo4j-community-3.3.7 ;win10 我将官方最新的包graph-algorithms-algo-3.5.0.1.jar放在了 “neo4j的安装路径”/plugins 的路径下, 并在 “neo4j的安装路径”/conf/neo4j.conf文件中添加了 dbms.security.procedures.unrestricted=algo.* 在执行CALL algo.randomWalk.stream()时,总会报错:“Procedure Not Found: There is no procedure with the name algo.randomWalk.stream registered for this database instance. Please ensure you’ve spelled the procedure name correctly and that the procedure is properly deployed.” 于是我通过执行以下代码,想实现对algo所包含函数的查看:

list = api_graph.run("CALL dbms.procedures() YIELD name, signature, description " "WHERE name starts with ‘algo’ " “RETURN name, signature, description”).data() for l in list: print(l)

发现打印结果里没有algo.randomWalk.stream这个函数,可是官方网站上给出的Neo4j Graph Algorithms version 3.5的教程中明明包含这个函数 我在github上下载了graph-algorithms-algo至今为止所有发行的版本,一一尝试过后发现没有一个包含algo.randomWalk.stream函数的。 我想在neo4j的图上进行随机游走,我该怎么办?

6 回复

“algo.randomWalk.stream” “algo.randomWalk.stream(start = null :: ANY?, steps = 10 :: INTEGER?, walks = 1 :: INTEGER?, config = {} :: MAP?) :: (startNodeId :: INTEGER?, nodeIds :: LIST? OF INTEGER?, path :: PATH?)” “CALL algo.randomWalk.stream(start:null=all/[ids]/label, steps, walks, {graph: ‘heavy/cypher’, nodeQuery:nodeLabel/query, relationshipQuery:relType/query, mode:random/node2vec, return:1.0, inOut:1.0, path:false/true concurrency:4, direction:‘BOTH’}) YIELD nodes, path - computes random walks from given starting points”

用的graph algorithms 3.4.8.0 image.png

是不是neo4j本身的版本低了?

@zhoujieren64 您好,我现在用的是neo4j-community-3.3.7,之前安装过最新的desktop版本,但是在create graph输入密码时会出现以下错误: Database failed to create: Error: Could not change password,所以我现在使用的是在浏览器上运行的。 我刚才尝试了一下使用graph algorithms 3.4.8.0 1.png 但是还是报了以下错误: 2.png

@zhoujieren64 请问您使用的是什么版本?我去尝试一下

@byn12345 无法改密码试试用管理员运行

卸载community-3.3.7 的服务,安装最新的neo4j-community-3.5.0,使用最新的graph-algorithms-algo-3.5.0.1.jar,解决了问题。果然是neo4j本身版本的问题,版本不够新,使用什么版本的graph algorithms居然都不行,感觉有点坑。非常感谢楼上的帮助!

回到顶部