Context / Client / get_ontology_induction

get_ontology_induction

Context.Client.get_ontology_induction(**kwargs)

Returns an ontology induction’s status, and, once it is a draft, the ontology it created.

See also: AWS API Documentation

Request Syntax

response = client.get_ontology_induction(
    ontologyInductionId='string'
)
Parameters:

ontologyInductionId (string) –

[REQUIRED]

The ID or Amazon Resource Name (ARN) of the ontology induction to return.

Return type:

dict

Returns:

Response Syntax

{
    'id': 'string',
    'arn': 'string',
    'status': 'INDUCING'|'DRAFT'|'FAILED'|'CANCELLED',
    'failure': {
        'code': 'string',
        'message': 'string'
    },
    'ontologyName': 'string',
    'ontologyDescription': 'string',
    'ontologyId': 'string',
    'ontologyArn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'updatedAt': datetime(2015, 1, 1),
    'seedOntologyId': 'string',
    'prompt': 'string',
    'inputConfig': {
        'documents': [
            {
                'name': 'string',
                'sizeBytes': 123,
                'contentType': 'PDF'|'TXT'|'MARKDOWN'|'CSV'|'JSON'|'YAML'|'DOC'|'DOCX'|'HTML'
            },
        ]
    }
}

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) –

      The status of the ontology induction: INDUCING while it runs, then DRAFT once it has created a draft ontology, or FAILED. An induction that CancelOntologyInduction stops is CANCELLED. DRAFT, FAILED, and CANCELLED are final.

    • failure (dict) –

      Why the induction is FAILED. Absent in every other status.

      • code (string) –

        A code that identifies why the induction failed. Codes include the following:

        • INPUT_UNREADABLE - AWS Context couldn’t read an uploaded document.

        • TOO_MANY_DOCUMENTS - The request has more documents than one induction accepts.

        • SEED_INVALID - The seed ontology’s source document was deleted, is larger than 400,000 bytes, or doesn’t parse.

        • FRAGMENT_EMPTY - The induction found nothing to induce in the documents, and there is no seed to start from.

        • FRAGMENT_FAILED - Inducing from a document failed after retries.

        • DOCUMENT_FILTERED - The model that drafts the ontology refused to process a document.

        • MERGE_FAILED - Merging the results from the documents failed after retries.

        • INDUCED_TOO_LARGE - The draft is larger than the maximum size of an ontology.

        • DRAFT_WRITE_FAILED - AWS Context couldn’t save the draft.

        • TIMED_OUT - The induction didn’t finish within its time limit.

        • RUN_STOPPED - The run stopped before it finished.

        If AWS Context rejects the induced draft, code is the code that CreateOntology reports for the same problem (see OntologyIssueCode), for example RDF_PARSE_ERROR or NO_CLASSES.

        For INPUT_UNREADABLE, TOO_MANY_DOCUMENTS, SEED_INVALID, FRAGMENT_EMPTY, DOCUMENT_FILTERED, and INDUCED_TOO_LARGE, fix the input, and then start a new induction. For the other codes, start a new induction with the same input. New codes can be added, so handle a code that you don’t recognize. Use code, not message, to decide how to respond.

      • message (string) –

        A human-readable description of why the induction failed. Use code, not message, to decide how to respond.

    • ontologyName (string) –

      The name the induction’s ontology gets, as StartOntologyInduction took it ( ontologyName). Once the ontology exists, its current name is GetOntology’s.

    • ontologyDescription (string) –

      The description the induction’s ontology gets ( ontologyDescription). Absent when there is none.

    • ontologyId (string) –

      The ontology the induction created. Present exactly when the status is DRAFT: the ontology is created as DRAFT, in the same step that makes the induction DRAFT. Absent while INDUCING, and on a FAILED or CANCELLED induction, which never has an ontology. Returned even after the ontology is deleted.

    • ontologyArn (string) –

      The ARN of ontologyId. Present when it is.

    • createdAt (datetime) –

      The date and time when the ontology induction was created.

    • updatedAt (datetime) –

      The date and time when the ontology induction was last updated. Set when the induction is created, and updated on every change, such as a change of status.

    • seedOntologyId (string) –

      The seed ontology the induction started from. Absent when started without a seed. Returned in every status.

    • prompt (string) –

      The prompt that the induction was started with. Absent if the induction was started without a prompt.

    • inputConfig (dict) –

      What the induction was started from, without the document content.

      Note

      This is a Tagged Union structure. Only one of the following top level keys will be set: documents. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

      'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
      
      • documents (list) –

        The documents uploaded in the request, in the order given.

        • (dict) –

          An uploaded document as recorded.

          • name (string) –

            The document’s name, as uploaded.

          • sizeBytes (integer) –

            The document’s size in bytes.

          • contentType (string) –

            The document’s content type, as declared in the StartOntologyInduction request. Absent only for an induction started before StartOntologyInduction required a content type.

Exceptions