Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Graph Data Modeling in Python
Graph Data Modeling in Python

Graph Data Modeling in Python: A practical guide to curating, analyzing, and modeling data with graphs

Arrow left icon
Profile Icon Gary Hutson Profile Icon Matt Jackson
Arrow right icon
€23.99 €26.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8 (6 Ratings)
eBook Jun 2023 236 pages 1st Edition
eBook
€23.99 €26.99
Paperback
€33.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Gary Hutson Profile Icon Matt Jackson
Arrow right icon
€23.99 €26.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8 (6 Ratings)
eBook Jun 2023 236 pages 1st Edition
eBook
€23.99 €26.99
Paperback
€33.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€23.99 €26.99
Paperback
€33.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Graph Data Modeling in Python

Introducing Graphs in the Real World

Social network analysis, fraud detection, modeling the stability of systems (for example, rail and energy grids), and recommendation systems all rely on graphs as the lynchpin underpinning these types of networks. In each of these examples, the relationships between individual people, bank accounts, or other single units are fundamental to describe and model the data. As opposed to traditional data models, a graph is a perfect way to represent groups of interacting elements.

This chapter will serve as an introduction to why graphs are important and introduce you to the fundamentals of what makes up a graph network. Moreover, we will look at how to transition from traditional data storage strategies, such as relational databases (RDBs), to how you can use this knowledge to work with graph databases (GDBs). Throughout this book, we will be working with a popular graph database, namely Neo4j. This will be followed by an explanation of how graphs are utilized in the real world and then a gentle introduction to working with the main package workhorses, known as igraph and NetworkX, which are the best and most stable graph packages for graph data analysis and modeling.

In this chapter, we’re going to cover the following topics:

  • Why should you use graphs?
  • The fundamentals of nodes and edges and the properties of a graph
  • Comparing RDBs and GDBs
  • The use of graphs across various industries
  • Introduction to NetworkX and igraph

Technical requirements

We will be using the Jupyter Notebook to run our coding exercises. For this, you will require python>=3.8.0, along with the following packages, which will need to be installed in your environment with the pip install command:

  • networkx==2.8.8
  • igraph==0.9.8

All notebooks, along with the coding exercises, are available at the following GitHub link: https://github.com/PacktPublishing/Graph-Data-Modeling-in-Python/tree/main/CH01.

Why should you use graphs?

In modern, data-driven solutions and enterprises, graph data structures are becoming more and more common. This is because, in our modern, data-driven world, relationships between things are becoming as, if not more important, than the things themselves. In modern industries and enterprises, graphs are starting to become more common and powerful in understanding the relationships between entities. I would say that these relationships and how they are connected have become more important than the entities themselves. We will demonstrate examples of real-life graphs in our use cases in the following chapters with detailed instructions on how to build these networks and the core considerations you need to make for the graph design.

Graphs are fundamental to many systems we use every day. Each time you are online and receive a product recommendation, it is likely that a graph solution is powering this recommendation. This is why learning how to work with graph data and leveraging these types of networks is a fast-growing and key skill in data science.

Composite components of a graph

Networks are a tool to represent complex systems and the complex nature of the connections arising in today’s data. We have already referenced how graphs are powering some of the big powerhouse recommendation systems in action today.

Graph methods tend to fall into four different areas:

  • Movement: Movement is concerned with how things travel (move) through a network. These types of graphs are the drivers behind routing and GPS solutions and are utilized by the biggest players in finding the optimal path across a road network.
  • Influence: On social media, this area specifies who the known influencers are and how they propagate this influence across a network.
  • Groups and interactions: This area involves identifying groups and how actors in the network interact with each other. We will look at an example of how to apply community detection methods to find these communities through the node (the actor involved) and its connections (the edges). Don’t worry if you don’t know what these terms are for now; we will focus on these in the Fundamentals of nodes, edges, and the properties of a graph section.
  • Pattern detection: Pattern detection involves using a graph to find similarities in the network that can be explored. We must look at this from the actor’s (node’s) point of view and find similarities between that actor and other actors in the network. Here, actor is taken to mean person, author profile, and so on.

In this section, we have explained the core components of a graph by providing simple working definitions. In the following section, we will delve deeper into these fundamental elements, which make up every graph you will come across in the industry. We will look at nodes, edges, and the various properties of a graph.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Transform relational data models into graph data model while learning key applications along the way
  • Discover common challenges in graph modeling and analysis, and learn how to overcome them
  • Practice real-world use cases of community detection, knowledge graph, and recommendation network

Description

Graphs have become increasingly integral to powering the products and services we use in our daily lives, driving social media, online shopping recommendations, and even fraud detection. With this book, you’ll see how a good graph data model can help enhance efficiency and unlock hidden insights through complex network analysis. Graph Data Modeling in Python will guide you through designing, implementing, and harnessing a variety of graph data models using the popular open source Python libraries NetworkX and igraph. Following practical use cases and examples, you’ll find out how to design optimal graph models capable of supporting a wide range of queries and features. Moreover, you’ll seamlessly transition from traditional relational databases and tabular data to the dynamic world of graph data structures that allow powerful, path-based analyses. As well as learning how to manage a persistent graph database using Neo4j, you’ll also get to grips with adapting your network model to evolving data requirements. By the end of this book, you’ll be able to transform tabular data into powerful graph data models. In essence, you’ll build your knowledge from beginner to advanced-level practitioner in no time.

Who is this book for?

If you are a data analyst or database developer interested in learning graph databases and how to curate and extract data from them, this is the book for you. It is also beneficial for data scientists and Python developers looking to get started with graph data modeling. Although knowledge of Python is assumed, no prior experience in graph data modeling theory and techniques is required.

What you will learn

  • Design graph data models and master schema design best practices
  • Work with the NetworkX and igraph frameworks in Python Store, query, ingest, and refactor graph data
  • Store your graphs in memory with Neo4j
  • Build and work with projections and put them into practice
  • Refactor schemas and learn tactics for managing an evolved graph data model

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 30, 2023
Length: 236 pages
Edition : 1st
Language : English
ISBN-13 : 9781804619346
Category :
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jun 30, 2023
Length: 236 pages
Edition : 1st
Language : English
ISBN-13 : 9781804619346
Category :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 101.97
Causal Inference and Discovery in Python
€29.99
Graph Data Modeling in Python
€33.99
Hands-On Graph Neural Networks Using Python
€37.99
Total 101.97 Stars icon

Table of Contents

15 Chapters
Part 1: Getting Started with Graph Data Modeling Chevron down icon Chevron up icon
Chapter 1: Introducing Graphs in the Real World Chevron down icon Chevron up icon
Chapter 2: Working with Graph Data Models Chevron down icon Chevron up icon
Part 2: Making the Graph Transition Chevron down icon Chevron up icon
Chapter 3: Data Model Transformation – Relational to Graph Databases Chevron down icon Chevron up icon
Chapter 4: Building a Knowledge Graph Chevron down icon Chevron up icon
Part 3: Storing and Productionizing Graphs Chevron down icon Chevron up icon
Chapter 5: Working with Graph Databases Chevron down icon Chevron up icon
Chapter 6: Pipeline Development Chevron down icon Chevron up icon
Chapter 7: Refactoring and Evolving Schemas Chevron down icon Chevron up icon
Part 4: Graphing Like a Pro Chevron down icon Chevron up icon
Chapter 8: Perfect Projections Chevron down icon Chevron up icon
Chapter 9: Common Errors and Debugging Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8
(6 Ratings)
5 star 83.3%
4 star 16.7%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Jacob Silva Mar 07, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book! It quickly teaches a beginner about graph data with easy-to-understand content, hands-on exercises, and provided source code. Then, it touches on advanced topics like projections on graph data. I am happy we picked this book for our Tech Book Club
Amazon Verified review Amazon
Amanda Fetch Sep 26, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As someone who is currently working with a knowledge graph based solution within an organization, it is imperative that I find solid resources to cover both the basics and more advanced concepts of graph data modeling. "Graph Data Modeling in Python" starts with the basics of graph structures and their real-world applications, then the book systematically covers practical use-cases from making recommendations using Python to designing complex pipelines with Neo4j and Cypher. Its in-depth coverage on transforming relational databases to graph databases, building knowledge graphs, and addressing common errors I found very useful. A perfect blend of theory and hands-on examples makes it an indispensable resource for anyone venturing into the world of graph databases. Highly recommended for both beginners and seasoned professionals!
Amazon Verified review Amazon
Jacob Vandergriff Sep 28, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Graph Data Modeling in Python provides a great introduction for those familiar with python and relational databases.The flow from relational databases, to python graph modeling, to scaling up to Neo4j databases was exceptional and can get any beginner to a graph developer.
Amazon Verified review Amazon
Om S Jul 05, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book begins by highlighting the growing importance of graphs in our daily lives, driving various applications such as social media, recommendation systems, and fraud detection. Readers are introduced to the benefits of graph data models, which enhance efficiency and uncover hidden insights through complex network analysis.With a focus on practical use cases, readers learn how to design optimal graph models capable of supporting a wide range of queries and features. The transition from traditional relational databases to dynamic graph data structures is seamlessly addressed, empowering readers to unlock the power of path-based analyses. The book also covers working with Neo4j for persistent graph database management.By the end of the book, readers will possess the skills to transform tabular data into powerful graph data models, ranging from beginner to advanced-level proficiency. They will have a deep understanding of schema design best practices, proficiency in NetworkX and igraph frameworks, and the ability to store, query, ingest, and refactor graph data."Graph Data Modeling in Python: A Practical Guide to Curating, Analyzing, and Modeling Data with Graphs" is a must-read for those interested in graph databases and data modeling. The book caters to individuals with prior knowledge of Python, while also being accessible to beginners in graph data modeling. Its practical approach, real-world examples, and coverage of common errors and debugging make it an essential companion for those looking to extract valuable insights from graph data.
Amazon Verified review Amazon
SEAN W. GRANT Aug 18, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This was a good book to read that helped in understanding how to build a graph from various sources (rdbms tables, NLP outputs). It showed how you can use some common python libraries (NLTK, Spacy) to process some data and create a graph from it. There were a couple chapters that I especially liked: Chapter 4 and 7.Chapter 4- Building Knowledge Graphs: Author does a great job of explaining what a knowledge graph is, how to design one and then walk through how to build one. Knowledge graphs are becoming a popular topic and structure that businesses are using to provide better understanding and this chapter will help you understand how you can start looking at your data to build a knowledge graph.Chapter 7-Refactoring and Evolving Schemas: I found this to be a great explanation of power of the graph database and how it can adjust fast to your needs without causing a problem with live data. The hands-on examples were great at showing how easy it is to change the schema in the Neo4j database.Overall this was a great book for getting your hands dirty on designing, understand and building graphs that will help you think about how connected data really is.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.