The knowledge layer for enterprise AI: Domain Ontology Neo4j Principal Consultant Jesús Barrasa published a chapter on domain ontologies as the knowledge layer for enterprise AI, arguing that a governed graph of definitions, stewards, rules and validity intervals is needed so agents can resolve contested business terms. The chapter uses AcmeBank's churn metric, which three teams report as 3.2%, 1.1% and 4.7% under different definitions, to show that agents cannot tell which meaning applies without that context. Neo4j is promoting its Context Engine product as the tool for building this layer at enterprise scale. The knowledge layer for enterprise AI: Domain Ontology Principal Consultant, Neo4j 15 min read This series is the practical build companion to Jesús Barrasa’s knowledge layer manifesto . This chapter is built on the previous chapter 2: Processes . Building this at enterprise scale? Neo4j Context Engine https://neo4j.com/product/context-engine/ is the new Neo4j product for building a knowledge layer for enterprise. Neo4j Context Engine | AI Context Layer for Agents https://neo4j.com/product/context-engine/ Chapter 02 https://medium.com/neo4j/the-knowledge-layer-for-enterprise-processes-f0fc54157e0a ended on a question: what is affordability here? Which fields, from which systems, under which rules? This chapter answers the first and last parts, the meaning and the rules. The fields belong to chapter 04, when data products arrive, and the systems to chapter 05, when we finally touch physical schema. Meaning comes first, because everything downstream resolves based on its definition. And getting the meaning correct based on your enterprise knowledge and context is what makes agents reliable to use across all functions of your business. At the quarterly business review, Folake Nwachukwu asks what churn was last quarter, and gets three answers: - Retention says 3.2% : every current and savings account closed, or dormant for 90 consecutive days. - Customer Insight says 1.1% : customers with no active product left at the bank at all. - Credit Risk says 4.7% : credit facilities settled, and nothing new borrowed within 12 months. All three teams were asked the same question, how many customers did we lose last quarter, and all three answered it correctly. What differs is what losing a customer means to each of them. For Retention, a closed or dormant account is the moment to act, because that’s where they run win-back campaigns and that’s what their targets are measured on. Customer Insight looks at the whole relationship, so a customer who closed every current and savings account but still has a loan or a credit card with the bank hasn’t gone anywhere yet. Credit Risk cares about lending, and a borrower who settles their loan and doesn’t come back within a year is lost revenue and a gap in their book, whatever else they still hold with the bank. These definitions carry their own metrics and business logic, and the bank and your agents needs all three. That’s the real problem: not that churn has several meanings, but that nobody, and certainly no agent, can tell which meaning applies to the question in front of them. Each of those definitions is knowledge the bank already has, just not anywhere nor in the shape an agent can consume. Without that context, an agent asked ‘how many customers churned’ has no way of knowing which answer you need, or that there’s more than one. And churn is only the loudest case: affordability, exposure, active customer and dormant all shift meaning depending on who you ask, and every one of them shows up in a report somewhere with a number attached. So this chapter gives AcmeBank’s contested vocabulary a governed home in the graph. By the end, every term has a definition, a steward, a rule, and a validity interval, and you’ll be able to ask the graph what churn means, who owns that meaning, which rule enforces it, which definition was in force last quarter, and which meaning applies in your context. An agent will be able to ask the same questions before it computes anything. Here’s where we’re going: - Why a domain ontology - Building this layer - What the business gets out of it - How it connects to the other layers - What lives in the model - Building this architecture - Asking it questions - What’s next Why a Domain Ontology? Every organisation I’ve worked with has a glossary somewhere: a wiki page, a data dictionary, a spreadsheet with 400 rows and owners who all left. Where this fall short is that a glossary describes things but nothing enforces it, and nothing connects it to the actual work, the data products, physical systems or business process. Take the SMB loan approval process from chapter 02: when an agent reaches the risk assessment step and needs the customer’s risk score, it has to know what risk means in that process, which data product holds the right score, and which system that data product actually reads from, to get it right. The domain ontology is the governed version of that ambition. It puts business terms into the graph as first-class nodes: what the term means, what attributes it carries, which rule makes the definition testable, which role stewards it, and when the definition was in force. And because it’s a layer of the same graph, it connects downward. A steward isn’t a name in a spreadsheet, it’s a chapter 01 Role, filled by a person, with history. A rule doesn’t just sit next to a definition: it can govern a chapter 02 task. That connectedness is the whole difference between a glossary and a knowledge layer. Building this layer The diagram above is the whole chapter in one picture. On the left is where meaning lives today: the data dictionary, wikis and policy documents, the definitions hard-coded into report queries. In the middle sits the pipeline that turns those sources into candidates. On the right, the graph and everyone who consumes it. Two design commitments do the heavy lifting in that middle column. Extraction outputs are proposals, not facts. A pipeline reading wikis and report code will find candidate terms and candidate connections. Every candidate is stamped with provenance at write time, meaning where it came from, when it was extracted, and how confident the extractor was. Every candidate also lands with status ‘proposed’. Nothing becomes canonical because a pipeline ran. A term becomes canonical when a steward approves it. We’ll see this working in the build: the pipeline has found a term called Client Attrition in Credit Risk’s wiki, and it’s sitting in the queue with two suggested matches, waiting for a human. The graph is checked against its own expectations. Rules in this layer aren’t prose. Each carries an evaluable expression, and some of those expressions are checks the graph runs against itself, like the rule that no two concepts with the same name may have overlapping validity intervals. A pipeline that looks complete has to prove it, and we’ll run that proof live at the end of the chapter. What makes governance work in this layer: - Provenance is stamped at write: every candidate carries its source, extraction date, and confidence. - Nothing becomes canonical silently: a steward have to confirm a proposal before it becomes real and used by your agents. What the business gets out of it So what does this buy the business? The right meaning in the right context for whoever’s asking. When Folake asks what churn was last quarter, she gets the enterprise definition, and behind it the rule that enforces it and the name of the person accountable for that meaning. When Kavitha asks the same question she gets Current Account Churn, and Rosa gets Borrower Churn, each with its own steward. The three functional definitions don’t get merged into one: they stay as scoped, named variants, and the graph resolves the right one from who’s asking rather than leaving people, or agents, to guess. Agents you can trust. An agent that can resolves “churn” against the governed concept before computing anything is auditable and trustworthy because you can see which definition it used and who owned that definition at the time. It also resolves by context: an agent whose context is the Credit Risk function takes Borrower Churn, one in Customer Retention takes Current Account Churn, and one anywhere else takes the enterprise definition, so the same word gets the right meaning without anyone hard-coding it. An agent that resolves “churn” against its training data is guessing on your behalf, without knowing how your enterprise operate. How it connects to the other layers Downward, this layer doesn’t just sit on chapters 01 and 02, it references them. Stewards are Roles from the operating structure, and the affordability rule we will discover later governs the process task: assess-affordability, which means the question chapter 02 ended on, now has a structural answer. Upward, the other two parts of that question are queued. Which fields? Chapter 04’s data products will attach to these concepts through their attributes, and the churn concept below is designed knowing a Customer Churn Risk product will consume it. From which systems? Chapter 05 is why the attributes below look suspiciously like columns, because that’s where they map to in our physical systems. What lives in the model DataConcept is a business term and everything needed to trust its meaning: a name, the definition, a status ’proposed’, ‘canonical’, or ‘superseded’ , a validity interval, and the provenance source, extractedAt, confidence, status so you always know where a meaning came from. Two concepts can share a name, because that’s how history works: Customer Churn exists twice in our graph, one superseded and one in force. DataAttribute is the measurable shape of a concept: name, datatype, allowed values. It carries the implied label :Attribute and in chapter 05 these attributes map to your physical schema. Where an attribute records a process decision, its allowed values are the process’s routing: affordabilityOutcome allows exactly ‘affordable’ and ‘not affordable’. BusinessRule makes a definition testable: a name, a ruleType ‘quality’, ‘contract’, ‘policy’, or ‘guardrail’ , and an evaluable expression. The relationships: HAS ATTRIBUTE hangs attributes off concepts. SUBTYPE OF and SYNONYM OF structure the term family. SEMANTIC MATCH, with confidence and status on the edge, is where extraction proposals live. GOVERNED BY connects rules to what they govern, which here means concepts, attributes, and chapter 02 tasks. STEWARDED BY points at a Role. The design decisions, from production experience: 1. Everyone has their own definition with a superseded enterprise wide one if exists. The three churn definitions were measuring at three grains: account, relationship, facility. The enterprise definition lands as: a customer has churned when they have held no active product with the bank for 180 consecutive days whilst Retention’s and Credit Risk’s definitions are SUBTYPE OF concepts with their own stewards and their own definition. 2. Historical questions earn intervals in the graph. The superseded 2023 definition keeps a closed validity interval and the status ‘superseded’. “Which definition was in force on the 14th” is a real business question, and it becomes answerable by traversing the graph. 3. Thresholds live in rules, not definitions. The affordability definition names the minimum debt service ratio; the guardrail rule owns the number 1.25 . Meaning changes rarely, thresholds change at a more frequent cadence. When the threshold moves, only the rule changes, not the concept or definition. 4. Extraction are proposals with provenance. SEMANTIC MATCH carries confidence and status. A steward’s yes graduates the match into the right canonical edge, SYNONYM OF or SUBTYPE OF, and the match stays behind as a record of how the connection was found. 5. Stewardship is a link to a role. STEWARDED BY points at a Role rather than a Person, because people move and the responsibility for a definition shouldn’t move with them. When someone leaves, whoever fills the role next inherits the stewardship, and FILLED BY still tells you who holds it today. That’s also why the owner property stays empty: a typed name would drift away from the edge. Building this architecture The requirement is the same as Chapter 1 & 2: Neo4j 2026.02 or later, Enterprise Edition, Cypher 25. Run Chapter 01’s three files first, followed by the Chapter 2’s files, then this chapter’s. Everything in this article is loadable, it ships with: Inside chapter 3’s folder, you will find: - 01-create-graph-type.cypher https://github.com/msenechal/enterprise-knowledge-layer-series/blob/main/chapter3/01-create-graph-type.cypher , the graph type schema for the blog series - 02-load-data.cypher https://github.com/msenechal/enterprise-knowledge-layer-series/blob/main/chapter3/02-load-data.cypher , this chapter’s dataset. - 03-queries.cypher https://github.com/msenechal/enterprise-knowledge-layer-series/blob/main/chapter3/03-queries.cypher , every query you can run against this graph to get value from this layer and answer the initial question. All the above are additive on top of Chapter 1 & 2. First run the graph type 01-create-graph-type.cypher https://github.com/msenechal/enterprise-knowledge-layer-series/blob/main/chapter3/01-create-graph-type.cypher Then load the data 02-load-data.cypher https://github.com/msenechal/enterprise-knowledge-layer-series/blob/main/chapter3/02-load-data.cypher . It creates: - 7 concepts one superseded, one still a proposal , - 4 attributes, - 4 rules - Linking with everything from chapter 1 & 2 Asking it questions Before we start, all the queries below are available in the same repository as it was in the chapter 1&2, in a separate chapter3 folder: 03-queries.cypher What does churn mean here, and who’s accountable for that meaning today? MATCH c:DataConcept {name: 'Customer Churn'} WHERE c.validTo IS NULLMATCH c - :STEWARDED BY - r:Role - f:FILLED BY - p:Person WHERE f.validTo IS NULLRETURN c.definition AS definition, r.title AS steward, p.name AS accountable; One row: the definition text, the stewarding role, and the person holding that role today, resolved through the same FILLED BY interval chapter 01 shipped. Which definition of churn was in force on 30 June 2025? MATCH c:DataConcept {name: 'Customer Churn'} WHERE c.validFrom <= date '2025-06-30' AND c.validTo IS NULL OR c.validTo date '2025-06-30' RETURN c.definition AS inForce, c.status AS status, c.validFrom AS validFrom, c.validTo AS validTo; The 2023 definition comes back, marked ‘superseded’, with its interval. There’s no version table or archive database behind this: the old meaning never left the graph, it just closed its interval. If your auditors have ever asked what a number meant when it was reported, this query is for them. The process says assess affordability. What does that mean here, and under which rule? php MATCH t:BusinessTask {id: 'task-assess-affordability'} - :GOVERNED BY - rule:BusinessRule MATCH c:DataConcept - :GOVERNED BY - rule MATCH c - :STEWARDED BY - r:Role - f:FILLED BY - p:Person WHERE f.validTo IS NULLRETURN t.name AS task, rule.name AS rule, rule.expression AS expression, c.name AS concept, c.definition AS definition, r.title AS steward, p.name AS accountable; Only one additional hop and we have the task, the rule, the threshold behind the rule, the concept, its definition, and the person who owns the meaning. And the definition is the sentence the process was missing: a borrower can afford a facility when their verified net monthly income, after existing commitments, covers the proposed repayment at or above the bank’s minimum debt service ratio, sustained for the full term of the facility . The row crosses three layers to get there, which is what the benefits of having all the layers in one graph gives us. Show me the churn family. MATCH p = :DataConcept {name: "Customer Churn"} - :SUBTYPE OF|SYNONYM OF|SEMANTIC MATCH - :DataConcept RETURN p; One picture: the enterprise definition in the middle, two scoped subtypes holding the old functional definitions, one confirmed synonym, and one extracted proposal waiting on a steward. Now the one that connects all 3 chapters so far: The credit committee wants to raise the affordability floor. What does that change, and who needs to know? MATCH p1 = rule:BusinessRule {id: 'rule-affordability-floor'} <- :GOVERNED BY - t:BusinessTask <- :HAS TASK - :BusinessActivity <- :HAS ACTIVITY - proc:BusinessProcess MATCH p2 = proc <- :OWNS - :Role - fo:FILLED BY - :Person WHERE fo.validTo IS NULLMATCH p3 = t <- :PERFORMS - :Role - fd:FILLED BY - :Person WHERE fd.validTo IS NULLMATCH p4 = rule <- :GOVERNED BY - :DataConcept - :STEWARDED BY - :Role - fs:FILLED BY - :Person WHERE fs.validTo IS NULLRETURN p1, p2, p3, p4; The rule from this chapter sits in the middle. Follow it one way and you reach the step it governs in chapter 02’s loan process, and from there the role that owns the process and the underwriters who perform the step, all from chapter 01. Follow it the other way and you reach what affordability means and who stewards that meaning. Before the floor moves, everyone it affects is already on the screen. What’s next The bank now agrees on what churn means. The graph still can’t hand you the number. That’s the next layer: data products, meaning consumption-ready data packaged for an outcome, with freshness, quality and contracts attached, starting with the Customer Churn Risk product these concepts were designed for. That chapter is in the works. Before then, I suggest you try two things. First, pick a term that means different things to different teams in your organisation and model it the same way: the enterprise definition, a variant for each team that needs one, and a role to steward each of them. A good place to start could be a term that already shows up in your BI/analytic reports. Second, load chapters 01 to 03, point the official Neo4j MCP server at your database read-only, and ask it what churn means, then ask what it meant last year. It will answer both, from the same graph. Similar to how we wrapped up in chapter 2, here is a concrete example of using the knowledge layer we are building, in claude, through MCP: Chapter 01 https://medium.com/neo4j/the-enterprise-knowledge-layer-operating-structure-93f5a68f94cf gave AcmeBank its structure and chapter 02 https://medium.com/neo4j/the-knowledge-layer-for-enterprise-processes-f0fc54157e0a its process. This chapter gave it its definitions and meanings, and the next one turns those words into something you can consume. The knowledge layer for enterprise: Domain Ontology https://medium.com/neo4j/the-knowledge-layer-for-enterprise-domain-ontology-dea3197d5cf0 was originally published in Neo4j Developer Blog https://medium.com/neo4j on Medium, where people are continuing the conversation by highlighting and responding to this story.