What is ontology?
I keep hearing the word “ontology”. A couple of years ago the same sentence would have said “data model” or “schema”.
Palantir sells one. Microsoft has added an ontology item to Fabric. If you’ve heard it in a pitch and weren’t sure what it meant, that’s fair. The word has had at least four meanings.
- Philosophy. The study of what exists.
- AI research. Tom Gruber’s 1993 definition is “an explicit specification of a conceptualization.”1
- The web. In 2001 Tim Berners-Lee and his co-authors wrote that they “co-opted the term for their own jargon”, and that for them an ontology is “a document or file that formally defines the relations among terms”.2
- Palantir. “An Ontology is a categorization of the world”, and theirs is “the digital twin of an organization”.
So the word isn’t new. It’s been in computing since at least 1993. What’s new, to me at least, is hearing it from people selling software.
None of those is much use if you’re trying to work out what you’re being sold.
So, I give you a simple coffee shop.
A coffee shop
Take a shop that sells coffee (sorry). Here’s what exists in it.
There are products: a flat white, an oat milk upgrade, a bag of beans. There’s stock: milk in the fridge, cups under the counter. There are staff, and the shifts they work. There are sales.
Those things relate to each other. A sale contains products. A sale was rung up by a member of staff. That person was on a shift. Every flat white sold takes some milk and a cup out of stock.
And there are sums. Today’s takings are the total of today’s sales. The milk left is what was delivered, less what was poured.
That’s an ontology.
It’s a list of the things, how they relate, and the sums between them. You could say all of it out loud to someone on their first day.
1970
The shop’s till keeps a table of products, a table of sales and a table of staff. Each sale points at the person who rang it up and the products in it.
That design comes from a paper Edgar Codd wrote at IBM in 1970.3 One detail caught me out when I read it. I’d been treating “relational” as tables that relate to each other. It isn’t that. Codd says “the term relation is used here in its accepted mathematical sense”, which is a set of rows. The relation is the table. The links between tables come from keys and joins.
I did know this once. I forgot it, the way you forget most things when you’re stuck in delivery.
“Graph” is even older. In that paper Codd is arguing against “the graph or network model”, which he calls “presently in vogue”. So graph databases were around before relational ones. Google launched its Knowledge Graph in 2012 under the line “things, not strings”.
Storing things that link to other things isn’t new under either name.
Palantir’s own documentation includes a translation table for people who know databases:
| What you already have | What Palantir calls it |
|---|---|
| Dataset | Object type |
| Row | Object |
| Column | Property |
| Join | Link type |
Palantir also adds “action types”, which define how an object is allowed to change. The till’s refund button is the same idea: one defined way to change a sale.
Counting the till
It doesn’t get complicated… and then it does. Here’s where the real engineering is.
The natural way to record your coffee sales is one row each, as they happen. That’s quick to write and it’s chronological in most cases. But ask for today’s takings and the till has to add up every sale since you opened.
Ask for takings by hour, by product, for the last three years, across forty shops, and it’s adding up millions of rows.
The other way is to keep running totals. Every sale also bumps a number for the hour, the product and the shop. Now the answer is instant. But every sale creates more computer work, and if one of those totals ever disagrees with the rows underneath, you’ve got two values.
Same inputs, different layout, and a very different speed. This is most of what I think about at Flowstate. How do you keep loosely linked data reliable? How do you keep tightly linked data fast once there’s a lot of it? How do you put a number in front of a person without making them wait for it?
Codd wrote about this too. The first sentence of his paper says users “must be protected from having to know how the data is organized in the machine”.
The second half of the paragraph says why: “changes in data representation will often be needed as a result of changes in query, update, and report traffic”.
I find it amazing that this is from 1970. Codd was planning for data that outgrows its layout, and for query patterns that shift, with no working system to point at. His paper says “implementations of systems to support the relational model are not discussed”. The disk drive IBM delivered the following year, the 3330, held 100MB on a removable pack. The reasoning was written for that hardware and it still holds at millions of rows.
The layout should follow the questions. If everyone asks for takings by hour, you should store that as a total. If nobody has asked for it since March, stop. If you ask for a different date range, things get slower. We need to add them up, just for you, my special snowflake.
I find this the most interesting part. A system that watches what gets asked and rearranges its own storage to suit is a hard problem. It only works if the meaning is held apart from the layout, so one can move without breaking the other.
For the more technical readers: I’m talking about holding the definition of the data as something closer to prose, and not only as a relational schema. Gruber’s word for that level is “semantic”, against the “logical” or “physical” level a database schema sits at.4
Meaning
Look inside the till’s database and you’ll find a column called status with a number from 0 to 4 in it. You’ll find a column called amount. Is that with VAT (or GST) or without? Does a refund show up as a negative sale, or as a row somewhere else?
The database stores all of it. Nothing in it tells you the answers.
Codd left a footnote in 1970.
Naturally, as with any data put into and retrieved from a computer system, the user will normally make far more effective use of the data if he is aware of its meaning.
Six years later Peter Chen wrote that the relational model “may lose some important semantic information about the real world”.5 In 1979 Codd came back with a paper called “Extending the Database Relational Model to Capture More Meaning”.6
The discussion happening here is about retrieval and understanding. What am I trying to retrieve? What am I trying to understand?
Postgres, a database a lot of modern software runs on, has a COMMENT command that stores a line of text against a table or a column. It isn’t in the SQL standard, and it changes nothing about how a query should run. But leaving a comment might just help define the value you’re trying to convey with the field you’ve named.
So this clearly isn’t everywhere, and it isn’t decided. But maybe ontology is more to do with definition than it is to do with structure.
This field is definitely to be stored as a number, but why?
AI
If we ask ourselves why Palantir leans on the word ontology so hard, I think it’s because the word carries the part of the message that sells.
Language models are what you really want. Businesses want to sell them to you. But the constant roadblock to building complex agentic solutions is how crap your data is.
Hilariously, you’ve probably already figured this out. You can’t find what you need, or you have partial records, or stuff is missing that just shouldn’t be.
That’s where language models step in. And I said language models, instead of AI, because the reasoning is purely linguistic. It’s just asking questions… repeatedly… and answering itself.
When your data model carries an explanation of how different systems and values relate, that reasoning gets a lot clearer than if you just aimed it at a database and said “good luck”.
I think the explanation comes in four kinds.
Definitions. A sale is one paid order. Takings are sales less refunds, including VAT.
Values. status = 3 means refunded. Sizes are S, M and L.
Examples. A large oat flat white is one sale with two lines: the drink, and the oat upgrade.
Structures. A sale has lines. A line points at a product. A product draws on stock.
There’s a benchmark that measures what this is worth. BIRD, from 2023, is 12,751 questions over 95 real databases, each answered by writing a query.7 For the questions that needed it, the authors wrote a sentence of background. Their own example is that “center”, in a basketball database, is stored as pos = C. Then they ran every model twice, with the sentence and without.
GPT-4 got 34.88% right without it and 54.89% with it. The people they tested got 72.37% without and 92.96% with.
The sentence was worth about twenty points to GPT-4 and about twenty to the people. Those are 2023 models and the scores have moved a long way since. The sentences were also written per question by experts, which is kinder than real life, where the description has to exist before anyone knows the question. I’d still take the gap between the two columns seriously.
I think this is part of why the word is back. A model depends on the descriptions in a way the till never did.
Flexible or structured
So there are two things being sold under one word.
One is flexible. You describe your business in plain terms, keep those descriptions beside the data, and change them as you learn. The storage underneath is free to be rearranged. A model can read the descriptions and so can a new hire. I think this is great, and you can start it in a text file. Gruber’s own example of a minimal ontology is “a textual glossary of terms” attached to a search service.4
The other is structured. A vendor’s tool, a fixed set of object types you model up front, and a long engagement to fill them in. I struggle to see what’s new there. It looks to me like the enterprise data model we’ve been sold before, with a different face.
If someone’s pitching you an ontology, ask which of the two it is, and what happens to it when your questions change.
That includes me.
Flowstate’s ontology describes how you work
Flowstate already holds the shape of how an organisation works: the Work it plans, the people and teams who do it, and who’s on what, for how much of their time, between which dates. The Ontology platform adds the rest of what the business runs on. Deals and companies from HubSpot or Attio. Issues from Jira or Linear. Documents, like CVs and statements of work.
Each kind of record, and each of its properties, gets a meaning in plain words: what it’s for, what each value means, and an example. HubSpot stores appointmentscheduled. The meaning says a first call is booked, nothing is agreed yet, and there’s no Work to link it to. That covers definitions, values and examples, three of the four kinds from earlier.
Links are the fourth. “Deal pays for Work.” A link can come from a shared key, from people, or from an agent that works it out and asks when it isn’t sure.
You don’t model the whole business up front. One type, a sentence about what it means and one link is a start, and you can rewrite any of it when your questions change.
Agents and code do the work on it
Writing it down matters because something can then act on it. An action runs whenever a record is created, changed or deleted, and one of three things runs it:
- A ready-made agent. Flowstate writes the instructions and picks the model.
- Your own agent. You pick a Claude or Gemini model and brief it in your own words.
- Code. TypeScript, in a sandbox of its own with no internet and nothing to install. The editor is typed from your ontology, so the meanings you wrote show up as you type, and an action won’t save if it sets a value that doesn’t exist.
Code uses no model, so it has no AI spend and does the same thing every time. Use it when the rule is exact. Use an agent when the job needs judgement.
Either can stop and ask a person. The run waits, uses no compute while it waits, and carries on with the answer.
Two examples.
Resourcing from a statement of work. A signed SOW says what you’ve promised to deliver and by when. Upload your SOWs as a file type, and an agent reads each one, links it to its Work and writes down the roles it needs. Resourcing can start when the contract is signed, not when the project kicks off. Flowstate’s ready-made resourcing agent already does this from a deal in your CRM.
What Fin is worth. Intercom bills Fin per resolution. Helm already counts Fin’s resolutions and prices them at your contracted rate, so you know what it costs. Cost is half the sum. The other half is what each resolution was worth: which customer, on which plan, and what a person would have cost to answer it. That’s a question about how records relate, which is what an ontology is for.
Every run is measured
Helm exists to show a company what its AI costs. It’d be odd if our own agents were the exception.
Every run records its model, the tokens it read and wrote, its AI spend and its compute time. The Usage tab totals them by action for the month, against a monthly limit for the organisation and, if you want one, for each action. You can try an action on one record before you switch it on, and see what it would change and what it would cost, without changing anything.
This is the work Flowstate was built for: describing how an organisation does its work, and measuring what that work costs, whether a person or an agent does it.
The coffee shop already knows what it sells, who sold it and what’s left in the fridge. The useful part is writing that down in plain words and keeping it apart from the storage.
References
Footnotes
-
Thomas R. Gruber, A Translation Approach to Portable Ontology Specifications, Knowledge Acquisition 5(2), 1993. ↩
-
Tim Berners-Lee, James Hendler and Ora Lassila, The Semantic Web, Scientific American, May 2001. ↩
-
E. F. Codd, A Relational Model of Data for Large Shared Data Banks, Communications of the ACM 13(6), June 1970. ↩
-
Tom Gruber, Ontology, in the Encyclopedia of Database Systems, Springer-Verlag, 2009. ↩ ↩2
-
Peter Pin-Shan Chen, The Entity-Relationship Model: Toward a Unified View of Data, ACM Transactions on Database Systems 1(1), March 1976. ↩
-
E. F. Codd, Extending the Database Relational Model to Capture More Meaning, ACM Transactions on Database Systems 4(4), December 1979. ↩
-
Jinyang Li et al., Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLs, NeurIPS 2023. Figures are execution accuracy on the test set, Table 2. ↩