Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Getting Started with the Graph Query Language (GQL)
  • Table Of Contents Toc
Getting Started with the Graph Query Language (GQL)

Getting Started with the Graph Query Language (GQL)

By : Ricky Sun, Yuri Simione, Jason Zhang
close
close
Getting Started with the Graph Query Language (GQL)

Getting Started with the Graph Query Language (GQL)

By: Ricky Sun, Yuri Simione, Jason Zhang

Overview of this book

Graph Query Language is becoming the go-to standard for graph databases, especially with its support for interconnected analytics and GenAI capabilities. This book comes from a team of industry veterans who know exactly how to break down the fundamental GQL concepts, graph terms, definitions, catalog systems, and everything that matters in actual work. You’ll get to grips with graph data types, value expressions, graph matching patterns, and modifying statements through practical GQL examples. Once you've got the basics down, you’ll tackle advanced GQL topics such as path modes, complex path matching patterns, shortest path queries, composite statements, session and transaction commands, and procedures. You’ll also learn to create extensions and understand the design of graph databases to solve industry issues. The authors cover techniques like property graphs to help you optimize your graph queries and offer insights into the future of GQL and graph technology. By the end of this book, you’ll confidently query and update graph data, run graph algorithms, create visualizations, and apply your learnings to a real-world use case of money flow analysis for assessing bank client behaviors and detecting transaction risks. *Email sign-up and proof of purchase required
Table of Contents (17 chapters)
close
close
14
Glossary and Resources
15
Other Books You May Enjoy

Using OPTIONAL

GQL provides the OPTIONAL keyword to ensure the statements execute continuously even when no data is available to drive subsequent statements.

In general, OPTIONAL assigns a NULL value when the statement cannot produce any result.

OPTIONAL MATCH

The MATCH statement in GQL supports the OPTIONAL keyword.

For example, to retrieve nodes with some IDs from the graph shown in Figure 7.5, use the following:

GQL:
FOR id in ["a", "b", "z"]
OPTIONAL MATCH (n {_id: id})
RETURN n

The query returns the following:

  • a
  • b
  • NULL

Since the node z does not exist, the result corresponding to the ID z is NULL. If the query is executed without the OPTIONAL keyword, it will return only the matched results:

GQL:
FOR id in ["a", "b", "z"]
MATCH (n {_id: id})
RETURN n

This query returns the following:

  • a
  • b

Another example is to retrieve optional...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Getting Started with the Graph Query Language (GQL)
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon