Review and edit grounding proposals
Each grounding proposal covers one table and one ontology. It proposes adding a link from the table to a class and from each matched column to a property. It can also contain removals. A removal proposes removing a link (a delete operation) that grounding no longer recommends.
You can approve a proposal or reject it. Before you approve it, you can also drop individual links from it. You can drop only added links, not removals. On the console, you delete a link. With the API, you drop the link’s operation. Both remove the link from the proposal.
You can review grounding proposals on the AWS Context console or with the API. If you can’t approve, reject, or edit a proposal, see Troubleshoot structured data grounding.
Review grounding proposals on the console
To review grounding proposals on the AWS Context console, follow these steps:
-
In the navigation pane, choose Agent context, and then choose your Agent Context.
-
Choose the Curation tab.
-
Find the grounding proposals in the Changes to review section. To see every proposal, choose View all changes. On the All changes page, choose the Pending tab, and then filter Generated by for Ontology grounding.
-
To see the links that a proposal adds or removes, choose the proposal’s link in the Change column.
-
(Optional) To keep only some of the added links, choose Edit change. Choose the remove icon next to each link that you don’t want, and then choose Apply edited change. To discard your edits, choose Cancel. Removing a table’s link to a class also removes its column links.
-
To apply the proposal, choose Approve. To discard it, choose Reject.
You can also approve or reject a proposal from the Actions menu of its row on the All changes page.
Review grounding proposals with the API
To review grounding proposals with the API, do the following:
-
Call
ListCurationProposalswithstatusset toPENDING_REVIEW. Grounding proposals havegeneratedByset toONTOLOGY_GROUNDING. -
To read the change set’s current version, call
GetChangeSetwith the proposal’schangeSetId.GetChangeSetreturns the change set’s metadata, includingchangeSetVersion. It doesn’t return the operations. -
To see the links in the proposal, page through
ListChangeSetOperationswith the samechangeSetId. Each entry initemsis one operation: aput, anupdate, or adelete. The operation has anentitywith anodeIdor anedgeId, andproperties. For a link,entityhas anedgeId, andpropertiesincludes theedgeType.In a grounding proposal, each link operation adds a link (a
putoperation) or removes a link (adeleteoperation). -
(Optional) To drop added links that you don’t want, call
UpdateChangeSeton the proposal’s change set. Send thechangeSetVersionfromGetChangeSet. InoperationsToRemove, list the operations to drop, copied unchanged fromListChangeSetOperations. Follow the rules that the next section, Rules for editing a grounding proposal, describes. -
If you dropped links, call
GetCurationProposalto read the proposal’s newrevisionId. -
To approve the proposal, call
AcceptCurationProposal. To reject it, callRejectCurationProposal. Send the proposal’s currentrevisionId.
The following example shows the inputs for GetChangeSet and ListChangeSetOperations. It isn’t a complete request.
GetChangeSet agentContextId: <agent-context-id> changeSetId: <change-set-id> ListChangeSetOperations agentContextId: <agent-context-id> changeSetId: <change-set-id> nextToken: <next-token>
Replace the following values:
-
<agent-context-id>– the ID or ARN of your Agent Context. -
<change-set-id>– the proposal’schangeSetIdfromListCurationProposals. -
<next-token>– thenextTokenfrom the previous response.
The following example shows the inputs for UpdateChangeSet. It isn’t a complete request.
UpdateChangeSet agentContextId: <agent-context-id> changeSetId: <change-set-id> changeSetVersion: <version> operationsToRemove: - <operation>
Replace the following values:
-
<agent-context-id>– the ID or ARN of your Agent Context. -
<change-set-id>– the proposal’schangeSetIdfromListCurationProposals. -
<version>– thechangeSetVersionfromGetChangeSet. -
<operation>– an entry fromitemsinListChangeSetOperations, copied unchanged. Add one entry for each operation to drop.
The following example shows the inputs for AcceptCurationProposal and RejectCurationProposal. It isn’t a complete request.
AcceptCurationProposal agentContextId: <agent-context-id> curationProposalId: <proposal-id> revisionId: <revision-id> RejectCurationProposal agentContextId: <agent-context-id> curationProposalId: <proposal-id> revisionId: <revision-id>
Replace the following values:
-
<agent-context-id>– the ID or ARN of your Agent Context. -
<proposal-id>– the proposal’scurationProposalIdfromListCurationProposals. -
<revision-id>– the proposal’s currentrevisionId. If you dropped links, use the value fromGetCurationProposal. Otherwise, use the value fromListCurationProposals.
The proposal’s status changes to APPROVED or REJECTED. For what happens next, see What happens after you decide.
If AcceptCurationProposal or RejectCurationProposal fails, see ConflictException: you can’t approve or reject a proposal. If UpdateChangeSet fails, see You can’t drop links from a proposal.
Rules for editing a grounding proposal
When you drop links from a grounding proposal, the following rules apply:
-
You can drop only operations that add a link (
putoperations on relationships). You can’t drop a removal (delete), and you can’t drop a table, column, or other node operation. -
To drop a table’s link to a class, also drop all of that table’s column links in the same request.
-
You can drop a single column link on its own.
-
At least one operation must remain in the change set. To drop every link, reject the proposal instead.
-
You can’t restore a dropped link. If you dropped a link by mistake, reject the proposal.
-
Each edit gives the proposal a new
revisionId. Read the proposal again withGetCurationProposalbefore you approve it. An approval with the earlierrevisionIdfails with aConflictException.
UpdateChangeSet request fields
The following table describes each field in the request.
| Field | Description and rules |
|---|---|
|
|
Required. The Agent Context that the change set belongs to, by its ID or ARN. A change set of another Agent Context returns a |
|
|
Required. The change set of the proposal, the |
|
|
Required. The change set version that you read with |
|
|
Required. The operations to drop, up to 1,000. Copy each entry unchanged from |
|
|
Optional. Makes the request safe to retry. 1 to 64 printable ASCII characters, with no spaces. If you repeat the same request with the same token within 8 hours, AWS Context returns the change set’s latest version. It doesn’t change the change set again. If you reuse the token for another change set or for a different request, the call fails with a |
AcceptCurationProposal and RejectCurationProposal request fields
AcceptCurationProposal and RejectCurationProposal take the same fields. The following table describes each field in the request.
| Field | Description and rules |
|---|---|
|
|
Required. The Agent Context that the proposal belongs to, by its ID or ARN. A proposal of another Agent Context returns a |
|
|
Required. The ID of the proposal, from |
|
|
Required. The revision ID of the proposal, as you last read it. If the proposal changed after you read it, the call fails with a |
|
|
Optional. Makes the request safe to retry. 1 to 64 printable ASCII characters, with no spaces. If you repeat the same request with the same token within 8 hours, AWS Context returns the proposal’s current state. It doesn’t change the proposal again. If you reuse the token for another proposal, the call fails with a |
What happens after you decide
-
Approve – Applies the links. If the change can’t be applied, the proposal and its change set end with status
FAILED. -
Reject – Discards the links. AWS Context doesn’t propose the same links for that table again, with no time limit. The proposal stays suppressed until the links that grounding would propose change or the table’s current links change. Then grounding can propose the links again as a new proposal.
-
No decision – A curation policy that holds the proposal can set an auto-reject window. Under the default curation policy, the window is 14 days. When the window ends, AWS Context rejects the proposal with
statusReasonCodeREQUEST_EXPIRED. The proposal’sexpiresAtvalue shows when the window ends. A proposal that AWS Context rejects this way stays suppressed in the same way as one that you reject.
The default curation policy holds grounding proposals for review. If the Agent Context’s curation policy doesn’t hold them, AWS Context applies grounding proposals without review.