I am trying to pass on the parameter to the cypher query in a function but it is not returning the results as expected. First error was ClientError: {code: Neo.ClientError.Statement.ParameterMissing} {message: Expected parameter(s): x}
I checked it on another forum where I also had to pass the parameter along with query run session I did so and error disappeared but still it didn't get the results as expected and returned the empty nodes.
In the graph db the nodes are connected with 4 types of relationships with an ids.
This is what I have tried so far:
def get_objects(x):
query = ''' MATCH (p)-[r]->(a) where r.id = $x RETURN p.id; '''
resultNodes = session.run(query, x = x)
df = DataFrame(resultNodes)
print(df)
return df
def find_max_1():
authors,terms,venues,papers=0,0,0,0
authors=get_objects(1).max()
terms=get_objects(2).max()
venues=get_objects(3).max()
papers=get_objects(4).max()
return authors,terms,venues,papers
def main():
m = m=find_max_1()
if __name__ == "__main__":
main()
and the output is:
Empty DataFrame
Columns: []
Index: []
Empty DataFrame
Columns: []
Index: []
Empty DataFrame
Columns: []
Index: []
Empty DataFrame
Columns: []
Index: []
I also checked giving the absolute value as ''' MATCH (p)-[r]->(a) where r.id = '1' RETURN p.id '''
into the function, it worked fine but there is a problem when i pass it through the function?
Any kind of help in right direction would be appreciated.
Thanks in advance.