Answers.Body: <p><strong>Knowledge graph embeddings (KGE)</strong> are embeddings created in the context of a <a href="https://ai.stackexchange.com/a/32666/2444"><strong>knowledge graph (KG)</strong></a>, which can be viewed as a visual/graphical representation of a knowledge base, where nodes are <strong>entities</strong> (e.g. &quot;a car&quot; or &quot;Lewis Hamilton&quot;) and edges are <strong>relations</strong> between those entities (e.g. &quot;drives&quot;), so a (directed) connection from &quot;Lewis Hamilton&quot; to &quot;a car&quot; through the edge &quot;drives&quot; would represent the fact &quot;Lewis Hamilton drives a car&quot;.</p>
  <p>A KGE is a vector representation of an entity or relation in the KG that, hopefully, preserves the <strong>semantics</strong> of the entities and relations. For example, we expect the embedding of the entity &quot;man&quot; to be closer to the embedding of the entity &quot;woman&quot; than to the embedding of a &quot;turtle&quot;. The idea of learning a lower-dimensional vector representation of objects that preserves some notion of semantics or meaning between those objects also appears in other AI subfields, like natural language processing (see e.g. <a href="https://arxiv.org/pdf/1301.3781.pdf" rel="nofollow noreferrer"><em>word embeddings</em></a>), or ML applied to software engineering (see <a href="https://arxiv.org/pdf/1803.09473.pdf" rel="nofollow noreferrer"><em>code embeddings</em></a>).</p>
  <p>A KGE can be useful because a KG is most likely incomplete, so one of the tasks that you need to solve when using a KG is determining whether a fact is true or false. So, if we denote the fact as a triple <span class="math-container">$f = \langle s, r, o \rangle$</span>, where <span class="math-container">$s$</span> stands for the subject, <span class="math-container">$r$</span> for the relation, and <span class="math-container">$o$</span> the object, then we want to determine whether this fact <span class="math-container">$f$</span> is true or false. In the context of KGEs, this is known as <strong>triple classification</strong>. Of course, in our KG, we don't have the fact <span class="math-container">$f$</span>, but maybe we have the entities <span class="math-container">$s$</span> and <span class="math-container">$o$</span> but there's no edge between them that is labeled with <span class="math-container">$r$</span>. So, given the embeddings of <span class="math-container">$s$</span>, <span class="math-container">$r$</span>, and <span class="math-container">$o$</span> (which was previously learned), we can then use a so-called <strong>score function</strong> to determine the likelihood of this fact. So, KGEs can be used to discover new &quot;likely&quot; knowledge, but it's a different approach than using deduction to derive new knowledge from a set of axioms or facts. It's an <strong>inductive/probabilistic approach</strong>, which has advantages (e.g. you don't need a deductive system) but also disadvantages (e.g. the fact may not actually be true even if our approach tells us that's the case).</p>
  <p>There are many similar/related ways to learn KGEs. Just to give you an idea of how these are learned, a simple approach (<strong>TransE</strong>) is as follows. You learn the vectors <span class="math-container">$s$</span>, <span class="math-container">$r$</span> and <span class="math-container">$o$</span> such that the constraint <span class="math-container">$s + r = o$</span> is satisfied. Of course, this constraint only makes sense if <span class="math-container">$o$</span> can only go with <span class="math-container">$s$</span> and <span class="math-container">$r$</span>, so this approach is not realistic, as it doesn't model e.g. many-to-many relations. For this reason, people have introduced other approaches (like <strong>RotatE</strong> or <strong>ConvE</strong>), which have advantages but also disadvantages. There are also other issues that arise when learning these embeddings, like generating synthetic negative/false facts (i.e. if you have a KG, you only have known true facts, so how do you know if a fact is false? You need examples of false facts!).</p>
  <p>The <a href="https://en.wikipedia.org/wiki/Knowledge_graph_embedding" rel="nofollow noreferrer">Wikipedia page on KGEs</a> is already quite comprehensive, but there are many other resources on the topic. For example, the survey <a href="https://persagen.com/files/misc/Wang2017Knowledge.pdf" rel="nofollow noreferrer">Knowledge Graph Embedding: A Survey of Approaches and Applications</a> (2017) or the (long but very useful) tutorial <a href="https://kge-tutorial-ecai2020.github.io/" rel="nofollow noreferrer">Knowledge Graph Embeddings Tutorial: From Theory to Practice</a> by some of the people that are currently doing research on this topic.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-26T11:57:58.907Z
Answers.LastActivityDate: 2022-01-01T18:26:19.627Z
Answers.LastEditDate: 2022-01-01T18:26:19.627Z
Answers.UserDisplayName: nbro
Body: <p>What are knowledge graph embeddings? How are they useful? Are there any extensive reviews on the subject to know all the details? Note that I am asking this question just to give a quick overview of the topic and why it might be interesting or useful, I am not asking for all the details, which can be given in the reference/survey.</p>
  
Tags: <reference-request><embeddings><knowledge-graph><knowledge-graph-embeddings>
Title: What are knowledge graph embeddings?
UserDisplayName: nbro
ThreadText: # What are knowledge graph embeddings?
  
  (Asked by: username_0 on 2021-12-26)
  
  What are knowledge graph embeddings? How are they useful? Are there any extensive reviews on the subject to know all the details? Note that I am asking this question just to give a quick overview of the topic and why it might be interesting or useful, I am not asking for all the details, which can be given in the reference/survey.
  
  **Tags:** reference-request, embeddings, knowledge-graph, knowledge-graph-embeddings
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-12-26. Score: 3 | Accepted answer
  
  **Knowledge graph embeddings (KGE)** are embeddings created in the context of a [**knowledge graph (KG)**](https://ai.stackexchange.com/a/32666/2444), which can be viewed as a visual/graphical representation of a knowledge base, where nodes are **entities** (e.g. "a car" or "Lewis Hamilton") and edges are **relations** between those entities (e.g. "drives"), so a (directed) connection from "Lewis Hamilton" to "a car" through the edge "drives" would represent the fact "Lewis Hamilton drives a car".
  
  A KGE is a vector representation of an entity or relation in the KG that, hopefully, preserves the **semantics** of the entities and relations. For example, we expect the embedding of the entity "man" to be closer to the embedding of the entity "woman" than to the embedding of a "turtle". The idea of learning a lower-dimensional vector representation of objects that preserves some notion of semantics or meaning between those objects also appears in other AI subfields, like natural language processing (see e.g. [*word embeddings*](https://arxiv.org/pdf/1301.3781.pdf)), or ML applied to software engineering (see [*code embeddings*](https://arxiv.org/pdf/1803.09473.pdf)).
  
  A KGE can be useful because a KG is most likely incomplete, so one of the tasks that you need to solve when using a KG is determining whether a fact is true or false. So, if we denote the fact as a triple $f = \langle s, r, o \rangle$, where $s$ stands for the subject, $r$ for the relation, and $o$ the object, then we want to determine whether this fact $f$ is true or false. In the context of KGEs, this is known as **triple classification**. Of course, in our KG, we don't have the fact $f$, but maybe we have the entities $s$ and $o$ but there's no edge between them that is labeled with $r$. So, given the embeddings of $s$, $r$, and $o$ (which was previously learned), we can then use a so-called **score function** to determine the likelihood of this fact. So, KGEs can be used to discover new "likely" knowledge, but it's a different approach than using deduction to derive new knowledge from a set of axioms or facts. It's an **inductive/probabilistic approach**, which has advantages (e.g. you don't need a deductive system) but also disadvantages (e.g. the fact may not actually be true even if our approach tells us that's the case).
  
  There are many similar/related ways to learn KGEs. Just to give you an idea of how these are learned, a simple approach (**TransE**) is as follows. You learn the vectors $s$, $r$ and $o$ such that the constraint $s + r = o$ is satisfied. Of course, this constraint only makes sense if $o$ can only go with $s$ and $r$, so this approach is not realistic, as it doesn't model e.g. many-to-many relations. For this reason, people have introduced other approaches (like **RotatE** or **ConvE**), which have advantages but also disadvantages. There are also other issues that arise when learning these embeddings, like generating synthetic negative/false facts (i.e. if you have a KG, you only have known true facts, so how do you know if a fact is false? You need examples of false facts!).
  
  The [Wikipedia page on KGEs](https://en.wikipedia.org/wiki/Knowledge_graph_embedding) is already quite comprehensive, but there are many other resources on the topic. For example, the survey [Knowledge Graph Embedding: A Survey of Approaches and Applications](https://persagen.com/files/misc/Wang2017Knowledge.pdf) (2017) or the (long but very useful) tutorial [Knowledge Graph Embeddings Tutorial: From Theory to Practice](https://kge-tutorial-ecai2020.github.io/) by some of the people that are currently doing research on this topic.
  
  
  ---
  
  