Hello,
I've been struggling for days to optimize the following request:
For the context, i have a graph that contains User nodes with some properties and relationships.
From python, i fetch these nodes and do some calculation with them and the result is the following data that i want to update neo4j with:
My data is as follow:
{'Labels': [{'date': '21/11/2018', 'rankings': [{'score': '0.00967110194468', 'lbl': '0', 'user': 'alpha'}, {'score': '0.00967110194468', 'lbl': '0', 'user': 'Betha'}], 'name'='dummy'},
{'date':...}]}
The following works on a small amount of Data so I tried to use apoc.periodic.iterate without success
query = "UNWIND $Labels as label"+\
" MERGE (c:Label {name: label.name})" +\
" ON CREATE SET c.date = label.date"+\
" WITH c, label"+\
" UNWIND label.rankings as ranking"+\
" MATCH (b:User) where b.name = ranking.user"+\
" MERGE (b)-[r:Has{score: ranking.score}]->(c)"
Even with a basic request as follow, I got nothing, no errors, nothing at all. it seems like it is running but i got 0 results.
query = "CALL apoc.periodic.iterate(UNWIND $Labels as label RETURN label, CREATE (:Test {name:label.name}), {batchSize:1000, iterateList:True, parallel:true})"
Can someone please help me? I'm new to neo4j.
I use neo4j 3.4.7 and the neo4j-driver for python.
Thanks in advance for your help.