start_ontology_induction
¶
start_ontology_induction(
ontology_name: OntologyName,
input_config: OntologyInductionInputConfig,
*,
config_overrides: Optional[ContextClientConfig] = None,
client_token: Optional[ClientToken] = None,
ontology_description: Optional[UserDefinedString] = None,
seed_ontology_id: Optional[OntologyIdentifier] = None,
prompt: Optional[OntologyInductionPrompt] = None,
tags: Optional[TagMap] = None,
ontology_tags: Optional[TagMap] = None,
) -> StartOntologyInductionResponse
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 a DRAFT: 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 need context:CreateOntology permission in addition to context:StartOntologyInduction. If you specify tags, you also need context:TagResource permission.
Parameters:
-
client_token(Optional[ClientToken], default:None) –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. -
ontology_name(OntologyName) –The new ontology's display name.
-
ontology_description(Optional[UserDefinedString], default:None) –Optional. The new ontology's description. An empty string is the same as none.
-
input_config(OntologyInductionInputConfig) –The input to induce the ontology from. Set exactly one member.
-
seed_ontology_id(Optional[OntologyIdentifier], default:None) –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(Optional[OntologyInductionPrompt], default:None) –Optional. Instructions for the induction.
-
tags(Optional[TagMap], default:None) –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. -
ontology_tags(Optional[TagMap], default:None) –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.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.
-
InternalServerException–The request failed because of an internal error. Retry the request.
-
ThrottlingException–The request was denied because it exceeded a request rate quota. Wait, then retry the request.
-
ValidationException–The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.
-
ConflictException–The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.
-
ResourceNotFoundException–The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.
-
ServiceQuotaExceededException–The request would exceed a service quota. Check the quota that
quotaCodenames, reduce your usage, and then retry the request. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Start an ontology induction The following example starts an ontology induction from one Markdown document; the induction runs asynchronously and creates a DRAFT ontology when it finishes.
>>> client.start_ontology_induction(client_token='8b0e6d4c-2a1f-4c3e-9d7b-5a6f7e8d9c0b', ontology_name='library-catalog', ontology_description='Books, authors, members, and loans for a lending library.', input_config={'documents': [{'name': 'catalog-overview.md', 'contentType': 'MARKDOWN', 'content': 'IyBMaWJyYXJ5IGNhdGFsb2cKCkVhY2ggYm9vayBoYXMgYW4gSVNCTiwgYSB0aXRsZSwgYW5kIG9uZSBvciBtb3JlIGF1dGhvcnMuIE1lbWJlcnMgYm9ycm93IGNvcGllcyBvZiBib29rcyB0aHJvdWdoIGxvYW5zIHRoYXQgaGF2ZSBhIGR1ZSBkYXRlLgo='}]}, prompt='Model books, authors, library members, and loans. Give every type a stable identifier.')
Source code in docs_src/capo_context/_services/context.py
3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 | |