An ontology is a formal, machine-readable specification of a controlled vocabulary, built to represent large numbers of very specific semantic relationships within a domain. Where a thesaurus is designed for people to browse and search, an ontology is designed for machines to reason with, it defines classes, their attributes, the relationships between them, and even inference rules that let software draw new conclusions from what's explicitly stated. The Resource Description Framework, an official web standard, expresses these relationships as triples, subject, predicate, object, such as "Cat is a type of Pet," which a machine can process directly.
Building an ontology is significant work, and the source material is clear that organizations should generally adopt or extend an existing shared ontology within their domain community rather than building their own from scratch, since interoperability depends on different systems agreeing on the same underlying model.
A thesaurus helps a person find the right term. An ontology helps a machine understand that two differently-worded facts actually mean the same thing, which is a fundamentally different, and much harder, problem to solve.
No, a thesaurus alone would not suffice. Automatically flagging a medication-condition conflict requires software to reason over relationships, to combine "this medication treats condition X" with "this patient has condition Y" with "condition Y is a contraindication for this medication class" and draw a conclusion no human explicitly stated. A thesaurus's broader, narrower, and related terms are built for humans to browse and search, not for machines to run inference over. This is precisely the gap an ontology's inference rules and formal, machine-readable relationships are designed to fill.
The colleague's underlying worry is legitimate, though: ontologies require significant investment to build correctly, and the source material is explicit that building one from scratch is generally the wrong move, the better path is adopting or extending an existing, shared ontology within the medical domain, of which several already exist for exactly this kind of clinical relationship data, rather than a single company attempting to construct medical-domain reasoning capability entirely on its own.This distinction matters generally: the question isn't "thesaurus versus ontology" as if picking a fancier tool. It's whether the actual requirement is human search and browsing, which a thesaurus serves well, or automated machine reasoning, which requires an ontology's more demanding, but fundamentally different, kind of structure.