Skip to main content

CREATE ONTOLOGY

Commands › Extracting entities from documents · Admins only, through sercha_define or a tenant file

Creates an empty ontology. An ontology holds the entities (CREATE ENTITY), edges, record types and structures that extraction reads out of a corpus's documents. This is the older document-extraction layer; new work usually lands documents as tables and builds the model over them with CREATE ENTITY and CREATE RELATION.

Syntax​

CREATE ONTOLOGY <name>

Parameters​

ParameterDescription
<name>The ontology's name. Entities in it are named <name>.<Entity>.

Usage notes​

  • A second ontology of the same name is an error.
  • The ontology is a draft until a corpus is bound to it. BIND CORPUS and REBIND CORPUS freeze the draft as a numbered version, which extraction then uses.
  • Extracted rows are read from the corpus, not the ontology: SELECT ... FROM <corpus>.<Entity>.

Examples​

CREATE ONTOLOGY finance;
CREATE ENTITY finance.Invoice (
invoice_no TEXT KEY EXTRACT 'The invoice number as printed',
total NUMERIC EXTRACT 'The invoice total including tax'
) ROOT;
result
ontology "finance" created (id=finance)

See also​

CREATE ENTITY (extraction) · CREATE EDGE (ontology) · CREATE CORPUS · BIND CORPUS · DROP ONTOLOGY