Query a Neo4j Graph Database With Cypher

Lab Steps

Logging in to the Amazon Web Services Console
Connecting to the Neo4j Web Application
Querying the Graph Data

The hands-on lab is part of this learning path

Ready for the real environment experience?

Time Limit30m


Neo4j is becoming a standard for graph databases. With its simplicity and potential, you can start building reliable and useful databases. A key feature of Neo4j is the language used both as DDL and DML: Cypher. Cypher is a powerful language that uses clauses similar to SQL. Although, Neo4j is a NoSQL DBMS so Cypher doesn't work on structured data, as SQL does. When you need to query a graph database, you need to define the graph pattern first. A graph pattern is a graphical and logical way to identify the graph resources (nodes and edges) you want to query. You can think of a graph pattern as a subgraph of the whole graph you will query. Cypher uses an ASCII-Art syntax to represent the graph pattern. That's a very good approach because you can graphically think about what you need to query to create the Cypher query. In Cypher, nodes are referred with () and edges with []. One of the simplest graph patterns is the following: (:label_1)-[:type_1]->(:label2) which represents a relationship between two nodes (the first labelled with label_1 and the second labelled with label_2) through an arch whose type is type_1.

In this lab, you will use Cypher to query a Neo4j graph database.

Learning Objectives

Upon completion of this beginner level lab, you will be able to:

  • Understand how a graph pattern is structured
  • Perform graph queries using Cypher

Intended Audience

  • Data engineers who want to start using Neo4j as a graph database solution
  • Developers who want to start performing graph queries using Cypher


To get the most out of this lab, you should have basic knowledge of the concepts of graph databases and Neo4j. To achieve this, we suggest taking the following labs:

Environment before
Environment after
About the Author
Learning paths2

Stefano studies Computer Science and is passionate about technology. He loves working with Cloud services and learning all the best practices for them. Google Cloud Platform and Amazon Web Services are the cloud providers he prefers. He is a Google Cloud Certified Associate Cloud Engineer. Node.js is the programming language he always uses to code. When he's not involved in studying or working, Stefano loves riding his motorbike and exploring new places.

Covered Topics