The idea, explained
A table organizes data into fixed rows and columns. A knowledge graph instead emphasizes connections. The triple “Product P100 — madeBy — Acme” links two entities through a named relationship. Another triple can say “Product P100 — category — RunningShoe.” Together, many triples form a directed, labeled graph: directed because each relationship has a starting and ending point, and labeled because the relationship has a name.
RDF uses an IRI, or Internationalized Resource Identifier, to identify an entity or relationship unambiguously. An IRI is similar to a web address, although it identifies something and does not have to open a webpage. Literals hold values such as “89.99” or “red.” A blank node represents something whose identifier is not known or not important outside the local graph.
This structure helps integrate sources with different schemas. A retailer, manufacturer and standards body can describe the same product using shared identifiers and relationship names. New fact types can be added without redesigning every existing row. The trade-off is that identifiers and vocabularies must be governed carefully; two labels that look alike may still refer to different concepts.
SPARQL is a query language for RDF graphs. A SPARQL query describes a pattern of triples rather than joining tables by columns. Variables stand in for unknown subjects, predicates or objects. The engine finds combinations of graph facts that satisfy the required pattern. Optional patterns add data when available without rejecting an otherwise valid result.
Knowledge graphs and embeddings solve different problems. A graph preserves explicit, inspectable relations. An embedding represents similarity as numbers in a vector. Systems can combine them: embeddings retrieve semantically similar candidates, while graph relations enforce known connections or constraints.
Follow a worked example.
Suppose a shopping graph contains these facts:
P100 — madeBy — Acme P100 — category — RunningShoe P100 — price — 120 P200 — madeBy — Acme P200 — category — HikingBoot P300 — madeBy — Nova P300 — category — RunningShoe
A buyer asks for every running shoe made by Acme and its price.
Step 1: the query pattern requires “?product — madeBy — Acme.” This matches P100 and P200.
Step 2: it also requires “?product — category — RunningShoe.” P100 satisfies this pattern, while P200 does not. P300 is a running shoe but fails the Acme condition.
Step 3: the query requests “?product — price — ?price.” P100 links to the literal value 120, so the result is product P100 with price 120.
If price were marked optional, P100 could still appear even when its price triple was missing. This example shows graph querying as pattern matching: the answer comes from the intersection of connected facts, not from text similarity or a guess.
Where people get stuck
Common misconception: any connected database is automatically a knowledge graph. A useful knowledge graph needs stable entity identifiers, clearly defined relationship meanings and rules for resolving duplicate or conflicting facts. Another mistake is treating every missing edge as proof that a relationship is false. In an open graph, a missing fact often means “not recorded.” Finally, graph structure does not guarantee truth; provenance, validation and update processes are still required.
Now try it yourself.
1. Check the core idea
Practice: A graph says A — worksFor — CompanyX, B — worksFor — CompanyX, and B — manages — A. Which entities match a query for people who work for CompanyX and manage A, and why?
Reveal the answer & reasoning
Only B matches. The first required pattern, “?person — worksFor — CompanyX,” produces candidates A and B. The second pattern, “?person — manages — A,” matches B. The shared variable ?person must have the same value in both patterns, so the intersection leaves B. A works for CompanyX but has no recorded manages-A relationship. That absence should be read as “the graph does not establish it,” not automatically as proof that A never manages anyone.
Why this was added
The catalog covers databases, embeddings and retrieval but lacks a lesson on explicit graph relationships, RDF triples and pattern-based SPARQL queries.