如何在 Neo4j 中将参数传递给 gds.create.graph?例如,这个查询有什么问题?(我使用py2neo)
query = """
CALL gds.graph.create.cypher(
'betweenness',
'MATCH (n) WHERE n:Criminal AND id(n) in $nodes_in_component
RETURN id(n) AS id, labels(n) AS labels',
'MATCH (m:Crime)<-[r:INVOLVED_IN]-(n:Criminal)
WHERE id(m) in $nodes_in_component
RETURN id(m) AS source, id(n) AS target, type(r) AS type',
parameters:{nodes_in_component: nodes_in_component}
)
YIELD graphName, nodeCount, relationshipCount, createMillis
"""
graph.run(query, parameters= {"nodes_in_component":nodes_in_component}).data()