You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am considering using neomodel to query a Neo4j database as cypher queries are no longer required. The neomodel documentation shows how to work on neomodel created node labels and fetch the associated attributes. For instance, people = Person.nodes.filter(age__gt=3). However, I have a different situation. I have a graph created with py2neo, however without a pre-defined nodes and relationships. I created nodes and relationships on the fly because I was not aware of all the node attributes in advance and the list kept growing.
Irrespective of these discrepancies, I assume that "class Person(StructuredNode)" is equivalent to the nodes I have in my graph. Assuming this, I want to able to retrieve node attributes just like the above example. My use case would be -> chem_info = Chemical.nodes.filter(Molecular Weight < 500) or retrieve the relationship where a certain protein is targeted by this chemical. How do I achieve this? How do I let neomodel know the available node labels from my graph?
I was able to connect to my database using neomodel and get couple of things done. See below:
from neomodel.scripts.neomodel_inspect_database import NodeInspector
This gives me a hint that things I want to do might be possible.
Please let me know or point me to the documentation where I can get counts of each labels or filter relationships based on user-defined constraints (of course without cypher queries).
Thanks in advance,
Reagon
The text was updated successfully, but these errors were encountered:
Hi there community,
I am considering using neomodel to query a Neo4j database as cypher queries are no longer required. The neomodel documentation shows how to work on neomodel created node labels and fetch the associated attributes. For instance, people = Person.nodes.filter(age__gt=3). However, I have a different situation. I have a graph created with py2neo, however without a pre-defined nodes and relationships. I created nodes and relationships on the fly because I was not aware of all the node attributes in advance and the list kept growing.
Irrespective of these discrepancies, I assume that "class Person(StructuredNode)" is equivalent to the nodes I have in my graph. Assuming this, I want to able to retrieve node attributes just like the above example. My use case would be -> chem_info = Chemical.nodes.filter(Molecular Weight < 500) or retrieve the relationship where a certain protein is targeted by this chemical. How do I achieve this? How do I let neomodel know the available node labels from my graph?
I was able to connect to my database using neomodel and get couple of things done. See below:
from neomodel.scripts.neomodel_inspect_database import NodeInspector
NodeInspector.get_properties_for_label('Protein')
Output:
{'Name': 'STRING',
'GO cellular component': 'STRING',
'GO biological process': 'STRING',
'GO molecular function': 'STRING',
'Uniprot': 'STRING',
'Sequence': 'STRING'}**
This gives me a hint that things I want to do might be possible.
Please let me know or point me to the documentation where I can get counts of each labels or filter relationships based on user-defined constraints (of course without cypher queries).
Thanks in advance,
Reagon
The text was updated successfully, but these errors were encountered: