Curltale AI

Docs › Ontology

The Excel template

The workbook that describes your model: every sheet and column, how upload works.

Download it from Changes & versions: blank, or filled with any version (an export). Sheets:

SheetOne row per
InstructionsHow to fill it in.
ModelA model property (name, version, standards, what each sensitivity class means...).
EntitiesEntity.
FieldsField (attribute or calculated field) of an entity.
ValuesAllowed value of a field (value, label, note).
FiltersNamed filter of an entity.
ChecksData-quality check of an entity.
RelationshipsRelationship (ids can be left empty: they are numbered automatically).
ExamplesQuery example (ids can be left empty).

Conventions: required columns have a red header; every header has a help comment; closed lists are dropdowns; list cells separate items with | ; lifecycle states are one line per status column; parameters of examples are JSON. Any column the template does not define is a custom property (grey header in exports).

Upload (modeller role): the file (up to 20 MB) is first checked without creating anything. The report gives every problem with sheet, row and column, plus counts of what would be created. Only a file without errors becomes a draft; an existing draft is replaced only when you choose to. Export and re-import lose nothing.

An export by someone without the restricted entitlement leaves out the examples of restricted fields.

A minimal workbook#

You do not need every column to start. This is the smallest model that uploads without a single error: two entities, their fields, one filter and one relationship. It has been checked against the upload report.

Sheets. A workbook must contain all nine sheets, in any order, even the ones you leave empty: Instructions, Model, Entities, Fields, Values, Filters, Checks, Relationships, Examples. Do not rename or delete them. Easiest: download the blank template and fill it in.

Model (row 1 is a header; the model's name is required):

settingvalue
nameShop

Entities (required columns only, plus a definition):

keynamedomainkindsemantic_tablebusiness_keysystem_of_recorddefinition
customerCustomerSalesmasterpublic.customerscustomer_noCRMA person or company that buys from us.
orderOrderSalestransactionpublic.ordersorder_noShopOne purchase by a customer.

Fields (required columns, plus a description and, on the foreign key, the entity it points to):

entity_keycolumnrolebusiness_nametypesensitivitydescriptionreferences
customeridprimary_keyCustomer idintegerinternal
customercustomer_noattributeCustomer numbertextinternalWhat people quote when they call us.
customeremailattributeEmailtextpersonal
orderidprimary_keyOrder idintegerinternal
orderorder_noattributeOrder numbertextinternal
ordercustomer_idforeign_keyCustomerintegerinternalCustomer
ordertotalfact_measureOrder totaldecimalconfidentialTotal in EUR.
orderclosed_atattributeClosed attimestampinternalEmpty while the order is open.

Filters:

entity_keynamefiltersynonymsstatus
orderopen orderclosed_at IS NULLnot closed \in progress

Relationships (note: from and to use entity names, not keys):

frompredicatetocardinalityjoinstatus
Orderis placed byCustomermany-to-oneorder.customer_id = customer.idconfirmed

Values, Checks and Examples can have just their header row (entity_key, column, value, label; entity_key, id, rule; title, sql).

Upload it, read the report, and you have a draft. Then add what makes the model valuable: meanings, allowed values, more filters, calculated fields, checks and worked examples.

Keys or names? entity_key, applies_to and an entity's subtype_of use the entity key (customer). A field's references, and from and to in Relationships, use the entity name (Customer).

Column reference#

Every sheet, every column, taken from the template itself. Required columns have a red header in the workbook; the others are optional. Closed lists are dropdowns.

Entities#

ColumnNeededMeaning
keyrequiredShort lower_snake_case id, used everywhere else in this workbook (customer, order_line).
namerequiredBusiness name shown to people and agents.
domainrequiredBusiness domain: Sales, Finance, Operations...
kindrequiredWhat sort of concept it is. One of: master, reference, transaction, fact, relationship, bridge, agreement, supertype, derived, technical.
definitionoptionalOne or two sentences: what one row of this entity is.
semantic_tablerequiredschema.table in the database that holds it.
primary_keyoptionalColumn that identifies a row.
business_keyrequiredColumn(s) people use to identify it (customer number, order number).
system_of_recordrequiredThe system that owns the data.
synonymsoptionalOther words for it, separated by " \
not_to_confuse_withoptionalThings it is often mistaken for, with the difference. Separated by " \
belongs_tooptionalParent concept, if any.
subtype_ofoptionalEntity key of the supertype, if any.
model_statusoptionalHow settled this entity is in the model. One of: confirmed, new, placeholder.
standard_resourceoptionalOptional. Name of the matching concept in an industry standard you follow.
standard_referenceoptionalOptional. Which standard / document it comes from.
standard_detailoptionalOptional. Any further reference (API, section).
lifecycle_statesoptionalOne line per status column: "status: draft > active > closed".
example_questionsoptionalTypical questions this entity answers. Separated by " \

Fields#

ColumnNeededMeaning
entity_keyrequiredEntity this field belongs to.
columnrequiredColumn name in the entity's table; for a calculated field, a short code.
rolerequiredprimary_key / foreign_key / attribute ... or calculated: a value computed from the data, not a column. One of: attribute, primary_key, foreign_key, alternate_reference, dimension, fact_measure, derived_attribute, lineage, calculated.
business_namerequiredName people use.
typerequiredData type. One of: text, integer, decimal, boolean, date, timestamp, text[].
descriptionoptionalWhat the value means (for a calculated field: how it is computed, in words).
sensitivityrequiredinternal / confidential / personal / restricted. One of: internal, confidential, personal, restricted.
agent_accessoptionalfull, masked (shown as a stable hash to callers without the class) or none. Default: none for restricted, otherwise full. One of: full, masked, none.
review_statusoptionalHow settled the definition is. Default needs_review. One of: confirmed_by_team, by_design, high_confidence, needs_review, source_needed.
referencesoptionalFor foreign keys: the entity NAME it points to.
formatoptionalPattern, e.g. two letters + 6 digits.
exampleoptionalA sample value (never a restricted one).
business_termoptionalGlossary name of this field.
business_term_descriptionoptionalGlossary definition.
standard_nameoptionalOptional. The name in the industry standard you follow.
unitoptionalUnit of the value: count, EUR, hours...
sqloptionalCalculated fields: optional SQL that computes the value. Context for agents, never run by the app.

Values#

ColumnNeededMeaning
entity_keyrequiredEntity of the field.
columnrequiredField whose values these are.
valuerequiredAn allowed value (the code stored in the column).
labeloptionalWhat it reads as to people.
noteoptionalAnything worth knowing about this value.

Filters#

ColumnNeededMeaning
entity_keyrequiredEntity the filter applies to.
namerequiredThe words people use: open order, unpaid invoice.
filterrequiredSQL condition on the entity's table, columns unqualified (closed_at IS NULL, amount_due > 0).
synonymsoptionalOther ways to say it. Separated by " \
descriptionoptionalWhat it means.
statusoptionalgoverned (agreed) or working (not confirmed yet). Default working. One of: governed, working.
sourceoptionalWhere the definition comes from.

Checks#

ColumnNeededMeaning
entity_keyrequiredEntity the check is about.
idrequiredCheck id, unique per entity (DQ01).
rulerequiredThe data quality rule in words.
sqloptionalOptional SQL returning one column n = number of violations (must be 0); run by the Model check.
noteoptionalCaveats.

Relationships#

ColumnNeededMeaning
idoptionalR-001... Leave empty to number automatically.
fromrequiredEntity NAME (as in the Entities sheet) where the link starts.
predicaterequiredThe verb: places, belongs to, is billed on.
torequiredEntity NAME where it ends.
cardinalityrequiredmany-to-one... One of: many-to-one, one-to-many, one-to-one, many-to-many, many-to-zero-or-one (optional), subtype-of.
joinrequiredExact join: a.col = b.col
statusrequiredconfirmed, optional (may be empty) or unreliable (often empty or wrong). One of: confirmed, optional, unreliable.
status_detailoptionalWhy it has that status.
sentenceoptionalThe link as a sentence. Default: built from the names.
noteoptionalCaveats.

Examples#

ColumnNeededMeaning
idoptionalEX01, EX02... Leave empty to number automatically.
titlerequiredThe question the example answers.
bodyoptionalA note on the path it takes or what to watch for.
sqlrequiredThe query, with :parameters.
paramsoptional{"customer_id": "customer"} parameter -> entity key.
sample_sqloptionalA query returning one row of parameter values, so the example can be tried on real data.
applies_tooptionalEntity keys this is about. Separated by " \
topicoptionalOptional grouping.
sourceoptionalWhere it comes from.

Model#

The Model sheet is a list of settings, one per row (name in the first column, value in the second).

RowMeaning
nameName of the ontology
idShort id
versionVersion number
dateDate
sourceWhere it comes from
statusReview status text
standardsStandards followed, separated by |
access.internalWhat internal means in your organisation
access.confidentialWhat confidential means
access.personalWhat personal means
access.restrictedWhat restricted means
access.row_levelThe row-level rule, in words (documentation only: row-level security is not enforced)
how_to_readReading notes, separated by |

This documentation covers version 0.2.0. Something missing or wrong? Open an issue.