Context / Client / start_ontology_induction
start_ontology_induction¶
- Context.Client.start_ontology_induction(**kwargs)¶
Starts an ontology induction, which induces a draft ontology from the documents that you provide. The induction runs asynchronously. To get its status, call GetOntologyInduction. When the induction’s status is
DRAFT, AWS Context has created the ontology as aDRAFT: GetOntologyInduction returns the ontology’s ID, and GetOntology returns the draft. To publish the draft, use the AWS Context console. Because AWS Context creates the ontology on your behalf, you needcontext:CreateOntologypermission in addition tocontext:StartOntologyInduction. If you specify tags, you also needcontext:TagResourcepermission.See also: AWS API Documentation
Request Syntax
response = client.start_ontology_induction( clientToken='string', ontologyName='string', ontologyDescription='string', inputConfig={ 'documents': [ { 'name': 'string', 'contentType': 'PDF'|'TXT'|'MARKDOWN'|'CSV'|'JSON'|'YAML'|'DOC'|'DOCX'|'HTML', 'content': b'bytes' }, ] }, seedOntologyId='string', prompt='string', tags={ 'string': 'string' }, ontologyTags={ 'string': 'string' } )
- Parameters:
clientToken (string) –
A unique, case-sensitive identifier that you provide to make the request idempotent. A retry of the same request with the same token returns the induction that the first request created, and the same token used with a different request returns a
ValidationException. If that induction, or the ontology it created, was deleted since, a retry with the token fails withConflictException.This field is autopopulated if not provided.
ontologyName (string) –
[REQUIRED]
The new ontology’s display name.
ontologyDescription (string) – Optional. The new ontology’s description. An empty string is the same as none.
inputConfig (dict) –
[REQUIRED]
The input to induce the ontology from. Set exactly one member.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
documents.documents (list) –
Documents uploaded in the request.
(dict) –
One input document, uploaded in the request. The documents are the material that the ontology is induced from, not an ontology, so they don’t use OntologySourceFormat. Only the seed and the induced result are Turtle.
name (string) – [REQUIRED]
The name of the document. Each document in the request needs its own name, and the name only labels the document, whose type
contentTypesets.contentType (string) – [REQUIRED]
The document’s type. Its bytes must be a real document of this type. Otherwise the request fails with ValidationException.
content (bytes) – [REQUIRED]
The content of the document, of the type that
contentTypespecifies. Each document can be up to 10,485,760 bytes (10 MiB), and all the documents in the request together up to 10 MiB.
seedOntologyId (string) – Optional. An existing ontology to start from, by ID or ARN. If you omit it, AWS Context induces the ontology from the documents alone. The seed must be an ontology that you own, it must be
PUBLISHED, and its current version must be derived from a Turtle source document. You also needcontext:GetOntologypermission on the seed. If the seed doesn’t exist, the request fails withResourceNotFoundException. If it can’t be used, the request fails withValidationException. If the seed’s source document is deleted while the induction runs, is larger than 400,000 bytes, or doesn’t parse, the induction fails withSEED_INVALID.prompt (string) – Optional. Instructions for the induction.
tags (dict) –
Tags to add to the induction when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can’t start with
aws:. To add tags, you also needcontext:TagResourcepermission on the new induction. If you specify more than 50 user tags, the request fails withServiceQuotaExceededException, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails withValidationException. These tags go on the induction only.ontologyTagsgo on the ontology.(string) –
A tag key. Leading and trailing whitespace is trimmed. Keys starting with
aws:are reserved for AWS.(string) –
A tag value. Leading and trailing whitespace is trimmed.
ontologyTags (dict) –
Tags to add to the ontology the induction creates at DRAFT, with the same limits and rules as
tags. They are checked here, and supplying them also requirescontext:TagResourceon the new ontology. These tags go on the ontology only.tagsgo on the induction.(string) –
A tag key. Leading and trailing whitespace is trimmed. Keys starting with
aws:are reserved for AWS.(string) –
A tag value. Leading and trailing whitespace is trimmed.
- Return type:
dict
- Returns:
Response Syntax
{ 'id': 'string', 'arn': 'string', 'status': 'INDUCING'|'DRAFT'|'FAILED'|'CANCELLED' }
Response Structure
(dict) –
id (string) –
The ID of the induction, assigned by AWS Context.
arn (string) –
The Amazon Resource Name (ARN) of the ontology induction.
status (string) –
Always INDUCING on a fresh start. The stored status on an idempotent replay. The ontology is created at DRAFT: GetOntologyInduction returns its ID from then on. It stays a draft until you publish it in the AWS Context console.
Exceptions