To a seven-year-old
Knows: what a city and a country are, and how to draw a line between two dots; does not know what data, a database, or a computer language is.
Look at the panel. Those floating bubbles are things. Santiago is a thing. Chile is a thing. Michelle Bachelet is a thing — she's a person, but people are things too.
Now I want to tell you something true about two of them. Santiago is the capital of Chile. How do I show that, without a sentence?
I tie a string between them. And I write on the string, so nobody forgets which kind of true thing it is. The string between Santiago and Chile says capital of.
Try it. Drag the Santiago bubble onto the Chile bubble. When you drop it, the panel asks you what to write on the string — pick capital of from the little row of words. A string appears, and underneath, the panel reads your fact back to you: "You just said: Santiago is the capital of Chile."
That's a fact. Two bubbles and one string with a word on it. Every fact you know can be tied up this way.
Now do it again. And again.
Tie Chile to South America with located in. Tie Chile to Argentina with borders. Tie Buenos Aires to Argentina with capital of.
After a while you don't have facts any more. You have a web — bubbles all over the place with strings running between them. That web is what grown-ups call a knowledge graph. It's just a map of things and how they're joined.
The good bit
Tap a bubble. Everything it is tied to lights up, and everything else goes pale. That's how you see what one thing's whole story is.
Then press Walk the strings. Watch it start at Santiago, slide along the string to Chile, and then along the next string to South America.
Nobody ever tied Santiago straight to South America. There's no string there. But you just walked from one to the other, so now you know: Santiago is in South America.
That's the whole trick. You tie down the things you were told — and then, by walking, you find out things nobody told you.
To a teenager
Knows: lists, spreadsheets, maybe a little Python; has used Wikipedia and search engines. Does not know formal semantics or query languages.
Last level we called them bubbles and strings. Time for the real names.
A bubble is an entity. Santiago is an entity. Chile is an entity. So are people, languages, continents — anything you can point at and say "that thing". A string is a relation, and it has a name written on it: capitalOf. Put a head entity, a relation and a tail entity together and you have a triple:
(Q2887, capitalOf, Q298) # Santiago, capital of, Chile
Those Q codes are not decoration. Real graphs don't store the word "Santiago" as the identity of the thing — the word is ambiguous and language-specific. They store an opaque id and hang labels off it. Wikidata, the graph that feeds a lot of Wikipedia's infoboxes, really does call Santiago Q2887. Open the triple table under the panel and you're looking at the same shape a real graph uses: three columns, one row per fact.
Strings have arrows
Here's the first thing level one lied about by omission. Edges are directed and typed. capitalOf and hasCapital are two different relations pointing opposite ways. Swap the head and tail on capitalOf and you don't get a slightly odd sentence, you get a false one: Chile is not the capital of Santiago. Click a row in the table, hit the flip arrow button, and read what it says. Direction is meaning.
Some relations do survive the flip. borders is symmetric: if Chile borders Argentina then Argentina borders Chile, always. locatedIn is transitive: Santiago in Chile, Chile in South America, therefore Santiago in South America — even though nobody typed that row. Those properties are facts about the relation itself, not about any one pair of entities.
Two kinds of statement
"Santiago is the capital of Chile" is about two specific things. "All capitals are cities" is about every capital that has ever existed or will. You could try to write the second one as a million edges, or you can write it once, as a rule, in a separate layer called the ontology.
Flip show classes in the panel. Class boxes appear beside the entities — City, Country, Place — joined by subclass arrows: Capital ⊑ City ⊑ PopulatedPlace ⊑ Place. Thin edges say which class each entity belongs to. That's the schema. It's a graph too, sitting on top of the facts.
Now flip apply rules. Derived edges appear. Santiago was only ever typed as a City, but a City is a PopulatedPlace, which is a Place — so those types get derived, and the transitive locatedIn hop to South America appears too. Nobody wrote those. A program worked them out from rules you wrote once.
Answers nobody typed
Tap the question chip Which cities are in South America? and watch the panel walk it: start at every entity of class City, follow locatedIn one hop, follow it again. The readout tags each answer ASSERTED if a row in the table says it outright, or DERIVED if the machine reasoned it out. That distinction is the whole point of the level. Turn the rules off and half the answers vanish — the facts didn't change, only what you were allowed to conclude from them.
To a computer science undergraduate
Knows: SQL, relational algebra, basic logic, big-O. Does not know RDF, SPARQL, Cypher, or the open-world assumption.
Last level we called them bubbles, strings and labels. The real words: a 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 1. Formally it is a set of triples G = {(h, r, t)} over an entity set and a relation set 23. Our running edge is (Q2887, capitalOf, Q298).
Two data models, not one
The graph model is not fixed. It may be a directed edge-labelled graph — RDF — or a property graph 1. The difference bites the moment you want to say something about a statement. Santiago has been capital since 1818, and one particular reference vouches for it. In a property graph that is two key/value pairs hanging off the edge. In plain RDF an edge has nowhere to hang anything, so you mint a statement node and point at it — reification:
# RDF: reified statement :s1 a rdf:Statement ; rdf:subject :Q2887 ; rdf:predicate :capitalOf ; rdf:object :Q298 ; :start "1818" ; :source <wikidata:Q2887#ref1> .
// Property graph: attributes on the edge itself
(:City {id:'Q2887'})-[:capitalOf {start:1818, source:'wikidata:Q2887#ref1'}]->(:Country {id:'Q298'})
Flip the property-graph view switch in the panel and watch the qualifiers on Santiago's edge migrate between a green statement node and a label on the edge. Same information, four extra triples versus zero.
Querying is relational algebra plus paths
A triple store is a three-column table, so a basic pattern query is a self-join. That part you already know. What graph query languages add is the second half of this sentence: they support not only standard relational operators (joins, unions, projections, etc.), but also navigational operators for recursively finding entities connected through arbitrary-length paths 1. Arbitrary length is the bit plain SQL-92 cannot express.
# SPARQL SELECT ?city WHERE { ?city :capitalOf ?c . ?c :locatedIn+ :Q18 }
// Cypher, same answer
MATCH (city)-[:capitalOf]->(c)-[:locatedIn*1..3]->(:Q18) RETURN city
Run them side by side in the panel. Then set the path length back to *1..1 and the containment hop that needed two steps disappears: with a fixed-length join you must know the depth in advance. That is the navigational operator earning its keep.
Deduction adds edges nobody wrote
Level 2's "rule" has a name and a formalism. Knowledge splits into simple statements, such as "Santiago is the capital of Chile", which live as edges, and quantified statements, such as "all capitals are cities", which need something more expressive 1. That something is an ontology or a rule language, which define and reason about the semantics of the terms used to label and describe the nodes and edges 13. Turn on RDFS entailment and two rules fire over our data: rdfs:subClassOf transitivity up the Capital ⊑ City ⊑ PopulatedPlace ⊑ Place chain, and transitivity of locatedIn, which materialises (Q2887, locatedIn, Q18). Those rows are marked DERIVED in the binding table. Turn entailment off and the same query returns fewer answers — the query did not change, the semantics did.
The open-world assumption
Your database says NOT EXISTS means false. A knowledge graph does not. There is no edge saying Valparaíso is not the capital of Chile, and there is no edge saying Michelle Bachelet does not speak Spanish; under the open-world assumption both are simply unknown. So FILTER NOT EXISTS answers "not in my graph", never "not true in the world". Tick the OWA check in the panel and any query whose answer depends on absence gets flagged. Deduction only ever adds what follows necessarily — which is why the next level stops deducing and starts predicting.
?x :capitalOf ?y then ?y :locatedIn+ :Q18 (edit the relation names and the target id), plus FILTER NOT EXISTS.
To a PhD student in knowledge graph completion
Knows: SGD, embeddings, ranking metrics, PyTorch. Does not know the filtered-ranking conventions, the leakage history of FB15k/WN18, or how negative sampling choices dominate results.
Last level the graph was something you queried. A query engine only ever returns what someone wrote down, and under the open-world assumption a missing edge means nothing at all. So take the incompleteness seriously and make it the task.
The task, stated properly
Write the graph as a set of triples, G = {(h, r, t)} ⊆ E × R × E 24. Most graphs of this shape are badly incomplete, and completion means inferring the missing links — concretely, predicting the missing head or tail given (h, r) or (r, t) 2. You learn a scoring function s(h, r, t) that measures the plausibility of a triple from its embeddings, then rank every candidate entity in the tail slot. That framing is pointwise learning-to-rank 4, and it is why your metric is a ranking metric and not accuracy.
Three geometries, one interface
The scoring functions split into translational-distance and semantic-matching families 2. Pick a model in the panel and the formula renders above the plot:
# translational TransE s = −‖es + rr − eo‖p rr ∈ ℝk # bilinear / semantic matching DistMult s = ⟨es, rr, eo⟩ rr ∈ ℝk ComplEx s = ⟨es, rr, eo⟩ rr ∈ ℂk # rotation RotatE dr(h,t) = ‖h ∘ r − t‖
The formulas and the O(nek + nrk) space costs are lifted verbatim from the ConvE table 4; RotatE's is the Hadamard rotation with p(h,r,t) = sigmoid(γ − dr(h,t)) 5. The geometry buys you specific algebra. DistMult's trilinear product is symmetric in s and o, so it literally cannot separate capitalOf from hasCapital; ComplEx fixes that by moving rr into ℂk and conjugating the object 4. Train DistMult in the panel and watch borders — the symmetric relation — come out fine while the capital pair collapses.
Negatives are half the model
Graphs contain positives only, so you manufacture negatives by corrupting h or t; the established variants are uniform and Bernoulli sampling 2. The loss you actually optimise is
L = −log σ(γ − dr(h,t)) − Σi wi · log σ(dr(h′i,t′i) − γ)
with wi = 1/n under uniform sampling 5. Self-adversarial sampling replaces that with wi = p(h′i,r,t′i) = softmax(α · f(h′i,r,t′i)), weighting each negative by the current model's own score 5. Push the α slider up and most of the gradient goes to the handful of hard negatives; that is where a large part of the reported gain over uniform sampling comes from, which is the first reason to distrust family-versus-family comparisons.
The pitfall your supervisor will lead with
Mean Reciprocal Rank plus Hits@k, computed filtered: when ranking candidates for (h, r, ?) you remove every other tail known to be true from the candidate list, otherwise a correct alternative fact penalises you. Flip filtered off in the panel and watch MRR sag for no modelling reason.
Then the real hazard. WN18 and FB15k suffer test-set leakage from inverse relations of training triples appearing in the test set, and the effect is severe enough that a simple rule-based model achieves state-of-the-art results 4. Our TRIPLES carry the same defect by construction: capitalOf and hasCapital are stored as mirrored pairs. Flip leak inverses and the leakage banner reports how much of the MRR a memorise-the-inverse baseline explains on its own. The remedy in the literature was to derive robust variants of the datasets — FB15k-237 and WN18RR, with the inverse relations removed 45.
- train to populate
To a peer working on KG–LLM systems
Knows: retrieval augmentation, transformer internals, adversarial ML, the KGC literature. Needs no scaffolding — needs the seams argued, and needs to know which claims the ledger actually supports.
Four levels in, we have a graph of data whose nodes are entities and whose edges are relations 1, a split between simple statements as edges and quantified statements as axioms 1, a query layer that adds navigational operators to the relational core 1, and a scoring function s(h,r,t) ranked pointwise over candidates 4. Now the honest part. Some of what I told you at level 4 is folklore, and the part of this level that you probably care about most — attacks — is mostly not in my evidence ledger. I will label it as such, in the panel and here.
What level 4 oversold
The family-versus-family story (translational vs. semantic-matching 2, TransE ‖es+rr−eo‖p vs. ⟨es,rr,eo⟩ with rr∈ℝk or ℂk 4, RotatE's dr(h,t)=‖h∘r−t‖ 5) is usually told as geometry: ComplEx handles antisymmetry, RotatE handles composition. That is true about the hypothesis class and mostly silent about the leaderboard. The training regime moves the numbers just as hard: uniform vs. Bernoulli corruption of h or t 2, and self-adversarial weights p(h′i,r,t′i) ∝ exp(α·f) replacing the 1/n in the negative-sampling loss 55. My position: attribute a gain to geometry only when negatives, dimension and budget are matched — and remember that on WN18/FB15k a rule-based model reached state of the art because inverse relations leaked into test, which is why FB15k-237 and WN18RR exist 45.
Three frameworks, and where the trust boundary sits
The canonical taxonomy is three-way: KG-enhanced LLMs, LLM-augmented KGs, synergized LLMs + KGs 6, motivated by a symmetry — LLMs fall short of accessing factual knowledge, KGs are hard to construct 6. Under LLM-augmented KGs you get LLM-augmented embedding, completion, KG-to-text and KGQA 6; under the other direction, KG-guided planning, neuro-symbolic reasoning, and post-hoc factuality checking of LLM output 7; and construction/canonicalization across heterogeneous sources 7. GraphRAG is the concrete instance: "a data pipeline and transformation suite … designed to extract meaningful, structured data from unstructured text using the power of LLMs" 8, using "knowledge graph memory structures to enhance LLM outputs" 8 to "form a targeted context for question answering" 8. Graph-model-plus-LLM retrieval is still active work 6.
Flip the pattern switch in the panel and watch the boundary move. In KG-enhanced-LLM the graph is read-only at inference and the attack surface is retrieval ranking. In LLM-augmented-KG the extractor writes, so attacker-supplied text becomes attacker-authored triples. Synergized closes the loop, and a poisoned write returns as retrieved context on the next question.
The argument I will actually defend
KGs are attractive because their knowledge is "accurate, explicit and easily-modifiable" 7. That third adjective is the whole security story. Explicit means a grounded answer is a deterministic function of a small retrieved subgraph; easily-modifiable means one edge changes that function. Add (Valparaiso, capitalOf, Chile) in the panel and every downstream answer rewrites — no gradient, no jailbreak string, one row. The control point is therefore not the prompt: it is provenance. Our shared data already carries it — source, start, trust per statement — so turn trust weighting on and set the threshold above user-upload.
Boundary of the ledger
Nothing in my sources demonstrates a KG poisoning or prompt-injection attack. The propagation claim is an inference from the explicit/easily-modifiable property 7 combined with the extraction-from-unstructured-text pipeline 8; the panel labels it INFERRED. Passage p3's injection succeeding against a real extractor is speculative here. One thing is documented and worth your operational attention: the reference implementation "is largely in maintenance mode, and won't be accepting new PRs or implementing new features … particularly to address CVEs as they arise" 8. Build on it if you like; own the patch path. And note the level-3 asymmetry never went away — under the open-world assumption a missing edge is not a false one, so a defence that filters low-trust triples buys precision by refusing to answer.