Ontology
An ontology is the schema that turns provisional keyword mentions into a typed world model: entity types, relation types, and the patterns that connect them (Owner -[:HAS]-> Pet). You can publish a schema before a single file exists, or upload your corpus first and let Fontana propose one from what it finds.
Building an ontology
Section titled “Building an ontology”You can build a schema through any combination of three sources:
- Bring your own: write the namespace’s
ontology.ttlwith OWL classes and object properties and SKOS labels (see Schema format). - Algorithmic mining: a miner that calls no model reads structure already explicit in your corpus (csv and spreadsheet column headers, markdown table headers, repeated capitalised phrases and acronyms, folder and filename patterns) and finds candidate types with evidence counts. A candidate never enters the ontology on its own: under
evolve, entity resolution adds it when it types an entity with it. - AI discovery: on demand, Fontana samples representative chunks from your corpus and proposes a schema (entity types, relation patterns, aliases) with the strongest model configured for the namespace, because schema errors compound into every later extraction. You edit the proposal, then publish.
Schema-first and data-first namespaces use the same publish step. Publishing a schema for the first time triggers a keyword re-index (seconds per file, no model call) rather than a full reprocess.
Schema format
Section titled “Schema format”Fontana keeps your schema as Turtle, in standards your ontology team and RDF tools already read:
| Ontology part | Standard term |
|---|---|
| Entity type | owl:Class; its parent is rdfs:subClassOf |
| Name, aliases, description | skos:prefLabel, skos:altLabel, skos:definition |
| Relation type | owl:ObjectProperty with rdfs:domain and rdfs:range; several allowed types are an owl:unionOf class, none means any type |
| Constraints on relations | SHACL shapes |
| Fontana settings | annotation properties of the Fontana vocabulary https://fontana.ai/vocab/kg#: provisional, conflictPolicy, temporal and allowCoOccurrence on a term, the evolution and keyword policy on the owl:Ontology node, and every term’s short id |
Each of Fontana’s own types and relations has an IRI under the namespace’s base IRI, https://fontana.ai/kg/<namespace>/ by default and the same in every environment: …/type/bond for an entity type, …/relation/issued_by for a relation type. The namespace’s own base IRI is the IRI of the file’s owl:Ontology node; you set it on the Ontology tab. A term taken from a published standard keeps that standard’s IRI.
The file is a set of statements written in a fixed order with fixed prefixes, so the same ontology always gives the same file and a change shows as a small diff. Statements Fontana does not use itself, such as SHACL shapes or another annotation on a term, are kept when Fontana writes the file again.
Entity type hierarchy
Section titled “Entity type hierarchy”Entity types in a namespace form a hierarchy. Every entity type has at most one parent. A type with no parent is a top-level type. A type placed under a parent is a kind of that parent: Bond is a kind of Debt instrument, which is a kind of Instrument.
The hierarchy is kept in the namespace’s recognition file, .fontana/kg/recognition.yaml, which you edit on the Ontology tab. Each key in the file is an entity type, its value is the types under it, and a leaf is an empty mapping ({}). An absent recognition file means Fontana’s own tree, so a later change to that tree reaches a namespace that has not customised it.
Fontana’s built-in types come with these default parents:
| Parent | Kinds |
|---|---|
| Organization | Legal entity, Government entity, Not-for-profit organization, Financial institution, Sole proprietorship |
| Legal entity | Corporation, Partnership, Trust, Private limited company |
| Instrument | Equity, Debt instrument, Derivative, Loan |
| Equity | Share |
| Debt instrument | Bond, Asset-backed security |
| Derivative | Option, Future, Forward, Swap |
| Swap | Credit default swap |
| Loan | Mortgage |
| Collective investment vehicle | Fund |
| Fund | Private equity fund, Private credit fund, Investment fund |
| Account | Cash account, Securities account |
| Transaction | Trade, Payment, Capital call, Distribution |
| Trade | Foreign exchange trade |
| Payment | Credit transfer, Direct debit |
| Corporate action | Dividend, Stock split, Merger, Rights issue, Spin-off |
| Document | Agreement |
Every other built-in type is top-level. That includes Person, Organization, Party, and party roles such as Issuer, Investor, Custodian and Counterparty.
How a type gets its parent
Section titled “How a type gets its parent”A type is created in a namespace when you save the recognition file, when a file is processed and something of that type is recognised, or when the Ontology Agent proposes it. Its parent is decided at that moment:
- A type that is a key in the recognition file sits under the key above it. A key with nothing above it is top-level, including Bond when you place Bond at the top of the file.
- A type the file does not name takes its default parent from the table above. Any default parent the namespace does not have yet is created with it: a document that produces Bond, when Bond is not a key in the recognition file, also creates Debt instrument and Instrument.
- A type that already exists keeps the parent it has until you save a recognition file that places it somewhere else. A new type created under a parent you have moved follows that parent.
A relation type declared between types also applies to their kinds: a relation whose source is Instrument applies to a Bond. Entity search by type includes kinds, so asking for entities of type Instrument returns Bonds as well.
Moving a type
Section titled “Moving a type”You change a parent by editing the recognition file on the Ontology tab. With write access to the namespace, Save writes the file and moves each existing type under the parent the file names. A new key becomes a type immediately, so the graph shows the tree before any document mentions it. Reset to default restores Fontana’s tree; saving that tree removes a custom recognition file.
Fontana refuses a file that does not parse, and a move that would place a type under itself or under one of its own kinds. It shows the reason and writes nothing in that case. Each move that does save is recorded in the activity log.
Evolution policy: strict, evolve
Section titled “Evolution policy: strict, evolve”During review, the Ontology Agent and entity resolution meet entities or relationships that do not fit your schema. You choose what happens to that off-schema signal, per namespace, and it happens at once:
| Policy | Behaviour |
|---|---|
strict |
A type or relation outside the schema is dropped; only schema-conforming facts are written |
evolve (default) |
The new type or relation is added to the ontology marked provisional, and matching facts are written in the same run |
A provisional type stays marked until a person confirms or deletes it on the Ontology tab.
When the Ontology Agent proposes a new entity type that is a kind of an existing one, it can name that type as the parent. With evolve, the type is added under that parent, marked provisional. With strict, the proposal is dropped. The agent cannot move a type that already exists; you do that by saving the recognition file on the Ontology tab.
Ontology tab
Section titled “Ontology tab”Open a namespace in KG Studio and choose Ontology. The tab has two views, Recognition and Relations.
Recognition opens first. Its tree shows the namespace’s entity types, with each provisional type in its place, under its parent or at the top level, marked. Confirm on that row removes the mark and adds the type, with any parent the file lacks, to the recognition file. Delete removes the type from the ontology and from any relation type that names it; Fontana refuses to delete a type that still has subtypes. Both work once your edits are saved. Below the tree, the editor holds the namespace’s recognition file. Beside the editor, a Standards column lists each library of entity types as the same kind of tree, so you can build the file by ticking names: ticking a name inserts that type under its default parent when that parent is already a key, and at the top level otherwise; unticking a name removes that key and the keys nested under it. Save and Reset to default are on this view, and an unsaved change is still there when you switch to Relations and back. While Recognition is open, the page chat reads the same file and saves through the same Save.
Relations is a read-only list of each relation type and the types it goes from and to. Above it, Base IRI shows the base your namespace’s own types and relations use, marked as the default until you change it. With write access you can set your own: an absolute https IRI ending in / or #. Saving moves the IRI of every type and relation Fontana made, keeps the IRI of each type taken from a published standard, and never changes a short id. Entity IRIs in any export you make afterwards change with it; an export made before keeps the old IRIs.
Recognition looks only for the keys in the file. Saving the file creates and moves the types it names and removes the confirmed types it no longer names. A provisional type is never removed by a save, whether or not the file names it; only Delete removes it.
Where the ontology is kept
Section titled “Where the ontology is kept”A namespace keeps its ontology as a file in Fontana Files, .fontana/kg/ontology.ttl, and its recognition tree as .fontana/kg/recognition.yaml. The ontology file is the whole record of the ontology: its types and relations, their provisional marks, the evolution policy and the keyword policy. Every change to the ontology is written to that file first and to the graph after it: the evolution policy you set in KG Studio, a type you confirm or delete, a term the Ontology Agent proposes, or a type entity resolution adds. Candidate types mined from your documents, and the evidence behind them, are not kept in the file; they come back when the graph reloads your documents’ processing results.
A namespace that still has the earlier .fontana/kg/ontology.json is converted once, in one change that writes ontology.ttl and removes the JSON file: its published types and relations are kept, a namespace on the retired log policy becomes strict, and the stored drafts and review decisions are not carried over.
What the Ontology Agent writes about instances (its facts, the entity types it sets and the entities it merges) is appended to .fontana/kg/manual-triples.jsonl in the same namespace before it reaches the graph, and merge decisions go to .fontana/kg/finalize-decisions.jsonl. A rebuilt graph loads these files after the ontology and the processing results, so it holds the same schema and the same curated facts without a model call. See Rebuilding the graph.
Provenance of mined types
Section titled “Provenance of mined types”Every entity type Fontana mines from your documents keeps a record of where it came from: the documents whose headings, table headers, acronyms or capitalised phrases produced it, and how often it occurred in each. Select a type in the KG Studio graph to see its Provenance, and switch on Entity types with Entities to see every entity attached to its type. When you reprocess or delete a document, its evidence is updated with it.
What publishing does and does not invalidate
Section titled “What publishing does and does not invalidate”Publishing a new ontology version is cheap for most of your corpus:
| Data | Effect of a new publish |
|---|---|
| Chunks, outline, full-text index, embeddings | Untouched; never invalidated by a schema change |
| Keyword mentions and co-occurrence signals | A keyword re-index re-scans each file (seconds per file, no model call) |
| Typed relationships and model-derived mentions | Marked stale (hash mismatch); re-extraction is explicit and budgeted, not automatic |
The expensive steps, parsing and embedding, are schema-independent by construction, so evolving your schema never forces a full reprocess of a large corpus.