Ontology

In Mix, the ontology for your model comprises intents, entities (previously referred to as concepts), information about relationships (for example, between intents and entities or between entities and other entities), and grammars associated with such information.

For more information about ontologies in Mix, see Ontology.

About the exported ontology package

The package file exported with the export project ontology package endpoint uses the following naming convention:

projectid-projectname-ontology-exportdate-exporttime.zip

Where:

  • projectid is the ID of the project
  • projectname is the name of the project
  • exportdate is the date that the package was exported, in the yyyy-mm-dd format
  • exporttime is the time that the package was exported, in the hh-mm-ss format, using Greenwich Mean Time (GMT)

For example:

  • Ontology export: 2960-Coffee App-ontology-2021-05-31-15-27-33.zip

Ontology package file structure

An ontology package can include the following files:

File name Description Availability
locale/locale.trsx
(for example, en_US/en_US.trsx)
TRSX file that defines the NLU ontology for a locale. See the TRSX documentation for details. All users
locale/grammars/name/name.grxml
(for example, en_US/grammars/CARD_TYPE/CARD_TYPE.grxml)
GrXML files that define any rule-based grammars. See Rule-based entities for details. Only available if rule-based grammars have been defined for this project. Nuance Professional Services users
(see note)

Appending to an ontology

When you append content to the ontology of the project, the content is added to the existing ontology.

Make sure to include the ontology files (that is, the .TRSX file as well as any corresponding .grxml files) as described in Ontology package file structure, following the same structure.

Export project ontology package

GET /v4/projects/{projectId}/ontology/.export

Export the project ontology package to a .zip file. Note that rule-based grammars are restricted and not available to all users. As such, the ontology package exported by regular users will not include these files. Regular users may end up with an incomplete ontology after calling this endpoint. See About the exported ontology package for details.

Responses

Status Meaning Description Schema
200 OK Ontology package (zip file, with application/octet-stream content-type) Inline
401 Unauthorized Request could not be authorized Inline
404 Not Found Project not found Inline
500 Internal Server Error Internal server error Inline
default Default An unexpected error response. grpc.gateway.runtime.Error

Append project ontology

PUT /v4/projects/{projectId}/ontology/.append

Append the content in the provided .zip file to the project ontology.

Parameters

Name In Type Description
projectId path string ID of project to append the ontology to.
ยป content body string (binary) Zip file of the ontology content to append.

Responses

Status Meaning Description Schema
200 OK Job successfully created mix.api.JobResponse
401 Unauthorized Request could not be authorized Inline
404 Not Found Project not found Inline
500 Internal Server Error Internal server error Inline
default Default An unexpected error response. grpc.gateway.runtime.Error

Example responses

  Job successfully created  

Get entity types

GET /v4/ontology/entity-types

Retrieve the available entity types.

Responses

Status Meaning Description Schema
200 OK List of available entity types mix.api.ListEntityTypesResponse
400 Bad Request Bad Request Inline
401 Unauthorized Request could not be authorized Inline
500 Internal Server Error Internal server error Inline
501 Not Implemented Feature is not yet enabled Inline
default Default An unexpected error response. grpc.gateway.runtime.Error

Example responses

  200 response