带有py2neo的Neo4j可视化:TypeError:'LabelSetView'对象不可调用

问题描述 投票:1回答:1

我正在尝试遵循以下示例

https://nicolewhite.github.io/neo4j-jupyter/hello-world.html

from scripts.vis import draw
import neo4jupyter

options = {"Person": "name", "Drink": "name", "Manufacturer": "name"}
draw(graph, options)

对于这部分代码,我遇到此错误:

ypeError                                 Traceback (most recent call last)
<ipython-input-7-6a87e5426fa3> in <module>
      3 
      4 options = {"Person": "name", "Drink": "name", "Manufacturer": "name"}
----> 5 draw(graph, options)

~\PycharmProjects\Knowledge_Graph\scripts\vis.py in draw(graph, options, physics, limit)
    104         target_id = row[4]
    105 
--> 106         source_info = get_vis_info(source_node, source_id)
    107 
    108         if source_info not in nodes:

~\PycharmProjects\Knowledge_Graph\scripts\vis.py in get_vis_info(node, id)
     91 
     92     def get_vis_info(node, id):
---> 93         node_label = list(node.labels())[0]
     94         prop_key = options.get(node_label)
     95         vis_label = node.properties.get(prop_key, "")

TypeError: 'LabelSetView' object is not callable

我在网上阅读到scripts.vis可能存在一些问题,但是我不太确定如何解决它

neo4j jupyter-notebook py2neo
1个回答
0
投票

请从下面的链接签出最新版本,它可以解决问题

https://github.com/merqurio/neo4jupyter/issues/5

© www.soinside.com 2019 - 2024. All rights reserved.