DATA SCIENCE / PYTHON CODE SNIPPETS

From Dataframe to Knowledge Graph

Using networkx and matplotlib

Ednalyn C. De Dios
Data Science Nerd
Published in
3 min readSep 8, 2024

Photo by Gabrielle Meschini on Unsplash

I stumbled upon an article exploring the relationships in the Mahabharata using a knowledge graph, and it made me wonder if the same can be done with the Bible. I searched Kaggle for a suitable dataset, and once I found it, I began to embark on a journey into the world of knowledge graphs.

In this post, I will visualize and analyze the Bible characters’ relationships using networkx and matplotlib.

Let’s begin.

Introduction

A Knowledge Graph is a way of organizing information by connecting related things, like people, places, or ideas, in a web-like structure. It shows how different things are related, making finding, understanding, and using that information easier. The things or entities are called nodes, and the relationships between them are called edges. Below, the circles are the nodes, and the lines are the edges.

Jayarathina, CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0>, via Wikimedia Commons

A Knowledge Graph is a powerful tool for modeling, organizing, and reasoning about data, particularly when you need to capture the…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in Data Science Nerd

Home for data science slackers. A Medium publication sharing introductory concepts, cool projects, code snippets, and of course, pictures!

No responses yet