Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-02-2019 09:17 AM
In the Cypher Refresher module for the Applied Graph Algorithm Training one of the first tutorial pages has the following:
We’ll start by seeing which cities have the most reviews:
MATCH (c:City) RETURN c.name, size((c)<-[:IN_CITY]-()) AS numberOfReviews ORDER BY numberOfReviews DESC LIMIT 10;
The Yelp Public dataset contains data from a sampling of cities, but we’ll contain our analysis to businesses in the Phoenix area.
Based on the schema, this looks to actually be returning the number of businesses in the returned cities, not the number of reviews. I believe the following would be a more appropriate Cypher query for counting the number of reviews by city:
MATCH (c:City)
RETURN c.name, size((c)<-[:IN_CITY]-(:Business)<-[:REVIEWS]-(:Review)) AS numberOfReviews
ORDER BY numberOfReviews DESC
LIMIT 10;
09-03-2019 06:10 AM
Hello Steve,
You are absolutely correct. Thank you for pointing this out.
We will correct the browser guide.
Elaine
All the sessions of the conference are now available online