Setup and Cypher Refresher

To complete this course we will make use of the following tools:

Neo4j Sandbox

Neo4j Sandbox

Neo4j Sandbox is a hosted Neo4j tool that allows you to run private instances of Neo4j without having to install Neo4j locally. You can choose Neo4j Sandbox usecases that come pre-loaded with datasets and your Neo4j Sandbox instances can be accessed over the internet, making them useful for building sample applications. While Neo4j Browser is the primary way to interact with Neo4j instances hosted by Neo4j Sandbox, for this course you will also connect your sandbox instance to a simple web application.

Neo4j Browser Guides

Neo4j Browser Guide

Neo4j Browser Guides are documents that embed text, images, and Cypher queries inside Neo4j Browser in a carousel-like series of slides. We use Neo4j Browser Guides to show how to use graph algorithms in Cypher and Neo4j. Each module will have a browser guide to help "guide" you through the content.

You can access the guides for this course by running this command in Neo4j Browser. This command is already set up for you in the Yelp Sandbox you will be using for this course.

:play applied_graph_algorithms

The Neo4j Graph Algorithms Plugin

Neo4j Graph Algorithms plugin

The focus of this course is on using the graph algorithms available in the Neo4j Graph Algorithms Plugin. The plugin implements four types of graph algorithms: Path Finding, Centrality, Community Detection, Similarity. The first three are classic graph algorithms and the fourth can be used on its own or in combination with the other three.

This plugin is available in the Yelp Sandbox you use for this course, so you need not install it.

CodeSandbox React Application


Since this an applied course, we want to see how to enhance features of an actual application. You will use an existing React application for this part of the course. CodeSandbox is a hosted environment that allows you to edit, run, and preview JavaScript applications, all in the browser.

This CodeSandbox contains all the client code for the application that you will build. You will want to have CodeSandbox open in another tab as you work through the application for each module of this course.

The Yelp Public Dataset

Yelp helps people find local businesses based on reviews, preferences, and recommendations. Over 163 million reviews have been written on the platform as of the middle of 2018. Yelp has been running the Yelp Dataset challenge 2 since 2013, a competition that encourages people to explore and research Yelp’s open dataset.

As of Round 12 of the challenge, the open dataset contained:

  • Over 7 million reviews plus tips.

  • Over 1.5 million users and 280,000 pictures.

  • Over 188,000 businesses with 1.4 million attributes.

  • 10 metropolitan areas.

The Yelp dataset represents real data that is very well structured and highly interconnected. It’s a great showcase for graph algorithms that you can also download and explore. You will use a Neo4j Sandbox already loaded with this data.

Building a business reviews application

You will build your own version of using this data. You will use graph algorithms to improve the quality of results in the application.

The rest of the course will follow this structure:

  • Introduction to an algorithm.

  • Learn how to execute the algorithm using Cypher in Neo4j Browser.

  • Use the Cypher and updated graph to improve the application in Code Sandbox.


Your exercise for this module is to get all the tools up and running and talking to each other.

Before creating a Yelp Neo4j Sandbox instance, you need to read and agree to the Yelp Dataset License.

  1. Create a Yelp Neo4j Sandbox instance. Note: You must log in to the Neo4j Sandbox site. This may require you to register with Neo4j.

  2. In Yelp Sandbox you just created, click the Open Neo4j Browser button to open a Neo4j Browser for the Yelp database. You will be using this Neo4j Browser window throughout this course.

  3. In Neo4j Browser, complete the steps in the first Neo4j Browser Guide (:play applied_graph_algorithms), Cypher Refresher.

  4. Open the React application in CodeSandbox. This is the initial version of our business reviews application. You will be using this Code Sandbox window throughout this course.

  5. In CodeSandbox:

    1. Sign in to CodeSandbox with your github credentials.

    2. Click Fork.

    3. Edit the .env file by replacing the default environment variables with the credentials for your Yelp Neo4j Sandbox. The URL and credentials are available to you from your Yelp sandbox pane if you open the details of the pane by selecting arrow to the right of the Open Neo4j Browser button.

      1. Replace the value for REACT_APP_NEO4J_URI with the value of Websocket Bolt URL from the Connection Details tab of the Yelp Sandbox.

      2. Replace the value for REACT_APP_NEO4J_PASSWORD with the Password in the Connection Details tab of the Yelp Sandbox.

    4. Save this file.

    5. Click the refresh icon to connect the CodeSandbox Browser (on the right) to the database.

    6. Confirm that you can now view data in the database by selecting a name in the drop down (initially selected with Dolores). Data should be retrieved for each user.

Useful Resources

If you get stuck, watch this video to see how it all fits together.

The creation of the Yelp Sandbox has changed and you should use the link provided above for creating the Yelp Sandbox, as well as using the Connection Details information for the sandbox.

Overview of the application and connecting it to your Neo4j Sandbox instance

Check your understanding

Question 1

Verify your CodeSandbox React application is connected to Neo4j Sandbox

Which of the following users appear in the User Profile dropdown?

Select the correct answers.

  • Bob Loblaw

  • William

  • Dolores

  • PrincessCandyEmpire

Question 2

Cypher refresher

Using the Neo4j Browser for your Yelp Neo4j Sandbox instance write a Cypher query to find all the businesses connected to the Category "Breweries". How many breweries are there in the dataset?

Select the correct answer.

  • 10

  • 38

  • 1142

  • 27455


You should now have:

  • Created a Yelp Neo4j Sandbox instance.

  • Opened a Neo4j Browser for the Yelp database.

  • Completed the Cypher Refresher section in the Neo4j Browser Guide.

  • Opened the businesses reviews application in CodeSandbox.

  • Connected your React CodeSandbox application to your Neo4j Sandbox instance.