Publish a draft ontology
When the draft describes your business the way you want, publish it. Publishing makes the ontology final, so that you can use it in an Agent Context or as a template ontology. For more information about template ontologies, see Choose a template ontology (optional).
When you publish, AWS Context checks the draft again. If the checks pass, the draft becomes version 1.0.0, the ontology’s only version. The ontology’s status changes to PUBLISHED.
To publish a draft ontology on the AWS Context console, follow these steps:
-
On the Ontologies page, open the induction that you want to publish.
After you publish, the ontology’s status never changes back to DRAFT, and you can’t edit the draft.
-
Choose Publish.
-
In the Publish ontology dialog box, confirm that you want to publish.
The console shows the ontology as Published. The ontology now has version 1.0.0.
Publish a draft with the API
To publish a draft with the API, call UpdateOntology with the draft’s ID (ontologyId), status set to PUBLISHED, and the draft’s current revision ID (revisionId). Don’t send a draft in the same call.
The following example shows the inputs for publishing a draft with UpdateOntology.
UpdateOntology ontologyId: <the draft's ontologyId> revisionId: <the draft's current revisionId> status: PUBLISHED
If publishing fails
If the checks fail, the call fails with a ValidationException, and the ontology stays DRAFT. Fix the issues, save the draft, and publish again. For information about how to fix the issues, see Fix errors.
If the call fails with a ConflictException, the ontology doesn’t change. A ConflictException has one of the following causes:
-
The ontology isn’t a draft. For example, it’s already published. You can publish only a draft.
-
Someone saved another edit after you read the draft, so your revision ID is out of date. Read the draft again with
GetOntology, and publish with the new revision ID. -
An earlier attempt to publish the same revision left stored files that differ from this attempt’s. Save the draft again with a draft edit, which starts a new revision, and then publish.
-
Another request changed the ontology at the same moment. Read the ontology again, and then try again.
If the call fails with a ThrottlingException, send the same request again with the same clientToken. AWS SDKs do this for you. A retry with the same token returns the result of the first call.
Next steps
After you publish the ontology, you can do the following:
-
Use it in an Agent Context. To do so, map it to a knowledge base connection. For how to create a mapping and choose its ontology, see Data mapping. For what AWS Context does with the ontology there, see Import into the Agent Context.
-
Use it as the template ontology of a new induction. For more information, see Start an ontology induction.
-
Remove it from Agent Contexts or delete it when you no longer need it. For more information, see Removing and deleting ontologies.
To change the classes, attributes, or relationships of a published ontology, start a new induction with it as the template ontology. Then review and publish the new ontology. You can still change a published ontology’s name and description with UpdateOntology.