In the previous section, we saw the important APIs exposed by py2neo along with examples for each of them. In this section, we will further use these APIs and see their practical implementations in real-world scenarios.
Let's recreate the social network data which we created using Cypher in Chapter 2, Querying the Graph with Cypher, using various APIs and methods exposed by py2neo.
First and foremost, we will clean up our database, so perform the following steps to do that:
OPTIONAL MATCH (n)-[r]-(n1) delete r,n.n1; MATCH n delete n;
Next we need to write some ...