Creates a business entity, saved at once. Fails when a table or key column does not exist, is hidden or is not in
an attached database, and with a conflict when the ontology already has an entity of that name in any letter case.
supportingTables lists the tables around the members (detail, link, measurement or lookup) and may be omitted;
a table listed twice is refused with ONTOLOGY_SUPPORTING_TABLE_DUPLICATE, and a member with
ONTOLOGY_SUPPORTING_TABLE_IS_MEMBER.
The entity to create.
A Promise that resolves to the created entity.
Creates an ontology. It stores no relationships: call generate to propose them, the schema associations of the attached databases included.
The ontology to create.
A Promise that resolves to the ontology.
Creates a property of a business entity, saved at once and human-sourced unless the request says otherwise. Fails
when a source is not on a member or supporting table of the entity (ONTOLOGY_PROPERTY_NOT_A_MEMBER), repeats a
table or names a missing or hidden column, or is on a supporting table next to another source
(ONTOLOGY_PROPERTY_SUPPORTING_SOURCE_ALONE); with a conflict when the entity has a property of that name, or one
that uses one of its source columns.
The property to create.
A Promise that resolves to the created property.
Creates a relationship, saved at once. Fails when a table or column does not exist, is hidden or is not in an attached database, when an entity id does not name an entity of the ontology that has its side's table as a member or a supporting table, when a confirmation column does not exist, and with a conflict when the ontology already has the link.
The relationship to create.
A Promise that resolves to the created relationship.
Deletes a business entity with its properties. A generated one is remembered, so runs do not propose it again.
Id of the entity.
A Promise that resolves when the entity is deleted.
Deletes an ontology with its relationships, entities and properties.
Id of the ontology.
A Promise that resolves when the ontology is deleted.
Deletes a property. A generated one is remembered, so runs do not propose it again.
Id of the property.
A Promise that resolves when the property is deleted.
Deletes a relationship. A deleted imported or generated relationship is remembered, so imports and runs do not propose it again.
Id of the relationship.
A Promise that resolves when the relationship is deleted.
Removes the result of the last finished run without saving it.
Id of the ontology.
OptionalstartedAt: number
The startedAt of the result read, so a newer run's result is kept. Omitted removes any.
A Promise that resolves when the result is gone.
Follows a relationship from starting records to the rows of the other table that equal a starting key on every
join column. Each row is labelled by the relationship's confirmation columns, with totals per label; a hidden
column is never read. Confirmation columns and filters compare dates and timestamps by calendar day, ignoring the
time of day. Fails when the request passes a limit of AI_ONTOLOGY_LIMITS, such as more than
maxFollowStartRecords starting records or maxFollowLinkedRows linked rows.
The relationship, the starting table, column and values, and the columns to return and sum.
A Promise that resolves to the labelled rows, the totals per label and a note on how to read them.
Starts the background run that proposes the content of the ontology, saving nothing: it imports the schema
associations of the attached databases, generates relationships and business entities from the schemas and
sampled rows, then properties for up to 50 entities that have none, then reads each attached knowledge base. Once
lastGenerationRun is completed, read the proposed content with getGenerationResult and store it, as it
is or edited, with saveContent. Fails with a 409 while a run is already going.
Id of the ontology.
Optionaloptions: Omit<GenerateAiOntologyRequest, "ontologyId">
usePreviousOntology: true (the default) starts from the stored content and adds to it;
false starts from nothing and generates everything again, which needs an attached database or knowledge base.
mode: update (the default) or regenerate, which also proposes removing the AI-generated rows the run no
longer finds.
A Promise that resolves to the ontology with the started run.
Starts a background run that generates only properties, for the named business entities or, with none named, for
up to 50 entities that have no property yet, saving nothing. It proposes new properties, and more sources for
held ones, kept in suggestedSources when a person made or edited the property. Take its result as
generate describes. Fails with a 409 while a run, of either kind, is already going.
Id of the ontology.
Optionaloptions: Omit<GenerateAiOntologyPropertiesRequest, "ontologyId">
entityIds: 1 to 50 entities to generate properties for.
A Promise that resolves to the ontology with the started run.
Reads the stored relationships, business entities, properties and knowledge base records of an ontology, with the revision a save of them sends back.
Id of the ontology.
A Promise that resolves to the content and its revision.
Reads the content the last run proposes, once it completed. The result's revision is that of the content the run started from. It is kept for a day, until a save of the content, discardGenerationResult or the next run removes it.
Id of the ontology.
A Promise that resolves to the result, absent when there is none.
Gets one ontology.
Id of the ontology.
A Promise that resolves to the ontology, or undefined when it does not exist.
Lists the business entities of an ontology.
Id of the ontology.
A Promise that resolves to the entities.
Lists the ontologies, each with the number of its relationships and business entities.
A Promise that resolves to the ontologies.
Lists what the ontology stores about its attached knowledge bases: per knowledge base a refresh has read, its summary, root topics and the business entities each topic's documents are about.
Id of the ontology.
A Promise that resolves to the records, in attached order.
Lists the properties of an ontology.
Id of the ontology.
Optionaloptions: Omit<ListAiOntologyPropertiesRequest, "ontologyId">
Returns only the properties of entityId. Default: all properties.
A Promise that resolves to the matching properties.
Lists the relationships of an ontology, each with the business entity of each side that resolves to one.
Id of the ontology.
A Promise that resolves to the relationships.
Starts a background run of only the knowledge base step of generate, saving nothing: it reads the root topics of each attached knowledge base and links them to business entities. Take its result as generate describes. Fails with a 400 when no knowledge base is attached and a 409 while a run, of any kind, is already going.
Id of the ontology.
A Promise that resolves to the ontology with the started run.
Deletes every relationship, business entity and property of an ontology, and what it remembers as removed, and keeps the ontology, its databases, its last run record and the agents that use it. Fails with a 409 while a generation run is going; the ontology reports a running generation while the reset deletes.
Id of the ontology.
A Promise that resolves when the ontology is empty.
Replaces the stored content of an ontology. New and changed rows are checked as a create or an update would check
them; a row sent back unchanged is kept. A generated row the save removes is remembered, so runs do not propose it
again. Fails with ONTOLOGY_CONTENT_CHANGED (409) when the stored content changed since revision was read.
The ontology, the whole content, the revision it builds on and whether it comes from a run that started over.
A Promise that resolves to the stored content and its new revision.
Replaces the name, the description and the members of a business entity and sets its source to human. An omitted supportingTables keeps the stored list, and an empty list clears it. A kept supporting table
that becomes a member leaves the list. A table cannot become a supporting table while a property of the entity has
a source on it plus another source (ONTOLOGY_SUPPORTING_TABLE_PROPERTY_CONFLICT, 409). A repeated or member
supporting table is refused with ONTOLOGY_SUPPORTING_TABLE_DUPLICATE or ONTOLOGY_SUPPORTING_TABLE_IS_MEMBER.
The id of the entity and its new fields.
A Promise that resolves to the updated entity.
Replaces the name, the description, the attached databases and, when given, the attached knowledge bases of an ontology. Attaching a database stores no relationships: the next generate run proposes them. Relationships of a detached database are kept, so attaching it again brings back its edits; a detached knowledge base loses its record. Changing the databases or knowledge bases fails with a 409 while a generation run is going.
The id of the ontology and its new fields.
A Promise that resolves to the ontology.
Sets the topic links of an attached knowledge base: each joins one of its topics, by name, and a business entity. The links named replace every other link; a generated link removed is remembered. Later runs keep these links and still refresh the summary and topics. Fails with a 409 when the record or its links changed since they were checked, by another edit or an entity delete: read it again.
The ontology, the knowledge base and its topic links.
A Promise that resolves to the updated record.
Replaces the name, description, type and sources of a property, sets its source to human and clears its
suggested sources. An omitted sensitivity or agentVisible keeps its stored value, and
sensitivity: null clears the tag. A source the property already stores is kept even when its table has left the
entity or its column is hidden, so such a property can still be hidden or edited; a new source is checked like one
of createProperty (ONTOLOGY_PROPERTY_NOT_A_MEMBER for a table of neither kind), including the rule that
a source on a supporting table is the only source. Fails with a conflict when another property of the entity uses
one of its source columns.
The id of the property and its new fields.
A Promise that resolves to the updated property.
Replaces the sides, label and description of a relationship. An omitted entity id or
confirmation columns, or one sent back unchanged, keeps the stored value; null or [] clears it. A side moved to
another table checks its entity id again and removes an omitted one that no longer fits. A generated or
schema-imported relationship becomes human-sourced, so a later import or generation run leaves the edit in place.
The id of the relationship and its new fields.
A Promise that resolves to the updated relationship.
AiOntologyClient manages the ontologies of the application: databases, the relationships between their tables, the business entities those tables hold and the properties of those entities. Generation proposes content that saveContent stores; every stored row reaches models.