Ontologies for AI in practice: Do LLMs need ontologies, or are text definitions good enough?
A three-part experiment on a small, deliberately ambiguous genealogy dataset (fictional people) tested what changes when an LLM is given progressively more semantics.
The task: count a person’s ancestors. The evidence is anecdotal by design, but practical.
🔎 Part I: adding semantics step by step
Data alone: many errors, and a correct count only by chance
Cleaner dates: no change
Plain-text definitions: a substantial improvement
RDF knowledge graph: the same answer, but it exposed hidden assumptions, including an imprecise question (“how many ancestors in this dataset?”)
Curated graph: more precise and consistent answers
Ontology: the correct count
🧪 Part II: model size and stability
Small local models (4B to 8B) could not use added semantics
Impact started to appear at 32B parameters
Text definitions produced high variability across runs
Knowledge graphs with ontologies matched or beat definitions and were more consistent
Removing the text definitions from context improved graph-based results
🧩 Part III: how to provide semantics
OWL axioms only, OWL with definitions, OWL with operational directives, Apache Ossie (OSI) and Google’s OKF were compared.
Takeaways:
- Axioms alone were not enough, and the natural-language definitions inside ontologies did most of the work
- With a capable model, the format mattered little. Opus reached perfect results across representations, while DeepSeek-R1:32B used none of them
- Ontology plus knowledge graph was the most effective and consistent option
- Among approaches that annotate data directly, OKF ranked highest
Definitions alone are not enough. Results were strongest when context-specific meaning is connected to the data elements themselves, as in a knowledge graph.
By Andrea Splendiani
Ontologies for AI in practice / part I https://sbee.link/gkx3nd6rec
Ontologies for AI in practice / part II https://sbee.link/erhmudfwc6
Ontologies for AI in practice / part III https://sbee.link/3d7xhwbnm4
#LLM #FAIRData #OWL #SemanticLayer #DataGovernance
--
Missed a talk at #CDL26? Or missed the whole thing?
All talk recordings will be available in the next few days.
With this many ideas and speakers, nobody could catch them all live
✅ Were you there? Replays included in your ticket
🎟 Couldn’t make it? Get a remote ticket for permanent on-demand access
https://sbee.link/pqwxhda3n4
