Ontology
An ontology defines the entity types in a domain and how they relate, the schema a knowledge graph fills in with actual records.
What is an ontology?
An ontology is a formal definition of the entity types that exist in a domain and the relationships allowed between them. A company ontology might define that a Customer can own a Deal, a Deal belongs to a Product line, and an Employee owns a Deal. It doesn't hold any actual customers or deals. Without one, every source that touches customer data invents its own shape for what a customer is, and nothing connects a customer row in a CRM to the same customer mentioned in a support ticket.
How does an ontology differ from a knowledge graph?
An ontology is the schema. A knowledge graph is the populated structure built on top of it. An ontology says a Deal can belong to a Customer. A knowledge graph contains the actual deal, the actual customer, and the edge connecting them. Building a knowledge graph without an ontology first means entity types get invented ad hoc as data comes in, and the same entity can end up described three different ways in three different files.
How does an ontology work in an AI system?
An ontology gets defined once, usually as a small set of top-level entity types such as Customer, Employee, Deal, and Project, each with the attributes and relationships that matter for the domain. New data gets classified against that schema as it comes in, instead of each source dictating its own structure. Qontext's context repository uses its folder hierarchy as this schema: the first layer of folders names the base entity types, and every file placed inside inherits that type's structure and relationships, so an agent reading from any folder can rely on the same shape of record everywhere.