hands-on lab

Query a Neo4j Graph Database With Cypher

Intermediate
Up to 40m
118
4.2/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.
Lab description

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

Prerequisites

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:

Updates

July 7th, 2022 - Fixed environment error

Environment before

Environment after

About the author
Students
40,576
Labs
106
Courses
2
Learning paths
10

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
Lab steps
Connecting to the Neo4j Web Application
Querying the Graph Data