Can't proceed with 04_Predictions.ipynb - Data Science with Neo4j

I did follow the training well up to this step in the google jupyter notebook:
train_missing_links ="""
MATCH (author:Author)
WHERE (author)-[:CO_AUTHOR_EARLY]-()
MATCH (author)-[:CO_AUTHOR_EARLY*2..3]-(other)
WHERE not((author)-[:CO_AUTHOR_EARLY]-(other))
RETURN id(author) AS node1, id(other) AS node2, 0 AS label

Here it took forever not finished, so I tried it on the sandbox browser but it returned WebSocket fail after long time.

I changed it like this and could get the result within a minute:
MATCH (author:Author)
WHERE (author)-[:CO_AUTHOR_EARLY]-()
MATCH p = (author)-[:CO_AUTHOR_EARLY*2..3]-(other)
WHERE not((author)-[:CO_AUTHOR_EARLY]-(other))
return count(p)

Would you help me to run the original code to proceed the training?

Hello @gigauser,

From what you are describing, something in the graph went wrong, leading to a transaction that did not complete.

My suggestion is to create a new sandbox/jupyter environment and skip to that exercise.

Please keep in mind that this course uses the older Graph Algorithms Library that is supported with Neo4j 3.5. I strongly recommend that you take this newly-published course which is an update to this course for Neo4j 4.0 and uses the new Graph Data Science Library:

Using a Machine Learning Workflow for Link Prediction:


Thank you for giving the tips. I tried several times but it didn't work but only the modified to get its aggregation like count(p) worked.
Now I gave it up and start the new training with Neo4j 4.0.