Knowledge graphs and structured knowledge
How to model, extract, resolve and query structured knowledge — with the queries that similarity search cannot answer, and the parts that break at scale.
A knowledge graph is not a technology choice. It is the decision to write down the entities in your business and the relationships between them, with stable identities, so that a question about two things at once has an answer. Most organisations already hold that information; it is spread over three CRMs, a spreadsheet, and the part of the wiki nobody has read since 2021.
These pages take the engineering path through it. What a triple is and what it costs you. How to get entities out of text without the model inventing relations. How to decide that two records are the same thing, with a threshold you can defend. How to give every fact a source and a date. And the queries — multi-hop, aggregate, negation, completeness — that a vector index structurally cannot answer, each written out in SPARQL, Cypher or SQL so you can run it rather than take it on trust.
Where this subject usually goes wrong is at the two ends: too much ontology before there is any data, or an LLM pointed at a corpus with no schema and no validation. Both produce a graph nobody queries. The middle path is narrow and it is what these pages describe.
What a Knowledge Graph Is, Concretely
A knowledge graph built from one ordinary sentence, triple by triple, with the same facts shown as tables and as a graph so the difference is visible.
8 min read
Ontologies, Taxonomies and Schemas
Three levels of structure — controlled vocabulary, taxonomy, ontology — with what each one buys you and what it costs to maintain.
9 min read
RDF, SPARQL and the Semantic Web, Twenty Years On
What RDF and SPARQL actually are, written as a working query language guide, plus a straight account of which parts of the semantic web vision were adopted.
10 min read
Property Graphs and Cypher: Model, Load and Query in One Evening
A complete first property graph: constraints, a CSV load, the queries worth knowing, and the MERGE mistake that duplicates every node.
11 min read
Extracting a Knowledge Graph With an LLM
A closed schema, a prompt that demands evidence spans, and a validation pass that rejects every entity and relation not grounded in the source text.
12 min read
Entity Resolution: Deciding Two Records Are One Thing
Blocking, pairwise scoring, and a threshold chosen from a precision/recall table with the asymmetric cost of a bad merge worked out on the page.
13 min read
Canonical IDs, and Why Your Graph Forks Without Them
An identifier design that survives merges, splits and re-ingestion: opaque internal ids, an alias table, tombstones, and ids that never stop resolving.
12 min read
Temporal Knowledge: Facts That Were True Then
Valid time and transaction time on edges, the three ways to store an interval, and the as-of and overlap queries the intervals make possible.
11 min read
Provenance in a Knowledge Base
How to attach a source to every fact — named graphs, RDF-star, edge properties or an assertion table — and the retraction query that makes it worth the storage.
10 min read
When to Use a Knowledge Graph: Questions Vectors Cannot Answer
Five classes of question that similarity search structurally cannot answer — multi-hop, aggregation, negation, conjunctive constraints and completeness — each with the query that does.
15 min read
Text-to-Cypher and Text-to-SPARQL
Serialising the schema into the prompt, validating the generated query against it, and executing read-only with a timeout — in that order, never the reverse.
12 min read
Keeping a Knowledge Graph Fresh
Change data capture into a graph: idempotent upserts, out-of-order events, deletes that must not delete, and a conflict rule written down before it is needed.
12 min read
Wikidata as a Free Backbone
How Wikidata is structured, how to query it properly with p/ps/pq rather than wdt, how to link your entities to it, and how to measure its coverage of your own domain.
13 min read
Product Catalogues as Graphs
Modelling products, variants, typed attributes and compatibility once, so that search facets, fitment questions and recall impact all fall out of the same graph.
11 min read
A Rules Engine Next to a Model
Which decisions must never be probabilistic, why a rules engine gives three things a model cannot, and how to route a request between them.
11 min read
Constraint Solvers and the Problems They Own
A rostering problem with its search space computed on the page, the CP-SAT model that solves it, and what a solver certifies that a sampler cannot.
12 min read
Checking Model Output Against a Database
A grounding check that requires every factual claim to be typed, looks each one up, and returns a citation, a correction or a refusal — never an unchecked assertion.
12 min read
A Glossary Your Company and Your Model Both Use
One term table, three consumers: selective prompt injection, query expansion in retrieval, and a validator that flags deprecated terminology in output.
10 min read
Master Data Management for AI Teams
The discipline behind deciding which customer record is the real one, in the four architectural styles, and why AI teams meet it whether or not they wanted to.
11 min read
Turning a Wiki Into Something Machines Can Query
Triage the pages, take the tables and infoboxes first, extract the rest against a schema, and work out whether the review is affordable before you start.
12 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- Embeddings & vector search
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Inference, serving & latency
- Evaluation, benchmarks & LLM-as-judge
- Observability & LLMOps
- Hallucination & failure modes
- LLM cost engineering
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Search, ranking & recommendation
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns
- Build it: end-to-end AI tutorials
- Python for AI: hands-on recipes
- TypeScript, React and the web
- Frameworks and SDKs
- Errors and troubleshooting
- AI facts, numbers and statistics
- The history of AI
- The maths behind AI
- Architectures beyond the transformer
- Reinforcement learning
- Diffusion and generative media
- Speech, audio and voice engineering
- Benchmarks, one at a time
- AI search visibility
- Infrastructure and operations
- Databases and storage for AI
- Classical ML in production
- Regulation, jurisdiction by jurisdiction
- Prompt recipes and pattern library
- AI for people who do not write code
- Writing, media and creative work
- Edge and on-device AI
- Interpretability and model internals
- Field notes