Upload an ontology
You can upload your ontology on the AWS Context console or with the API. AWS Context checks the file while you wait. If the checks pass, AWS Context publishes the ontology, and you can use it in your Agent Contexts.
Upload an ontology on the console
To upload an ontology on the AWS Context console, follow these steps:
-
On the Ontologies page, choose Import ontology.
-
For Ontology name, enter a name for your ontology.
-
(Optional) For Description, enter a description. If your file has a description, the console fills it in for you.
-
For Definition file, choose Choose file, and then choose your
.ttlfile. You can also drag the file onto the page. -
(Optional) For Tags, add tags. A tag is a key and an optional value that you assign to the ontology, so that you can organize, find, and manage your ontologies.
-
Choose Import.
When the upload finishes, your ontology appears on the Ontologies page. If AWS Context finds problems in the file, the console lists them so that you can fix the file and upload it again. For more information, see Errors and warnings after an upload.
Upload an ontology with the API
To upload an ontology with the API, call CreateOntology. Send a name (name), the format (sourceFormat, set to TURTLE), and the content of your file (source). A description (description) and tags (tags) are optional.
CreateOntology also requires a client token (clientToken): 1 to 64 printable ASCII characters, with no spaces. A request without one fails with a ValidationException. The AWS SDKs and the AWS CLI generate a token for you if you don’t set one, so you need to send it yourself only when you call the API directly. The token makes the request safe to retry:
-
If you repeat the same request with the same token within 8 hours, AWS Context returns the ontology that the first request created. It doesn’t create a second one.
-
If you send a different request with the same token, for example with an edited
sourceor a differentname, the call fails with aValidationExceptionthat namesclientToken. The original ontology doesn’t change.
The following example shows the inputs for the CreateOntology API request. It isn’t a complete request. Replace the values in angle brackets with your own values:
CreateOntology clientToken: <a unique token for this request> name: Claims ontology sourceFormat: TURTLE source: <the content of your .ttl file> description: <optional: a description of your ontology>
The response includes the ontology’s ID (id), its Amazon Resource Name (arn), and any warnings (validationIssues).