I used django_neomodel to connect the Neo4j graph database. The graph data in Neo4j database is above which is the relationships between genes.
This is my model for data.
class Genes(StructuredNode):
id = StringProperty()
name = StringProperty()
source = Relationship('Genes', 'Interaction')
target = Relationship('Genes', 'Interaction')
When I run len(Genes.nodes)
in python shell, it throws an error:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "G:\software\anaconda\envs\flybase\lib\site-packages\neomodel\util.py", line 344, in __get__
return self.getter(type)
File "G:\software\anaconda\envs\flybase\lib\site-packages\neomodel\core.py", line 266, in nodes
return NodeSet(cls)
File "G:\software\anaconda\envs\flybase\lib\site-packages\neomodel\match.py", line 581, in __init__
install_traversals(self.source_class, self)
File "G:\software\anaconda\envs\flybase\lib\site-packages\neomodel\match.py", line 172, in install_traversals
raise ValueError("Can't install traversal '{0}' exists on NodeSet".format(key))
ValueError: Can't install traversal 'source' exists on NodeSet
Anybody knows why?