Hidden Connections in Texts with Knowledge Graphs
Much of the information we deal with today exists in the form of unstructured natural language text. From academic papers and news articles to social media posts, legal documents, and reports, countless entities and relationships are densely embedded in these texts. But unless someone reads them carefully, it’s difficult to grasp the structure and connections beneath the surface. A Knowledge Graph is a structured graph that represents real-world entities (such as people, places, and concepts) as nodes, and their relationships as links. For example, the sentence “Jane sent a letter to Peter” can be represented as: [Jane] — sent a letter (Relation) — [Peter] To construct such knowledge graphs from text, various natural language processing (NLP) techniques are used in combination—such as Named Entity Recognition (NER) to identify entities, Relation Extraction to determine the links between them, and Entity Linking to connect them with external knowledge bases.
Let's Build a Knowledge Graph!
As the saying goes, “Seeing is believing.” To demonstrate how it works, I collected some real-world text data and built a few sample knowledge graphs using NetMiner.
※ You can download the original data used in this article from the attached file.
1. Avengers - Infinity War
(Warning: May contain spoilers. Please skip if you haven’t seen the film!)
Being the culmination of Marvel's Infinity Saga, Avengers: Infinity War features a wide cast of characters and dramatic events. I retrieved the movie synopsis from IMDb (approx. 10,000 characters including spaces) and generate a Knowledge Graph with NetMiner.
<Node Set>
<Link Set>
From the synopsis, I extracted various characters, concepts, and locations, then structured their relationships into a network.
I narrowed it down to Person, Planet, and Organization entities and visualized them as a network graph. Node shapes and colors were mapped by entity type, and node size reflected PageRank Centrality.
From this visualization alone, I can summarize the plot structure as follows:
- The core of the story revolves around Earth and Titan, where the Avengers face off against Thanos's army.
- The network captures connections among key figures like Thanos, Tony Stark, Stephen Strange, Vision, Wanda Maximoff, Hulk, and Peter Quill.
2. Squid Game - Season 1 (Warning: May contain spoilers. Please skip if you haven’t seen the film!)
TV series often unfold over an extended storyline, featuring numerous characters who become entangled in complex relationships as they each follow their own narrative arcs.
So, I visualized the key character relationships from Squid Game in the form of a knowledge graph.
Nodes with higher eigenvector centrality are shown in a larger size and a more vivid color.
※ Source: Wikipedia
At the center is, of course, the main character, Seong Gi-Hun. Gi-Hun is connected not only to his family (his mother, daughter, and ex-wife), but also to many of the fellow contestants he encounters throughout the game.
These include his childhood friend Cho Sang-Woo, teammates like Kang Sae-Byeok, Ali Abdul, and Oh Il-Nam, as well as the Hwang brothers (the Front Man and the police officer), with whom he shares critical moments up to the very end.
3. Seasonal Shift in Relationships: HBO House of the Dragon S1 vs S2 (Warning: May contain spoilers. Please skip if you haven’t seen the film!)
One more to try.
This time, it's House of the Dragon, the prequel to HBO's hit series Game of Thrones. Let’s take a look at how the character relationships change between Season 1 and Season 2.
※ Source: Wikipedia
First, this is the character network from Season 1.
- Node color: Result of Louvain community detection
- Node size: Betweenness centrality
Rhaenyra, Viserys, and Daemon—the central figures of the storyline—are positioned at the core of the network and exhibit high betweenness centrality.
A high betweenness centrality indicates that these characters play a key role incontrolling and spreading information throughout the network.
Now, let's take a look at the character network in Season 2.
Compared to Season 1, Season 2 shows a clearer separation between the Blacks and the Greens, while the number of characters has significantly increased, resulting in a more complex network.
Notably, Alicent, who was previously grouped with Rhaenyra in the same cluster in Season 1, is now fully aligned with the Greens.
The influence of Viserys, once a key figure, has greatly diminished.
Additionally, Aemond has begun to form his own distinct cluster, suggesting that his role will become more prominent in the next season.
Look at the brokerage analysis.
The below table shows the top-ranked characters based on liaison scores from the brokerage analysis. A liaison serves as a mediator between different communities, acting as a political or strategic bridge without being firmly tied to a single faction.
Season 1 | Season 2 |
Rhaenyra | Rhaenyra |
Viserys | Daemon |
Alicent | Aemond |
Corlys Velaryon | Alicent |
Daemon | Aegon II |
In Season 1, Rhaenyra, Viserys, Alicent, and Daemon scored high as liaisons, while in Season 2, Aemond has newly emerged as a key liaison figure.
His rise suggests that he may play a pivotal role in disrupting the balance between the two opposing sides.
4. News Article
News articles are always rich with entities—people, events, organizations, locations—and the relationships between them. We selected a headline article from CNN Business dated July 18, 2025:
※ Source: Trump takes credit for sweet change to Coca-Cola | CNN
The article reports that Coca-Cola, allegedly at President Trump’s request, is replacing high-fructose corn syrup with real cane sugar.
This time, I focused the Knowledge Graph on four categories: Person, Organization, Event, and Geography (Location). I also visualized the types of relationships involved.
At the center are President Trump and Coca-Cola, connected by a "discussed with" relationship. Other relationships included: - Trump → (declared change to) → Coca-Cola - Coca-Cola → (competitor) → PepsiCo Even a short news article can yield a complex, multilayered network of relationships.
5. Court Case / Crime Report
Legal cases also contain rich entities and relationships. I analyzed the "Facts" section of the 1971 U.S. Supreme Court decision on the Pentagon Papers case:
※ Source: https://supreme.justia.com/cases/federal/us/403/713/
This case revolved around the U.S. government's attempt to block publication of classified Vietnam War documents by the New York Times. The Supreme Court ultimately ruled that such a prior restraint violated the First Amendment’s protection of press freedom.
In the resulting knowledge graph, the Pentagon Papers are clustered with Indochina, the Vietnam War, and Secretary of Defense Robert McNamara. On the opposite side, entities like the U.S. Supreme Court, federal government, New York Times, and the First Amendment form their own cluster, showing the constitutional conflict over press freedom.
Knowledge Graphs: Unlocking Hidden Context in Your Data
Even now, texts are being generated at an incredible pace. But the meaning and structure behind them often remain hidden. With Knowledge Graphs, we can bring these connections to light—helping us identify key entities, understand complex relationships, and navigate the information landscape more effectively. If you’ve ever wanted to map out the hidden structure of your texts, a knowledge graph might be the perfect place to start.
Isn’t it time to stop seeing text as just words—and start seeing it as structure?
[Tutorial] Structuring Text into a Knowledge Graph ☞
- Attach
- sample.zip


