Book Image

Hands-On Graph Analytics with Neo4j

By : Estelle Scifo
Book Image

Hands-On Graph Analytics with Neo4j

By: Estelle Scifo

Overview of this book

Neo4j is a graph database that includes plugins to run complex graph algorithms. The book starts with an introduction to the basics of graph analytics, the Cypher query language, and graph architecture components, and helps you to understand why enterprises have started to adopt graph analytics within their organizations. You’ll find out how to implement Neo4j algorithms and techniques and explore various graph analytics methods to reveal complex relationships in your data. You’ll be able to implement graph analytics catering to different domains such as fraud detection, graph-based search, recommendation systems, social networking, and data management. You’ll also learn how to store data in graph databases and extract valuable insights from it. As you become well-versed with the techniques, you’ll discover graph machine learning in order to address simple to complex challenges using Neo4j. You will also understand how to use graph data in a machine learning model in order to make predictions based on your data. Finally, you’ll get to grips with structuring a web application for production using Neo4j. By the end of this book, you’ll not only be able to harness the power of graphs to handle a broad range of problem areas, but you’ll also have learned how to use Neo4j efficiently to identify complex relationships in your data.
Table of Contents (18 chapters)
1
Section 1: Graph Modeling with Neo4j
5
Section 2: Graph Algorithms
10
Section 3: Machine Learning on Graphs
14
Section 4: Neo4j for Production

To get the most out of this book

You will need to have access to a Neo4j database that you can manage (that is, update settings and add plugins). The recommended way is to use Neo4j Desktop, which you can download from https://neo4j.com/download/.

You can create one graph per chapter. Only the "GitHub" graph we will start creating in chapter 2 and enrich in chapter 3 will be reused later in the book, but instructions will be given to recreate it in case you have not read the preceding chapters. You are also given a set of questions at the end of every chapter for self-learning.

All codes, except those in Chapter 5, Spatial Data and Chapter 11, Using Neo4j in Your Web Application, are compatible with both Neo4j 3.5 and Neo4j 4.x.

Regarding Chapter 5, since Neo4j Spatial is not yet compatible with Neo4j 4.x (the most recent version at the time of writing is 0.26.2), the code in this chapter is only valid for Neo4j 3.5. Similarly, for Chapter 11, we will rely on the neomodel package (last version at the time of writing is 3.3.2), not yet compatible with Neo4j 4.

Software/hardware covered in the book OS requirements
Neo4j ≥ 3.5 Windows, Linux, or macOS; a minimum of 8 GB of RAM
APOC (Neo4j plugin) ≥ 3.5.0.11 Windows, Linux, or macOS; a minimum of 8 GB of RAM
neo4j-spatial (plugin) Windows, Linux, or macOS; a minimum of 8 GB of RAM
Neo4j Graph Data Science plugin (GDS) ≥ 1.0 Windows, Linux, or macOS; a minimum of 8 GB of RAM
Python ≥ 3.6 Windows, Linux, or macOS; a minimum of 8 GB of RAM
Node.js ≥ v10 & npm
(Second part of chapter 11 only)
Windows, Linux, or macOS; a minimum of 8 GB of RAM

For the second part of Chapter 11, where we will create a React application with the GRANDstack, you will also need Node.js and npm installed on your system.

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the Support tab.
  3. Click on Code Downloads.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Hands-On-Graph-Analytics-with-Neo4j. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781839212611_ColorImages.pdf

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system."

A block of code is set as follows:

 submit = SubmitField('Submit')

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

password = StringField('Password', validators=[DataRequired()],
widget=PasswordInput(hide_value=False)
)

Any command-line input or output is written as follows:

python models.py

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Warnings or important notes appear like this.
Tips and tricks appear like this.