Image courtesy — cayley.io

Knowledge Graph — Algorithmic implementation of a thought process?🧐 — Part I

Shaswat Lenka
4 min readMay 26, 2019

Knowledge graphs have been used for quite a while in the industry. Big players like Google and Microsoft use it for storing context-specific information and relations that are useful in improving search results. In this two-part series, I will explain a different perspective of knowledge graphs in part I. In part II, we will implement a Knowledge graph using Python and an open source graph database called Cayley. But first, let's begin describing what a Knowledge Graph is(hereafter we’ll abbreviate it by KG):

When you google, say, “where is infinite loop?”, how does Google know that you refer to a place and not the infinite loop in programming? With every word you type, you refer to a real-world object and having some information about the object and how people have referred to it in past becomes extremely important. So how exactly can we keep all the relevant information about a real-world entity and all its relationships to other events/entities? A graph! A graph with the nodes as an entity and the connections to other nodes as some sort of relationship it might have with it. In the above example, The entity “Apple Corporation” might be connected with “infinite loop” with the relation “headquarter” and the keyword “where” might be connected to the entity “place” with the relation “refers to” and place, in turn, might be connected with “Infinite Loop” with the relation “is”. So when we traverse the Graph, it might read out like — “where refers to a place which is Infinite Loop” and what information do we have about Infinite Loop? “Apple Corporation Headquarters!” So, this makes sense!

A KG is a graph in which all the entities are represented as nodes of the graph and their connection to other entities is established by a relationship. Just like :

In the above example, a relationship can also be established between me and my Grandfather as a ‘grandson’, and that’s the beauty of KGs.

I hope that by now you should have got a high-level idea of what a KG is. If not, here are some more resources:

  1. WTF is a Knowledge Graph
  2. Introducing the Knowledge Graph

Okay! Now that you have got a fair idea of what a KG is, let's see how can a KG help us build an intelligent thought process. Let's take an example:

You are a very efficient problem solver in Physics. You can get to the concept behind the problem before anyone else in your class. So, you must be thinking in a way others don’t, when they approach such a problem. So, how can I, who is a pathetic noob in Physics, mimic your thought process to get to the concept behind the problem? Can we use a KG instead?

So I sit beside you and asked you to loudly speak your thoughts while solving the problem. While you solve, I extracted the key entities from your thoughts and established relationships between them and the concepts required to solve the problem in a KG. I asked you to solve all the problems in a given chapter and then all the problem in the given book! Now my KG is complete! I have replicated all the keywords and connections that fire your neurons! Now my KG should be able to tell the concept used in all the problems in that book. But can it suggest a concept for another problem from another author? Maybe. Or, maybe not. As we encounter different words, sentences and keywords which is not present in our KG, it would get confused or unable to suggest an answer. If that is the case, we need to feed this new information to our knowledge graph until we exhaust all the possibilities of every entity and their relations. It's the same as a toddler trying to learn her mother tongue. But how can we as Data Scientists and AI enthusiasts use such a beautiful feature of KGs?

We’ll see that in Part — II of this topic when we actually build a KG for semi-supervised multi-class classification next week. Till then, keep learning!

📝 Read this story later in Journal.

👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. Read the Noteworthy in Tech newsletter.

--

--

Shaswat Lenka
Shaswat Lenka

Written by Shaswat Lenka

Software Engineer @GE👨🏻‍💻 | open-source advocate | CS Grad Student @Georgia Tech

No responses yet