# What are the differences between a knowledge base and a knowledge graph?

During my readings, I have seen many authors using the two terms interchangeably, i.e. as if they refer to the same thing. However, we all know about Google's first quotation of "knowledge graph" to refer to their new way of making use of their knowledge base. Afterward, other companies are claiming to use knowledge graphs.

What are the technical differences between the two? Concrete examples will be very useful to understand better the nuances.

Based on the related Wikipedia, a knowledge base (KB) is:

a technology used to store complex structured and unstructured information used by a computer system. The initial use of the term was in connection with expert systems which were the first knowledge-based systems.

As there are different representation model for a KB, we can find different terminology in different domains. For example, in some AI articles, it's called ontology.

Knowledeg graph (KG) is another object model to KB realization which is introduced by Google for its search engine (as you have mentioned). Hence, KG is a specification of KB. You can find more information in the paper Knowledge Graphs, such as more history about the KG or a formal definition of that:

knowledge graph is a graph of data intended to accumulate and convey knowledge of the real world, whose nodes represent entities of interest and whose edges represent relations between these entities.

Moreover, you can find some articles about contextual KG (CKG) in the paper Learning Contextual Embeddings for Knowledge Graph Completion and KG$$^2$$: Learning to Reason Science Exam Questions with Contextual Knowledge Graph Embeddings.

• I am not sure if an ontology is a synonym for KB. For example, read this article What’s the Difference Between an Ontology and a Knowledge Graph?, where the author says that a knowledge graph is an "instantiation" of an ontology. See also Ontologies and knowledge bases: towards a terminological clarification (1995) by Nicola Guarino et al. The term ontology has been defined differently in many cases. There's also this related blog post.
– nbro
Jun 11, 2020 at 14:08
• @nbro You're right. They are not a synonym. It's also a realization of a KB. However, the term "ontology" is mostly used in AI as a reference to a KB
– OmG
Jun 11, 2020 at 14:25
• I have to support OmG here. I have always seen the word 'ontology' used in AI. Whether that is 'correct' or not is a different question, sadly. Jan 28, 2021 at 21:25

### What is a knowledge graph?

Appendix A.3 "Knowledge Graphs": 2012 Onwards of the survey Knowledge Graphs (which is probably the most extensive survey on KGs) states that knowledge graphs have been defined in different ways in recent years. Each of these definitions raises questions about the relationship between KGs and other related concepts, like graph databases, knowledge bases, and ontologies.

One definition of a KG is

a graph where nodes represent entities, and edges represent relationships between those entities. Often a directed edge labelled graph is assumed (or analogously, a set of binary relations, or a set of triples)

The question here is: what's the difference between KGs and graph databases (like Neo4j)? Graph databases have been used to build KGs, but is there any actual difference between these 2 terms?

Another definition of a KG is

a knowledge graph is a graph-structured knowledge base

So, according to this definition, a KG would be a type of knowledge base (KB).

### What is a knowledge base?

In the same appendix, the authors write

The phrase "knowledge base" was popularised in the 70's (possibly earlier) in the context of rule-based expert systems [72], and later were used in the context of ontologies and other logical formalisms [68]

They conclude that a KB has also been defined in ambiguous ways in the past.

Norvig and Russell, in chapter 7 (p. 235) of their AIMA book (3rd edition), define a KB as a set of sentences/facts, for example, expressed in propositional logic. You then use inference techniques to derive new knowledge from this knowledge base. The programming language PROLOG is based on this definition of a KB.

### What is the difference between a KG and KB?

So, there is not a single answer to your question because knowledge graphs (KGs) and knowledge bases (KBs) have been defined in multiple (often ambiguous) ways in the past. Some people say that KGs are different from KBs, while other people use the term KG as a synonym for KB or define it as a type of KB.

However, if we define a KG as a graph with nodes that represent entities (like city and country) and edges that represent the relations between those entities (which is a common definition of a KG), we can view a KG as a visual representation of a KB, defined as a set of sentences/facts (for example, expressed in propositional logic). To see why this is the case, consider the following simple KG.

Let's denote this KG by $$K = \{E, R\}$$, where $$E = \{ \text{Santiago}, \text{Chile}, \text{Perú}\} = \{ S, C, P\}$$ is the set of entities (with a property) and $$R = \{ \text{capital}, \text{borders}\} = \{ c, b \}$$ is the set of relations. In $$K$$, we have the following relations

• Santiago is the capital of Chile: $$(S, c, C)$$
• Chile borders Perú: $$(C, b, P)$$
• Perú borders Chile: $$(P, b, C)$$

which can be put into a set of facts $$F = \{(S, c, C), (C, b, P), (P, b, C) \}$$, which is the KB associated with this specific KG.

In the context of KGs, we also have a task/problem similar to the inference (or knowledge reasoning) one in the context of KBs, which is known graph completion, which can be divided into other subtasks, like entity prediction, relation prediction and triple classification, which use knowledge graph embeddings.