The Inherent Power of Knowledge Graphs

Paulo Cysne
7 min readMar 18, 2024

In this article I cover the following:

  • What Knowledge Graphs are
  • The difference between synthetic and ontology driven Knowledge Graphs
  • Impactful use cases of Knowledge Graphs
  • Python libraries for knowledge graphs
  • The 10 best books to learn Knowledge Graphs
  1. What are Knowledge Graphs?

A knowledge graph is like a big map of ideas and information. It connects things together, showing how they’re related.

Knowledge graphs capture not just individual pieces of information, but also the relationships and structure between them. It goes beyond just data. It adds meaning and context by explaining the relationships and importance of different entities.

They go beyond just data. They represent knowledge in a structured way, capturing the meaning and relationships between concepts. This structure is what makes them more powerful and versatile.

They bring many benefits for Data Scientists:

Makes data understandable
Data scientists often work with messy data. Knowledge graphs help organize and connect data points, making it easier to see patterns and relationships.

Answers complex questions
Imagine asking a question about different data points and getting a clear answer that considers how they’re connected. Knowledge graphs can do that!

Improves predictions
By understanding relationships, data scientists can build better models that predict future outcomes more accurately.

Speeds discoveries
No more searching through mountains of data. Knowledge graphs can help data scientists find relevant information quickly.

2. Synthetic vs. Ontology Driven Knowledge Graphs

Synthetic data

They are artificially generated data that mimics real-world data. It can be useful for training machine learning models or filling in gaps in datasets. However, synthetic data often lacks the richness and complexity of real-world data.

This kind of data focuses on creating data that resembles real data, but it doesn’t necessarily capture the underlying meaning or relationships between things.

Ontology-driven knowledge graphs

They are a way of representing knowledge using a formal structure. Ontologies define the relationships between concepts and entities in a specific domain. This allows for more robust and interpretable knowledge representation compared to synthetic data.

Ontology-driven knowledge graphs provide a deeper understanding and richer information compared to simply having synthetic data.

Frameworks used to build knowledge graphs

BFOs (Basic Formal Ontology), common core ontologies, and upper/lower bound ontologies are all examples of frameworks used to build knowledge graphs. They provide standardized vocabularies and relationships between concepts, making knowledge graphs more reliable and interoperable.

3. Some Impactful Use Cases of Knowledge Graphs

Healthcare and Life Sciences

Drug Discovery
Knowledge graphs can connect information on genes, proteins, diseases, and existing drugs. This allows researchers to identify potential drug targets, explore mechanisms of action, and repurpose existing drugs for new uses.

Clinical Decision Support
Ontology-driven knowledge graphs can be used to build intelligent systems that assist doctors in making diagnoses and treatment decisions. By integrating patient data with medical ontologies, these systems can suggest relevant treatments, highlight potential drug interactions, and personalize care plans.

Finance and Risk Management

Fraud Detection
Knowledge graphs can analyze financial transactions, customer data, and external information to identify patterns indicative of fraudulent behavior. By analyzing the connections and patterns within the data, it becomes easier to spot anomalies. This allows institutions to detect and prevent fraud more effectively.
Knowledge graphs can also be used to detect cross-channel frauds, where fraudulent activities span across multiple transaction channels. They also enable real-time or near real-time detection of potential fraud, which is crucial for preventing financial losses.

Regulatory Compliance
Firms can leverage knowledge graphs to map regulations to relevant data points, ensuring compliance with complex financial regulations. This can automate compliance checks and reduce the risk of financial penalties.

Knowledge Management and Search

Enterprise Search
Organizations can utilize knowledge graphs to create intelligent search engines that understand the relationships between internal documents, data sources, and people. This allows employees to find relevant information more quickly and efficiently.

Customer Support
Chatbots and virtual assistants can leverage knowledge graphs to answer customer questions more comprehensively. By understanding the relationships between products, services, and troubleshooting steps, these systems can provide more accurate and personalized support.

4. Python Libraries for Knowledge Graphs

Several Python libraries cater to different aspects of Knowledge Graphs. Here’s a breakdown of some popular options:

Core Libraries

RDFLib
This is a fundamental library for working with RDF (Resource Description Framework), a core standard for representing knowledge graphs. It allows you to load, parse, manipulate, and query RDF data and ontologies.

AmpliGraph
It is designed for tasks like knowledge graph completion and link-based categorization. It’s the first open-source toolkit aimed at democratizing graph representation learning.

kglab
It provides a simple abstraction layer for building knowledge graphs, integrating with popular Python libraries such as Pandas, NetworkX, and RDFLib.

Ontology Development and Management

fastobo-py
This library provides Python bindings for the fastobo library, which efficiently parses OBO (Open Biomedical Ontologies) format 1.4. OBO is a popular format for representing biomedical ontologies.

FunOWL
This library offers a functional syntax for working with OWL (Web Ontology Language) in Python. OWL allows for more complex ontology definitions compared to OBO.

LinkML
This library focuses on Linked Open Data Modeling Language, which promotes interoperability between knowledge graphs. It helps ensure your ontology can connect with others.

Querying and Reasoning

SPARQL
While not a Python library itself, SPARQL is a query language specifically designed for RDF data. Libraries like RDFLib often integrate SPARQL functionalities for querying your knowledge graph.

Additional Tools

PyKEEN (Python Knowledge Embeddings)
This library goes beyond basic knowledge graph creation. It helps build and evaluate knowledge graph embedding models, which can be useful for tasks like entity linking or recommendation systems.

Pykg2vec
Similar to PyKEEN, this library focuses on knowledge graph embedding algorithms, allowing for fast testing and model building.

Choosing the right library

It depends on your specific needs:

  • For basic ontology parsing and manipulation: RDFLib
  • For working with OBO ontologies: fastobo-py
  • For building complex OWL ontologies: FunOWL
  • For interoperable knowledge graphs: LinkML
  • For querying your knowledge graph: SPARQL (integrated with RDFLib)
  • For knowledge graph embedding models: PyKEEN, Pykg2vec

5. The 10 Best Books To Learn Knowledge Graphs

5.1) Building Knowledge Graphs
by Jesus Barrasa and Jim Webber

A recent, outstanding book

5.2) Knowledge Graphs: Fundamentals, Techniques, and Applications
by Mayank Kejriwal, Craig A. Knoblock, Pedro Szekely

A remarkable book in the area.

5.3) Knowledge Graphs: Methodology, Tools and Selected Use Cases 1st ed. 2020 Edition
by Dieter Fensel (Author), Umutcan Şimşek (Author), & 7 more

A concise and insightful book

5.4) The Practitioner’s Guide to Graph Data: Applying Graph Thinking and Graph Technologies to Solve Complex Problems 1st Edition
by Denise Gosnell Ph.D., Matthias Broecheler Ph.D.

A very useful, brilliant book in the area

5.5) Introduction to Graph Theory (Dover Books on Mathematics) 2nd Edition
by Richard J. Trudeau (Author)

A classic, fundamental book

5.6) The Knowledge Graph Cookbook
by Andreas Blumauer , Helmut Nagy

Easy to understand and insightful

5.7) Designing and Building Enterprise Knowledge Graphs, 1st Edition
by Juan Sequeda, Ora Lassila

A superb introduction to the area

5.8) Graph Algorithms: Practical Examples in Apache Spark and Neo4j 1st Edition
by Mark Needham, Amy Hodler

Another fundamental, outstanding book

5.9) Graph Theory with Applications to Engineering and Computer Science
by Narsingh Deo

An outstanding introductory treatment of graph theory and its applications The first nine chapters constitute an excellent overall introduction, requiring only some knowledge of set theory and matrix algebra.

5.10) Graph Analysis and Visualization: Discovering Business Opportunity in Linked Data 1st Edition
by Richard Brath, David Jonker

A unique, enjoyable book with many insights

"It brings graph theory out of the lab and into the real world. Using sophisticated methods and tools that span analysis functions, this guide shows you how to exploit graph and network analytic techniques to enable the discovery of new business insights and opportunities. Published in full color, the book describes the process of creating powerful visualizations using a rich and engaging set of examples."

Support My Work: The links provided are Amazon affiliate links. By using these links for your purchases, you’re supporting my work at no extra cost to you. It’s a simple way to show your appreciation and help me continue bringing you great content. Thank you for your support!

--

--